Liviu Petreus Posted August 11, 2022 Posted August 11, 2022 I want to create SLD from the information of an excel file using the range selection for certain block attributes. I have attached the excel file as source and the Autocad file as drawing completion. I would be grateful if you could help me with a lisp program for this routine. 01a_Anexa 1.xls SLD_0.dwg Quote
Steven P Posted August 11, 2022 Posted August 11, 2022 3 parts to this I think getting the data from excel, inserting the blocks at the right points and then completing the attribute values... How far have you got with this? there are LISPs out there I think that will do everything if you can find them. I need to do a similar thing next week, never having had to extract information from excel really so will be following this post. As for steps 2 and 3, insert a block the basics are (command "_.insert" "C:\\Blocks\\dgs" yourinsertionpoint "" "" "") ;;Insert block from fike (command "-insert" BlkName yourinsertionpoint "" "" "") ;;Insert block laoded into CAD and I am going to be trying attupdm from here next week ( https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/td-p/6927162 ) I think is the one I found. The excel part... will see who has something handy shortly Quote
BIGAL Posted August 11, 2022 Posted August 11, 2022 (edited) Easiest is save excel as csv lots of read a csv. Then do the insert bit. Then just as you say insert at 0,0 and scale of 1, 0 rotation -insert bname s 1 pt 0 Then zoom 0.9XP this is a nice size just inside work area. Set attreq to 0 so turn off atts input if ok. A tip for make slides it was started back in year dot so screens with like 4k screens now will screw up the making of slides, I make my Autocad about 1/4 of screen size then make slides I am using 1920x1080. And yes can make 100 or so in one go if set up right. There is slidelibrary out there but had problems with it when I threw like 50+ at it. The old old acad slidelib.exe worked great. Edited August 11, 2022 by BIGAL 1 Quote
Liviu Petreus Posted August 12, 2022 Author Posted August 12, 2022 6 hours ago, BIGAL said: Easiest is save excel as csv lots of read a csv. Then do the insert bit. Then just as you say insert at 0,0 and scale of 1, 0 rotation -insert bname s 1 pt 0 Then zoom 0.9XP this is a nice size just inside work area. Set attreq to 0 so turn off atts input if ok. A tip for make slides it was started back in year dot so screens with like 4k screens now will screw up the making of slides, I make my Autocad about 1/4 of screen size then make slides I am using 1920x1080. And yes can make 100 or so in one go if set up right. There is slidelibrary out there but had problems with it when I threw like 50+ at it. The old old acad slidelib.exe worked great. Thanks for the reply. I was using a small program FBC.lsp but it takes me time to arrange the excel file and then I have to draw the other part of the SLD. I am attaching the .lsp and .xls files that we use. FBC_SAMPLE_LP_1.lsp 01a_Anexa 1. Balanta de puteri.csv Quote
Steven P Posted August 12, 2022 Posted August 12, 2022 9 hours ago, BIGAL said: Easiest is save excel as csv lots of read a csv. Then do the insert bit. Before I go looking later, is there a way for LISP / CAD to 'saveas' an excel file to CSV format? (haven't looked yet though) Quote
BIGAL Posted August 14, 2022 Posted August 14, 2022 Yes could be done but if your already interrogating the excel via lisp then just read cells direct. Look at Getexcel.lsp will read a entire excel sheet and make a list that you could use. Re make csv you can save, quit, close, add etc so save as csv would just be find the correct parameters. Did not look. (vlax-invoke-method (vlax-get-property myxl "ActiveWorkbook") "SaveAs" filename -4143 "" "" :vlax-false :vlax-false nil ) ; saveas Working on select range or all to a Acad Table, almost working. 1 Quote
Steven P Posted August 14, 2022 Posted August 14, 2022 I haven't had chance to look yet either but have getexcel, reading from a CSV would be quicker? That is no problem for what need though Quote
SLW210 Posted August 15, 2022 Posted August 15, 2022 What is the purpose of using a SLD? I do similar with a Table and Data Link. Quote
Steven P Posted August 15, 2022 Posted August 15, 2022 4 minutes ago, SLW210 said: What is the purpose of using a SLD? I do similar with a Table and Data Link. Graphically it can be easier and clearer to read, though a table can give exactly the same information Keeps me in a job...... Quote
Recommended Posts
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.