+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Oct 2011
    Posts
    9

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

    Registered forum members do not see this ad.

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

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,322

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by newby View Post
    Does anyone have a LISP snippet that can populate parameters in a dynamic block?
    Dynamic Block functions

    Quote Originally Posted by newby View Post
    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.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

Similar Threads

  1. Excel to ACAD Table - Font question
    By jwkilgore in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 13
    Last Post: 6th Sep 2016, 11:51 pm
  2. Read Excel Data Cells and Draw in AutoCAD thru LISP
    By NHM in forum AutoLISP, Visual LISP & DCL
    Replies: 34
    Last Post: 28th Jun 2013, 05:58 am
  3. Insert dynamic block from file with multiple dynamic blocks
    By BUrBaKy in forum AutoCAD Drawing Management & Output
    Replies: 17
    Last Post: 14th Nov 2012, 11:38 pm
  4. Excel Data Links and ACAD Table Formatting
    By slimpickinz in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 19th Nov 2009, 10:42 pm
  5. Can I insert values of text into Excel table
    By todorb2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 6th Jan 2009, 02:18 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts