Bill Tillman Posted September 28, 2021 Share Posted September 28, 2021 I have a title block block which has 13 attributes that I need to update using LISP. Here is the attribute layout: I'm attempting to use Lee Mac's code UpdateTitleblockV1-9.lsp for this task. I edited and saved the Sample.csv file and made only a couple of changes to the main code. When I run it, the command window shows "All attributes are up to date." yet nothing gets changed in the block on Layout1 or Layout2. The Sample.csv file looks like this: Quote Drawing1,Layout1,TitleBlock24x36,SOME ARCHITECT INC,SOME CONSTRUCTION CO,999-9999,PJ8765,CDF100,09/28/2021,1/8"=1'-0",Me1,JT,Me2 I have also attached a copy of the CAD file which contains the title block block I'm working with. Drawing1.dwg Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted September 28, 2021 Author Share Posted September 28, 2021 (edited) UPDATE: I got it working correctly. Turns out I wasn't formatting the csv file correctly. Still a little unclear on how it works, but I'll figure that out later. I once had a similar LISP program which would automatically iterate through all the layouts and make these changes. It even kept a counter to number the sheets sequentially in a given format. That code got left behind several years ago so I'll have to rely on memory. And with all the pandemic stuff going on memory is something I'm running short on. LOL! Edited September 28, 2021 by Bill Tillman Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 28, 2021 Share Posted September 28, 2021 One of the methods I use is taking advantage of just fill the attributes based on creation order, then its a global routine any block, you just have to make sure that you have a csv with every attribute even blank ones Bill,,Tilman is 3 attributes with say middle name blank, so no need for tag names, but csv must match creation order. ie your image. Happy to help more Something like this obj is title block in a layout, lst is the line from a csv ("layoutname" "BILL" "" "Tillman") can do a check count of atts against the csv so dont get funny answers. Note the + x 1 as this skips the layout name in the list (setq x 0) (foreach att (vlax-invoke (vlax-ename->vla-object obj 'getattributes) (vla-put-textstring att (nth (+ x 1) lst)) (setq x (1+ x)) ) ps do you want read from excel ? Quote Link to comment Share on other sites More sharing options...
LISPnoob Posted March 21 Share Posted March 21 Hi! Very late to the party lol but when you said you weren't "formatting the CSV file correctly", what did you do to fix it? Quote Link to comment Share on other sites More sharing options...
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.