* Property xAxisData( ) As double:
This property returns or sets the x coordinate of the drawing view's coordinate system origin, expressed in millimeters with respect to the sheet coordinate system. This method is not available with 2D Layout for 3D Design.
Example:
Retrieves the x coordinate of the coordinate system origin of the MyView drawing view: X = MyView.xAxisData
* Property x( ) As double:
For an interactive view, the get_x and put_x methods are equivalents to get_xAxisData and put_xAxisData. In a generative case, get_x and put_x return or set the x coordinate of the projection of the 3D centre of gravity, expressed in millimeters with respect to the sheet coordinate system. This method is not available with 2D Layout for 3D Design.
* Property yAxisData( ) As double:
This property returns or sets the y coordinate of the drawing view's coordinate system origin, expressed in millimeters with respect to the sheet coordinate system. This method is not available with 2D Layout for 3D Design.
Example:
Sets the y coordinate of the coordinate system origin of the MyView drawing view to 5 inches. NewYCoordinate = 5*25.4 MyView.yAxisData = NewYCoordinate
* Property y( ) As double:
For an interactive view, the get_y and put_y methods are equivalents to get_yAxisData and put_yAxisData. In a generative case, get_y and put_y return or set the y coordinate of the projection of the 3D centre of gravity, expressed in millimeters with respect to the sheet coordinate system. This method is not available with 2D Layout for 3D Design.
The above is the official API documentation. The specific comparison effect is as follows:
Using .xAxisData .yAxisData
factory.CreateCircle oXY(0) - view.xAxisData, oXY(2) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(0) - view.xAxisData, oXY(3) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.xAxisData, oXY(2) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.xAxisData, oXY(3) - view.yAxisData, 3, 0, 2 * Dpi
Using .X .Y
factory.CreateCircle oXY(0) - view.X, oXY(2) - view.Y, 3, 0, 2 * Dpi
factory.CreateCircle oXY(0) - view.X, oXY(3) - view.Y, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.X, oXY(2) - view.Y, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.X, oXY(3) - view.Y, 3, 0, 2 * Dpi
It can be seen that .xAxisData .yAxisData represents the center of the view, while .X .Y refers to the origin position of the 3D graphics corresponding to the view.
The complete .xAxisData .yAxisData code reference is as follows, and .X .Y can be handled similarly:
Sub testCarLine()
Dim sheet As DrawingSheet
Set sheet = CATIA.ActiveDocument.Sheets.ActiveSheet
Dim mainView As DrawingView
Set mainView = sheet.Views.Item(1)
mainView.Activate
For i = 3 To sheet.Views.Count
Set view = sheet.Views.Item(i)
drawCircles view
Next
End Sub
Sub drawCircles(view)
Dim oXY(4)
view.SIZE oXY()
Dim factory As Factory2D
Set factory = view.Factory2D
view.Activate
factory.CreateCircle oXY(0) - view.xAxisData, oXY(2) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(0) - view.xAxisData, oXY(3) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.xAxisData, oXY(2) - view.yAxisData, 3, 0, 2 * Dpi
factory.CreateCircle oXY(1) - view.xAxisData, oXY(3) - view.yAxisData, 3, 0, 2 * Dpi
End Sub
It's important to note that in the above code:
- The loop starting from 3 is because views.item(1) represents MainView and views.item(2) represents BackgroundView.
- The Dpi represents the pi radians.
Please use "DrawingView" in your program to avoid duplications while maintaining similar meanings.