seegs Posted July 19, 2011 Share Posted July 19, 2011 Hi all, I have written a few basic autolisp programs now, to test what I have learned so far. My latest one is to draw the outline of a house, with the user entering the width of the house and the pitch of the roof. The problem is, with this program and the others I have written, when I run it it occasionally messes up. As in, sometimes it will miss drawing some lines or they will be in the wrong place. If this happened every time then obviously there is a problem in the program. But for it to happen randomly is something i just don't get. Is this a common thing with beginners? Thanks Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 19, 2011 Share Posted July 19, 2011 Sounds like you need to write your self a bit of a user program manual and record what variables are being used where and stay consistant not much good making one variable a string in one program and a real in another it will crash, same with selection sets often if you try to make the same named one again it will give an error. You need to work out what combo of steps causes a crash. Sometimes a real bug it can be the zoom factor of the drawing at the time this is a hair pulling problem but once you know about it you can work around it. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 19, 2011 Share Posted July 19, 2011 Hi all, The problem is, with this program and the others I have written, when I run it it occasionally messes up. As in, sometimes it will miss drawing some lines or they will be in the wrong place. If this happened every time then obviously there is a problem in the program. But for it to happen randomly is something i just don't get. Is this a common thing with beginners? You should put your osnap off before the command "_.line" or "_.polyline" and whatever in your routine . e.g. (setq os (getvar 'osmode)) (setvar 'osmode 0) ..... ... your commnads and codes here ..... .. then we reset the osmode as it was before (setvar 'osmode os) If you use entmake(x) instead of command call that would avoid the osmode settings .:wink: Tharwat Quote Link to comment Share on other sites More sharing options...
seegs Posted July 19, 2011 Author Share Posted July 19, 2011 Thanks for the quick reply guys. I did know about the osnaps affecting line placement, and I was pretty sure I was getting this problem with osnaps on and off. BUT I just tested my program again and again and everytime I ran with osnaps on the lines went to the wrong place, & vice versa Cheers 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.