반응형
Drawing에 포함된 3D 모델을 표시 합니다.
반드시 drawing을 open 하고 실행 합니다.
Be sure to open the drawing.
Sorce Code
Set model = model2D.ListModels()
Sub Solid_name_2d()
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection
Dim session As pfcls.IpfcBaseSession
On Error GoTo RunError
Set conn = asynconn.Connect("", "", ".", 5)
Set session = conn.session
Dim model2D As IpfcModel2D
Set model2D = session.CurrentModel
Dim drawingFilename As IpfcModel
Set drawingFilename = session.CurrentModel
Cells(3, "C") = drawingFilename.Filename
Dim model As IpfcModels
Set model = model2D.ListModels()
For i = 0 To model.Count - 1
Cells(i + 7, "b") = model(i).Filename
Next i
conn.Disconnect (2)
'Cleanup
Set asynconn = Nothing
Set conn = Nothing
Set session = Nothing
Set model = Nothing
RunError:
If Err.Number <> 0 Then
MsgBox "Process Failed : Unknown error occurred." + Chr(13) + _
"Error No: " + CStr(Err.Number) + Chr(13) + _
"Error: " + Err.Description, vbCritical, "Error"
If Not conn Is Nothing Then
If conn.IsRunning Then
conn.Disconnect (2)
End If
End If
End If
End Sub
Business inquiries : lionkk@idt21c.com
'VBA For Creo' 카테고리의 다른 글
developing . . . . Drawing Dimension All Display With Tolerence (0) | 2021.03.13 |
---|---|
Drawing View List (0) | 2021.03.08 |
Creo Drawing In Session (0) | 2021.03.08 |
How to get the dimensions of a feature by Creo Parametric VB API? (1) | 2021.03.07 |
Connecting to a Creo Parametric Process (0) | 2021.03.03 |