Rename Layout Tabs

Discussion in 'AutoCAD' started by bellenoit, Jul 19, 2004.

  1. bellenoit

    bellenoit Guest

    Is there a quick and dirty way to rename layout tabs? I want to take our multiple tabs (Layout2-Plot C, Layout3-Plot C, etc.) and remove the "Layout" and keep the 2-plot, 3-plot, etc? This is for when we have multiple layouts on one drawing...

    can I do it with the VLA commands?

    (defun DelTabs ()
    (vl-load-com)
    (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
    (if (= "Layout*" (vla-get-name x)) *** then what??????

    not very familiar with the whole VLA stuff a little help would be appreciated?

    Thanks!

    noit
     
    bellenoit, Jul 19, 2004
    #1
  2. Have a look at the SUBSTR function.

    --
    Autodesk Discussion Group Facilitator


    multiple tabs (Layout2-Plot C, Layout3-Plot C, etc.) and remove the "Layout"
    and keep the 2-plot, 3-plot, etc? This is for when we have multiple layouts
    on one drawing...
     
    Jason Piercey, Jul 19, 2004
    #2
  3. bellenoit

    Jürg Menzi Guest

    Hi Noit

    This can be what you are looking for (not tested):

    (defun RenameLayouts ( / AcdDoc TmpNme)
    (vl-load-com)
    (setq AcdDoc (vla-get-activedocument (vlax-get-acad-object)))
    (vlax-for Obj (vla-get-layouts AcdDoc)
    (if (wcmatch (setq TmpNme (vla-get-name Obj)) "Layout*")
    (vla-put-name Obj (substr TmpNme 7))
    )
    )
    (princ)
    )

    Cheers
     
    Jürg Menzi, Jul 19, 2004
    #3
  4. bellenoit

    bellenoit Guest

    Thanks Juerg!!!! That is exactly what I wanted!!!

    That's the second time you came through for me on my Programming!!!!

    noit
     
    bellenoit, Jul 19, 2004
    #4
  5. bellenoit

    Jürg Menzi Guest

    Hi Noit

    Glad to help you...¦-)

    Cheers
     
    Jürg Menzi, Jul 19, 2004
    #5
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.