.NET

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

Layout Manager - switching Layouts

415 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 (415 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 (415 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 (415 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 (415 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 (415 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 (415 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!