Jump to content
NSH

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

Recommended Posts

NSH

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.

Share this post


Link to post
Share on other sites
BIGAL

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

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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