Dynamo vs Autocad

This is my lesson, which solves the problem of interaction between Dynamo and AutoCAD. Lesson in Russian, but it is understandable

Python code:

import clr

clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

clr.AddReferenceToFileAndPath(‘C:\Program Files\Autodesk\AutoCAD 2015\Autodesk.AutoCAD.Interop’)

from Autodesk.AutoCAD.Interop import *
from System import *

restart = IN[0]

curves = IN[1]

acadApp = AcadApplicationClass()
acadApp.Visible = True

for i in (curves):
p1 = i.StartPoint
p2 = i.EndPoint
p1C = Array[float]([p1.X, p1.Y, p1.Z])
p2C = Array[float]([p2.X, p2.Y, p2.Z])
lin = acadApp.ActiveDocument.Database.ModelSpace.AddLine(p1C, p2C);

acadApp.ZoomExtents();

This is really great! Commands are from ObjectARX, right?

yes

FEM Mesh in AutoCAD
Dynamo_pandus

Hello Khasan. Mamaev,

Wow, this is cool. Have you uploaded any package for this?

Thanks,

Rtiesh

 

how can I make the reverse process, look for an entity in AutoCAD and send to Dynamo

acadApp.ActiveDocument.Utility.GetEntity(object, object, object)

 

Excuse me please, but I do not know how to do it. I am currently engaged in this task. On the results of write here