Page 1 of 1

Export Attributes

Posted: Tue Jun 23, 2020 11:23 am
by gfunvake
I work on a 64bit Windows 10 Computer, Have QCAD 3.24.3.0 (3.24.3).
I regularly receive data in DWG format that contains custom attributes. I want to create a csv file that contains:
  • A specific custom attribute
  • The X coordinate and
  • The Y coordinate.
Any help will be appreciated.

Gabriel

Re: Export Attributes

Posted: Wed Jun 24, 2020 9:58 am
by andrew
You'd have to write a script that does that.

Here are some starting points:

Displaying all block attributes in the command line history of QCAD:
https://github.com/qcad/qcad/blob/maste ... ributes.js

Exporting the block list as CSV file:
https://github.com/qcad/qcad/blob/maste ... tExport.js

Re: Export Attributes

Posted: Wed Jun 24, 2020 1:35 pm
by gfunvake
Thanks - I'll give it a shot.

Re: Export Attributes

Posted: Thu Jun 25, 2020 11:10 pm
by gfunvake
Hi Andrew
I am struggling with this, mostly because I am not really a programmer.
Does QCAD have a LIST command similar to AutoCAD?

Re: Export Attributes

Posted: Fri Jun 26, 2020 6:18 am
by CVH
Hi,
I was interested in the topic so I stayed lurking. :roll:
I have ('had') a add-on in the pipeline to document drawing entities.
That might just be your LIST command, although I have no AC experience.
It's like Andrew would state it: 'highly experimental'.
And far from finished, still I use it frequently to give me numbers and values without the typing over ...

Starting with scripting in Qcad can have a steep learning curve.
JavaScript or C++ too. e_geek

The two scripts Andrew refers too are actually implemented in Qcad under menu 'Misc' ... 'Block'.
You can try them out but they won't give you all the info you asked for. :(
Including X/Y would not be that hard.
On the command line or to a CSV neither.
I can't say that of Blocks and Attributes.
I did not consider them yet being non-basic drawing entities. :|
And at some points I really don't understand their special techniques fully. :oops:
On top, my recent encounters with them are only on their buggy nature. (see posts)

Could you provide an example file with a multitude of what you want to document?
And how to format it to CSV?
A full blown example drawing will only troubles and confuse me.
Lets start simple, moderate.
I'll give it a try, it would serve my documenting skills anyway ... :wink:

Regards,
CVH