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

Need Help : How to call Dynamo Player Open to execute Revit API ? #15102

Open
chuongmep opened this issue Apr 9, 2024 · 9 comments
Open

Need Help : How to call Dynamo Player Open to execute Revit API ? #15102

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

Comments

@chuongmep
Copy link
Contributor

chuongmep commented Apr 9, 2024

Dynamo Version

3.0

Host

No response

Operating System

Windows 10

What did you do?

I want try automation process use Dynamo Player :

  • Open Dynamo Player
  • Automation Reference to Folder contains dynamo Script.
  • Execute.

What did you expect to see?

Can't fine any way to implement.

What did you see instead?

Nothing

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

We are trying use Revit API addin

Stack Trace

No response

Details

No response

@Amoursol
Copy link
Contributor

@chuongmep are you trying to use a Graph in Dynamo Player, or trying to use the Player API to create your own addin?

@chuongmep
Copy link
Contributor Author

Hi @Amoursol , I saw it can call from forma to open user interface of dynamo player, so I just want to know how it posible to use the Player API to create my own addin and execute dynamo script, and then I can connect to forma platform.

@Amoursol
Copy link
Contributor

Ah, understood! @saintentropy @twastvedt any insight you can provide to @chuongmep here?

@twastvedt
Copy link
Contributor

Hi @chuongmep! Are you building an addin in Revit, Dynamo, or Forma? Is the goal to run a Dynamo graph in the Revit context from Forma?

@chuongmep
Copy link
Contributor Author

chuongmep commented Apr 15, 2024

Hi @twastvedt , that is Revit add-in can intergrate with Dynamo, my process is intergrate from :

  • Revit Add-in. -> Dynamo
  • Revit Add-in -> Forma
    Can we call open dynamo player from Revit Add-in ?

@twastvedt
Copy link
Contributor

OK! Some thoughts:
You can do a lot with pyRevit, including starting Dynamo and running a graph. Here's some discussion on that topic:
https://discourse.pyrevitlabs.io/t/how-to-execute-a-dynamo-graph-inside-a-python-script/1742/4

Relay allows you to add a button to the Revit ribbon that runs a Dynamo graph. Maybe that's what you need, or it's open source and you might be able to learn from what it does.
https://github.com/johnpierson/Relay?tab=readme-ov-file (the part that starts Dynamo is here)
Discussion:
https://forum.dynamobim.com/t/relay-for-revit-adding-dyns-to-ribbon/55566?u=jacob.small

Orkestra has capability around sharing Dynamo scripts, if that's the end goal

@chuongmep
Copy link
Contributor Author

chuongmep commented Apr 17, 2024

Thank you @twastvedt , I think I'm done with first step to open dynamo player now :

 RevitCommandId commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.DynamoPlayer);
                       commandData.Application.PostCommand(commandId);

Nexte step with me is how to add default path setting for folder in Dynamo Player ?
image

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

Hi @chuongmep , sorry for the delay. What version of Revit and Dynamo are you using? Up to Revit 2023, that setting is in %appdata%\generative-design-client-2022\AppSettings.json. Starting in Revit 2024 the default folder is set in Dynamo's settings file, at %appdata%\Dynamo\Dynamo Revit\<Dynamo version>\DynamoSettings.xml.

@chuongmep
Copy link
Contributor Author

Thank you for you help @twastvedt, it really useful for me to keep continute grow the ideal !

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

4 participants