jremiro Posted September 27, 2011 Posted September 27, 2011 I have a lisp routine that we have used for several years. The routine takes a pline, offsets it on either side based on user defined spacing then inserts a premade block to symbolize a road. The block is spaced according to user defined spacing. For instance, a block can be inserted at 2 times the width of the "road" as many times as needed to symbolize the entire length of the offset pline. Hopefully this makes sense! This lisp routine works great on it's own. However, once inserted into a macro, it starts the block insertion at the end of the pline, only inserting one block. This is happening in all versions of AutoCAD we are using from 2004 through 2011. Is there a setvar that should be reset or cleared within the lisp routine? Any suggestions would be appreciated. Thanks! Quote
ketxu Posted September 28, 2011 Posted September 28, 2011 Where is your code ^^ ? What message when you used ur marco ? (You can press F2 to read it) Quote
jremiro Posted September 28, 2011 Author Posted September 28, 2011 This is an AutoLisp routine that was written several years ago that has survived several versions of AutoCAD. The routine, along with specific user input including a block name, has been put into a drop down menugroup. When selecting from the menugroup, I have this problem (the block inserting at the end of the line). When I launch this lisp routine from the command line, it inserts the first block at the beginning of the pline and additional copies of the block along the line spaced according to user input. This morning I discovered this only happens if I run the routine from the command line first. If I select from the pulldown menu first, it will default in both instances to the end of the pline. I don't get any error messages. Thanks again. Quote
Lee Mac Posted September 28, 2011 Posted September 28, 2011 Have all local variables been declared local to the function? It sounds like a variable is holding its value and hence the program is starting from where it left off. Quote
ketxu Posted September 29, 2011 Posted September 29, 2011 So what code of marco in your menu ? Maybe it's sth different between your commandline version and assigned menu pulldown? ^^ Quote
jremiro Posted October 3, 2011 Author Posted October 3, 2011 Thanks for the reply. Although I'm fairly weak in LISP code, I think all variables are local. I've yet to come up with a solution so will continue to appreciate all replies. Thanks again. Quote
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.