+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Feb 2016
    Posts
    4

    Default Generate mutiple AutoCAD drawings from data stored in an Excel file.

    Registered forum members do not see this ad.

    Dear smarties
    I read a few articles here and there regarding a way to generate multiple drawings from an excel file, but no one had explained step by step on how to do it. So, I am lost half way. I am very new to this kind of things, but I will try to follow, so please go slow on me.
    here is what I want to fix:
    1. I need to automatically generate 10 drawings both in dwg and pdf copied into a folder.
    2. All the variables (VAR1 to VAR3) are stored in an excel file. refer to the attached files as an example.
    3. I only need to create one original drawing, which will be used to generate all the 10 drawings.


    Please help








    Attached Files

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    Your excel is no where near what you need

    Sheet size x y
    start pt x y
    points x y
    points x y
    points x y
    points x y
    A man who never made mistakes never made anything

  3. #3
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Feb 2016
    Posts
    4

    Default

    BIGAL, thanks a lot for your reply.
    I may be wrong with the excel file I shared, but I don't know any better.
    As long as I explained what I wanted, so if there is anything that I should add in the file, please let me know.
    Could you please help me with a working sample and all the steps that I need to follow to get it to work?

  4. #4
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    If your doing closed shapes then just enter in excel the difference in X Y then you need to write a script from this entry or copy column. You need to use "concatenate" in excel.
    Attached Images
    A man who never made mistakes never made anything

  5. #5
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    This is what I was looking for a real good example http://www.cadtutor.net/forum/showth...ighlight=excel
    A man who never made mistakes never made anything

  6. #6
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Feb 2016
    Posts
    4

    Default

    BIGAL
    Thank you for the example, but you didn't understand what I am trying to achieve. Let me re-explain what I want:
    I have a drawing in AutoCAD (Already drawn) with a drawing number VAR01, the variable width of the shape VAR02 and the variable height of the shape VAR03.
    Meanwhile, I have all the variables VAR01, VAR02 and VAR03 in a spread sheet.
    I want to generate all the shop drawings automatically from that spread sheet without the need to actually draw every drawing separately one by one especially if I had 100s of drawings to generate.
    Would you have a solution to that?

  7. #7
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    I blieve I understand you, a shape 3 side a shape 4 side a shape 5 sides you can not have a auto solution, (you can but not right now) you need to post a excel that means something not just var1 var2 var3 etc we dont have a clue. I am more than happy to say you can draw an object from excel data, but it must make sense. The example I posted as a beam 4 lines and holes in it just cahnge some numbers in excel and get next beam.
    A man who never made mistakes never made anything

  8. #8
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Feb 2016
    Posts
    4

    Default

    BIGAL
    I know there is a way using either AutoLisp, VB and/or connect Excel/CSV files to AutoCAD with a small code that to connect and run the generation of the shop drawings.
    Your solution is not what I am after and I am not planning to enter coordinates to DRAW anything but only to replace text/Block/etc within the original shop drawing and print out all the rest in either pdf or dwg into a folder.
    As you can see, that's very different that what you were suggesting, but thank you for trying to help.

  9. #9
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    Ok my final real big hint others know what I am talking about search here for "SHAFT" & Excel. Autocad about 10+ years ago supplied a sample drawing called "shaft" and a excel called "shaft" change the values a cell in the excel and watch the drawing of a shaft change in Autocad. I have no idea why they no longer put it in their samples.

    Its a dynamic block linked to a excel.

    Trying to find, a google post "Does anyone remember the shaft.xls sample which used to ship with R12 " it is here.

    search for Ibeam3d.dvb in c:\programfiles\Autocad\Autocad...xxx \samples\vba
    VBAMAN and load Ibeam3d
    A man who never made mistakes never made anything

  10. #10
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    555

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Berbero View Post
    1. I need to automatically generate 10 drawings both in dwg and pdf copied into a folder.
    2. All the variables (VAR1 to VAR3) are stored in an excel file. refer to the attached files as an example.
    3. I only need to create one original drawing, which will be used to generate all the 10 drawings.


    Please help




    hi, my $0.02 of workaround
    1. actually you can save your VAR in *.txt or *.csv
    VAR1 VAR2 VAR3
    Dwg1 Dim1 Dim11
    Dwg2 Dim2 Dim12
    Dwg3 Dim3 Dim13
    Dwg4 Dim4 Dim14


    2. use read-line to obtain contents then split as list
    ;example:
    Code:
    (setq dwg '(("VAR1" "VAR2" "VAR3")
    	    ("Dwg1" "Dim1" "Dim11")
    	    ("Dwg2" "Dim2" "Dim12")
    	    ("Dwg3" "Dim3" "Dim13")
                ("Dwg4" "Dim4" "Dim14")
    	    )
          ) ;_ end of setq

    3. copy the source drawing according to list
    Code:
    (if (and (setq fn (findfile "ORIGINAL-DWG.dwg")) (setq l (fnsplitl fn)))
      (foreach x (mapcar 'car (cdr dwg)) 
        (vl-file-copy fn (apply 'strcat (subst x (cadr l) l)))
        ) ;_ end of foreach
      ) ;_ end of if
    now we open the newly created drawing, example "Dwg3.dwg"
    all handles are identical for each copied drawing,
    Code:
    (mapcar 'handent '("1f6" ;VAR1
    		   "1f9" ;VAR2
    		   "212" ;VAR3
    		   ))
    ;(<Entity name: 7efa13b0> <Entity name: 7efa1408> <Entity name: 7efa1490>)

    4. finally, since new drawings have been created,
    BIGAL can give some advise using script to modify entities?
    lambda not optimized.. ( apply '= "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

Similar Threads

  1. Replacing text in Autocad File using excel data?
    By rythem_of_the_nig in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 7
    Last Post: 10th Jun 2014, 12:34 am
  2. Generate plan/elevation view - drawings in Autocad Structural Detailing
    By kristopuleshi in forum Vertical Products: General
    Replies: 2
    Last Post: 16th Jan 2013, 04:08 pm
  3. Generate table with some data from excel
    By jhonnying in forum AutoLISP, Visual LISP & DCL
    Replies: 25
    Last Post: 30th Nov 2011, 09:08 am
  4. Replies: 2
    Last Post: 5th Jan 2011, 09:40 pm
  5. Have mutiple drawings open and have them in tabs?
    By James in forum AutoCAD General
    Replies: 56
    Last Post: 9th Jan 2008, 04:51 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts