반응형
■ IpfcSolid
이 개체는 솔리드를 정의합니다.
Property : IsSkeleton as Boolean
- 모델이 스켈레톤 모델이면 true이고 그렇지 않으면 false입니다.
Option Explicit
Sub SkeletonCheck()
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection: Set conn = asynconn.CONNECT("", "", ".", 5)
Dim oSession As pfcls.IpfcBaseSession: Set oSession = conn.session
Dim oModel As IpfcModel: Set oModel = oSession.CurrentModel
Dim oSolid As IpfcSolid: Set oSolid = oModel
Dim oCheck As Boolean: oCheck = oSolid.IsSkeleton
If oCheck = False Then
MsgBox "현재 모델은 스켈레톤 아닙니다"
Else
MsgBox "현재 모델은 스켈레톤 입니다"
End If
conn.Disconnect (2)
'Cleanup
Set asynconn = Nothing
Set conn = Nothing
Set oSession = Nothing
Set oModel = Nothing
End Sub
프로그램 실행 화면
IpfcSolid.GeomOutlin모델 사이즈 계산
■ IpfcAssembly 개체
Property : IsExploded as Boolean
If the assembly is exploded, this attribute is true; otherwise, it is false
코드]
Option Explicit
Sub ExplodCheck()
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection: Set conn = asynconn.CONNECT("", "", ".", 5)
Dim oSession As IpfcBaseSession: Set oSession = conn.session
Dim oModel As IpfcModel: Set oModel = oSession.CurrentModel
Dim oAssembly As IpfcAssembly
Set oAssembly = oModel
Dim ExplodCheck As Boolean
ExplodCheck = oAssembly.IsExploded
MsgBox ExplodCheck
'Disconnect with Creo
conn.Disconnect (2)
End Sub
프로그램 실행 결과
Creo 화면 | 실행 결과 |
'VBA, VB.NET For Creo' 카테고리의 다른 글
의뢰] Part List 프로그램 변형 A01 (0) | 2022.11.25 |
---|---|
IpfcModelItemOwner / IpfcModelItem / IpfcCoordSystem (0) | 2022.11.23 |
VBA Fundamentals #3 : IpfcModel (0) | 2022.11.20 |
VB로 만든 설계 자동화 프로그램 (0) | 2022.11.18 |
Run-time error 2147417851 (80010105) (0) | 2022.11.16 |