Page 1 of 1

Custom Layer Property Maximum Size

Posted: Tue Oct 10, 2017 12:03 pm
by DavidKTrudgett
Hi there,

I seem to have bumped up against a QCAD limitation in custom property size, in particular in the maximum size of data allowed in a custom layer property. I am storing JSON strings in custom layer properties, and one of them was quite a bit larger than the rest, at around 14 or 15 K bytes. (Mostly, they were much less than 1K.)

What happens is that the large custom property is silently dropped from the DXF, and my testing leads me to believe that the behaviour is caused by the large size of the property text, because reducing the size progressively resulted in reaching the point where the property would no longer be dropped from the DXF. (I think it was around 8K or 10K, something like that.)

Would it be possible to increase the maximum size allowed in custom properties to, say, 20KB? I guess there must be some reasonable limit for memory management purposes?

Kind regards,
David

Re: Custom Layer Property Maximum Size

Posted: Tue Oct 10, 2017 1:06 pm
by andrew
Unfortunately, these are very likely DXF/DWG format restrictions which are not possible to overcome (without breaking the file format).

I would advise against storing anything but the most trivial data as custom properties and instead keep more complex data elsewhere and only reference it through a custom property. I.e. the custom property could hold an ID which can then be looked up in a database (SQL, XML, JSON, etc.) for additional information.

Re: Custom Layer Property Maximum Size

Posted: Tue Oct 10, 2017 1:12 pm
by andrew
Please refer also to this topic for more information:
viewtopic.php?f=2&t=3269

Re: Custom Layer Property Maximum Size

Posted: Wed Oct 11, 2017 1:23 am
by DavidKTrudgett
Okay, thank you, Andrew! That makes some sense, I guess. I'll have to live with it and do something along the lines of what you have suggested.

Many thanks!

David

Re: Custom Layer Property Maximum Size

Posted: Wed Oct 11, 2017 8:56 am
by andrew
An alternative would of course be to split long properties up into multiple properties. Something along the lines of MyProperty001, MyProperty002, MyProperty003 which are then interpreted as "MyProperty". Arguably, QCAD could even do that automatically when saving and stitch those together when loading, without the user noticing. I'll give this some thought.