모델의 Feature들 ID를 로그 파일에 저장 하는 방법
□ VBA 코드
Dim BaseSession As pfcls.IpfcBaseSession
Dim curDir As String
Dim Feature As pfcls.IpfcFeature
Dim logFile As Object
curDir = BaseSession. GetCurrentDirectory()
Set logFile = CreateObject("Scripting.FileSystemObject").CreateTextFile(curDir & "IDT-VBA20221231.log")
Dim Selections As pfcls.IpfcSelections
Dim i As Integer
For i = 0 To features.Count - 1
Set feature = Selections.Item(i).SelItem
If Not feature Is Nothing Then
If feature.IsVisible Then
Set featSelection = CreateObject("MGCPCtl.Select").CreateModelItemSelection(features.Item(i), Nothing)
logFile.WriteLine "Selection created for feature with ID: " & feature.Id
logFile.Flush
End If
End If
Next i
logFile.Close
Set logFile = Nothing
'VBA For Creo' 카테고리의 다른 글
VBA에서 Session 개요 (0) | 2024.01.01 |
---|---|
A program that displays the status of all features in a Creo Part file (0) | 2023.12.31 |
선택된 Feature에 Dimension이 있는 경우 가져오기 (0) | 2023.12.31 |
선택한 Feature 이름 가져오기 (0) | 2023.12.29 |
Excel & Creo Dimension (0) | 2023.12.26 |