dft layer

 

Hello, i have a question for you.

I need enable or disable a layer in a dft files,(SE. Version 18 sp 10) by visual basic code.

I use visual basic 2005, have you any examples or any suggestions ?

Mauro

 

 

Posted by: Mauro Mignozzetti
Post date: 10/15/2007 2:36:04 AM

2 REPLIES

RE: dft layer

 

If you have not done so already, you need to download and install my free Solid Edge Spy application. It will help you qucikly find stuff like this.

Sub Main()

Dim objApplication As SolidEdgeFramework.Application = Nothing

Dim objDraft As SolidEdgeDraft.DraftDocument = Nothing

Dim objSheet As SolidEdgeDraft.Sheet = Nothing

Dim objLayers As SolidEdgeFramework.Layers = Nothing

Dim objLayer As SolidEdgeFramework.Layer = Nothing

 

Try

objApplication = Marshal.GetActiveObject("SolidEdge.Application")

objDraft = objApplication.ActiveDocument

objSheet = objDraft.ActiveSheet

objLayers = objSheet.Layers

objLayer = objLayers.Item("Layer1")

objLayer.Show = False

Catch ex As Exception

 

Finally

If Not (objLayer Is Nothing) Then

Marshal.ReleaseComObject(objLayer)

End If

If Not (objLayers Is Nothing) Then

Marshal.ReleaseComObject(objLayers)

End If

If Not (objSheet Is Nothing) Then

Marshal.ReleaseComObject(objSheet)

End If

If Not (objDraft Is Nothing) Then

Marshal.ReleaseComObject(objDraft)

End If

If Not (objApplication Is Nothing) Then

Marshal.ReleaseComObject(objApplication)

End If

End Try

End Sub

 

Posted by: Jason Newell
Post date: 10/16/2007 5:12:13 PM

RE: dft layer

 

hy jason,

thank you very much for your reply.

All work correctly.

Mauro

 

Posted by: Mauro Mignozzetti
Post date: 10/16/2007 8:55:17 PM