Layout settings

Discussion in 'AutoCAD' started by TCEBob, Dec 24, 2003.

  1. TCEBob

    TCEBob Guest

    What I'd like to do is highlight some layout tabs and then take some
    action on each of them. E.g., zoom extents. (layoutlist) is as close as
    I can get, and if I wanted to act on each listed one that would get me
    started.

    Q1: How can I programmatically change to a layer?

    Q2: How can I generate a list of layer names from the highlighted tabs?

    I'd really appreciate some guidance and hints!

    rs
     
    TCEBob, Dec 24, 2003
    #1
  2. TCEBob

    Jeff Mishler Guest

    A1: (setvar "clayer" "desiredlayername")
    A2: ??? If by this you mean list of layers used only in each tab then I'd
    get a selection set of all entities in the tab, (ssget "x" (list (cons 410
    "layoutname"))), then cycle through the ss and create a list of each
    entity's layer.

    What, I just realized, I'm not sure about is how to tell if more than one
    tab is selected ...... I will look into this.

    Jeff
     
    Jeff Mishler, Dec 24, 2003
    #2
  3. TCEBob

    Jeff Mishler Guest

    Bob,
    To follow up, it appears that ACAD doesn't expose to us which tabs (other
    than the "ctab") are selected. I did see one post that addressed this, and
    it's what I was going to suggest......you could create a dialog box, either
    with dcl (yuck) or vba and have the user select which tab(s) to work with.

    Jeff
     
    Jeff Mishler, Dec 24, 2003
    #3
  4. TCEBob

    TCEBob Guest

    Oh, spit. I'm sorry for the brain spasm; the header says "layout" but
    the contents say "layer." Here is is, corrected:

    What I'd like to do is highlight some layout tabs and then take some
    action on each of them. E.g., zoom extents. (layoutlist) is as close as
    I can get, and if I wanted to act on each listed one that would get me
    started.

    Q1: How can I programmatically change to a layout?

    Q2: How can I generate a list of layout names from the highlighted tabs?

    I'd really appreciate some guidance and hints!

    rs

    (thanks for the response, Jeff.)
     
    TCEBob, Dec 24, 2003
    #4
  5. TCEBob

    Jeff Mishler Guest

    You know, I somehow thought that's what you meant and I almost answered it
    that way, but ya never know.... ;-)

    A1a: (setvar "ctab" "layoutname")
    A1b: (vla-put-activelayout doc (vla-item (vla-get-layouts doc)
    "layoutname"))
    where "doc" = (vla-get-activedocument (vlax-get-acad-object))

    But note that a LOT of things can be done via vla-* functions so that
    actually changing the ctab (which often causes a regen) is not always
    necessary.

    A2: You can't......see my other response. You could do something like this
    though:
    (defun gettabs (/ count num#)
    (setq count 0)
    (textscr)
    (foreach lay (layoutlist)
    (princ "\n")
    (princ (cons count lay))
    (setq count (1+ count))
    )
    (setq num# (getstring "\nEnter number(s) of layouts to use (use commas to
    seperate multiples): "))
    (graphscr)
    num#
    )

    Then use the response to manipulate the tabs. For instance, the user
    selected "0":

    (setq seltab (gettabs))
    (cond ((and (< (strlen (seltab)) 3)(not (wcmatch seltab "*`,*")))
    (setq lay (nth (itoa seltab) (layoutlist))))
    (other conditions.....)
    )

    The one condition shown will set the var "lay" to the layout name of the
    chosen layout when the user enters any number from 0 to 999, not that that
    many tabs can be in any drawing.....
    So, that could get you started....then again, it could just confuse you
    more..... <;-)

    Happy Holidays,
    Jeff
     
    Jeff Mishler, Dec 25, 2003
    #5
  6. TCEBob

    TCEBob Guest

    Ha! Confuse me more! Can't be done.

    Your advice, as always, sage and helpful. I bet there is an indicator in
    the works somewhere that says "layout tab highlighted." Plot recognizes
    the selected ones. When I find it I will share it.

    Thanks,

    rs
     
    TCEBob, Dec 25, 2003
    #6
  7. TCEBob

    CAB2k Guest

    Excuse me for intruding, but I am confused.

    How can you highlight more than one layout tab?
    I am using ACAD 2000.

    CAB
     
    CAB2k, Dec 26, 2003
    #7
  8. TCEBob

    TCEBob Guest

    Hold down the shift or ctl key like in Windows. (2004)

    rs
     
    TCEBob, Dec 26, 2003
    #8
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.