ステータス



ドキュメントの種類

Sub GetDocumentType()
    Dim objApp As SldWorks.SldWorks
    Dim objModelDoc As SldWorks.ModelDoc2
    Dim intType As Integer
 
    Set objApp = Application.SldWorks
    Set objModelDoc = objApp.ActiveDoc
    If objModelDoc Is Nothing Then
        MsgBox "NO Open"
        Exit Sub
    End If
    intType = objModelDoc.GetType()
    Select Case intType
    Case swDocumentTypes_e.swDocNONE '0:NONE
        MsgBox "NONE"
    Case swDocumentTypes_e.swDocPART '1:部品
        MsgBox "PART"
    Case swDocumentTypes_e.swDocASSEMBLY '2:アセンブリ
        MsgBox "Assembly"
    Case swDocumentTypes_e.swDocDRAWING '3:図面
        MsgBox "Drawing"
    Case swDocumentTypes_e.swDocSDM '4:SDM
        MsgBox "SDM"
    End Select
End Sub
 


コメント

最終更新:2013年12月11日 23:55