Layout Manager - switching Layouts

Layout Manager - switching Layouts

Anonymous
Not applicable
1,321 Views
6 Replies
Message 1 of 7

Layout Manager - switching Layouts

Anonymous
Not applicable
How do you get access to the layout manager?

I found this posted under ObjectARX

AcApLayoutManager *pLayM = NULL;
pLayM = (AcApLayoutManager *)
acdbHostApplicationServices()->layoutManager();
AcDbLayout *pLayout =
pLayM->findLayoutNamed(pLayM->findActiveLayout(TRUE),TRUE);

This lead me to believe that I can create a reference to the object using this line

Dim oLayoutManager As LayoutManager = HostApplicationServices.WorkingDatabase.?

I would like to switch layouts using .Net.
0 Likes
1,322 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
The easiest way to find out things (which is obviously
NOT the er 'documentation'), is to use Reflector and its
search function.

LayoutManager manager = LayoutManager.Current;

Also keep in mnd that many classes follow this pattern
(where there's no public c'tor and instead, you must call
a static member to get an instance).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4871047@discussion.autodesk.com...
How do you get access to the layout manager?

I found this posted under ObjectARX

AcApLayoutManager *pLayM = NULL;
pLayM = (AcApLayoutManager *)
acdbHostApplicationServices()->layoutManager();
AcDbLayout *pLayout =
pLayM->findLayoutNamed(pLayM->findActiveLayout(TRUE),TRUE);

This lead me to believe that I can create a reference to the object using this line

Dim oLayoutManager As LayoutManager = HostApplicationServices.WorkingDatabase.?

I would like to switch layouts using .Net.
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks Tony,

I am still kinda green when it comes to .net and ObjectARX.

This line worked in VB.Net

Dim oLayoutManager As LayoutManager = LayoutManager.Current
0 Likes
Message 4 of 7

Anonymous
Not applicable
Now, for the other half of my question.

How do I switch layouts? I guess that I wrongly assumed that something called a "LayoutManager" would allow me to switch the active layout.
0 Likes
Message 5 of 7

Anonymous
Not applicable
How about the .CurrentLayout property?
0 Likes
Message 6 of 7

Anonymous
Not applicable
According to the object browser, that property is read-only
0 Likes
Message 7 of 7

Anonymous
Not applicable
Never Mind,
Current : Read Only
CurrentLayout : Not Read Only
0 Likes