New command - SnapDistanceManual

This forum is for 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: Clive, andrew, Husky

New command - SnapDistanceManual

Postby 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 65 times
riverbuoy
Active Member
 
Posts: 37
Joined: Thu Oct 03, 2013 5:37 pm

Re: New command - SnapDistanceManual

Postby 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
Husky
Moderator
 
Posts: 659
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New command - SnapDistanceManual

Postby 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 1556 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 1556 times

Have fun :wink:
Clive
User avatar
Clive
Moderator
 
Posts: 914
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

Postby 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.
riverbuoy
Active Member
 
Posts: 37
Joined: Thu Oct 03, 2013 5:37 pm

Re: New command - SnapDistanceManual

Postby 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 1541 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
Husky
Moderator
 
Posts: 659
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New command - SnapDistanceManual

Postby 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
User avatar
J-J
Moderator
 
Posts: 173
Joined: Tue Mar 24, 2009 9:48 pm

Re: New command - SnapDistanceManual

Postby 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
Idealos
Newbie Member
 
Posts: 7
Joined: Mon Nov 25, 2013 5:10 pm

Re: New command - SnapDistanceManual

Postby 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.
riverbuoy
Active Member
 
Posts: 37
Joined: Thu Oct 03, 2013 5:37 pm

Re: New command - SnapDistanceManual

Postby 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
Husky
Moderator
 
Posts: 659
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New command - SnapDistanceManual

Postby 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.
Clive
User avatar
Clive
Moderator
 
Posts: 914
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

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

I second you Husky.


So do I...but let the master comment first!
JJ
User avatar
J-J
Moderator
 
Posts: 173
Joined: Tue Mar 24, 2009 9:48 pm

Re: New command - SnapDistanceManual

Postby 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:
Clive
User avatar
Clive
Moderator
 
Posts: 914
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New command - SnapDistanceManual

Postby Idealos » Sun Dec 15, 2013 9:24 am

Hi,

How could I put it in Spanish?

Thank you
QCad Pro
Idealos
Newbie Member
 
Posts: 7
Joined: Mon Nov 25, 2013 5:10 pm


Return to QCAD 3 ' script Add-On & Plug-in challenge '

Who is online

Users browsing this forum: No registered users and 1 guest