Run Dynamo Script from AutoLISP in C3D

Can you run a Dynamo Script from AutoLISP?

Can you pass values from AutoLISP to Dynamo?

You can use the AECCRUNDYNAMOSCRIPT command. Also look at this post:

Can you explain further what you’re trying to achieve?

1 Like

I have a value that is returned from lisp and would like to not have to re-enter the value in dynamo

Yes, it’s a real shame we can’t seem to call a specific dynamo script like this, or with a command button, or from some other app within C3D … and actually feed inputs to dynamo as part of that call. I’d be very excited if it was possible to call up Dynamo Player to open, just showing a chosen file path of graphs. Then we could use tool palettes to organize graphs, with detailed descriptions when hovering the mouse over them.

But as far as I can tell, a command button or similar can make a dynamo graph run blind with no inputs available, and that’s it. Or you can trigger Dynamo player to open, and it will point at the last folder path it remembers - but you can’t call Dynamo Player to open with a view of a specific folder.

… so my users who don’t otherwise do dynamo, have to struggle with finding a specific graph by name alone, while navigating through folders.

This is possible, but don’t believe you can pass arguments. I will look it up.

Stephen Grisez

Searching for possibilities on running dynamo via lisp I landed on this thread. Passing values from LISP I suggest you use a custom variable in the drawing wich u reuse in de Dynamo script. This should help you passing variables to the Dynamo script without using external files.

e.g. in lisp you store your variable with (setq my_xvar 1)

# Load the Python Standard and DesignScript Libraries
import sys
import clr

# Add Assemblies for Application
clr.AddReference('AcMgd')
from Autodesk.AutoCAD.ApplicationServices import *

adoc = Application.DocumentManager.MdiActiveDocument
res = adoc.GetLispSymbol(my_xvar)

# Assign your output to the OUT variable.
OUT = res

Another way is to use AutoCAD Useri1~5,Userr1~5,Users1~5 to store the lisp value in lisp code, then dynamo read it

1 Like