Lisp giving different result when re-run compared to first

Lisp giving different result when re-run compared to first

mhan0017
Explorer Explorer
218 Views
3 Replies
Message 1 of 4

Lisp giving different result when re-run compared to first

mhan0017
Explorer
Explorer

Hi,


I have written the following lisp to draw some circles and points at a set offset from the middle of two selected points. Two points are offset 18mm from the line, the other two offset 190mm. However when i run the lisp the first time there is no 18mm offset (but there is the 190mm offset) then when it is re-run immediately it works as intended by drawing all 4 objects with the correct offset. Weird how it half works the first time, then completely works the second time.

 

Not sure if there is something in how the code is written or some sort of bug elsewhere

 

Any assistance would be appreciated!

0 Likes
Accepted solutions (1)
219 Views
3 Replies
Replies (3)
Message 2 of 4

komondormrex
Mentor
Mentor

hi,

this comparison will never give true

 

(and
           (> checklength 0.654)
           (< checklength 0.674)
)

 

 also i would clear snap in drawing command with "_non" like this

 

(command "._point" "_non" bolt4)
(command "._circle" "_non" bolt1 0.018)

 

 

0 Likes
Message 3 of 4

komondormrex
Mentor
Mentor

sorry for that phase for comparison(

0.654 /= 0.674

0 Likes
Message 4 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

In such cases, running OSNAPs are almost always the culprit.

 

See the history of how to fix the issue - there are 3 ways basically: OSNAPCOORD / OSMODE / NONE 

0 Likes