Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to close Dynamo script opening in Dynamo by external application? #15086

Open
chuongmep opened this issue Apr 4, 2024 · 5 comments
Open
Labels
developer experience more high-level issues that are more specific to individuals actively developing on Dynamo.

Comments

@chuongmep
Copy link
Contributor

Dynamo Version

2.19

Host

No response

Operating System

Windows 10

What did you do?

I want intergrate with external application to close dynamo script opening

What did you expect to see?

Don't know how to do

What did you see instead?

Nothing

What packages or external references (if any) were used?

No response

Stack Trace

No response

Details

No response

Copy link

github-actions bot commented Apr 4, 2024

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

@avidit avidit added the developer experience more high-level issues that are more specific to individuals actively developing on Dynamo. label Apr 4, 2024 — with Slack
@mjkkirschner
Copy link
Member

hi @chuongmep can you please share some code or give a bit more of a technical description of what you want to achieve, I'm not sure how to help at the moment.

@chuongmep
Copy link
Contributor Author

chuongmep commented Apr 4, 2024

hi @chuongmep can you please share some code or give a bit more of a technical description of what you want to achieve, I'm not sure how to help at the moment.

Hi @mjkkirschner , this is code I can execute in case dynamo don't open :

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);

But when Dynamo opening, how can we call close script current by use Dynamo Application opening ?

@mjkkirschner
Copy link
Member

mjkkirschner commented Apr 4, 2024

so you start Dynamo programmatically, then you want to get to a state where no script is open, only a blank workspace?

if you are starting Dynamo with a view model you can do:
viewModel.NewHomeWorkspaceCommand.Execute(null);

If you only have access to the model, I think you'll need to do something like:
model.ClearCurrentWorkspace()

@chuongmep
Copy link
Contributor Author

Hi @mjkkirschner ,
In my case, the user opening dynamo include user interface, and what I want is from the Revit Ribbon, I can call another script to automation open with new tab in Dynamo user interface and run it with Code.
I don't think it is posible right now but I'm trying to get that process.
Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience more high-level issues that are more specific to individuals actively developing on Dynamo.
Projects
Status: Triage
Development

No branches or pull requests

3 participants