업무 자동화/VBA, VB.NET For Creo
IpfcModelItemOwner
ToolBOX01
2023. 8. 18. 14:16
□ IpfcModelItemOwner 소개
모델 내에서 아이템(피쳐, 부품, 어셈블리 등)을 소유하고 관리하는 데 사용되는 인터페이스입니다.
IpfcModelItemOwner.ListItems
[Function] ListItems (Type as IpfcModelItemType [optional]) as IpfcModelItems [optional]
활성화된 모델에서 지정된 유형의 항목 (Surface, Edge . . . )으로. 모델이 가지고 있는 목록들을 제공 합니다. 만일 "nothing" 으로 입력 하면 모든 유형의 항목에서 검색 하여 목록을 제공 합니다
▷ 모델의 ID를 표시 하는 예제 코드
Dim ModelItemOwner As IpfcModelItemOwner
Dim ModelItems As IpfcModelIts
Dim ModelItem As IpfcModelItem
Set ModelItemOwner = model
Set ModelItems = ModelItemOwner.ListItems(EpfcModelItemType.EpfcModelItemType_nil)
Dim i As Integer
For i = 0 To ModelItems.Count - 1
Set ModelItem = ModelItems(i)
MsgBox ModelItem.ID
Next i
ModelItemOwner.ListItems은 모델(Part, Assemble, Drawing)의 내용을 배열의 형태로 가져 올수 있습니다.
가져온 내용은 "EpfcModelItemType"으로 분류 하여 가져올수 있습니다. EpfcModelItemType.EpfcModelItemType_nil은 모든 내용을 가져오는 옵션 입니다.