Hi i am an architect, and I am currently trying out the trial version of Qcad 3.29.4.0 on Windows 10.
I would like to make window, door, zone, etc. schedules using custom properties or block attributes (not sure which one to use yet).
I am experimenting with the dwg2csv command line tool to export these data.
I have no scripting background, but managed to export custom properties one by one. However there are 30-40 ish properties for a window, and there are other completely different ones for zones.
Is there an option in the dwg2csv tool to export all the available custom properties or attributes for blocks?
dwg2csv - export all available custom properties
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: dwg2csv - export all available custom properties
To work with custom properties, you can list all of them using multiple -p switches.
For example, to list all values of custom properties "MyAttribute1" and "MyAttribute1"
This will output something in the format:
With one row for each block reference in the file.
Using block attributes won't work as you would have to somehow connect the listed attribute entities back to the block reference they belong to which is currently not possible from the CSV output.
For example, to list all values of custom properties "MyAttribute1" and "MyAttribute1"
Code: Select all
./dwg2csv -t "Block Reference" -p QCAD:MyProperty1 -p QCAD:MyProperty2 -f custom_properties.dxf; cat custom_properties.csv
Code: Select all
QCAD:MyProperty1,QCAD:MyProperty2
7.5,34.5
4.2,45.5
...
Using block attributes won't work as you would have to somehow connect the listed attribute entities back to the block reference they belong to which is currently not possible from the CSV output.
Re: dwg2csv - export all available custom properties
Thank you andrew, hope i got it, I only dont understand the last part:
"Using block attributes won't work as you would have to somehow connect the listed attribute entities back to the block reference they belong to which is currently not possible from the CSV output."
I made a test file with both attributes and custom properties, and both the attributes and the custom properties could be written to the csv file.
I feel like making rather attributes and putting them on a hidden layer can give more control, as custom property names can not be modified after creating them.
What am I missing?
"Using block attributes won't work as you would have to somehow connect the listed attribute entities back to the block reference they belong to which is currently not possible from the CSV output."
I made a test file with both attributes and custom properties, and both the attributes and the custom properties could be written to the csv file.
I feel like making rather attributes and putting them on a hidden layer can give more control, as custom property names can not be modified after creating them.
What am I missing?
Re: dwg2csv - export all available custom properties
Yes, of course, but Block Attributes exist on there own.
You also need to query the associated Block Reference ID to know to what Block Reference it is related to ...
... This doesn't work the other way around, the reference is upwards and not downwards.
Meaning that you can not query a certain Block Reference and export its associated Block Attributes ID's and content.
But you can query a certain Block Attribute and export its content and the associated Block Reference ID.
# EDIT # This was script based and Andrew explained that the delegated properties can be queried ...
Regards,
CVH
Last edited by CVH on Fri Mar 22, 2024 4:34 pm, edited 1 time in total.
Re: dwg2csv - export all available custom properties
lowattila: Yes, you are right. I didn't realize that one can output attributes as part of the block reference record instead of their own records, so attributes will also work indeed.
Re: dwg2csv - export all available custom properties
Thank you guys, really appreciate your quick answers. Qcad seems to be a very powerful tool.