Jump to content

Program to Create Multiple AutoCAD Files using Template and Import Data from Excel ?


NSH

Recommended Posts

Let’s say you have DWG title block template file, “DAY” with attributes tagged, “B” and “C”. You also have XLSX file, “CAL” with column A rows, (1 thru 7), column B rows, (ONE thru SEV) and column C rows, (SUN thru SAT). How do you use any programing method to create 7 drawings automatically using the template and the worksheet, numbered sequentially so that file “6.dwg” would contain title block displaying “SIX” and “FRI”? Thank You in advance. If I may be any more specific, please ask.

Link to comment
Share on other sites

If you do a bit of searching here I posted some code using Getexcel.lsp this allows both ways autocad -> excel -> autocad.

 

You can save a variable using setenv this is saved on your computer, using a "Script" you can run a lisp that creates new dwg but uses the correct row for the info.

 

I am pretty sure there is numerous examples here about read excel and populate a title block.

 

This is maybe what your script would look like, you will need to create the enviroment variable only once then it can be changed any time. (setenv "Mytitle" 1)

 

New mydwt
(setenv "Mytitle" 1)
(load "My title updator")
saveas dwgname 
close
New mydwt
(setenv "Mytitle" 2)
(load "My title updator")
saveas dwgname 
close
New mydwt
(setenv "Mytitle" 3)
(load "My title updator")
saveas dwgname 
close

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