Line Break Symbol script
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.
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Line Break Symbol script
!! UPDATE, PLEASE CLICK THE LINK !! viewtopic.php?f=30&p=32527#p32527
This is a modified script of the ExLineDove.js script created by Matthias Melcher.
LineBreakSymbol creates a line break from 2 picked points, it can be scaled and rotated depending on where the second point is picked. To install it, make a new folder called Draw (if you don't have that folder) in the scripts/Misc folder, then extract the LineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a "Line Break Symbol" menu item under the Misc/Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S2, commands are either breaksymbol or brksym.
After picking the first point the 'symbol' will appear, you'll see you can rotate and scale about that point, pick a second point to fix. It creates 3 lines. I'd like to make it one polyline eventually, plus I'd like the removal of the line between the two points to be automatic, I've been using the 'Break out Segment' command to do it thus far.
This is a modified script of the ExLineDove.js script created by Matthias Melcher.
LineBreakSymbol creates a line break from 2 picked points, it can be scaled and rotated depending on where the second point is picked. To install it, make a new folder called Draw (if you don't have that folder) in the scripts/Misc folder, then extract the LineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a "Line Break Symbol" menu item under the Misc/Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S2, commands are either breaksymbol or brksym.
After picking the first point the 'symbol' will appear, you'll see you can rotate and scale about that point, pick a second point to fix. It creates 3 lines. I'd like to make it one polyline eventually, plus I'd like the removal of the line between the two points to be automatic, I've been using the 'Break out Segment' command to do it thus far.
- Attachments
-
- LineBreakSymbol.zip
- (10.82 KiB) Downloaded 460 times
Last edited by petevick on Tue Mar 16, 2021 8:08 pm, edited 3 times in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Line Break Symbol script
Nice work Pete.
And that for someone who just recently said that he had no knowledge of it
TOP
Regards,
CVH
PS: As Polyline it is already functional here ...
And that for someone who just recently said that he had no knowledge of it
TOP
Regards,
CVH
PS: As Polyline it is already functional here ...
Last edited by CVH on Fri Mar 05, 2021 11:19 am, edited 1 time in total.
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
Thanks CVH, but to be fair all the work was done in the ExLineDove.js script, I just changed a few things here and there
Pete
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
-
- Premier Member
- Posts: 474
- Joined: Mon Sep 30, 2019 6:21 am
- Location: Melbourne - Australia
Re: Line Break Symbol script
Great Pete
I'll definitely use this especially to jog large radii..
Thanks
John Hyslop
I'll definitely use this especially to jog large radii..
Thanks
John Hyslop
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]
Re: Line Break Symbol script
Pete, I like that. What would complete it would be to have a 3rd point (specifying height) as well as finally converting the lines to a polyline.
I'm trying to follow your code but I'm unfamiliar with the ECMAScript interface. As an ex-programmer (15yrs back) this is definitely new territory. I admire your ability to have done this.
Best
I'm trying to follow your code but I'm unfamiliar with the ECMAScript interface. As an ex-programmer (15yrs back) this is definitely new territory. I admire your ability to have done this.
Best
Windows 10
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
I knew someone would ask for a 3rd point It's a fair request, might be doable.Panchdara wrote: ↑Sat Mar 06, 2021 1:58 amPete, I like that. What would complete it would be to have a 3rd point (specifying height) as well as finally converting the lines to a polyline.
I'm trying to follow your code but I'm unfamiliar with the ECMAScript interface. As an ex-programmer (15yrs back) this is definitely new territory. I admire your ability to have done this.
Best
It's not not my script ! I modified a few lines of the ExLineDove.js script created by Matthias Melcher. I'm still struggling with ECMAScript. My last programming was fairly extensive with AutoLISP and Visual Lisp some 40 years ago !!, all learnt with 3" thick reference books, no google or internet then (geez, that makes me feel old ) and that's what's frustrating about this scripting lark, I have all the resources in the world, and I'm still struggling to grasp it.
Thanks John, glad it's going to be useful to youJohn Hyslop wrote: ↑Fri Mar 05, 2021 11:45 pmGreat Pete
I'll definitely use this especially to jog large radii..
Thanks
John Hyslop
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
This update would not have been possible without the incredible amount of effort put in by CVH in sorting out the coding.
PolyLineBreakSymbol replaces LineBreakSymbol, it is a significant update consisting of the following;
To install the PolyLineBreakSymbol tool first create a new folder called Draw in the scripts>Misc folder (if you don't already have that folder) and then extract the PolyLineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a Polyline Break Symbol menu item under the Misc>Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S3, commands are either pbreaksymbol or pbrksym.
User Options toolbar The first option is Remove Segment. If checked, the chosen entity segment between the break symbol will be removed if unchecked, the segment is not removed. The default is checked.
The second option is Peak Height. This indicates the height to the peak of the symbol from the chosen entity. The minimum value is 1 and the maximum value is 9. The default value is 3. This changes the look of the symbol considerably from one extreme to the other.
The last option is Inclined and Vertical. If Inclined is selected the symbol will have inclined first and last segments thus... If Vertical is selected the symbol will have vertical first and last segments thus... The default is Inclined.
How to use
In the Pro version of Qcad you will be first asked to choose either a line, arc, circle, ellipse, spline or polyline to break up. In the CE version, you are asked to choose either a line, arc, circle or ellipse. You must choose one of those entities to proceed, selecting some other entity will result in an error message being displayed on the command line.
You are then prompted to pick the first break point. The break symbol will then appear. You will note that at this point you can scale the symbol along the path of the chosen entity by moving the crosshairs, also the break symbol has inherited the properties of the chosen entity, layer/line width etc. You will then be prompted to pick a second point. This will fix the final size of the symbol, and, if the Remove Segment option is checked, the segment between the symbol will be removed.
Note that after the first point is picked you can change any of the user options and the symbol will be updated to reflect your changes.
You can now insert another break symbol or click the right mouse button to end.
PolyLineBreakSymbol replaces LineBreakSymbol, it is a significant update consisting of the following;
- the break symbol is now drawn as a polyline
- user options added to the Options toolbar
- option to remove the segment between the symbol
- option to set the peak height of the symbol
- option for either Inclined or Vertical first and last segments
To install the PolyLineBreakSymbol tool first create a new folder called Draw in the scripts>Misc folder (if you don't already have that folder) and then extract the PolyLineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a Polyline Break Symbol menu item under the Misc>Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel. The shortcut is S3, commands are either pbreaksymbol or pbrksym.
User Options toolbar The first option is Remove Segment. If checked, the chosen entity segment between the break symbol will be removed if unchecked, the segment is not removed. The default is checked.
The second option is Peak Height. This indicates the height to the peak of the symbol from the chosen entity. The minimum value is 1 and the maximum value is 9. The default value is 3. This changes the look of the symbol considerably from one extreme to the other.
The last option is Inclined and Vertical. If Inclined is selected the symbol will have inclined first and last segments thus... If Vertical is selected the symbol will have vertical first and last segments thus... The default is Inclined.
How to use
In the Pro version of Qcad you will be first asked to choose either a line, arc, circle, ellipse, spline or polyline to break up. In the CE version, you are asked to choose either a line, arc, circle or ellipse. You must choose one of those entities to proceed, selecting some other entity will result in an error message being displayed on the command line.
You are then prompted to pick the first break point. The break symbol will then appear. You will note that at this point you can scale the symbol along the path of the chosen entity by moving the crosshairs, also the break symbol has inherited the properties of the chosen entity, layer/line width etc. You will then be prompted to pick a second point. This will fix the final size of the symbol, and, if the Remove Segment option is checked, the segment between the symbol will be removed.
Note that after the first point is picked you can change any of the user options and the symbol will be updated to reflect your changes.
You can now insert another break symbol or click the right mouse button to end.
- Attachments
-
- PolyLineBreakSymbol.zip
- (8.19 KiB) Downloaded 443 times
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Line Break Symbol script
Will that overwrite the already existing entry in 3.26.0.1?petevick wrote: ↑Thu Mar 11, 2021 6:41 pm
Installation
To install the PolyLineBreakSymbol tool first create a new folder called Draw in the scripts>Misc folder (if you don't already have that folder) and then extract the PolyLineBreakSymbol folder in the zip file into the new Draw folder. Restart Qcad and you'll find a Polyline Break Symbol menu item under the Misc>Draw menu, and a toolbar button on the Misc Draw toolbar and the Misc Draw section of the Tool Matrix panel.
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
additional word document of the above if you want a formatted hard copy.
- Attachments
-
- readme.doc
- (29 KiB) Downloaded 425 times
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
No, the new tool is a different name PolylineBreakSymbol and new folder name. Just delete the original LineBreakSymbol folder
I should have mentioned that really shouldn't I
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Line Break Symbol script
BRILLIANT!!!! Not what I had thought, but fantastic! A gazzillion thumb ups.
I don't understand the "peak height"..... would be nice to have that 3rd pint that specifies the height - don't get me wrong, this is brilliant. Ltta effort went into this. Oh, and one further request - have a frequency, ie number of cycles. (I know, it's not Christmas yet )
Last edited by Panchdara on Thu Mar 11, 2021 8:19 pm, edited 3 times in total.
Windows 10
Re: Line Break Symbol script
Well .... I'm sure you already realized that that isn't possible.
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..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
It is possible if you installed LineBreakSymbol from the zip file, but not if you are using Qcad version 3.26.1 as it is part of the Qcad install. I assume the next Qcad update will have the PolylineBreakSymbol tool as it's already in the repositry.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Line Break Symbol script
I take it you like it then
It's just a linear unit, a means of keeping control of crazy user input It has to be a controlled value, anything else would take lots of code to verify all kinds of parameters.I don't understand the "peak height"..... would be nice to have that 3rd pint that specifies the height
Jeez, it's only been uploaded a few minutes I have no idea what you mean by "number of cycles" so no, you can't have it......unless yo explain yourselfOh, and one further request - have a frequency, ie number of cycles. (I know, it's not Christmas yet )
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Line Break Symbol script
Pete, thank you. What I mean by "cycle" is frequency, this lovely feature only has 1Hz, 1 cycle.
This is a 3 cycle Sawtooth.
2 cycle Triangular - Nevertheless, it's looking great!
This is a 3 cycle Sawtooth.
2 cycle Triangular - Nevertheless, it's looking great!
Windows 10