Layout settings

TCEBob

Usenet Archive
Joined
Jul 3, 2003
Messages
327
Reaction score
0
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
 
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
 
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
 
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.)
 
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
 
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
 
Excuse me for intruding, but I am confused.

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

CAB
 
CAB2k said:
Excuse me for intruding, but I am confused.

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

CAB

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

rs
 

Latest threads

Back
Top