title block automation

Discussion in 'AutoCAD' started by Meelis Muru, Jan 26, 2005.

  1. Meelis Muru

    Meelis Muru Guest

    Hello,

    I have 10+ layouts (sometime ~40) in one DWG file with title blocks and I can edit them through
    DDATTE command. How I can automate some options when I am filling title blocks? Like page numbers,
    product material, customer's name. Script have to collect all title block over the layouts and fill
    some cells. Page 1 of Pages 15, Page 2 of Pages 15, Material etc. I can add manually tale pages and
    script fill all needed cells. To fill all cells manually takes wasteful of time.
    Is it possible?

    Rgrds,
    Meelis Muru
     
    Meelis Muru, Jan 26, 2005
    #1
  2. Meelis Muru

    LibertyOne Guest

    Hi Meelis,

    yes this is possible to do. I myself have created an internal system which upadates the revision number in all layouts that I have. I use blocks with attributes and when the revision number is updated due to a change in the drawing, each title block is updated accordingly.

    The concept is simple - the Lisp programm as well. Give a yell if you need some help setting up a system like this.

    LibertyOne
     
    LibertyOne, Jan 26, 2005
    #2
  3. Meelis Muru

    Meelis Muru Guest

    number in all layouts that I have. I use blocks with attributes and when the revision number is
    updated due to a change in the drawing, each title block is updated accordingly.
    Maybe you can send an example code or smth to me?


    Meelis Muru
     
    Meelis Muru, Jan 26, 2005
    #3
  4. Meelis Muru

    LibertyOne Guest

    The whole program isn't a stand alone finished lsp file. It accesses blocks from our block library as well. I don't think coping and pasting the code would help you any further, but...

    Why not build this thing again from scratch? I would take the time and I think other users here may gain something as well.

    Give me some feedback as to how you want to go about doing this. Do you first want to make a basic system and customize it for your in house needs later, or make it from the start tailored to your needs?

    First off, we need to set some goals and limits as well to keep this tutorial from getting out of hand. I don't know your level in AutoCAD or AutoLISP, but the main thing is that the interest is there - or you wouldn't be here.

    We need to make blocks with attributes, write some Lisp code to automate the whole process, and store everything on your system so that you and your coworkers can use it efficiently within your work environment.

    The main goal is to write a program that updates the information in all layouts automatically.

    LibertyOne
     
    LibertyOne, Jan 26, 2005
    #4
  5. Meelis Muru

    Meelis Muru Guest

    I want to write this code with my hands. When I need to change some parts, I can do it myself. I am
    happy if you can tell me some keywords, where from I have to start.

    Meelis
     
    Meelis Muru, Jan 26, 2005
    #5
  6. Meelis Muru

    LibertyOne Guest

    ok, start off with creating a block with attributes. When I go about doing something like this, I make a list of the names of the attributes because I will need these names again to call and plug in the infomation in the correct spot.

    For example:

    In my application, I created a block for the revision line. This block contains only 4 attributes labled INDEX_NR (revision number), INDEX_BEZ (revision comment), INDEX_DATUM (date of revision) and INDEX_NAME (name of person who did the revision)

    INDEX_NR is filled with the next highest revision number (this information is extracted from the blocks already inserted)

    INDEX_BEZ is filled with text that the user is prompted to fill out. (getstring T "\nRevision text: ")

    INDEX_DATUM is filled with the actual date taken from the system variable DATE (menucmd "M=$(edtime,$(getvar,date),DD.MO.YY)") I used DIESEL to convert the form in which the date is given into text.

    INDEX_NAME is filled with the users initials which is extracted from the system variable LOGINNAME and then checked for a match with the login name.

    (setq login_id (strcase (getvar "loginname")))
    (cond
    ( (= login_id "DEMUE") ;Mueller
    (setq nam "DM / ")
    )
    ( (= login_id "THSCH") ;Schmidt
    (setq nam "TS / ")
    )
    ( (= login_id "SAKEL") ;Kellermann
    (setq nam "SK / ")
    )
    ( T
    (setq nam "NAME?")
    )
    )

    After all the information is gathered I insert the block with attribute information.

    (command "_.insert" "C:/Path/Where/Block/Is/Located/index_up" ipt scf scf rot ndx aen nam dat)


    LibertyOne
     
    LibertyOne, Jan 26, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.