Message 1 of 5
DXF code usage in python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am working on the pyautocad module to automate autocad tasks using python as a substitute to LISP/VBA. But while using commands which need the dxf group codes I am facing problems.
e.g. https://help.autodesk.com/view/ACD/2017/ESP/?guid=GUID-EF0393EC-8446-4989-8C72-F3AE49D81176
As given in the link above, we have to use DXF codes as XDataType. But when I try using the same with python, It's not working. The code is given below:
"
from pyautocad import Autocad, APoint, aDouble
acad = Autocad(create_if_not_exists=True)
#Create Object
p = acad.model.AddPoint(APoint(100, 100, 0))
#Add dictionary to an object
p_dict = p.GetExtensionDictionary()
#Check if the dictionary has been assigned to the object
print(p.HasExtensionDictionary)
#Add X Record in the dictionary
p_xrecord = p_dict.AddXRecord("Object1")
print(p_xrecord) #XRecord
#Add Data into XRecord
print(p_xrecord.Name)
p_xrecord.SetXRecordData(102, "Hello")
"
I would like to know the possible solutions to this.