salman Posted June 17, 2009 Share Posted June 17, 2009 I draw point using WCS. No I align WCS to some object and draw another point exactly at the same location where first point is drawn. Now in a lisp program I get the coordinates of the two points apply distance command to them display the disatance using alert command, it is show to be 0, but in an if statement when i check that condition, it does not work. Can anyone explain why the if statement is not working although the distance displayed between the point ( using alert ) is shown to be 0. the reference code is ( setq dis( distance p1 p2 ) ) ( if ( = 0 dis ) ( alert "pts are same" ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 17, 2009 Share Posted June 17, 2009 When working in different UCS's use TRANS to convert all the points to the WCS, then perform your calculations. Quote Link to comment Share on other sites More sharing options...
TimSpangler Posted June 17, 2009 Share Posted June 17, 2009 and when using reals / integers it is best to use (equal instead or (= . It allow for some fuzz..... Quote Link to comment Share on other sites More sharing options...
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.