• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Active Contributor
    Posts: 44
    Registered: ‎04-12-2005

    Layout Manager - switching Layouts

    324 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.
    Please use plain text.
    *Tony Tanzillo

    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.
    Please use plain text.
    Active Contributor
    Posts: 44
    Registered: ‎04-12-2005

    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
    Please use plain text.
    Active Contributor
    Posts: 44
    Registered: ‎04-12-2005

    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.
    Please use plain text.
    Distinguished Contributor
    Posts: 313
    Registered: ‎12-06-2004

    Re: Layout Manager - switching Layouts

    06-10-2005 01:16 PM in reply to: Chris Ludtke
    How about the .CurrentLayout property?
    Please use plain text.
    Active Contributor
    Posts: 44
    Registered: ‎04-12-2005

    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
    Please use plain text.
    Active Contributor
    Posts: 44
    Registered: ‎04-12-2005

    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
    Please use plain text.