KHoughton Posted February 14, 2013 Posted February 14, 2013 I found the attached LISP routine on my company's network. It draws a side view of a hex head bolt. It works pretty well although it does pop up a few errors at the end of the command. I would like to be able to use the command without errors and would like to make a couple modifications to it but I do not know much about LISP. The command draws the bolt as expected but after entering the orientation angle it does this: Enter orientation angle : Unknown command "2DBOLT". Press F1 for help. Pick insert point: Unknown command "2DBOLT". Press F1 for help. Unknown command "2DBOLT". Press F1 for help. Unknown command "2DBOLT". Press F1 for help. Unknown command "2DBOLT". Press F1 for help. Unknown command "2DBOLT". Press F1 for help. Then it draws the bolt correctly. Any ideas why? Also... Currently you have to manually enter a distance for the grip (gap) between the bolt head and nut/washer, I would like to be able to pick the insertion point of the bolt and the insertion point of the nut and use these values to draw the bolt rather than manually entering the grip (gap) distance and rotation angle. Hopefully this all makes sense... I am using AutoCAD 2013. Thanks! 2DBolt.lsp Quote
BIGAL Posted February 15, 2013 Posted February 15, 2013 Just a guess (redraw) ; not sure about this maybe (command "Redraw") (setvar "OSMODE" OM) (command "layer" "set" LYR "") ; make this (setvar "clayer" lyr) else the layer dialouge will display thats probably the error Quote
KHoughton Posted February 18, 2013 Author Posted February 18, 2013 Thanks for your reply BIGAL, but neither of your suggestions made a difference. The layer dialog does not display and the program correctly creates and changes layers. Quote
Bill Tillman Posted February 18, 2013 Posted February 18, 2013 There are some really good routines for doing bolts, nuts, washers, etc... out there. Just do a search and you're sure to come across them. That is if your open to using something beside what you found already. Quote
KHoughton Posted February 18, 2013 Author Posted February 18, 2013 I have searched quite a bit and this one comes closest to what I need it to do, with a few tweaks it will be perfect. Unfortunately I do not know enough about LISP to make them... Quote
Bill Tillman Posted February 18, 2013 Posted February 18, 2013 Go to cadalyst.com and put bolts into the search window. They have at least a dozen or more that work with all kinds of angles, 2D, 3D, metric, imperial. Not to dampen your enthusiasm for this code you found, it's just that this topic is one that a lot of folks have spent a lot of time on and they have some excellent, already debugged examples to chose from. No need to reinvent the wheel as they say. 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.