Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
cadking2k5
Posts: 71
Registered: ‎04-17-2012
Message 1 of 9 (351 Views)

last point picked

351 Views, 8 Replies
09-02-2013 01:00 PM

how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle 

*Expert Elite*
hmsilva
Posts: 2,649
Registered: ‎12-17-2004
Message 2 of 9 (334 Views)

Re: last point picked

09-02-2013 02:29 PM in reply to: cadking2k5
cadking2k5,

the last specified point is stored in LASTPOINT System Variable, but if I understood correctly, you want the last picked point inside the circle command, and that point is not saved...

Is that point you're trying to get?
To get that point, you need to store the point previously, and then provide it to the circle command...

Henrique
Mentor
stevor
Posts: 836
Registered: ‎12-26-2005
Message 3 of 9 (324 Views)

Re: last point picked

09-02-2013 03:38 PM in reply to: cadking2k5
To use the selected points, you could make a routine to select points, or select the one point, and then issue the Circle command.
S
*Expert Elite*
Kent1Cooper
Posts: 5,243
Registered: ‎09-13-2004
Message 4 of 9 (282 Views)

Re: last point picked

09-03-2013 11:41 AM in reply to: cadking2k5

cadking2k5 wrote:

how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle 


Interestingly, if you draw a Circle using the 3P or 2P option, the last point you picked to define it is stored in the LASTPOINT System Variable, so you can get at it via (getvar 'lastpoint) or with "@" in some kind of drawing or editing command.  But with the Center-Radius approach, the point selected to define the radius is only used to calculate the length of the radius, and is not saved, nor do elements of defining selections in the TTR option have any influence on LASTPOINT.

Kent Cooper
*Expert Elite*
doni49
Posts: 1,336
Registered: ‎12-22-2012
Message 5 of 9 (234 Views)

Re: last point picked

09-12-2013 12:15 PM in reply to: cadking2k5

cadking2k5 wrote:

how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle 


What exactly are you trying to accomplish?  Maybe there's another way to get you there.

For example, the latest post commented on the fact that you couldn't get the last point used to create a circle if using the standard center/radius method.  This will get you there if that were needed.

 

(command "circle" (setq cen (getpoint "Center of Circle:  ")) (setq pt2(getpoint "Point on Circle" cen))); pt2 will have the second point that was selected.

Don Ireland



If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Forum links:
AutoCAD 2013/2014/2015
AutoCAD 2010/2011/2012

AutoLISP, VB and other AutoCAD customization


Civil 3D General
Civil 3d Cusomization

*Expert Elite*
Kent1Cooper
Posts: 5,243
Registered: ‎09-13-2004
Message 6 of 9 (226 Views)

Re: last point picked

09-12-2013 01:09 PM in reply to: cadking2k5

cadking2k5 wrote:

how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle 


Looking at that again, I am wondering:  If you're drawing the Circle using the TTR option, which most replies here don't really address, you don't directly pick a point that lies on the Circle's circumference, nor do you pick the center point, and you can't save two points to variables and build the Circle from them, but the center is calculated from the tangent objects and the specified radius.  The resulting Circle could touch either of the tangent objects sometimes rather far from where the cursor was when you picked near them.  By "the point I pick on the circle," do you mean the point of tangency and intersection of the new Circle with one of the tangent objects?  Or the nearest point on either the new Circle or one of the tangent objects to the location at which you picked?  In either case, would it matter whether it saved the first one or the second one, or would either one do?

Kent Cooper
*Expert Elite*
Kent1Cooper
Posts: 5,243
Registered: ‎09-13-2004
Message 7 of 9 (223 Views)

Re: last point picked

09-12-2013 01:20 PM in reply to: doni49

doni49 wrote:
.... you couldn't get the last point used to create a circle if using the standard center/radius method.  This will get you there if that were needed.

(command "circle" (setq cen (getpoint "Center of Circle:  ")) (setq pt2(getpoint "Point on Circle" cen))); pt2 will have the second point that was selected.


A drawback of that approach [which I think is, give or take, what stevor was suggesting] is that the Circle doesn't drag dynamically as it's asking you for the circumference-defining point, so you can't see what you're getting as in the regular Circle command.  It would be possible using (grread) to have it drag while asking for a picked point that it would be able to save, but I don't believe object snap would be available for that point.  [At least, I haven't found a way to get it to work, nor to type in a one-time Osnap mode, in a routine I built that draws a Rectangle based on a midpoint rather than on opposite corners.]

 

But in any case, it's moot if they're drawing the Circle using the TTR option [waiting for an answer to my clarification question about that] -- I expect it would require some other approach entirely.

Kent Cooper
*Expert Elite*
doni49
Posts: 1,336
Registered: ‎12-22-2012
Message 8 of 9 (216 Views)

Re: last point picked

09-12-2013 01:38 PM in reply to: Kent1Cooper

Kent1Cooper wrote:

doni49 wrote:
.... you couldn't get the last point used to create a circle if using the standard center/radius method.  This will get you there if that were needed.

(command "circle" (setq cen (getpoint "Center of Circle:  ")) (setq pt2(getpoint "Point on Circle" cen))); pt2 will have the second point that was selected.


A drawback of that approach [which I think is, give or take, what stevor was suggesting] is that the Circle doesn't drag dynamically as it's asking you for the circumference-defining point, so you can't see what you're getting as in the regular Circle command.  It would be possible using (grread) to have it drag while asking for a picked point that it would be able to save, but I don't believe object snap would be available for that point.  [At least, I haven't found a way to get it to work, nor to type in a one-time Osnap mode, in a routine I built that draws a Rectangle based on a midpoint rather than on opposite corners.]

 

But in any case, it's moot if they're drawing the Circle using the TTR option [waiting for an answer to my clarification question about that] -- I expect it would require some other approach entirely.


Good point Kent.  I guess we'll have to wait for clarification.  If we knew exactly what the OP is trying to accomplish, we might be able assist in finding another aproach.

Don Ireland



If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Forum links:
AutoCAD 2013/2014/2015
AutoCAD 2010/2011/2012

AutoLISP, VB and other AutoCAD customization


Civil 3D General
Civil 3d Cusomization

*Expert Elite*
Kent1Cooper
Posts: 5,243
Registered: ‎09-13-2004
Message 9 of 9 (110 Views)

Re: last point picked

02-10-2014 10:06 AM in reply to: Kent1Cooper

Kent1Cooper wrote:
....

A drawback of that approach [which I think is, give or take, what stevor was suggesting] is that the Circle doesn't drag dynamically as it's asking you for the circumference-defining point, so you can't see what you're getting as in the regular Circle command.  It would be possible using (grread) to have it drag while asking for a picked point that it would be able to save, but I don't believe object snap would be available for that point.  ....


I worked out a way to do that, in case it's of any use to the OP, but it does have the drawback described -- it honors neither running Object snap nor entry of a one-time Osnap mode for the circumference point [it does for the center].  And it won't let you set the value of, or turn on or off, positional Snap between picking the center and the point on the circumference, but it does honor positional Snap if it's already on.

Kent Cooper

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community