.NET

Reply
Valued Contributor
e.g.
Posts: 65
Registered: ‎07-23-2008
Message 1 of 4 (241 Views)
Accepted Solution

Change the current space

241 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?

 

Thanks,

 

e.g.

*Expert Elite*
_gile
Posts: 2,077
Registered: ‎04-29-2006
Message 2 of 4 (226 Views)

Re : Change the current space

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

Hi,

 

You can use the read/write CTAB sysvar.

Gilles Chanteau
Distinguished Mentor
michael.robertson
Posts: 590
Registered: ‎03-18-2008
Message 3 of 4 (205 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
e.g.
Posts: 65
Registered: ‎07-23-2008
Message 4 of 4 (192 Views)

Re: Change the current space

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

Thank you very much, it did help.

 

e.g.

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