TheSwamp

Code Red => VB(A) => Topic started by: Humbertogo on August 28, 2007, 02:44:52 AM

Title: copy layer properties ObjectDBX
Post by: Humbertogo on August 28, 2007, 02:44:52 AM
is there a way to copy layer with  properties from one doc Viewport to another using
ObjectDBX
Title: Re: copy layer properties ObjectDBX
Post by: Bryco on August 28, 2007, 09:59:45 AM
Humbertogo, I'm not sure about your question.
If you want to freeze layers in a viewport you add xdata tp the viewport. So it's possible.
Title: Re: copy layer properties ObjectDBX
Post by: Humbertogo on August 28, 2007, 10:22:00 AM
in my program i importing a  Layout using ObjectDBX
but i need to know witch layer are freeze in the viewport
(Layout)
Title: Re: copy layer properties ObjectDBX
Post by: Bryco on August 29, 2007, 11:13:53 AM
This is trickier than I thougth it would be.
I think your are better making the pviewport then add the xdata that trying to copy the pviewport

Code: [Select]
Sub CopyVpLayerStates(Vp As AcadPViewport, NewVp As AcadPViewport, NewDoc As AcadDocument)

    Dim Doc As AcadDocument
    Dim Xd, Xv
 
    Vp.GetXData "Acad", Xd, Xv
    NewVp.SetXData Xd, Xv
    NewVp.Update
    NewDoc.MSpace = False
    NewVp.Display (False)
    NewVp.Display (True)
    NewDoc.MSpace = True
   
End Sub