Hi All,
I’m trying to replicate the results in terms of exporting to a new drawing from this post Extract Objects into new drawing however I am getting this error:
Warning: ModuleNotFoundError : No module named ‘Autodesk.AutoCAD.ApplicationServices.Application’; ‘Autodesk.AutoCAD.ApplicationServices’ is not a package [’ File “”, line 38, in \n’]
Do you perhaps know a fix for this?
Script attached
Convert corridor to 2d.dyn (260.7 KB)
Change line 38 in python node
From
import Autodesk.AutoCAD.ApplicationServices.Application as acapp
To
from Autodesk.AutoCAD.ApplicationServices import Application as acapp
There are a lot of unnecessary imports in the code
Update lines 14 - 16 to the following so reference names match their respective dlls
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
1 Like
Thanks Mike.
Would this work from the other direction in civil3d. For example could I have a 'modelling" drawing I use for inheriting positional 2d data from another drawing driven by a drafter. That can import the block locations then populate and drape their positions as the design changes? If you can answer without using the word “.csv” I will buy you a beer.
Hi @Overcooked_75,
Yes, you can do this. Assuming that the 2D drawing is xref’d into the 3D drawing, you can take advantage of the fact that an xref is basically just a block reference. So, you can do this:
- Select the xref in Dynamo (this will return a block reference)
- Get the parent block definition using
BlockReference.Block
From there, you can get whatever data you want from the block just like you would from model space or some other block definition in the drawing. For example, you could use the All Objects of Type
or All Objects on Layer
nodes using the aforementioned block definition as the block
input. If the xref changes, just re-run the Dynamo graph.
Let me know if you need a sample.
1 Like