0

I would like to link the value of a custom property to the contend of a specific Mtext.

Here's what I got so far:

i = 0
while(i<len(Cpro)):
    doc.header.custom_vars.append(Cpro[i][0],Cpro[i][1])  # creating new custom properties list
    i = i+1


Number = doc.header.custom_vars.__iter__()
for e in Number:
    print(e)

I can get the whole list printed and even used to fill an MText(but the text is not linked to the Property value, it's only a copied string). But the goal is to set it in a way that the user of the dxf generated could change the Mtext contend by only changing the custom property value.

On BrisCAD you can use the "Field" command to choose one the custom properties to fill the text.

clD
  • 2,523
  • 2
  • 22
  • 38
  • Custom header variables are not FIELD objects. FIELD objects are not supported by ezdxf. You can not link any DXF entity or object to a MTEXT entity. Try using ATTRIB entities which are meant to attach data to block references but can also be used in model space. – mozman Dec 28 '20 at 03:40
  • Firstly, thanks for your quick reply. I am writing a routine to create a map template for Brics cad users. My goal was to make an text entity that could be changed based on a specific custom property. That way, when the user changes (using BricsCAD) the value of the property, it would change automatically the text. – SurveyMorais Dec 28 '20 at 08:20
  • This is mostly a CAD application related topic, because all the processing should happen in the CAD application. 1st step is to figure out how this could be archived in BricsCAD (I use BricsCAD for testing but I am not an expert) -- 2nd step would be to create this structures by ezdxf. A working DXF example from the CAD application is required for the 2nd step. – mozman Dec 29 '20 at 08:06

0 Answers0