I’m trying to create AutoCAD Text Fields automatically in dynamo, like this:
%<\AcObjProp Object(%<_ObjId 2514883671040>%).Name>%
I’m sure its a simple one, but how to I get the Autocad Object ID as a string in dyanmo to input into the field, instead of the Handle?
You’ll need a Python node, and can just access the InternalObjectId
property for the Object. Try this (haven’t tested it):
obj = IN[0]
OUT = str(obj.InternalObjectId)
Ok, looks to be throwing an error
AttributeError : ‘list’ object has no attribute ‘InternalObjectId’ [’ File “”, line 2, in \n’]
If you have a list of objects, then you’ll need to loop through them. Something like this:
objs = IN[0]
oids = []
for obj in objs:
oids.append(obj.InternalObjectId)
OUT = oids
2 Likes
Ah, of course, easy win
much appreciated
1 Like