Jump to content

Lisp routine use csv to update title block attributes - on ctab


HRae

Recommended Posts

  • 7 months later...
  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    31

  • HRae

    26

  • SteveK

    17

  • johmmeke

    15

Top Posters In This Topic

Posted Images

Hi Paul

 

I have been trying to set the very type of link up for a while now and have just stumbled on to the discussion from HRae, I have a large project starting and I am trying to set up a doc control and would like to use the link from a the drawing list to the Autocad attributes for title blocks and rev as well as any other info I put can on there.

Are you willing to part with you valuable knowledge on setting this up, would appreciate any help that I can get..

 

Dave Simpson

Link to comment
Share on other sites

I haven't read the entire 9 pages in this thread, so forgive me if I'm duplicating posts here... Is there a reason why you're not just using Sheet Set Manager and Custom Properties to populate your title block attributes via the use of Fields? :?

Link to comment
Share on other sites

Lee

 

I have loaded the csv file into the folder wher the drawings and have loaded the lisp file it seems to work - when I started it (UTB)it ask for the csv file will this happen every time you want update the title or other attributes.

 

Maybe you can give me a run down on setting this up.

 

Thanks for you input I think it is going to be good.

 

David

Link to comment
Share on other sites

Renderman

 

Thanks for the heads up on this, I am going to look into it further any idea where I can get a good tutorial so that I can understand it, the youtube videos they talk to quick.

 

David

Link to comment
Share on other sites

I have loaded the csv file into the folder wher the drawings and have loaded the lisp file it seems to work - when I started it (UTB)it ask for the csv file will this happen every time you want update the title or other attributes.

 

Hi David,

 

Firstly, I assume that your CSV file is in the correct format as described in the program description on my site.

 

At the top of the code you will find a section marked 'Location of CSV Drawing List'. If nil, the program will prompt for you to select a CSV file every time you run the program. You can either specify the full filepath of a CSV file (if in a fixed location), or, if the CSV file is in the working directory, you can just specify the name of the file, i.e. "MyCSV.csv" and the program should be able to find it.

 

Note that the program is currently set to automatically run when loaded, this allows you to include a load call in your ACADDOC.lsp to automatically update titleblock attributes when you open a drawing.

 

Be sure to carefully read the program description on my site, it should explain everything.

 

Lee

Link to comment
Share on other sites

Hi Lee

 

I have got that part up and running, now I would like to take it a step further as in the previous mails, I would like to run this with one drawing and multiple paper space layouts which have different values in the attributes , meaning a spreadsheet that would populate a complete drawing, the reason is that we have a large project that will consist of about 15 drawings per site and there are 200 sites, and would like to have all the drawing border info on a spreadsheet.

Hope we can get this going cause it would save us a lot of time changing the border text and setting up the sites.

 

David

Link to comment
Share on other sites

Hi Lee

 

Not having much luck, got layout 1 to work, layout 2 & 3 not so good I have also swapped the nil to the path for the drawing register file and I am still being asked for a drawing register file, what happens now.

 

David

Link to comment
Share on other sites

Not having much luck, got layout 1 to work, layout 2 & 3 not so good I have also swapped the nil to the path for the drawing register file and I am still being asked for a drawing register file, what happens now.

 

Do you have the 'LayoutCol' set to T in the adjustments to inform the program you are using a layout column in the CSV?

 

Are you specifying the filepath in the correct way? i.e. with double-backslashes or single forward slashes?

Link to comment
Share on other sites

Hi Lee

 

Firstly I really appreciate your help in this matter, it would so helpful to get this up and running.

 

I still can't get the other layouts to work, so I have attached the Update lisp that I have changed for you to look at, I have put the t where you said, which didnt work and I also put the CSV file in my documents that worked but if I put the csv file in a working drive it dose'nt work.

I have also included my CSV file and drawing register excel file you might be able to work it out.

 

The way I have it set up is the csv and excel file are in the working folder with the drawing and the lisp program is the Acad lisp folder. Do I need any other file to go anywhere, why I say this the original update had a _Dwglistcsv.txt file in the drawing folder.

 

Sorry I am being such a pain but I would really like to get this running it will save me heaps of time.

 

David

 

UpdateTitleblockV1-1.lsp

DrawingRegister.csv

DrawingRegister.xlsx

Link to comment
Share on other sites

Hi David,

 

First thing I noticed when I opened the modified .lsp file was this line:

 

(setq CSVDrawingList C:\\"DrawingRegister)

This will cause the whole program to fail (most likely with the error message: "malformed string on input") since you have misplaced the starting quotation mark for the string, and missed the ending quotation mark.

 

Are you using the Visual LISP IDE (VLIDE) (or other code editor) to edit the code? If not, I would strongly recommend you use the VLIDE to edit the LISP code, since mistakes such as the above are easily spotted with the syntax highlighting provided by standard code editors.

 

The remedy (hopefully):

 

 

  • Change the CSV filepath at the top of the .lsp file to:

(setq CSVDrawingList "DrawingRegister.csv")

 

  • The .lsp file can be saved to any directory, but preferably an AutoCAD support path - the location of this file is unimportant though, as long as you can load the LISP file. For loading the file on startup, I would advise you use the ACADDOC.lsp.

 

  • Place 'DrawingRegister.csv' in your working directory.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Lee

 

Sorry about the delay, still havent been able to get this to work, I have done what you have said still not working. What do you suggest, should I send you the excel file and the drawing with the lisp program so you can see if I have a value wrong.

 

Regards

 

David

Link to comment
Share on other sites

Hi David,

 

What error do you receive, if any? Or are the values just not being updated?

 

Just to clarify - the program is working from a CSV file, not an XLS file.

 

Lee

Link to comment
Share on other sites

Hi Lee

 

 

I get (Drawing not found in Drawing List) also every time I save the xls as a csv I get a message XXX.csv may contain features that are not compatible with CSV (Comma Delimited). Do you want to keep workbook in this format?

What do I do then, cause sometimes I loose the changes in the xls sheet, do you know why this message comes up or is it normal when saving to a csv.

 

 

David

Link to comment
Share on other sites

I get (Drawing not found in Drawing List)

 

Looking back over my code I notice that the Drawing filename in the CSV is case-sensitive - I will update this in the next version to remove the case sensitivity, but in the meantime, try changing the CAD filename in the CSV to exactly match the drawing filename and see if this works for you.

 

also every time I save the xls as a csv I get a message XXX.csv may contain features that are not compatible with CSV (Comma Delimited). Do you want to keep workbook in this format?

What do I do then, cause sometimes I loose the changes in the xls sheet, do you know why this message comes up or is it normal when saving to a csv.

 

Yes, this message is standard since a CSV does not support multiple worksheets, varying column widths etc.

Link to comment
Share on other sites

Hi Lee

 

Just thought I'd let you know that i finally got the update lisp to work on multi layout drawings, the was that I updated the csv file rather than update the excel file and save as a csv.

 

There must be something I did in the excel file that didnt translate to csv, anyway it works now, do you think this will be a problem updating the csv rather than excel file continually.

 

Thanks for all your help

 

David

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...