Imports System.Runtime.InteropServices
Public Class SmartDepthSlotFinite
Private Sub btnSmartDepthSlotFinite_Click(sender As System.Object, e As System.EventArgs) Handles btnSmartDepthSlotFinite.Click
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDoc As SolidEdgeDraft.DraftDocument = Nothing
Dim objDimStyles As SolidEdgeFrameworkSupport.DimensionStyles = Nothing
Dim objTempStyle As SolidEdgeFrameworkSupport.DimensionStyle = Nothing
Dim objType As Type = Nothing
Dim strFiniteSlot As String
Try
' Create/get the application with specific settings
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
If objApplication Is Nothing Then
' Get the type from the Solid Edge ProgID
objType = Type.GetTypeFromProgID("SolidEdge.Application")
' Start Solid Edge
objApplication = Activator.CreateInstance(objType)
' Make Solid Edge visible
objApplication.Visible = True
End If
objDraftDoc = objApplication.ActiveDocument
'Get the DimensionsStyles collection object
objDimStyles = objDraftDoc.DimensionStyles
'Get reference to first DimStyle.
objTempStyle = objDimStyles(0)
'Set the smart depth for Finite slot
objTempStyle.SmartDepthSlotFinite = "%HD - DEEP"
'Get the smart depth for Finite slot
strFiniteSlot = objTempStyle.SmartDepthSlotFinite
If strFiniteSlot <> "%HD - DEEP" Then
MsgBox("Error in SmartDepthSlotFinite property for dimension style.")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class