반응형
Drawing View List 표시
Source Code
Sub view_name_list()
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 drawingFilename As IpfcModel
Set drawingFilename = session.CurrentModel
Cells(3, "C") = drawingFilename.Filename
Dim Model2D As IpfcModel2D
Set Model2D = session.CurrentModel
Dim View2Ds As IpfcView2Ds
Set View2Ds = Model2D.List2DViews()
For i = 0 To View2Ds.Count - 1
Cells(i + 7, "b") = View2Ds(i).Name
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, VB.NET For Creo' 카테고리의 다른 글
Feature ID 및 Feature 이름 검색 프로그램 # 2/3 (0) | 2021.03.22 |
---|---|
developing . . . . Drawing Dimension All Display With Tolerence (0) | 2021.03.13 |
returns a list of all the solid models used in the drawing. (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 |