반응형
Feature Number and Feature Type Name List
IpfcModelItemOwner
연결된 모델 항목 (예 : 모델)이있는 개체의 기본 클래스입니다.
IpfcModelItemOwner.ListItems(Type as IpfcModelItemType [optional]) as IpfcModelItems [optional]
EpfcModelItemType.EpfcITEM_FEATURE
IpfcModelItem
이 클래스는 모델 항목을 정의합니다. 가능한 모델 항목 유형은 다음과 같습니다.
ITEM_FEATURE
ITEM_SURFACE
ITEM_EDGE
ITEM_COORD_SYS
ITEM_AXIS
ITEM_POINT
ITEM_QUILT
ITEM_CURVE
ITEM_LAYER
ITEM_NOTE
ITEM_DIMENSION
ITEM_REF_DIMENSION
IpfcFeature
이 클래스는 Feature을 정의합니다.
IpfcFeature.Pattern() as IpfcFeaturePattern
피쳐가 패턴의 멤버 인 경우 패턴입니다. 그렇지 않으면 null이됩니다.
Sub Feature_LIST2()
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 model As IpfcModel
Set model = session.CurrentModel
'Model File location
Cells(2, "c").Select
Selection.ClearContents
Cells(2, "c") = session.GetCurrentDirectory
'Model File Name
Cells(4, "c").Select
Selection.ClearContents
Cells(4, "c") = model.Filename
'Cells 초기화
Range(Cells(7, "A"), Cells(Rows.Count, "A")).EntireRow.Delete
'Feature LIST
Dim Modelowner As IpfcModelItemOwner
Set Modelowner = model
Dim FeatureItems As IpfcModelItems
Set FeatureItems = Modelowner.ListItems(EpfcModelItemType.EpfcITEM_FEATURE)
Dim Feature As IpfcFeature
'Feature Pattern
Dim Featurepattern As IpfcFeaturePattern
Dim PatternListMembers As IpfcFeatures
Dim Pattern As IpfcFeature
'Excel Display
For i = 0 To FeatureItems.Count - 1
Set Feature = FeatureItems(i)
If Feature.IsVisible = True Then
Cells(i + 7, "b") = Feature.FeatTypeName
Cells(i + 7, "c") = Feature.Number
Cells(i + 7, "d") = Feature.FeatType
Set Featurepattern = Feature.Pattern
If Not Featurepattern Is Nothing Then
Set PatternListMembers = Featurepattern.ListMembers
For j = 0 To PatternListMembers.Count - 1
Set Pattern = PatternListMembers(j)
Cells(i + 7, "e") = "Pattern"
Next j
End If
End If
Next i
Call BlankrowDelete
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
Sub BlankrowDelete()
Columns("B").SpecialCells(4).EntireRow.Delete
End Sub
Business inquiries : lionkk@idt21c.com
'VBA For Creo' 카테고리의 다른 글
Setting up the VBA API 환경 설정 (0) | 2022.08.20 |
---|---|
치수 값을 자동으로 대입 하여, 모델 면적 표시하기 (0) | 2021.03.30 |
developing . . . . Drawing Dimension All Display With Tolerence (0) | 2021.03.13 |
Drawing View List (0) | 2021.03.08 |
returns a list of all the solid models used in the drawing. (0) | 2021.03.08 |