SOLIDWORKS API VB Standalone #1

SOLIDWORKS API

SOLIDWORKS API VB Standalone その1 入門編 とりあえずVBでSOLIDWORKSとつなげてみる! 音声なし、、、日本語字幕でどうぞ

Imports SolidWorks.Interop.sldworks

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim swApp As SldWorks = Nothing
        Dim swDoc As ModelDoc2 = Nothing

        Try
            swApp = GetObject(, "SldWorks.Application")
        Catch
            swApp = Nothing
            Return
        End Try

        MessageBox.Show(swApp.RevisionNumber)

        swDoc = swApp.ActiveDoc
        If swDoc Is Nothing Then
            swApp = Nothing
            Return
        End If

        MessageBox.Show(swDoc.GetPathName)

    End Sub
End Class

コメント

タイトルとURLをコピーしました