Storing user defined variables to dynamic parts

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
stefanjacobs
Newbie Member
Posts: 5
Joined: Sun Aug 09, 2015 3:34 pm

Storing user defined variables to dynamic parts

Post by stefanjacobs » Sun Aug 09, 2015 4:54 pm

Hi there,

I'm using QCAD to develop a schematic capture application. The user of this application will be able to select different circuit elements from the Dynamic Part Library and connect it with lines in order to create a circuit. The DXF file will then be parsed to create a netlist file - nodes and circuit elements.

Each circuit element needs different values - part name, capacitance, etc. These values need to be changed dynamically. Is it possible to store user defined values for each element/part in the DXF file - or some other place for that matter. I've read quite a lot of the DXF2000 documentation, but can't seem to find a way of doing that.

Ideally, the user only need to double click on the part to edit its values.

Regards,
Stefan

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Storing user defined variables to dynamic parts

Post by hungerburg » Mon Aug 10, 2015 10:51 am

I suppose, that you paste blocks into your drawing; Blocks can, like lines etc. have DXF x-data properties; QCAD has its very own key-value schema that is conveniently scriptable. Its up to you though, to create a user interface that is more specific to your application than the general property editors "custom properties"; eg. that provides a dialogue with drop-down menus for keys and values etc…
Attachments
X-Data-Properties.png
A block with custom properties
X-Data-Properties.png (18.3 KiB) Viewed 9579 times

stefanjacobs
Newbie Member
Posts: 5
Joined: Sun Aug 09, 2015 3:34 pm

Re: Storing user defined variables to dynamic parts

Post by stefanjacobs » Fri Aug 14, 2015 1:43 pm

Hi there,

Thanks a lot for the reply. Will this be possible in the community version of Qcad? Can you please point me to QCAD's key-value schema? I would like to take a look into it.

And yes, I do use blocks. Let's say I use the same block multiple times in the same drawing - is it possible to give each block different values? While playing with the functionality of QCAD I realised that if I edit a specific block, all the blocks change - not just one.

Regards,
Stefan

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Storing user defined variables to dynamic parts

Post by andrew » Fri Aug 14, 2015 2:39 pm

stefanjacobs wrote:Will this be possible in the community version of Qcad?
No, supporting custom properties per entity is currently not planned for the QCAD Community Edition. dxflib would need a major update for this. Having said that, maybe someone from the QCAD Community will pick this up at one point...

Can you please point me to QCAD's key-value schema?
Not sure what you mean by "key-value schema". QCAD itself does not use custom properties.
Let's say I use the same block multiple times in the same drawing - is it possible to give each block different values?
The term 'block' can refer to a block definition or a block reference. A block with a given name (e.g. "MyBlock") is defined in its block definition. Once defined, this block can then be inserted into the drawing multiple times, creating multiple block references. Each block reference refers to the same block definition for block "MyBlock".

Each block definition can have its own custom properties and each block reference can have its own custom properties.

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Storing user defined variables to dynamic parts

Post by hungerburg » Tue Aug 25, 2015 10:54 am

Here, with qCAD PRO, a quick test done: Each block reference can have custom properties on its own and different from other instances. (I suppose you did edit the block itself and all referenced instances did change, which of course is, what blocks are for, among other uses.)

By key-value store, I referred to this: http://qcad.org/doc/qcad/latest/develop ... 908190d766

Peter

stefanjacobs
Newbie Member
Posts: 5
Joined: Sun Aug 09, 2015 3:34 pm

Re: Storing user defined variables to dynamic parts

Post by stefanjacobs » Wed Sep 09, 2015 3:16 pm

Hi there,

Sorry for the late reply. I end up buying the Pro licence. I have it sorted out now.

Thanks a lot for your time and helpfulness. I have some other questions, but will ask them in a new thread.

All the best,
Stefan

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”