Use LISP to import Excel to DWGPROPS

Use LISP to import Excel to DWGPROPS

Anonymous
Not applicable
6,017 Views
14 Replies
Message 1 of 15

Use LISP to import Excel to DWGPROPS

Anonymous
Not applicable

I used a function at my old job where with a LISP file (that someone else created), we were able to import one column of values from an excel file into the DWGPROPS of a DWG with Full CAD. I have been searching around, but I haven't been able to find this LISP or anything similar anywhere. I don't know how to write a LISP, so I was hoping someone had something or could advise me or help me with writing one. I keep finding lots of things that are way too simple to be helpful. 

 

We're using this because there are many fields that need to get updated and then used in the DWG, so I was hoping I could find the easy way to import all of these values so I don't have to do it over and over again. 

 

Thanks

0 Likes
6,018 Views
14 Replies
Replies (14)
Message 2 of 15

JTBWorld
Advisor
Advisor

I'm not aware of any existing one but can certainly help to create one. If interested contact me.

PS. You might find DWG Columns for Explorer a useful complement to DWGPROPS.


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Likes
Message 3 of 15

Anonymous
Not applicable

Thanks for responding! I've talked with my boss further and I'm not sure we're up for writing a LISP file ourselves or financing one if one doesn't already exist. Thank you for letting me know. 

0 Likes
Message 4 of 15

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I see that you are visiting as a new member to the AutoCAD forum. Welcome to the Autodesk Community!

 

 Have you explored working with PROPULATE?  It is not super-full featured but might perform what you are trying to do with DWGPROPS.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 5 of 15

Anonymous
Not applicable

Hi, thanks for responding. I was looking through the Propulate command explanation you linked and it doesn't sound like it does the same thing that I want. Or possibly I'm just not sure how to use it. 

0 Likes
Message 6 of 15

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

Yes, PROPULATE does not use Excel but rather uses its own templates to populate the DWG properties.

 

While not my favorite tool, it might work for what you are trying to do.  Here is a link to another description of the Express Tool that you might find useful.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 7 of 15

terrycadd
Enthusiast
Enthusiast

Hi and welcome to Autodesk forums! I have never used DwgProps at my work, but with the help of some very useful posts on the forums by Gilles Chanteau, I was able to create NewProps.lsp to extract information from an Excel file and put it in DwgProps. Download and copy NewProps.lsp to a folder in your AutoCAD Search Path. You can download the latest version of GetExcel.lsp from https://autolisp-exchange.com/AutoLISP-Code.htm . Download the images and spreadsheet here to look at and test. Open an existing drawing and then load NewProps.lsp and GetExcel.lsp and type NewProps on the command line to run it.

Best of luck. Terry
P.S. Many Engineers and Managers prefer working with the standard Excel xlsx file format because they may have important information on other sheet tabs that they would lose if the file was saved as an Excel csv file format.

Be sure to copy NewProps.lsp and GetExcel.lsp to a folder in your AutoCAD Search Path so it can create the dcl dialog form for you.

NA-09317-PB-xlsx.pngNewProps.pngNA-09317-PB-dwg.png

0 Likes
Message 8 of 15

mietek_markuszewicz
Explorer
Explorer

Hi, I try to use Newprops.lsp with no success. Everything seems to work fine but properties window is still empty. Does anyone tried this NewProps.lsp? I wonder what am I doing wrong? I tried on AutoCAD LT 2024 (lisp !) with lsp and xlsx files downloaded from above links. Dcl file is properly created. Thanks for any tips in advance.

0 Likes
Message 9 of 15

JTBWorld
Advisor
Advisor

 GetExcel function is missing in the LSP for one thing. But this code will not work with AutoCAD LT 2024 anyway, it would use functions not available in LT. 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

Message 10 of 15

WeTanks
Mentor
Mentor

I learned a lot from your lecture, thank you.

We.Tanks

EESignature

A couple of Fusion improvement ideas that could your vote/support:
図面一括印刷

0 Likes
Message 11 of 15

WeTanks
Mentor
Mentor

I added them, but without success.

please let me know

WeTanks_0-1682219169101.png

Please take a look at this recording.

We.Tanks

EESignature

A couple of Fusion improvement ideas that could your vote/support:
図面一括印刷

Message 12 of 15

mietek_markuszewicz
Explorer
Explorer
Thank You, Jimmy. So, that’s the end of the story 🙃
0 Likes
Message 13 of 15

terrycadd
Enthusiast
Enthusiast

    The location of the data in the Excel spreadsheets may vary from one to another. I open the spreadsheet and note the Column Letter, and the Starting and Ending Row Numbers then close the Excel spreadsheet. This might be helpful for someone testing out NewProps.lsp.
    The lisp file GetExcel.lsp is separate from NewProps.lsp and other lisp programs that I use at work, because from time to time I revise and update GetExcel.lsp. I only need to load it once without having to update it, in all the other lisp programs.

    I found that NewProps.lsp runs fine in an existing drawing, but in a new drawing it will not update the DwgProps form, leaving the Custom Tab blank. If I save the new drawing and re-open it, then NewProps runs fine. Has anyone also tested this before?
Thanks,

Terry

NA-09317-PB.jpg

0 Likes
Message 14 of 15

vladimir_michl
Advisor
Advisor

If you have multiple DWGs, the DWGpropsCSV utility might help you - see:

https://www.cadforum.cz/en/bulk-editing-of-drawing-properties-dwgprops-from-excel-tip13757

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

Message 15 of 15

CallumMX9DR
Participant
Participant

Hi there, 

 

I have been trying to get this to function but I am unfortunately running into a couple issues. 

 

The first issue I was able to fix myself, I added a macro to my Excel file to export a CSV of information. Next, I changed the code to recognize CSV files, so when I run the NEWPROPS command in CAD, it will prompt me to find a CSV file. All great. 

 

However, when I select the CSV file to import it will then error out. Below is the error code I get from CAD when trying to run the command. Not sure what's happening to cause it to do this, but hoping to import the CSV information into the custom DWGPROPS tab. I understand that CSV exports can have information in different cells. My understanding is that the code will prompt me to select which cells I'd like to have input into the custom DWGPROPS tab. Hope to hear from you soon, thank you Terry

0 Likes