.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layout Manager - switching Layouts

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
714 Views, 6 Replies

Layout Manager - switching Layouts

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.
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

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.
Message 3 of 7
Anonymous
in reply to: Anonymous

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
Message 4 of 7
Anonymous
in reply to: Anonymous

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.
Message 5 of 7
fantum
in reply to: Anonymous

How about the .CurrentLayout property?
Message 6 of 7
Anonymous
in reply to: Anonymous

According to the object browser, that property is read-only
Message 7 of 7
Anonymous
in reply to: Anonymous

Never Mind,
Current : Read Only
CurrentLayout : Not Read Only

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost