Valued Contributor
Posts: 65
Registered: ‎07-23-2008
Message 1 of 4 (243 Views)
Accepted Solution

Change the current space

243 Views, 3 Replies
07-11-2011 04:01 PM

Hello everybody,


I have a small application that zooms on an entity with specific properties. The problem is that if I am in paperspace and the entity is in model space, i cannot see the entity. How can I make the entity's space to become the current space?





*Expert Elite*
Posts: 2,082
Registered: ‎04-29-2006
Message 2 of 4 (228 Views)

Re : Change the current space

07-12-2011 01:01 AM in reply to: e.g.



You can use the read/write CTAB sysvar.

Gilles Chanteau
Distinguished Mentor
Posts: 590
Registered: ‎03-18-2008
Message 3 of 4 (207 Views)

Re: Change the current space

07-12-2011 07:49 AM in reply to: e.g.

If you know the name of the layout you can use


LayoutManager.Current.CurrentLayout = layoutName


If you don't know the layout of the entity you can use:


    Public Shared Function GetLayoutName(ByVal ent As Entity) As String
        Dim blockId As ObjectId = ent.BlockId
        Dim btr As BlockTableRecord = TryCast(ent.BlockId.GetObject(OpenMode.ForRead), BlockTableRecord)
        If Not btr.LayoutId.IsNull Then
            Dim layout As Layout = TryCast(btr.LayoutId.GetObject(OpenMode.ForRead), Layout)
            Return layout.LayoutName
        End If
        Return String.Empty
    End Function

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Valued Contributor
Posts: 65
Registered: ‎07-23-2008
Message 4 of 4 (194 Views)

Re: Change the current space

07-12-2011 10:13 AM in reply to: michael.robertson

Thank you very much, it did help.



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 or visit the Installation and Licensing Forum to get help installing your software.