Jump to content

LISP to read excel or acad table then insert and populate dynamic blocks?


newby

Recommended Posts

I am using dynamic blocks to automate the creation of 2.5d axis milling tool paths for a number of interrelated parts.

 

Reference this OVER simplified drawing:

Untitled-1.jpg

 

The green are outside material cuts, magenta is inside tool paths for slots. Because this is being imported into a cam package, closed shapes have to be poly lines, draw order and line direction matter, etc.

 

overall height of finished product is sum(d1,d3,d4)

 

customer specifies (variables) overall D, d3, d4 and ang1 and d2. the slots are arrayed and d1 is lengthened as needed.

 

to achieve overall D while maintaining EndGap, d2,d3 and d4 are all adjusted as minimally as possible.

 

My orginal plan was just to develop a dynamic block BUT acad doesnt allow dynamic control of the array spacing AND as far as I can tell, dynamic blocks+boolean logic=FAIL

 

What I REALLY WANT is a LISP routine that pulls parameters and block names from an excel sheet or linked table, generates the block, waits for placement and moves on to the next line item. The problem is I cant find and/or am not smart enough to figure out the following:

 

I've seen some posts on exporting attributes to excel/importing them back in... However, I dont see how to make an attribute drive constraints/parameters in a dynamic block. Is there a way to import parameters?

 

Is there a way to drive block parameters via table data?

 

Does anyone have a LISP snippet that can populate parameters in a dynamic block?

 

Can someone point me to a good command reference for LISP? I've programmed in C and know a winsy bit of VB, but not having a stylized editor to help keep the syntax straight is slowing my uptake. So is the lack of sleep. :(

 

Thank you in advance!!!

Link to comment
Share on other sites

Does anyone have a LISP snippet that can populate parameters in a dynamic block?

 

Dynamic Block functions

 

Can someone point me to a good command reference for LISP? I've programmed in C and know a winsy bit of VB, but not having a stylized editor to help keep the syntax straight is slowing my uptake.

 

IMO, the best editor for AutoLISP is the Visual LISP IDE (VLIDE), I have written a handful of tutorials here about it which may help to get you started.

 

With regards to importing from Excel, you can interface with Excel using ActiveX (example), but it is far easier to save the .xls as a .csv and use the read-line function to read it as a comma-delimited text file.

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