Can we Launch an addin or a plugin application using dynamo ?
on previous searches i finded to launch using Postable command id is there any other way ? how to find the Command ids of the application buttons?
Thanks in Advance
You can experiment by finding the .dll file that comes with the plugin and load it by choosing load library.
Make sure you setup a test project so no actual projects can get messed up.
Don’t count on anything except messing things up.
I Tried it Marcel it gave a new study but what i actually trying is to run the addin in revit using dynamo not addin in dynamo
I think you should be able to, if Revit can call it, Dynamo should be able to also.
I would test using a Python node, import the relevant dll and wrap it in a transaction… Just you would when using the DS libraries (which are also a Revit addin?)
Let us know how you get on!
clr.AddReference("ProtoGeometry") from Autodesk.DesignScript import Geometry as geom TransactionManager.Instance.EnsureInTransaction(doc) #Do Stuff TransactionManager.Instance.TransactionTaskDone()
Here is how to an external library, BiMorph:
Using the LoadAddIn Method seems to be the direction you will need to go, though unsure if it will/wont work in dynamo.
another solution to find Command id by Panel and Button Name
import clr import System clr.AddReference('RevitAPIUI') from Autodesk.Revit.UI import * clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import DocumentManager uiapp = DocumentManager.Instance.CurrentUIApplication clr.AddReference('PresentationCore') clr.AddReference('AdWindows') import Autodesk.Windows as adWin def findCommandIdByName(txtPanel, txtItemRibbon): ribbon = adWin.ComponentManager.Ribbon for tab in ribbon.Tabs: for panel in tab.Panels: for ribbonItem in panel.Source.Items: if ribbonItem.Text is not None: if txtItemRibbon == ribbonItem.Text and txtPanel in ribbonItem.Id: return ribbonItem.Id name_addin_button = findCommandIdByName(IN,IN) if name_addin_button is not None: id_addin_button = RevitCommandId.LookupCommandId(name_addin_button ) uiapp.PostCommand(id_addin_button) OUT = name_addin_button
can you use that script to launch a Revit Add-In? For example Roombook?
Can you launch that command and then apply with ok?
I think no, you will probably need to use the User32 API for the ‘Calculate’ button
Thank you for quick response @c.poupin !
How can you find the command Id of that button to apply via PostCommand? Or you mean something without PostCommand?
or maybe this way?
There is also here something but I don’t get it well how to find ID of that command.
Hello, try to find the ID like the example here (find the ribbon item by name and return its ID)
Yes, I can find Id but it is id of ribbon. Let’s take you example.
How could you find the CommandId of “Export” button down below in window in your add-in to finalize process?
In my example: I can find Calculate Areas but I can’t find “Calculate” command
I think this needs a wider discussion on the revit api forum for if you can interact with the running of another addin from a addin including any windows/forms that have interaction.
DynamoForRevit is a revit extension and has the same limitations as a extension would have.
You are right but you can also use external tools inside of it.
There is here an artical how you can use windows API to do some stuff. @c.poupin has already said that, I should use user32.dll. I am not good at .NET or Windows API
I was not able to use the method by @c.poupin for launching Robot Structural link. Could you possibly give that a try and let me know? I would appreciate it.
after testing, I unfortunately confirm that it does not work with Robot Structural link
I solved my problem with using Win32API. It was too tiring. I had to create a ZeroTouch-Node because of async task and use the inspector to find the right button. Too complicated
Thank you very much, @c.poupin , for testing. I appreciate the time.
Thank for, @Deniz_Maral, for letting me know. I will see which way I will need to take.