Page 1 of 1

Playing with Custom Properties

Posted: Mon Oct 01, 2018 8:02 am
by pmbrull
Hello and thank you for your time,

I've notices that motors like GDAL do not allow DXF files to contain any kind of information that is not geometric (for example, when using ogr2ogr to retrieve DB data as DXF, non geometric fields in the query are ignored).

However, in QCAD I've seen the possibility to add custom Entity fields. Inspecting the raw DXF they get written under "QCAD" tag. Is there a way to read/write does fields in scripts? What is the underlying logic in the raw DXF file so that it is possible for us to write these properties in previous Python scripts genereting the DXF?

Thanks,
Pere

Re: Playing with Custom Properties

Posted: Mon Oct 01, 2018 2:20 pm
by pmbrull
Hello again,

I kept browsing around and found my main mistake (although I don't know if it's the expected behaviour). When setting the new CustomProperty, it does not work unless you set title to "QCAD":

Code: Select all

op = new RAddObjectsOperation(false);

var hatch = new RHatchEntity(document, hatchData);
hatch.setCustomProperty("QCAD", "hello", 2.5);

op.addObject(hatch, false);
di.applyOperation(op);
Thanks,
Pere