Blocks counting
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.
Blocks counting
Hey all,
Does anyone know if there's a way to sort selected blocks inserted in a file and count them in an xl type of table ? Autocad and vectorworx do that very well, and that's very helpful to keep a trace of how many "this "or "that" you have in your plan.
Thanks !
Does anyone know if there's a way to sort selected blocks inserted in a file and count them in an xl type of table ? Autocad and vectorworx do that very well, and that's very helpful to keep a trace of how many "this "or "that" you have in your plan.
Thanks !
Re: Blocks counting
It shouldn't be a lot of effort to whip up such a solution as a simple script that creates a CSV file which can be imported into spreadsheet applications.
If you can post an example of what you have in mind (e.g. an example table with a brief description of the table columns), it would likely be very feasible to create a script to create a CSV file.
If you can post an example of what you have in mind (e.g. an example table with a brief description of the table columns), it would likely be very feasible to create a script to create a CSV file.
Re: Blocks counting
Yep - but I guess it needs time ...andrew wrote:It shouldn't be a lot of effort ...
http://www.ribbonsoft.com/bugtracker/in ... ask_id=555
Re: Blocks counting
Here are the keys to a success with feature requests:Husky wrote:Yep - but I guess it needs time ...
1. A clear, unambiguous specification (attach example drawing, provide example for expected output format, list expected step by step usage of the tool).
2. Keep it simple for a first version to start with. I.e. provide a request for a simple tool that will do the most important part of the job and will be the most useful with the least amount of effort. It will then be possible to gather feedback based on such a simple tool and incrementally improve and extend it.
Example usage spec:
1. Start tool "Export block list"
2. Choose file name (.csv)
3. QCAD exports the complete block list in CSV format with the columns "Count", "Name"
Possibilities for extension:
- Limit export to selected blocks
- Specify CSV format (comma separated, tab separated, ...)
- ...
This is just an example. I don't know if that is even approximately what you had in mind.
Re: Blocks counting
Hello Andrew,
This exactly what I had in mind , no more no less !
A simple table (I had an excel picture in mind but .csv file is good enough ) with block name and count , that's it !
When you say that it shouldn't be difficult to write the script, you mean i could do it even if I have no knowledge pf programming at all ?
Thanks anyway for the answer !
This exactly what I had in mind , no more no less !
A simple table (I had an excel picture in mind but .csv file is good enough ) with block name and count , that's it !
When you say that it shouldn't be difficult to write the script, you mean i could do it even if I have no knowledge pf programming at all ?
Thanks anyway for the answer !
Re: Blocks counting
No, but this is straight-forward to implement for me since the requirements of the output are clear and simple.Seb Riou wrote:When you say that it shouldn't be difficult to write the script, you mean i could do it even if I have no knowledge pf programming at all ?
You can find a simple implementation attached to this post.
Installation:
Extract the ZIP file into folder
scripts/Miscof your QCAD installation.
If done correctly, this will create the path
scripts/Misc/MiscBlock/BlockListExportYou should then have a new menu under
Misc > Block > Export Block ListPlease post any bug reports or additional feature requests to our task tracker at:
http://www.qcad.org/bugtracker/index.ph ... 1&do=index
- Attachments
-
- MiscBlock.zip
- Block list export to CSV
- (2.8 KiB) Downloaded 615 times
Re: Blocks counting
Nice! Thank you Andrew!
I have only one problem
I would like to use the csv file in Excel but in my European Windows version Excel can't understand the Tabulator as a "List Separator" - which means I have all data in one column.
If I save the csv as a txt and open it then in Excel every thing works fine - I have as desired the data separated in different columns.
Can I change something in the script to get a file what would work in first place with Excel and will ask me to separate in columns?
Result with the actual csv output: Result with the csv saved as a txt:
I have only one problem
I would like to use the csv file in Excel but in my European Windows version Excel can't understand the Tabulator as a "List Separator" - which means I have all data in one column.
If I save the csv as a txt and open it then in Excel every thing works fine - I have as desired the data separated in different columns.
Can I change something in the script to get a file what would work in first place with Excel and will ask me to separate in columns?
Result with the actual csv output: Result with the csv saved as a txt:
Re: Blocks counting
@Andrew, yes thank you for this, it is very useful
@Husky, I actually found that opening the .csv file with Notepad (or Wordpad) gives me a better result.
@Husky, I actually found that opening the .csv file with Notepad (or Wordpad) gives me a better result.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...
Re: Blocks counting
Thanks Andrew,it works great and does exactly what I meant it too.
Thumbs up !
Thumbs up !