Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lisp code working only sometimes in autocad

Status
Not open for further replies.

sosozah

Civil/Environmental
Nov 26, 2005
2
0
0
RO
Here's my problem: I wrote a lisp routine that draws a grid of blocks (rectangular array 50x50),a rectangular boundary, and the values of the X,Y coordinate on the rectangular boudary. At the time I wrote the code, it worked fine. After few hours... it begun drawing zero lenghten lines and positioning text at weird positions. I tested the code on 3 different machines... Sometimes it worked well, but more times with errors. All this in Autocad 2004. I've tested the code in intellicad and it works 100% all the times. I don't know where to find the problem and I'm asking for your help. Could it be a system variable in autocad?

Thank you.
 
Replies continue below

Recommended for you

I wrote a code one time that worked sometimes and did not work the next time I would need it. I found that if my osnap was off or I was zoomed in close it worked. What was taking place was the object snap was causing lines to start and end where they were not wonted. I wrote in the code to set the osmode to "0", and before the code exits to set the osmode back to what it was. That fixed it. Hope this is your fix and that this helps. Good Luck.
 
Thanks verry much, the osmode was my problem, indeed.
I guess it happens often to all beginers in autolisp coding :).

 
Status
Not open for further replies.
Back
Top