Short version: when told to draw a line from ptxx (a var containing x and y coords) AutoCAD starts from some point other than what is stored in ptxx.....sometimes
Long version:
Program to draw a fairly simple shape of 20 points connected with lines or even 1 pline. Program runs perfectly one to several times in a row then draws something unexpected one or several times. Seems to be random and after much effort I can not isolate any event that seems to cause this. Rewrote the program a couple times in different ways only to get the same result. Now I think it may not be the program and maybe my system.
Turning off all local declarations and running the program until it does something unexpected, and then...
From the command line: !pt10 , !pt11 , !pt12 ,OR !pt13 returns (13.0 16.0) , (13.0 13.0) , (16.0 13.0) , (16.0 12.375) respectively. These are 4 separate pts with different values and all correct as to what would be expected from the code generating them.
Now from the command line: (command "line" some-point) using pt10, 11, 12, or 13 ALL FOUR start the line command at the first point of (16.0 13.0). The correct location for only pt12.
What am I missing?
Ideas?
Running AutoCAD Architectural 2011 with no other known bugs on a decent machine with Windows 10.
Code is attached
Acceptable shapes drawn is attached. Size and chamfer distance may vary
Thanks
Solved! Go to Solution.
Solved by CodeDing. Go to Solution.
@Anonymous ,
Just at a brief glance, you should ALWAYS ALWAYS turn off your osnaps before drawing lines automatically. This may be affecting your drawing. Try turning them off before drawing lines...
(setq osm (getvar 'OSMODE)) (setvar 'OSMOSE 0)
...then restore them after lines have been drawn...
(setvar 'OSMODE osm)
Best,
~DD
Awesome. Thanks for the quick response.
I have not coded it yet, just turned off Osnap and shazam everything worked as planned. Will add the code to get current value, set to 0 and reset to original for Osmode. Thanks again.
@Anonymous wrote:
Awesome. Thanks for the quick response.
I have not coded it yet, just turned off Osnap and shazam everything worked as planned. Will add the code to get current value, set to 0 and reset to original for Osmode. Thanks again.
You also can do it without turned off Osnap ....... Like this......."yelloHelp-1.lsp"
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Can't find what you're looking for? Ask the community or share your knowledge.