New command - SnapDistanceManual

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

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

New command - SnapDistanceManual

Post by riverbuoy » Tue Dec 03, 2013 1:37 am

SnapDistanceManual

This tool allows you to snap to a point that is between two points, or a given
distance from the first point, at an angle defined by the second point.
It includes a snap distance box and a drop down combo box. The combo box
has three options - 'Distance', 'Percent' and 'Fraction'. So if you entered
50 percent or a fraction of 0.5, for example, it would retuen a point exactly
half-way between the two points.
You enter the value in the snap distance box, and then choose 'Distance',
'Percent', or 'Fraction' from the drop down box.
This command does not restrict the distance, percent or fraction entered.
Therefore a distance greater than the distance between the two points will
return a point beyond the second point. Similarly a percentage greater than
100, and a fraction greater than 1 will return a point beyond the second point.
You can also enter a negative value. This will return a point before the first
point. (Note: You can enter fractions as '1/7', or '3/11' for example.)
The shortcut for this command is DM.

The attached zip file contains the SnapDistanceManual subdirectory.
Extract this to the scripts/snap subdirectory. Then add the
SnapDistanceManual directory to snap.pro, or replace it with the included
snap.pro file.
Attachments
SnapDistanceManual.zip
(30.6 KiB) Downloaded 869 times

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

Re: New command - SnapDistanceManual

Post by Husky » Tue Dec 03, 2013 9:07 am

riverbuoy wrote:Then add the
SnapDistanceManual directory to snap.pro, or replace it with the included
snap.pro file.
Hi riverbuoy - this new command sounds interesting and I like to test it for me. Right now I'm not sure about this "snap.pro" file - where do I save it exactly? I don't have a "snap.pro" file which could be replaced ... :oops:

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

Post by Clive » Tue Dec 03, 2013 2:58 pm

@riverbuoy, great new snap tool, works well - very useful indeed 8)
New Snap tool.png
New Snap tool.png (8.68 KiB) Viewed 28610 times
@Husky, just copy and paste both the SnapDistanceManual folder and the Snap.pro file into the Scripts .Snap folder in QCAD. Remember to set the permissions.
2013-12-03_135535.png
2013-12-03_135535.png (1.93 KiB) Viewed 28610 times
Have fun :wink:
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

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

Re: New command - SnapDistanceManual

Post by riverbuoy » Tue Dec 03, 2013 6:05 pm

Hi Husky. I've just checked my trial version of QCad, and sure enough no snap.pro. So I copied the SnapDistanceManual folder into the scripts/Snap folder and restarted QCad, and it works. So no snap.pro required for the trial or commercial version. I was using the community source version which does require the file. I'll keep this in mind for the future.

Hi Clive. Thanks for your kind words.

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

Re: New command - SnapDistanceManual

Post by Husky » Tue Dec 03, 2013 7:05 pm

riverbuoy wrote:You can also enter a negative value. This will return a point before the first
point. (Note: You can enter fractions as '1/7', or '3/11' for example.)
Hi riverbuoy - really nice and useful tool - thanks for doing this!
May I ask you something what I haven't understood yet:
If I use a positive value like 1 1/3 Fraction I get a result what I have expected.
If I use the same value as a negative, - 1 1/3 or - (1/3), I don't understand the result. Could you please explain how it works correctly.
Husky-2013.12.03-02.png
Husky-2013.12.03-02.png (3.65 KiB) Viewed 29062 times
The second question is: Would it be possible to use the right click on the mouse to go one step back during the first or second point selection to "correct" a wrong point pick?

However - a nice and powerful snap tool!!! :D

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: New command - SnapDistanceManual

Post by J-J » Tue Dec 03, 2013 10:32 pm

Hello riverbuoy,

I just tried the tool you developed, thank you for sharing it. From what I saw at first, I believe it may even have more uses that you initially envisioned ...
JJ Win7 pro-64

Idealos
Newbie Member
Posts: 7
Joined: Mon Nov 25, 2013 5:10 pm

Re: New command - SnapDistanceManual

Post by Idealos » Tue Dec 03, 2013 10:38 pm

Hi,

I can only say thanks, this new tool is great. I'm a new user, and every day every day my excitement goes up.
Please go ahead


Thanks
QCad Pro

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

Re: New command - SnapDistanceManual

Post by riverbuoy » Tue Dec 03, 2013 11:29 pm

Hi Husky - Thanks for the feedback and positive reaction.

The command uses RMath.eval function to evaluate expressions. In expressions we
often leave out plus signs. So if we include the plus signs, for positive numbers
it evaluates as +1+1/3 which equals one and one third, as expected. However for
negative numbers what you have is -1+1/3 which equals minus two thirds. So to get
what you expect you need to negate both parts, i.e. -1-1/3, or negate the whole
number, i.e. -(1 1/3).
Hope this explains what is happening.

Right clicking is tricky. This command works by overriding the current action. If
we assume the current action is drawing a line, then that action is suspended
temporarily while we choose two points. This command sends the resulting point to
the line command and then terminates. Right clicking terminates the command and
control returns to the line command. If we changed this, we would require a
different way of terminating the command. As right-clicking is the standard way
of terminating commands, changing this would, I feel, confuse users.
Sorry for not being more helpful.

Hope this answers your questions.

Also thanks to J-J and Idealos for your kind comments.

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

Re: New command - SnapDistanceManual

Post by Husky » Wed Dec 04, 2013 9:36 am

riverbuoy wrote:Hope this answers your questions.
Yes it did - thanks a lot.
I'm not a big fan of construction lines and your new tool will help me to avoid a lot of such lines.
J-J wrote:... I believe it may even have more uses that you initially envisioned ...
Yes, I have to agree! This "two point figure pick" could be the base for a couple more helpful tools / amplifications. I have already a couple ideas where it would be useful to have ... at least for me. :lol:

@Andrew
What do you think? Is it possible to get this new snap tool permanently implemented into QCAD Pro? My vote is "yes" ......... oups, there was no poll? 8)

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

Post by Clive » Wed Dec 04, 2013 10:03 am

Husky wrote:I'm not a big fan of construction lines and your new tool will help me to avoid a lot of such lines.
Its a good job you have QCAD to use then and not an old drawing board :lol: although you may have an old board somewhere...like I do :roll:
J-J wrote:... I believe it may even have more uses that you initially envisioned ...
Husky wrote:Yes, I have to agree! This "two point figure pick" could be the base for a couple more helpful tools / amplifications. I have already a couple ideas where it would be useful to have ... at least for me. :lol:
Been testing this tool some more and yes I also agree, this new snap addition is certainly going to be more useful than we all think - what a great tool - well done :wink:
Husky wrote:@Andrew
What do you think? Is it possible to get this new snap tool permanently implemented into QCAD Pro? My vote is "yes" ......... oups, there was no poll? 8)
I second you Husky.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: New command - SnapDistanceManual

Post by J-J » Wed Dec 04, 2013 10:19 am

I second you Husky.
So do I...but let the master comment first!
JJ Win7 pro-64

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

Post by Clive » Wed Dec 04, 2013 10:35 am

J-J wrote:So do I...but let the master comment first!
Oops, thanks for the admonishment :oops:
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

Idealos
Newbie Member
Posts: 7
Joined: Mon Nov 25, 2013 5:10 pm

Re: New command - SnapDistanceManual

Post by Idealos » Sun Dec 15, 2013 9:24 am

Hi,

How could I put it in Spanish?

Thank you
QCad Pro

Post Reply

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