.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change the current space

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
e.g.
723 Views, 3 Replies

Change the current space

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.

3 REPLIES 3
Message 2 of 4
_gile
in reply to: e.g.

Hi,

 

You can use the read/write CTAB sysvar.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4
michael.robertson
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
Message 4 of 4
e.g.
in reply to: michael.robertson

Thank you very much, it did help.

 

e.g.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost