Jump to content

LISP to extract attributes into a excel already made


carlossebas

Recommended Posts

hi, my problem is that i want to get the information of a several number of Autocad files into an Excel file that i´ve already made previously(becouse in that Excel file, i have excel´s macros to work easier) , and the code that i´m going to show now, opens a new Excel and that´s what i don´t want to.

I have the excel file that i want to work with, in a route like  "C:\Users\Desktop\actualiza.xlsm"

Thanks beforehand

 

(if (and Dwg$lst (apply 'or (apply 'append (mapcar 'cadr Dwg$Lst))))
   (progn

      (setq xlApp (vlax-get-or-create-object "Excel.Application")

                xlCells (vlax-get-property
                               (vlax-get-property
                                  (vlax-get-property
                                     (vlax-invoke-method
                                         (vlax-get-property xlApp "Workbooks")
                                          "Add"
                                     )
                                     "Sheets"
                                  )
                                  "Item" 1
                              )
                              "Cells"
                           )
)

 

 

Edited by rkmcswain
added [CODE] tags
Link to comment
Share on other sites

Hello.  I have a few different Excel to AutoCAD Lisps that I've collected because I spent a lot of time trying to do the same thing.  I was finally able to get some help here on the forum.  Maybe one of these might be of some use to you.  Tks.

XL2BOM.lsp

GETCELLS.lsp

GETCELLS.txt

getexcel.lsp

getexcel.txt

excelcontrol.lsp

GETVALS.lsp

ATTEXP2XL.lsp

  • Like 1
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...