Jump to content

Recommended Posts

Posted

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.

Posted

Could you not post the Dimension LISP - there is perhaps another way around this :)

Posted

Sorry I figured it'd be a quick and easy one... And I'm at home now. I can post it on Monday.

Posted

When comparing if points are the same, usually you need to use "equal" vs "=", as in:

 

(equal pt1 pt2) and

(not (equal pt1 pt2))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...