afwjlk2 Posted June 6, 2014 Posted June 6, 2014 Hello, I am looking for a LISP for enclosing an object in order to figure out material requirements. In the past I had a huge list of pre-loaded LISP routines on my PC at work. So the issue is this: Need to get a hold of a LISP routine to enclose and object in AutoCAD. Second how exactly does one insert it into the program and make it a standard to each drawing. Third how does one know what the command would be? Any help would be great. Thank you Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 There are a couple of methods for making a lisp routine available no matter what drawing you are working in. Refer to the topic "Loading Programs Automatically" at Lee Mac's Programming website. Link: http://www.lee-mac.com/tutorials.html The name of a custom lisp command is included in the code. Look for a line that starts with defun c: Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 This is the LISP I'm using but it seems weird to me because I can get it to work on 2012 but not in 2013 AutoCAD. Any help would be appreciated. DB_Box.lsp Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 The current drawing I am working with would only allow me to copy to clipboard, place in a new drawing, then DB_Box, then copy to clipboard, Place back in original drawing and then it worked. (version 2012) Version 2013 won't even let me do that? Confused Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 I am new to LISP so please bear with me. I would really like an opinion on this LISP and any help you may offer. I am using this in doing material takeoffs and can’t seem to get it to work properly. When using the command in an existing drawing it will not do anything. The command comes up in the line at the bottom but won’t do what it’s supposed to. If I open a new drawing and execute the command it works just fine. (AutoCAD 2012). I cannot get it to work whatsoever in version 2013. Any help would be appreciated. Thank you; Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 What exactly is it that this lisp routine [DB_BOX.lsp] does? Please be specific anything less than that will be inadequate. Thank you. Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 The Routine puts a rectangle around a object and then adds dimensions to the rectangle. It's very basic but does not work properly. Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 OK. Give me a moment to download and test it. I'll be back. Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 I am thinking that the code is a bit jacked up. I'm trying to use for 12/13 at the same time. Why it doesn't work in an existing drawing is what really gets me. I really appreciate the help. Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 The code does/doesn't work. How can that be? My test has the code building a box around some text and then dimensioning it which is what it is supposed do (if I read your explanation correctly). But it also bombs out. See the screen capture below: Select object to be enclosed: ***An error has occurred with command "DB_Box"!*** Automation Error. Key not found Cannot invoke (command) from *error* without prior call to (*push-error-using-command*). Converting (command) calls to (command-s) is recommended. Is this what is happening when you try to use the lisp routine? Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 Yes that's the one when I use 2013. 2012 does not give me any error. I just have to take the object into a new drawing and then put it back for it to work with the rest of the drawing. That's a pain. Any ideas? Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 Why do you have to take the object into a new drawing then put it back? The routine works; it just bombs out at some point. Don't you get the results shown in post #12? If not, what is the routine doing differently? Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 If I'm in 12 and run DB_Box it gives me that error. If I copy the object and place it in a new drawing it does not. I can the place it back into the old drawing and then the command will work properly for the rest. It is very strange. Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 I think we have a communication problem. OK....it gives you the error but does it still function or not? In my single drawing test the lisp routine not only drew the box and dimensioned it, it ALSO gave me the error. It can throw errors all day if it wants as long as it continues to draw the box and add the dimensions. Listen....carefully...does it do BOTH when you use it? Yes or no? Quote
afwjlk2 Posted June 6, 2014 Author Posted June 6, 2014 If I use and existing drawing it wont work and gives me the error. If I use a new drawing it works and wont give me the error. Quote
ReMark Posted June 6, 2014 Posted June 6, 2014 I'm sorry to have to tell you this but in my just completed test using an existing drawing the lisp routine DB_BOX does work. It still throws an error message after the box and dimensions are added but I already expected that to happen so it comes as no surprise. I have no explanation why I can use the lisp routine in an existing drawing while you can't. How is the routine being loaded? 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.