.NET

Reply
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 1 of 7 (393 Views)

Layout Manager - switching Layouts

393 Views, 6 Replies
06-09-2005 03:04 PM
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.
*Tony Tanzillo
Message 2 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-09-2005 04:36 PM in reply to: Chris Ludtke
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.
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 3 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-10-2005 09:22 AM in reply to: Chris Ludtke
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
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 4 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-10-2005 09:23 AM in reply to: Chris Ludtke
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.
Distinguished Contributor
fantum
Posts: 313
Registered: ‎12-06-2004
Message 5 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-10-2005 01:16 PM in reply to: Chris Ludtke
How about the .CurrentLayout property?
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 6 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-10-2005 02:45 PM in reply to: Chris Ludtke
According to the object browser, that property is read-only
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 7 of 7 (393 Views)

Re: Layout Manager - switching Layouts

06-10-2005 02:50 PM in reply to: Chris Ludtke
Never Mind,
Current : Read Only
CurrentLayout : Not Read Only

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community