Bill Tillman Posted September 28, 2021 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
Bill Tillman Posted September 28, 2021 Author 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
BIGAL Posted September 28, 2021 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
LISPnoob Posted March 21 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
SimonBaines Posted June 7 Posted June 7 I have the same issue. Would be really useful to know the correct formatting of the CSV file. If anyone has any ideas, it'd be much appreciated as I can't now get it read the CSV file after saving it within Excel, when it originally worked when first opened. Quote
SLW210 Posted June 8 Posted June 8 Instructions are on the page where the file is located... Lee Mac Update TitleBlock Quote
BIGAL Posted June 9 Posted June 9 (edited) I do custom read Excel but looking into all the help provided by Lee as per link by SLW210, this stood out for me. "all attributed blocks containing attribute tags equal to the column headings in the CSV file will be updated" This matches what I inferred early on about csv it may need to match say the number of block attributes. Post your csv so we can look at it and a matching sample dwg. Edited June 9 by BIGAL 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.