Hi,
i am using the Command Line Tool dwg2csv.bat to export and process information about the entities of a .dxf File.
What i am missing is the total area of the Component.
For that i would like to use a self-made script (or any other means to get access to that information) that calculates the total area and exports it
to a file.
Is there any method i can use to achieve that without having to develop everything from scratch or maybe an example that i can use?
Greetings,
SM_MaGa
[SOLVED] Calculate total area
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
[SOLVED] Calculate total area
Last edited by SM_MaGa on Thu Apr 22, 2021 2:25 pm, edited 1 time in total.
Re: Calculate total area
What exactly would a "Component" be? Can you please attach a DXF file or screenshot? Thanks for any clarification you can provide.
Re: Calculate total area
Hi @andrew,
thanks for taking your time.
I attached attached a .dxf as a sample.
By Component i mean the whole thing described by the .dxf File.
Even better if i could exclude Measurement Information (Entities) thats included in the .dxf file, but thats not necessary.
Using the QCAD UI i can use the Polygonal Area tool to calculate the Area but in a script i am not sure about that.
Greetings,
SM_MaGa
thanks for taking your time.
I attached attached a .dxf as a sample.
By Component i mean the whole thing described by the .dxf File.
Even better if i could exclude Measurement Information (Entities) thats included in the .dxf file, but thats not necessary.
Using the QCAD UI i can use the Polygonal Area tool to calculate the Area but in a script i am not sure about that.
Greetings,
SM_MaGa
- Attachments
-
- Treppe Halle-2.dxf
- (3.34 KiB) Downloaded 387 times
Re: Calculate total area
As a first step, I would suggest to create a solid fill from the contents. This will only succeed if the file exclusively contains closed contours:
Although currently not included in QCAD Pro, we do have a command line script here that can then output the area of all solid fills or hatches per layer. This would look like this:
Usage info about dwghatcharea at:
https://qcad.org/en/products/qcad-comma ... ghatcharea
I'm happy to send this to you. Do you have a license for QCAD Professional or are you evaluating the trial version?
Code: Select all
dwghatch -o file_solid_fill.dxf file.dxf
Code: Select all
dwghatcharea file_solid_fill.dxf
0 : 64717.33669359441
1 : 0
2 : 0
3 : 0
4 : 0
5 : 0
6 : 0
7 : 0
8 : 0
https://qcad.org/en/products/qcad-comma ... ghatcharea
I'm happy to send this to you. Do you have a license for QCAD Professional or are you evaluating the trial version?
Re: Calculate total area
That looks very promising!
Yes, please send the command line script to me.
I am using a licensed version of QCAD/CAM on one of my Customers Systems.
Yes, please send the command line script to me.
I am using a licensed version of QCAD/CAM on one of my Customers Systems.
Re: Calculate total area
The script provided by @andrew provides exactly what i needed. Thus this thread can be closed. Thank you.
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Calculate total area
you cam mark the thread closed yourself by adding [SOLVED] to the title of your original post --> [SOLVED] Calculate total area
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6