KRBeckman Posted February 19, 2010 Posted February 19, 2010 I'm 95% done with a dimensioning lisp and I'm running into a problem... I'm prompting the user to select 3 points, the first two being the extension line origins and the 3rd being the basepoint that I use to calculate where the dimension line goes (I'm haveing the user select the outmost point of the object and then doing a calculation to pick a point 0.25" out from there in order to maintain consistancy with how far the dimensions are away from the object). The problem is that fairly regularly the quickest point to select as the 3rd point is also the 2nd point that was allready picked. But by doing this my lisp can't tell which direction to place the dimension, so I took a shot at adding code so that the user has to pick a 4th point if the 3rd point is the same as the 1st or 2nd, but its not working. Here's what I tried: (cond ( (= pt3 pt2) (setq pt4 (getpoint "\nSelect the direction of the dimension: "))) ( (= pt3 pt1) (setq pt4 (getpoint "\nSelect the direction of the dimension: "))) ( (and (/= pt3 pt2) (/= pt3 pt1)) (setq pt4 pt3))) I've also tried nested if functions, but that didn't work. Any help would be awesome. Quote
Lee Mac Posted February 19, 2010 Posted February 19, 2010 Could you not post the Dimension LISP - there is perhaps another way around this Quote
KRBeckman Posted February 19, 2010 Author Posted February 19, 2010 Sorry I figured it'd be a quick and easy one... And I'm at home now. I can post it on Monday. Quote
CarlB Posted February 19, 2010 Posted February 19, 2010 When comparing if points are the same, usually you need to use "equal" vs "=", as in: (equal pt1 pt2) and (not (equal pt1 pt2)) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.