TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: NPatton on April 05, 2017, 02:54:10 PM
-
Hello Everyone,
I'm new to the LISP world and I'm having an issue with the routine below. As you can see I'm creating a circle at specific coords, creating a block of the circle, inserting the block, redoing that process over and over by moving the block down 5 units, and rename the block each time.
The problem I experience is that this process doesn't seem to work correctly from LISP routine to LISP routine. I created 4 of the same routines and the only difference between any of them is the LISP name, command name, coords, and saved file name. 2 out of the 4 routines work correctly. When the routine doesn't work correctly I will get 3 groups of blocks stacked on top of each other within the DWG at various points instead of a row of let's say 20 blocks spaced 5 units apart. Hopefully, I explained all this correctly and thanks in advance for any help.
(setq filename
"TS-1WD-") (setq blks
(getint "\nEnter the number of blocks you would like to create:" )) (command "-block" filename1 pt1
"last" "") (command "-insert" filename1 pt1
"1" "1" "0") )
)
-
I think this is probably the *Classic* Command and Running Osnaps issue.
Since you are using command calls in your code the OSMODE variable can have an impact on the result.
Two solutions:
1. Temporarily change OSMODE to zero.
2. Use "_non" to override the running osnaps. Example:
(command "circle" "_non" pt1 0.25 )
EDIT: Typo.
-
I will give this a try.
Thanks for the help Roy_043
-
Don't forget to incorporate error trapping, it'll set the vars back to how they were pre-execution.