Jump to content

Help with existing LISP routine


KHoughton

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...