Dynamo sendcommand to commandline

Hello,

I’m trying to send the “select” command to the command line of autocad and get the selection_set back to dynamo.
The first part works but I have no idea how to get the selection_set back to dynamo.


PS. I run the dynamo script via a lsp-file, so I don’t use the dynamo-player. Therefore I don’t want to use the select-object node.

Gr Raf.

It’s been awhile, but if I recall correctly:

  • Dynamo can only run one transaction. This is true with certainty in Civil 3D.

  • You can only send a command when there is no active transaction. This is the part I am unsure of.

If those both are true, the lommand won’t get sent until after the Dynamo graph is done, so your selection won’t matter. You’ll need to look into another method (i.e have the user make the selection before the lisp and therefore Dynamo command is run; do the selection via another lisp method; use Dynamo Player instead of lisp; etc.;).

1 Like

Try using the Interop namespace

clr.AddReference("acmgd")
clr.AddReference("accoremgd")
clr.AddReference("Autodesk.AutoCAD.Interop")

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.Interop import *

acapp = Application.AcadApplication
acdoc = acapp.ActiveDocument
acdoc.SendCommand(command)

Hello,

The “send”-command works, I can send a “select” command to the command line. But then I want to work further with these selected objects in dynamo. But I don’t know how to get the selection back in dynamo/python.

Gr Raf.