Count up counter for consecutive number labeling

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

TSG
Premier Member
Posts: 337
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany

Re: Count up counter for consecutive number labeling

Post by TSG » Tue Dec 22, 2015 7:31 am

By rhe way, I'm using OS X on an iMac. What has to be done to get this enhancement as a permanent part of qcad?
Now I have to copy it into the right folder within the program app everytime I install a new version of qcad.

Thomas
Ich will nicht streiten. Ich will nur deutlich machen, dass ich Recht habe und DU NICHT.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Count up counter for consecutive number labeling

Post by Husky » Tue Dec 22, 2015 9:28 am

TSG wrote:What has to be done to get this enhancement as a permanent part of qcad?
You could politely ask Andrew ... like me. :wink:
Husky wrote:@Andrew
Would it be possible to have this new Counter tool permanently implemented in the QCAD "Misc" directory? I would really appreciate it. :wink:
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

TSG
Premier Member
Posts: 337
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany

Re: Count up counter for consecutive number labeling

Post by TSG » Tue Dec 22, 2015 1:32 pm

Husky wrote:
TSG wrote:What has to be done to get this enhancement as a permanent part of qcad?
You could politely ask Andrew ... like me. :wink:
Husky wrote:@Andrew
Would it be possible to have this new Counter tool permanently implemented in the QCAD "Misc" directory? I would really appreciate it. :wink:

Ok, here we go:
Andrew, would you please put the Counter Tool permanently in the QCAD "Misc" directory.

Thanks a lot

Thomas
Ich will nicht streiten. Ich will nur deutlich machen, dass ich Recht habe und DU NICHT.

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

Re: Count up counter for consecutive number labeling

Post by andrew » Mon Jan 04, 2016 1:47 pm


User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Count up counter for consecutive number labeling

Post by Husky » Mon Jan 04, 2016 9:31 pm

Very nice - thank you! :D
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

riverbuoy
Senior Member
Posts: 121
Joined: Thu Oct 03, 2013 5:37 pm

Re: Count up counter for consecutive number labeling

Post by riverbuoy » Sun Jun 05, 2016 5:08 pm

Hi,

While learning Ecmascript, I have used a function that always prints a fixed number of digits after the decimal point. It dawned on me that this was the perfect answer to fixing the problem of showing trailing zeroes in this command. So I have altered this command. It now has a spin box labelled 'Precision', which has a minimum value of zero, and a maximum value of seventeen. (Ecmascript can display up to 17 digits of precision). The value in the box wraps around, so if it is displaying 0, and you click the down arrow, it will wrap around to 17. If it is displaying 17, and you press the up arrow, it will wrap around to 0.
You use this value to determine how many digits should appear after the decimal point. If you wish to use whole numbers, set the precision to zero. So with a start number of 1, an increment of 1, and precision of 0, this will display:-
1, 2, 3, 4, ...
If you set precision to 1, you will get:-
1.0, 2.0, 3.0, 4.0, ...
If you set precision to 2, and increment to 0.1, you will get:-
1.00, 1.10, 1.20, 1.30, ...
If you set increment to 0.01, you will get:-
1.00, 1.01, 1.02, 1.03, ... 1.09, 1.10, 1.11 ... 1.99, 2.00 ...
The thing to remember, is that the precision should be set to at least the number of digits in the increment. So if the increment is 0.001, then precision should be set to at least three.
The advantage of this, is that you no longer have to change anything in 'Drawing Preferences', when using fractional numbers.

The change affects two files, which I have attached. These should be put in the directory 'scripts/Misc/MiscDraw/Counter', replacing the existing files.

I regard this as an important update, so if you are going to be using this command, you should definitely replace these files.

Regards

riverbuoy
Attachments
Counter.ui
(2.4 KiB) Downloaded 1083 times
Counter.js
(4.16 KiB) Downloaded 1018 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Count up counter for consecutive number labeling

Post by Husky » Sun Jun 05, 2016 6:00 pm

Hi riverbuoy,

very nice - thank you so much for this important (at least for me!) improvement. I really appreciate it. :D :D :D
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

FireAlarm
Newbie Member
Posts: 3
Joined: Thu Jan 05, 2017 4:20 pm

Re: Count up counter for consecutive number labeling

Post by FireAlarm » Thu Jan 05, 2017 4:39 pm

Is it possible to set up a counter to automatically add up the blocks so every time i add a smoke detector to my drawing it will add to the right column
Attachments
block.png
block.png (109.49 KiB) Viewed 28803 times

Whicked
Newbie Member
Posts: 9
Joined: Wed Sep 28, 2016 4:23 pm

Re: Count up counter for consecutive number labeling

Post by Whicked » Fri Jun 23, 2017 3:56 pm

@riverbuoy I just want to give you thanks and kudos for this. I have to number wires on a regular basis, and this is close to perfect. It's not AutoCAD electrical (No BOM or wire usage/load and Qcad doesn't support those) but it certainly makes a tedious task much more pleasant.

Thank you!
Bill J.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Count up counter for consecutive number labeling

Post by Husky » Sat Jun 24, 2017 4:24 am

FireAlarm wrote:Is it possible to set up a counter to automatically add up the blocks so every time i add a smoke detector to my drawing it will add to the right column
Hi,
I can tell you that we don't have something like that in the current QCAD Version but I can't tell you what the developers have already in the pipe ... :wink:

However - what I can tell you definitive is that the current QCAD Version has already a little simple script which will count blocks. :shock:
Maybe that is something what you can use to doublecheck your chart ...

Menu / Misk ...
Husky-2017.06.23-01.png
Husky-2017.06.23-01.png (28.31 KiB) Viewed 27854 times
Husky-2017.06.23-01.png
Husky-2017.06.23-01.png (6.28 KiB) Viewed 27854 times
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”