Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoLISP program gives different result each time

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
318 Views, 4 Replies

AutoLISP program gives different result each time

When i run a AutoLisp program, it gives me different result each time. When I call a value for a perticular variable using "!" it gives right value but when this variable is used to draw polyline, it gives me different polyline. I have defined four points named pt1, pt2, pt3 and pt4. After having offest value another 4 points are created named opt1, opt2, opt3 and opt4. When I check the value of pt1 and opt1 using !pt1 and !opt1, it gives me distinct value but when I draw a polyline using (command "pline" pt1 pt2 pt3 pt4 "c"), the result is either a triangle !! or polygon. 

 

someone please help.

4 REPLIES 4
Message 2 of 5
Shneuph
in reply to: Anonymous

Have you tried this with osnaps and polar tracking/ortho off?

 

(setq n4mosmode (getvar "osmode"));save osnapmode

(setvar "osmode" 0);turn of snaps

 

lisp....

 

 

(setvar "osmode" n4mosmode); reset osnap mode <---- edit n4mosmode to match.. was n3m

 

Sometimes osnaps etc can interfere w/ drawing geometry.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 5
hgasty1001
in reply to: Anonymous

Hi,

 

Disable osnap *before* take points: (setvar "OSMODE" 0). Usually you need:

 

(setq OldOsmode (getvar "OSMODE"))

(setvar "OSMODE" 0)

...

(setvar "OSMODE" OldOsmode)

 

 

 

Gaston Nunez

Message 4 of 5
chetanonautodesk
in reply to: Shneuph

THANKS A LOT FOR YOUR GUIDANCE. IT DID SOLVED MY PROBLEM.

Message 5 of 5
chetanonautodesk
in reply to: Shneuph

THANKS A LOT FOR YOUR GUIDANCE. IT DID SOLVED MY PROBLEM.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost