Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

LISP code to assemble parts?

Status
Not open for further replies.

ncsengineering

Agricultural
Jul 21, 2006
8
I do a lot of machinery drawings that are repetitive -- the machine has the same drive and end unit each time and the main thing that changes is overall length, which means I add 5 or 10-ft sections between the drive and end unit until the length is correct. Can anyone point me at some sample LISP code that would do something like this? I work in 3D if that matters. I have the feeling it would involve simple copying and pasting using the drive as the base point and then incrementing the length 10 ft each time until the overall length is reached. Even better would be code that would link to an Excel spreadsheet where I could enter machine parameters and have AutoCAD build it for me.
 
Replies continue below

Recommended for you

I >>> conjecture <<< that you could build such a modular machine model outside of AutoCAD, e.g. with a scripting language like awk, by concatenating fragments of DXF files, e.g. standard DXF preamble + end A + N modular sections + end B + standard DXF file terminator, to make a single DXF file that would open to reveal the machine you want.

I face a similar problem generating machines that are modular in more than one dimension, and I keep daydreaming about ways to make it easier ... if your machine really is modular in just one dimension, the problem should become much simpler. In theory.



Mike Halloran
Pembroke Pines, FL, USA
 
Actually I just started learning how to use dynamic blocks after I posted that message. Is there a way to have a visibility state linked to length? i.e. I have blocks of 2, 4 and 8 units length. Machine starts with a common head unit, then can have the possible combinations:

head+2+8n+tail
head+4+8n+tail
head+2+4+8n+tail
head+8n+tail

8n can be any number of the 8 unit sections, so an array takes care of that. I can make visibility states for each of the above cases and use multiple arrays to make the 2,4,8 units show up when I want to, but then manually have to set the visibility state for the whole thing. It would be slick if it could be linked though, or if an expression could be used to decide whether or not to even use a 2, 4, or 8 unit section in the first place based on the distance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor