Jump to content
newby

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

Recommended Posts

newby

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

Share this post


Link to post
Share on other sites
Lee Mac
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×