How to get the parameters of catia VBA DefineFrontView

LEE KING

How to get the parameters of catia VBA DefineFrontView

I need a help, thank you in advance;

when i use DefineFrontView API in VBA to generate the front view,

i don't know how to define U&V parameters in correct way;

DraftingInterfaces DrawingViewGenerativeBehavior (Object)

 MyView.GenerativeBehavior.DefineFrontView 0., 1., 0., 0., 0., 1.

 

For example: i want to get a front view from a plane which is created by customized,

so how can i get these parameters just like "0,1,0,0,0,1";

 

English is not my native language,please forgive me if there is a problem with the description;

your sincerely;

Lee King

Edited By:
LEE KING[Subscriber Members] @ Nov 24, 2022 - 12:43 PM (IDLW)

F I

RE: How to get the parameters of catia VBA DefineFrontView
(in response to LEE KING)

Hi.

In this case, use the GetFirstAxis and GetSecondAxis methods of the Plane object.

For example

Sub Sample()

Dim vCompUV As Variant
vCompUV = GetPlaneUVComponents(CATIA.ActiveDocument.Selection.Item(1).Value) 'Selected Plane

'------------------------
'
'Create DrawingView...
'
'------------------------

MyView.GenerativeBehavior.DefineFrontView vCompUV(0), vCompUV(1), vCompUV(2), vCompUV(3), vCompUV(4), vCompUV(5)

End Sub

Function GetPlaneUVComponents(oPlane As Plane) As Variant

Dim vCompUV(5) As Variant
Dim vCompU(2) As Variant
Dim vCompV(2) As Variant
Dim vPlane As Variant
Dim i As Long

'Change types for method use (Plane->Variant)
Set vPlane = oPlane

Call vPlane.GetFirstAxis(vCompU)
Call vPlane.GetSecondAxis(vCompV)

For i = 0 To 2
vCompUV(i) = vCompU(i)
Next
For i = 0 To 2
vCompUV(i + 3) = vCompV(i)
Next

GetPlaneUVComponents = vCompUV

End Function

 

My native language is not English either.
Sorry if I have expressed myself incorrectly.
Thank you.