# Run Dynamo Script from file path

**URL:** <https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991>\
**Category:** Dynamo Player\
**Tags:** dynamo\
**Created:** [May 24, 2023, 1:09pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991 "2023-05-24T13:09:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravishankar.unipune](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ravishankar.unipune/32/157492_2.png) [@ravishankar.unipune](https://forum.dynamobim.com/u/ravishankar.unipune)\
**Post date:** [May 24, 2023, 1:09pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/1 "2023-05-24T13:09:56Z")

</div>

Hi All

I am seeking help from the community as I have created an input form with the help of data-shapes UI nodes and would like to run another script from the file path after clicking the submit button in the form.

I am looking forward to hearing soon.

Best  
Ravi

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 24, 2023, 1:12pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/2 "2023-05-24T13:12:15Z")

</div>

@ravishankar.unipune ,

can you share some screenshots at least?

…sounds like a [pyRevit](https://discourse.pyrevitlabs.io/) Solution

KR

Andreas

---

<div class="post-metadata">

**Author:** ![ravishankar.unipune](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ravishankar.unipune/32/157492_2.png) [@ravishankar.unipune](https://forum.dynamobim.com/u/ravishankar.unipune)\
**Post date:** [May 24, 2023, 1:16pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/3 "2023-05-24T13:16:09Z")

</div>

Hi @Draxl_Andreas

Thanks for your response  
Please find the attached dynamo script.

Please do the needful.  
[Data Shapes UI form.dyn](https://forum.dynamobim.com/uploads/short-url/eFSEVb7Yr7gMPYsq8rWgGmNsCdG.dyn) (92.3 KB)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [May 24, 2023, 1:20pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/4 "2023-05-24T13:20:11Z")

</div>

Going to need dynamo api to do that I’d say - beyond my knowledge. If youre at the point of needing scripts to run scripts then definitely sounds like it is time to look into more advanced solutions like [pyrevit](https://discourse.pyrevitlabs.io/) or C# to develop toolkits.

Generally more polite to let the forum assist with these willingly vs tag the regulars onto your threads.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 24, 2023, 1:37pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/5 "2023-05-24T13:37:46Z")

</div>

I recommend you don’t over complicate it.

Take the second graph and convert it into a custom node with a static input to prevent execution until the first portion of the graph finishes.

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [May 24, 2023, 7:30pm UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/6 "2023-05-24T19:30:39Z")

</div>

Perhaps the Dynamo Command Line Interface might help you:

> [@How to run a Dynamo Graph in the background / How to use the Dynamo Command Line Interface](https://forum.dynamobim.com/t/how-to-run-a-dynamo-graph-in-the-background-how-to-use-the-dynamo-command-line-interface/74025):
>
> Hi everyone, I often use the Dynamo Sandbox environment because then I don’t have to open a host application, which saves time and resources. One disadvantage I always had with this was that I couldn’t run scripts without having to open my Dynamo Graphs itself, like the Dynamo Player. In my quest to reduce my number of clicks, effort & time, I came across a very handy feature of Dynamo that many people probably do not (yet) know. At least I didn’t! smiley : The Dynamo Command Line Interface …

---

<div class="post-metadata">

**Author:** ![ravishankar.unipune](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ravishankar.unipune/32/157492_2.png) [@ravishankar.unipune](https://forum.dynamobim.com/u/ravishankar.unipune)\
**Post date:** [May 25, 2023, 6:27am UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/7 "2023-05-25T06:27:37Z")

</div>

Sorry for mistake

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [May 25, 2023, 6:44am UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/8 "2023-05-25T06:44:54Z")

</div>

No problems. Generally we don’t mind being tagged that much, I think it is just better to include the wider forum in the people the post is visually open to 🙂

---

<div class="post-metadata">

**Author:** ![chuongmep](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chuongmep/32/197537_2.png) [@chuongmep](https://forum.dynamobim.com/u/chuongmep)\
**Post date:** [April 9, 2024, 7:47am UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/9 "2024-04-09T07:47:48Z")

</div>

In the case you need run in backgound and intergrate with add-in, with `temppath` is your dynamo script:

```auto
DynamoRevit dynamoRevit = new DynamoRevit();

                IDictionary<string, string> journalData = new Dictionary<string, string>
                {
                    {JournalKeys.ShowUiKey, false.ToString()},
                    {JournalKeys.AutomationModeKey, true.ToString()},
                    {JournalKeys.DynPathKey, temppath},
                    {JournalKeys.DynPathExecuteKey, true.ToString()},
                    {JournalKeys.ForceManualRunKey, false.ToString()},
                    {JournalKeys.ModelShutDownKey, true.ToString()},
                    {JournalKeys.ModelNodesInfo, false.ToString()},
                };
                DynamoRevitCommandData dynamoRevitCommandData = new DynamoRevitCommandData
                {
                    Application = commandData.Application,
                    JournalData = journalData
                    
                };
                Result result = dynamoRevit.ExecuteCommand(dynamoRevitCommandData);

```

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [April 9, 2024, 8:38am UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/10 "2024-04-09T08:38:50Z")

</div>

@chuongmep that’s actually quite cool! I am not really sure what I might use it for, but why not 🙂

---

<div class="post-metadata">

**Author:** ![Ahmed.Ramy.JBI](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Ahmed.Ramy.JBI](https://forum.dynamobim.com/u/Ahmed.Ramy.JBI)\
**Post date:** [April 24, 2024, 10:20am UTC](https://forum.dynamobim.com/t/run-dynamo-script-from-file-path/89991/11 "2024-04-24T10:20:29Z")

</div>

Hi Jacob! I did you recommendation, however I don’t know what you mean by static input?

For my case I used Thread.Pause node and gave every chunk of the script its own waiting time in milliseconds, but I still have a persisting problem. Here is the link of my post:

> [@Applying view templates twice to same view in 1 script](https://forum.dynamobim.com/t/applying-view-templates-twice-to-same-view-in-1-script/100396):
>
> Dear all, I have coded a script that applies view template to certain chosen views divided into two main sectors: the first row applies a certain viewtemplate to the views, the second row of the script applies another viewtemplate to the same views. However the problem is the following: After a lot of trials, dynamo doesn’t seem to deal with the same views twice in 1 script, having that said, it successfully rusn the first rows without problems but I can’t get to apply the 2nd viewtemplate to al…
