pycatia.drafting_interfaces.drawing_view¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
Warning
The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.
- class pycatia.drafting_interfaces.drawing_view.DrawingView(com_object)¶
Note
CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectDrawingViewRepresents a drawing view in a drawing sheet.The drawing view is included in a drawing sheet and contains texts,leaders,dimensions, arrows, pictures, tables, 2D Geometry and 2Dcomponent.Warning: This interface is not available with 2D Layout for 3DDesign.- activate() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Activate()Activates the drawing view. Activating a drawing view means that thisdrawing view is the one on which the end-user is nowworking.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example activates the ViewToWorkOn drawing view.ViewToWorkOn.Activate()
- Return type:
None
- aligned_with_reference_view() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub AlignedWithReferenceView()Activates the alignment with the reference view. Activating the alignmentwith the reference view restores the constraints that the reference viewimposes to the current drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example activates the alignment from the MyView drawing view toits reference view.MyView.AlignedWithReferenceView()
- Return type:
None
- property angle: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Angle() As doubleReturns or sets the angle of the drawing view. The angle is measuredbetween the axis system of the drawing view and the axis system of the drawingsheet where the drawing view lies. The angle is measured in radians and iscounted counterclockwise.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the angle of the MyView drawing view to 90 degreesclockwise. You first need to compute the angle in radians and set the minussign to indicate the rotation is clockwise.PI = 3.1415926535Angle90Clockwise = -PI/2MyView.Angle = Angle90Clockwise
- Return type:
float
- property arrows: DrawingArrows¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Arrows() As DrawingArrows (Read Only)Returns the drawing arrow collection of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in ArrowCollection the collection of arrows ofthe MyView drawing view.Dim ArrowCollection As DrawingArrowsSet ArrowCollection = MyView.Arrows
- Return type:
- property components: DrawingComponents¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Components() As DrawingComponents (Read Only)Returns the drawing component instances collection (i.e. ditto collection)of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in ComponentCollection the collection ofcomponent instances of the MyView drawing view.Dim ComponentCollection As DrawingComponentsSet ComponentCollection = MyView.Components
- Return type:
- property dimensions: DrawingDimensions¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Dimensions() As DrawingDimensions (Read Only)Returns the drawing dimension collection of the drawingview.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in DimensionCollection the collection ofdimensions of the MyView drawing view.Dim DimensionCollection As DrawingDimensionsSet DimensionCollection = MyView.Dimensions
- Return type:
- property factory_2d: Factory2D¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Factory2D() As Factory2D (Read Only)Returns the 2D factory of the drawing view. Take care that you must openedition on a sketch before adding or modifying elements in it. Take care thatyou must close edition on a sketch to keep all modifications before savingdocument.Warning: This method is not available with 2D Layout for 3D Design. To getSketch from factory2D:Set mySketch = my2DFactory.GetParentExample:The following example returns in my2DFactory the 2Dfactoryof the view myView:Set my2DFactory = myView.Factory2D
- Return type:
- property frame_visualization: bool¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property FrameVisualization() As booleanReturns or sets the drawing view frame visualizationstate.True if the drawing view frame is visible.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example shows the frame of the MyView drawingview.MyView.FrameVisualization = True
- Return type:
bool
- property generative_behavior: DrawingViewGenerativeBehavior¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property GenerativeBehavior() As DrawingViewGenerativeBehavior (ReadOnly)Returns the generative behavior of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in MyViewGenBehavior the generative behavior ofthe MyView drawing view.Dim MyViewGenBehavior AsDrawingViewGenerativeBehaviorSet MyViewGenBehavior = MyView.GenerativeBehavior
- Return type:
- property generative_links: DrawingViewGenerativeLinks¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property GenerativeLinks() As DrawingViewGenerativeLinks (ReadOnly)Returns the generative links of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in MyViewGenLinks the generative links of theMyView drawing view.Dim MyViewGenLinks As DrawingViewGenerativeLinksSet MyViewGenLinks = MyView.GenerativeLinks
- Return type:
- property geometric_elements: GeometricElements¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property GeometricElements() As GeometricElements (ReadOnly)Returns the collection of geometric elements included in the drawing viewsketch.Warning: This method is not available with 2D Layout for 3DDesign.Example:The following example returns in colGeometry the list of geometricelements in the view myView:Dim colGeometry As GeometricElementsSet colGeometry = myView.GeometricElements
- Return type:
- get_view_name(i_view_name_prefix: str, i_view_name_ident: str, i_view_name_suffix: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub GetViewName(CATBSTR iViewNamePrefix,CATBSTR iViewNameIdent,CATBSTR iViewNameSuffix)Returns the prefix, the ident and the suffix of the name of the drawingview. The method returns an error in case of 2D componentreference.Note: Prefix of drawing view can be also retrieved across name propertydefined in CATIABaseWarning: This method is not available with 2D Layout for 3DDesign.Example:This example gets the prefix, the ident, and the suffix of the nameof the MyView drawing viewDim MyPrefix, MyIdent, MySuffix As CATBSTRMyView.GetViewName (MyPrefix, MyIdent, MySuffix)
- Parameters:
i_view_name_prefix (str) –
i_view_name_ident (str) –
i_view_name_suffix (str) –
- Return type:
None
- insert_view_angle(i_first: int, io_text: DrawingText) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub InsertViewAngle(long iFirst,DrawingText ioText)Insert the Angle parameter in the text of the drawingtext.Warning: This method is not available with 2D Layout for 3DDesign.Parameters:iFirstThe first character from which the parameter is insertedioTextThe text on wich the scale parameter will be insertedExample:This example insert the Angle parameter of MyView drawing view atthe end of MyText drawing text.index = Len(MyText.Text)+1MyView.InsertViewScale index, MyText
- Parameters:
i_first (int) –
io_text (DrawingText) –
- Return type:
None
- insert_view_scale(i_first: int, io_text: DrawingText) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub InsertViewScale(long iFirst,DrawingText ioText)Insert the scale parameter in the text of the drawingtext.Warning: This method is not available with 2D Layout for 3DDesign.Parameters:iFirstThe first character from which the parameter is insertedioTextThe text on wich the scale parameter will be insertedExample:This example insert the Scale parameter of MyView drawing view atthe first character of MyText drawing text.MyView.InsertViewScale 1, MyText
- Parameters:
i_first (int) –
io_text (DrawingText) –
- Return type:
None
- is_generative() bool ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func IsGenerative() As booleanReturns whether the drawing view has a generativebehavior.Warning: This method is not available with 2D Layout for 3DDesign.True if the drawing view has a generative behavior.Example:This example retrieves in GenView if the MyView drawing view has agenerative behavior property set.GenView = MyView.IsGenerative()
- Return type:
bool
- isolate() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Isolate()Isolates the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example isolates the MyView drawing view.MyView.Isolate
- Return type:
None
- property lock_status: bool¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property LockStatus() As booleanReturns or sets the lock status of a drawing view.Warning: This method is not available with 2D Layout for 3DDesign.precondition: This property does not exist for the detail view. In thiscase, the method returns failed.Example:This example locks the ViewToWorkOn drawing view.ViewToWorkOn.LockStatus = True
- Return type:
bool
- property pictures: DrawingPictures¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Pictures() As DrawingPictures (Read Only)Returns the drawing picture collection of the drawingview.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in PictureCollection the collection of picturesof the MyView drawing view.Dim PictureCollection As DrawingPicturesSet PictureCollection = MyView.Pictures
- Return type:
- property reference_view: DrawingView¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property ReferenceView() As DrawingViewReturns or sets the reference view. The reference view is also the parentview to which the current drawing view is linked and which is used as referencefor alignment. Generally, the reference view is the front view, and the otherviews, such as the top, bottom, left, and right views, are linked to it. Thisreference drawing view is used:When moving the current drawing view. Its location remains constrainedto the reference view, depending on its type. For example, a left view can movehorizontally and a top view can move vertically.To update the scale of the current drawing view according to themodification performed to the one of the reference drawingview.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in ReferenceView the view used as reference bythe MyView drawing view.Dim ReferenceView As DrawingViewSet ReferenceView = MyView.RefView
- Return type:
- save_edition() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub SaveEdition()Saves the Sketch Edition. Once you have finished working with the drawingview, you must save its edition in order to register modification forUNDO/REDO. Indeed when activating a view, this view is open in edition whilethe previous active view is closed in edition. So calling SaveEdition() beforeexiting a macro without changing active view will allow a correct UNDO/REDObehavior.Warning: This method is not available with 2D Layout for 3DDesign.Example:The following example saves the edition of the drawing viewMyView:MyView.SaveEdition
- Return type:
None
- property scale: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Scale() As doubleReturns or sets the scale of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the scale of the MyView drawing view to0.5.MyView.Scale = 0.5
- Return type:
float
- property scale2: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Scale2() As doubleReturns or sets the scale of the drawing view (Workaround for VBAkeyword).Warning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the scale of the MyView drawing view to0.5.MyView.Scale2 = 0.5
- Return type:
float
- set_view_name(i_view_name_prefix: str, i_view_name_ident: str, i_view_name_suffix: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub SetViewName(CATBSTR iViewNamePrefix,CATBSTR iViewNameIdent,CATBSTR iViewNameSuffix)Sets the prefix, the ident and the suffix of the name of the drawing view.The method returns an error in case of 2D componentreference.Note: Prefix of drawing view can be also modified across name propertydefined in CATIABaseWarning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the prefix, the ident, and the suffix of the nameof the MyView drawing view respectively to “MyPrefix”,“MyIdent”,and “MySuffix”.MyView.SetViewName (“MyPrefix”, “MyIdent”,“MySuffix”)
- Parameters:
i_view_name_prefix (str) –
i_view_name_ident (str) –
i_view_name_suffix (str) –
- Return type:
None
- size() Tuple[float, float, float, float] ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Size(CATSafeArrayVariant oValues)Returns the bounding box of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Parameters:oValuesThe values of the view bounding box: Xmin, Xmax, Ymin, YmaxExample:This example gets the bounding box of the ViewToWorkOn drawingview.Dim oXY(4) As DoubleViewToWorkOn.Size oXYXmin = oXY(0)Xmax = oXY(1)Ymin = oXY(2)Ymax = oXY(3)
- Parameters:
o_values (tuple) –
- Return type:
Double
- property tables: DrawingTables¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Tables() As DrawingTables (Read Only)Returns the drawing table collection of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in TextCollection the collection of texts of theMyView drawing view.Dim TableCollection As DrawingTablesSet TableCollection = MyView.Tables
- Return type:
- property texts: DrawingTexts¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Texts() As DrawingTexts (Read Only)Returns the drawing text collection of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in TextCollection the collection of texts of theMyView drawing view.Dim TextCollection As DrawingTextsSet TextCollection = MyView.Texts
- Return type:
- property threads: DrawingThreads¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Threads() As DrawingThreads (Read Only)Returns the drawing thread collection of the drawing view.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in ThreadCollection the collection of threads ofthe MyView drawing view.Dim ThreadCollection As DrawingThreadsSet ThreadCollection = MyView.Threads
- Return type:
- un_aligned_with_reference_view() None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub UnAlignedWithReferenceView()Deactivates the alignment with the reference view. Deactivating thealignment to the reference view removes the constraints that the reference viewimposes to the current drawing view. You can then, for example, move andposition it freely.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example deactivates the alignment from the MyView drawing view toits reference view.MyView.UnAlignedWithReferenceView()
- Return type:
None
- property view_type: int¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property ViewType() As CatDrawingViewType (Read Only)Returns the drawing view type.Warning: This method is not available with 2D Layout for 3D Design.
- Returns:
enum cat_drawing_view_type
- Return type:
int
- property weldings: DrawingWeldings¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property Weldings() As DrawingWeldings (Read Only)Returns the drawing welding collection of the drawingview.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves in weldingCollection the collection of weldingsof the MyView drawing view.Dim weldingCollection As DrawingWeldingsSet weldingCollection = MyView.Weldings
- Return type:
- property x: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property x() As doubleFor an interactive view, get_x and put_x methods are equivalents toget_xAxisData, put_xAxisData In a generative case, get_x. put_x returns or setsthe x coordinate of the projection of the 3D centre of gravity. It is expressedwith respect to the sheet coordinate system. This coordinate, like any length,is measured in millimeters.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves the x coordinate of the view relative positionMyView.X = MyView.x
- Return type:
float
- property x_axis_data: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property xAxisData() As doubleReturns or sets the x coordinate of the drawing view coordinate systemorigin. It is expressed with respect to the sheet coordinate system. Thiscoordinate, like any length, is measured in millimeters.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example retrieves the x coordinate of the coordinate system originof the MyView drawing view.X = MyView.xAxisData
- Return type:
float
- property y: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property y() As doubleFor an interactive view, get_y and put_y methods are equivalents toget_yAxisData, put_yAxisData In a generative case, get_y. put_y returns or setsthe y coordinate of the projection of the 3D centre of gravity. It is expressedwith respect to the sheet coordinate system. This coordinate, like any length,is measured in millimeters.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the y coordinate of the view relative position MyViewto 5 inches. You need first to convert the 5 inches intomillimeters.NewYCoordinate = 5*25.4MyView.y = NewYCoordinate
- Return type:
float
- property y_axis_data: float¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property yAxisData() As doubleReturns or sets the y coordinate of the drawing view coordinate systemorigin. It is expressed with respect to the sheet coordinate system. Thiscoordinate, like any length, is measured in millimeters.Warning: This method is not available with 2D Layout for 3DDesign.Example:This example sets the y coordinate of the coordinate system origin ofthe MyView drawing view to 5 inches. You need first to convert the 5 inchesinto millimeters.NewYCoordinate = 5*25.4MyView.yAxisData = NewYCoordinate
- Return type:
float