Playing with Custom Properties

Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Post Reply
pmbrull
Junior Member
Posts: 14
Joined: Thu Aug 23, 2018 4:07 pm

Playing with Custom Properties

Post by pmbrull » Mon Oct 01, 2018 8:02 am

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

pmbrull
Junior Member
Posts: 14
Joined: Thu Aug 23, 2018 4:07 pm

Re: Playing with Custom Properties

Post by pmbrull » Mon Oct 01, 2018 2:20 pm

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

Post Reply

Return to “QCAD Developers and Contributors”