+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 34
  1. #21
    Junior Member
    Computer Details
    JGupte's Computer Details
    Operating System:
    Windows 7
    Discipline
    Construction
    JGupte's Discipline Details
    Occupation
    Document Controller/Report Writer
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Aug 2017
    Location
    Sydney, Australia
    Posts
    15

    Default

    Registered forum members do not see this ad.

    BIGAL,


    Alternatively, I have the code to save each drawing update in a TXT file that can be imported using ATTIN. But the ATTIN function asks for the TXT file to be selected manually.
    Is there any way to automate this so it always uses the same file?
    I can then create the TXT file for each drawing within my script loop, then run ATTIN on each drawing individually. I know it will take some time, but this script can be run overnight or even on weekends.


    I don't really care how it is done, just need it done.


    All help appreciated.


    JG

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

    Default

    Dumping out a txt file makes it even easier as you are not relying on the link to excel. A lisp file can be called as part of a script file to do changes on multiple dwgs like changing certain attributes.

    re 61 attributes not really a problem either if the output file was like this, it will get a liitle more complicated if you have multiple layouts and various atts to suit the cahnging layouts. Note what I am thinking about, attributes do not need to be in order as it uses the position number for updating.

    Code:
    layout1,""
    1,"attribute 1 value"
    2,"attribute 2 value"
    3,"rev 1"
    4,"attribute 4 value"
    layout2,""
    1,"attribute 1 value"
    2,"attribute 2 value"
    3,"rev 2"
    4,"attribute 4 value"
    Code:
    the script would be something like 
    open dwg1 (doupatts dwg1.txt) close Y
    open dwg3 (doupatts dwg3.txt) close Y
    open dwg4 (doupatts dwg4.txt) close Y
    We need two things a excel that makes sense and a sample dwg.
    A man who never made mistakes never made anything

  3. #23
    Junior Member
    Computer Details
    JGupte's Computer Details
    Operating System:
    Windows 7
    Discipline
    Construction
    JGupte's Discipline Details
    Occupation
    Document Controller/Report Writer
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Aug 2017
    Location
    Sydney, Australia
    Posts
    15

    Default

    Quote Originally Posted by BIGAL View Post
    Dumping out a txt file makes it even easier as you are not relying on the link to excel. A lisp file can be called as part of a script file to do changes on multiple dwgs like changing certain attributes.
    Yes, but as I don't know how to create or change LISP files, I am stuck.
    The ATTIN.LSP does what I want, but asks the user to select the input file. And as we have over 2000 files to update, nobody is going to sit there and sect the file 2000 times - which is my stumbling block.

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

    Default

    Your on line ! re read my post code will be lisp as I have done all the routines, but can be converted to VBA as method will be similar.
    A man who never made mistakes never made anything

  5. #25
    Junior Member
    Computer Details
    JGupte's Computer Details
    Operating System:
    Windows 7
    Discipline
    Construction
    JGupte's Discipline Details
    Occupation
    Document Controller/Report Writer
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Aug 2017
    Location
    Sydney, Australia
    Posts
    15

    Default

    Quote Originally Posted by BIGAL View Post
    We need two things a excel that makes sense and a sample dwg.

    Here are the files.


    Although I am trying to update 10 drawings in this procedure, I have only attached 1 (the other 9 are simply copies of this drawing).


    JG
    Attached Files

  6. #26
    Junior Member
    Computer Details
    JGupte's Computer Details
    Operating System:
    Windows 7
    Discipline
    Construction
    JGupte's Discipline Details
    Occupation
    Document Controller/Report Writer
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Aug 2017
    Location
    Sydney, Australia
    Posts
    15

    Default

    Quote Originally Posted by BIGAL View Post
    Your on line ! re read my post code will be lisp as I have done all the routines, but can be converted to VBA as method will be similar.

    Sorry, I can't understand code snippets you posted.


    Are they for LISP or VBA? (I am not very good at VBA, and don't know LISP at all.)


    I have tried to modify the ATTIN LSP to open the file
    C:\Users\297560\Documents\Development\AutoCAD Update\Block_Update_In.txt


    but I get the message "Error opening input file for read" when I run it in AutoCAD.


    (see attached LSP file)


    What am I doing wrong?
    Attached Files
    Last edited by JGupte; 24th Aug 2017 at 04:00 am.

  7. #27
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Oct 2012
    Posts
    293

    Default

    JGupte
    I do not quite understand why you are using an intermediate of Lisp ...
    Describe just what you want.
    Do you want it that way? :
    1. File Excel. The first line contains the names of the attributes. The second line shows the values of the attributes.
    2. Browse all files
    3. In each file, find the header block.
    4. Find in this block an attribute by name from Excel.
    5. Replace the value of the attribute in the block with the new value from the excel.

    Maybe you want to change only one attribute? Why go through all the attributes?
    Why get attributes from a file in a text file?

  8. #28
    Junior Member
    Computer Details
    JGupte's Computer Details
    Operating System:
    Windows 7
    Discipline
    Construction
    JGupte's Discipline Details
    Occupation
    Document Controller/Report Writer
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Aug 2017
    Location
    Sydney, Australia
    Posts
    15

    Default

    Hi maratovich,

    Yes, you have the requirement exactly.

    Our project has sort of run away from us. The draftsmen have been very inconsistent with the values they enter in title blocks.
    Management have decided they want to standardise the entries.
    By putting all the entries in a spreadsheet, they can then ensure the values all meet the standard.


    The txt file method (ATTIN) is only one method I was exploring.
    GATTE (update all blocks of same name in dwg - multiple sheets) was another - and possibly a better method?
    However, with this method, I was having problems selecting the blocks.



    So they will fill out the spread sheet table.
    My job (this script) is to go through the list and ensure all entries are as per the spread sheet.

    So what I need to do is:

    Loop through all dwg files in a list
    for each dwg file,
    open the dwg file
    find the Title block values in my spread sheet and export them to the drawing
    save and close the dwg file
    Loop

    If it saves a bit of processing time, I can restrict the updating to only updating those attribute values that are different from the value in my spread sheet.
    (but I think this would take more time, not less).

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

    Default

    Everything is there in the xcel file you have a dwg name you have a Tag name so no need to go down the attin path, you can open a dwg read the tag name, read correct value including nil and then up date. It gets a little trickier in that you want to update multiple dwgs and would need to possibly use a script. But its doable. I would check existing against excel so skip update. Check revs are +1 etc.

    1st off GOOGLE "update title block form excel" I can not emphasise more loudly "ITS OUT THERE DONE ALREADY"

    That is where I would start, customising someones code to suit your needs. I use Getexcel.lsp it has all the code done to read your excel file. Yes it is lisp but here should be an equivalent VBA version out there as well.

    The important thing here is it is a two way system alter in Autocad and update your spread sheet.

    Just a side note if you had posted your excel and dwg as part of 1st post it would have been all done by now.
    A man who never made mistakes never made anything

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

    Default

    Registered forum members do not see this ad.

    Just another question why is there only 1 layout for a project of this type, playing with a 10km road at moment, I would have all the sheets in the 1 dwg as layouts rather than 1 dwg per sheet very odd way to do it. I have a road project with 88 layouts and update the title blocks so much easier, obviously the dwg No is part of the title block. 2-3 lisps to do certain things to the title block.

    Doing it this way is so so much easier.

    Given the type of project I am suprised your company is going down this path this is so old fashioned a way of doing things, is it because your civil software and I have a suspicion which it is does seperate dwg sheets, is there not an option to do all in one dwg.

    I do appreciate a project of this type may have hundreds of sheets and yes it would have seperate dwgs but these would contain all the relevant sheet portions of a project.

    There is a lot of discussion here about model v's layouts but the final result is still multiple sheets in one dwg.

    We press a button and multiple layouts are created within or a new dwg from our civil design software. Going the other way would be so much better pull all the individuals into a master dwg which has all the title block details, its not hard thing to code because you would pull a whole dwg in and make new layouts if required. Also you make changes in your dwg regarding versions this should be pushed to the excel not the other way around to ensure quality control, the guy edits the excel tells the drafty but he/she goes home sick it suddenly comes unstuck.
    Last edited by BIGAL; 26th Aug 2017 at 01:59 am.
    A man who never made mistakes never made anything

Similar Threads

  1. Insert a title Block from excel into a opened dwt with excel vba
    By alex140590 in forum .NET, ObjectARX & VBA
    Replies: 2
    Last Post: 15th Jul 2016, 11:43 am
  2. Replies: 9
    Last Post: 19th Apr 2016, 03:43 pm
  3. Title block to excel spreadsheet
    By keiths in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 3rd Dec 2013, 07:26 am
  4. Excel spreadsheet to update autocad drawing title block
    By Jasenc in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 11th Feb 2013, 12:47 pm
  5. EXCEL Drawing register using Autocad Title Block Attributes
    By SimonC in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 25th Aug 2010, 03:40 am

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