업무 자동화/VBA, VB.NET For Creo
모델의 Front 뷰를 360도 회전 하기
ToolBOX01
2023. 8. 7. 16:42
■ 기능 소개
Front 방향을 기준으로 360도 회전 하는 코드 입니다.
▷ IpfcWindow
이 클래스는 창의 속성을 설명합니다.
창 위치는 화면의 왼쪽 위 모서리에서 창의 왼쪽 위 모서리를 기준으로 합니다. Creo 그래픽 창이나 다이얼로그 창과 같은 창 유형을 조작할 수 있습니다. 이를 통해 창의 크기를 변경하거나 위치를 이동시키는 등의 작업을 수행할 수 있습니다.
▷ IpfcViewOwner
이것은 연관된 보기(예: 모델)가 있는 객체의 기본 클래스입니다. 그래픽 뷰의 생성, 삭제, 표시 상태 변경, 뷰의 위치와 방향 변경 등을 수행할 수 있습니다.
IpfcViewOwner. CurrentViewRotate (Axis as IpfcCoordAxis, Angle as Double)
-> 속성은 현재 활성화된 그래픽 뷰의 회전 각도를 가져오거나 설정하는 데 사용됩니다.
이 속성을 사용하여 활성 뷰의 회전을 조작할 수 있습니다.
IpfcViewOwner. CurrentViewRotate (EpfcCoordAxis.EpfcCOORD_AXIS_X, 10.0)
IpfcViewOwner. CurrentViewRotate (EpfcCoordAxis.EpfcCOORD_AXIS_Y, 10.0)
IpfcViewOwner. CurrentViewRotate (EpfcCoordAxis.EpfcCOORD_AXIS_Z, 10.0)
Sub view_rotate()
'// 현재 세션 연결
file_name.model_session
Dim Windows As IpfcWindow
Dim ViewOwner As IpfcViewOwner
Set Windows = session.CurrentWindow
Set ViewOwner = model
Dim i As Integer
For i = 0 To 35
Call ViewOwner.CurrentViewRotate(EpfcCoordAxis.EpfcCOORD_AXIS_Y, 10)
Windows.Refresh
Next i
'Disconnect with Creo
conn.Disconnect (2)
'Cleanup
Set asynconn = Nothing
Set conn = Nothing
Set session = Nothing
Set model = Nothing
End Sub
10 | 50 | 180 | 230 |
![]() |
![]() |
![]() |
![]() |
추가) Front 뷰로 이동 하기
Sub view_front()
'// 현재 세션 연결
file_name.model_session
Dim Windows As IpfcWindow
Dim ViewOwner As IpfcViewOwner
Set Windows = session.CurrentWindow
Set ViewOwner = model
Call ViewOwner.RetrieveView("FRONT")
Windows.Refresh
'Disconnect with Creo
conn.Disconnect (2)
'Cleanup
Set asynconn = Nothing
Set conn = Nothing
Set session = Nothing
Set model = Nothing
End Sub