Hi
I have updated 'draw polyline' to have the same functionality as the 'line' command. So I have added a 'redo' button to the options toolbar, and also a 'restrict to angle and/or distance' button.
I have also added shortcuts to the buttons - ',C' ',U' ',R' for close, undo and redo. Also ',A' to toggle the arc segment box. (Remember you can change the comma to another character in 'Edit->Application Preferences->Widgets->Toolbars'.).
You can also now use the commands 'c', 'u', 'r' and 'a' in the command line. (You can also type 'c', 'cl', 'clo', 'clos' and 'close'. They will all invoke the 'close' command, but you only have to type as many characters as required to distinguish between commands. Similarly for the 'undo', 'redo' and 'arc' commands.).
Also if you press 'enter' or 'return' at the 'First vertex' prompt, it will choose the last position as the first vertex.
Use of the 'restrict' button is the same as in the line command.
The standard command enables the 'close' and 'undo' buttons when it is waiting for a first vertex. I have changed this so they are now disabled, so they behave as they do in the line command.
Finally when defining an arc segment, relative zero is set to the point you pick. If this point is not at the end of the arc segment, then relative zero will be in the wrong position. I changed this so relative zero is positioned at the end of the arc segment.
There are four files to implement the change, which I have attached. These should be copied to the 'scripts/Draw/Polyline/DrawPolyline' directory. The two files 'DrawPolyline.js' and 'DrawPolyline.ui' already exist in this directory, so if you wish to keep them, rename them first.
riverbuoy
Update Draw Polyline to match line command
Moderators: andrew, Husky, J-J
Update Draw Polyline to match line command
- Attachments
-
- RedoPath-inverse.svg
- (9.34 KiB) Downloaded 812 times
-
- RedoPath.svg
- (9.06 KiB) Downloaded 793 times
-
- DrawPolyline.ui
- (4.44 KiB) Downloaded 797 times
-
- DrawPolyline.js
- (14.02 KiB) Downloaded 739 times
Re: Update Draw Polyline to match line command
Nice - thanks again for taking care of tools like this one!riverbuoy wrote:Hi
I have updated 'draw polyline' to have the same functionality as the 'line' command.
Question to the new functionality:
If I restrict the angle (i.e. 45°) for an arc - I'm still able to pick any finishing point outside this given angle? Why is that so?
And what is the Mouspointer Info telling me?
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..."
Re: Update Draw Polyline to match line command
Understood! I can now answer my question by myself:Husky wrote:Question to the new functionality:
If I restrict the angle (i.e. 45°) for an arc - I'm still able to pick any finishing point outside this given angle? Why is that so?
And what is the Mouspointer Info telling me?
The given angle belongs not to the arc - it will restrict the Mousepointer position to relative zero. And the Compass orientation is always the same - regardless where I start my arc.
What means: I can't create a Polyline with arcs (180°) like this one, right?
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..."
Re: Update Draw Polyline to match line command
Hi Husky
However, this gave me an idea. I have added a sweep entry box to the options toolbar. This allows you to enter the sweep value you require. So, in your example, you would enter a value of 180.0 in this box.
The value in the box must be greater than or equal to 0.0, and less than or equal to 360.0. If it is outside these values then it will have no effect. Also if the value equals 0.0, it has no effect.
This change affects two files - 'DrawPolyline.js' and 'DrawPolyline.ui', which I have attached. As before copy them to the 'scripts/Draw/Polyline/DrawPolyline' directory.
Perhaps you could try this out and let me know what you think?
riverbuoy
Actually you can, BUT, trying to get an arc to be exactly 180° when the preceeding line segment is not horizontal or vertical, is extremely difficult (not quite impossible, it would require some manual calculations).Husky wrote:What means: I can't create a Polyline with arcs (180°) like this one, right?
However, this gave me an idea. I have added a sweep entry box to the options toolbar. This allows you to enter the sweep value you require. So, in your example, you would enter a value of 180.0 in this box.
The value in the box must be greater than or equal to 0.0, and less than or equal to 360.0. If it is outside these values then it will have no effect. Also if the value equals 0.0, it has no effect.
This change affects two files - 'DrawPolyline.js' and 'DrawPolyline.ui', which I have attached. As before copy them to the 'scripts/Draw/Polyline/DrawPolyline' directory.
Perhaps you could try this out and let me know what you think?
riverbuoy
- Attachments
-
- DrawPolyline.js
- (15.39 KiB) Downloaded 743 times
-
- DrawPolyline.ui
- (5.72 KiB) Downloaded 816 times
Re: Update Draw Polyline to match line command
Yes I know - but by now you know me .................. I'm a lazy boy.riverbuoy wrote: Actually you can, BUT, trying to get an arc to be exactly 180° when the preceeding line segment is not horizontal or vertical, is extremely difficult (not quite impossible, it would require some manual calculations).
YES - that was exactly what I was looking for!riverbuoy wrote:However, this gave me an idea. I have added a sweep entry box to the options toolbar. This allows you to enter the sweep value you require. So, in your example, you would enter a value of 180.0 in this box.
Till now my work-flow for a little bit more complicated Polyline was to create the shape with standard tools like lines, Arcs etc etc. and then I converted this with the Tool "Create from Segments" to a Polyline.
Now with your additional options for the "Draw Polyline" tool I'm able to improve my Work-flow. Nice! Thank you!
I will test it a little further but it looks already pretty good!
Question:
Would it be possible to mark values outside the working range in red? Like -45 or 375 etc.? As a hint for the User that he is doing something wrong ...riverbuoy wrote:The value in the box must be greater than or equal to 0.0, and less than or equal to 360.0. If it is outside these values then it will have no effect. Also if the value equals 0.0, it has no effect.
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..."