All Frameworks  Object Hierarchy  This Framework  Indexes   

VisPropertySet (Object)

Represents the graphic properties for the current selection.
Role: We retrieve the graphic properties of the current selection thanks to Selection.VisProperties

The graphic properties are: A partial modification of an object
A part (for example) contains faces, edges, lines, points. Interactively with the Edit Properties command the end user can change their color, their line type and so one. To go faster there is the Graphic Toolbar which contains a sub-set of properties. So this interface follows the behavior of the graphic toolbar. The color, the line type ... is applicated to the sub-element of the object defined by the application, and that you can retrieve in the graphic toolbar.

A multiple selection
When we modify a graphic property using the Setxxx methods, we modify one by one each element of the current selection.
When we read a graphic property using the Getxxx methods, we retrieve an information which is valid for all elements of the current selection.

Real versus Visible graphic properties
Elements of the current selection are inside a specification tree:
   Example :
    
   Product0
        Part1
           Part3
        Part2

 
In this sample, product0 and Part1 are nodes and Part3 and Part2 are leaves.
Each element (node and leaf) of this tree has its own graphic properties: that is the "Real" graphic properties.
But there is an inheritance mecanism, so each element has also "Visible" graphic properties. An element can be displayed with an another graphic properties that its real graphic properties.

The inheritance is the following:
From the root of the tree, the first node with an inheritance flag to 1, gives its property to each element below it. For each graphic property there is an independantly inheritance.
   Example with the color property: ( color inheritance flag, color)
    
   Product0    (1,red)
        Part1    (0,blue)
           Part3   (1,green)
        Part2    (0,Yellow)

 
In this sample the real colord of the product0 is red, blue for the part1, green for the part3 and yellow for the part2. But the visible color of each element is red, because the product0 gives the red color at all the tree.
See also:
Selection

Method Index

GetLayer
Returns the layer for the current selection.
GetPick
Returns the state pick mode for the current selection.
GetRealColor
Retrieves the real color for the current selection.
GetRealInheritance
Retrieves the real inheritance flag for the current selection.
GetRealLineType
Retrieves the real line type for the current selection.
GetRealOpacity
Retrieves the real opacity for the current selection.
GetRealWidth
Retrieves the real line width for the current selection.
GetShow
Returns the state show mode for the current selection.
GetSymbolType
Retrieves the symbol type for the current selection.
GetVisibleColor
Retrieves the displayed (visible) color for the current selection.
GetVisibleInheritance
Checks if the real property is hidden.
GetVisibleLineType
Retrieves the displayed (visible) line type for the current selection.
GetVisibleOpacity
Retrieves the displayed (visible) opacity for the current selection.
GetVisibleWidth
Retrieves the displayed (visible) line width for the current selection.
SetLayer
Sets the layer for the current selection.
SetPick
Sets the state pick mode for the current selection.
SetRealColor
Sets the real color and the color inheritance flag for the current selection.
SetRealLineType
Sets the real line type and the line type inheritance flag for the current selection.
SetRealOpacity
Sets the opacity and the opacity inheritance flag for the current selection.
SetRealWidth
Sets the real line width and the line width inheritance flag for the current selection.
SetShow
Sets the state show mode for the current selection.
SetSymbolType
Sets the symbol type.

Methods


o Func GetLayer( oLayerType,
oLayerValue) As
Returns the layer for the current selection.
Note: This property is global for the object.
Parameters:
oLayerType
the type of the layer
When the type is equal to catVisLayerNone, the layer of the current selection is "none".
When the type is equal to catVisLayerBasic, the layer of the currection selection is indicated by the following parameter.
oLayerValue
A value between 0 to 1000
This parameter is usefull only when the type of the layer is catVisLayerBasic.
Example:
The following sample shows how to retrieve layer of current selection.
 Dim layer
 layer = CLng(0) 
 Dim layertype As CatVisLayerType
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetLayer layertype, layer
 If (layertype = catVisLayerNone) Then 
 MsgBox "Layer None"
 End If
 If (layertype = catVisLayerBasic) Then 
 MsgBox "layer =" & layer
 End If
 
o Func GetPick( oPick) As
Returns the state pick mode for the current selection.
Note: This property is global for the object.
Example:
The following sample shows how to retrieve pick mode of current selection.
 Dim pickstate As CatVisPropertyPick
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetPick pickstate
 MsgBox "pick = " & pickstate
 
o Func GetRealColor( oRed,
oGreen,
oBlue) As
Retrieves the real color for the current selection.
Parameters:
oRed
A value between 0 and 255
oGreen
A value between 0 and 255
oBlue
A value between 0 and 255
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same real color, so oRed, oGreen and oBlue are valid
catVisPropertyUnDefined
The real color is not the same for all elements of the current selection, so oRed, oGreen and oBlue are not valid
Example:
The following sample shows how to retrieve real colors of current selection.
 Dim r, g, b 
 r = CLng(0) 
 g = CLng(0) 
 b = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetRealColor r, g, b 
 MsgBox "r = " & r & " g = " & g & " b = " & b 
 
o Func GetRealInheritance( iPropertyType,
oInheritance) As
Retrieves the real inheritance flag for the current selection.
Parameters:
iPropertyType
The type of property: Color, Opacity, Line Width, Line Type
oInheritance
0
No heritance
1
Heritance
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same real inheritance flag for the iPropertyType , so oInheritance is valid
catVisPropertyUnDefined
The real inheritance flag for iPropertyType is not the same for all elements of the current selection, so oInheritance is not valid
Example:
The following sample shows how to retrieve inheritance of current selection.
 Dim inhLineType, inhWidth, inhColor, inhOpacity
 inhLineType = CLng(0) 
 inhWidth = CLng(0) 
 inhColor = CLng(0) 
 inhOpacity = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetRealInheritance catVisPropertyLineType, inhLineType
 visProperties1.GetRealInheritance catVisPropertyWidth, inhWidth
 visProperties1.GetRealInheritance catVisPropertyColor, inhColor
 visProperties1.GetRealInheritance catVisPropertyOpacity, inhOpacity
 MsgBox "Inheritance : linetype = " & inhLineType & "width =" & inhWidth & "Colour ="  & inhColor & "Opacity =" & inhOpacity
 
o Func GetRealLineType( oLineType) As
Retrieves the real line type for the current selection.
Parameters:
oLineType
The value ranges from 1 to 63. Each indice is a line type customizable in the page Tools/Options/General/Display/Line Type.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same real line type , so oLineType is valid
catVisPropertyUnDefined
The real line type is not the same for all elements of the current selection, so oLineType is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oLineType is not valid
Example:
The following sample shows how to retrieve real line type of current selection.
 Dim linetype
 linetype = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetRealLineType linetype
 MsgBox "linetype = " & linetype
 
o Func GetRealOpacity( oOpacity) As
Retrieves the real opacity for the current selection.
Parameters:
oOpacity
a value between 0 (total transparency) and 255 (total opacity)
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same real opacity value, so oOpacity is valid
catVisPropertyUnDefined
The real opacity value is not the same for all elements of the current selection, so oOpacity is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oOpacity is not valid
Example:
The following sample shows how to retrieve real opacity of current selection.
 Dim op
 op = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetRealOpacity op 
 MsgBox "opacity = " & op
 
o Func GetRealWidth( oLineWidth) As
Retrieves the real line width for the current selection.
Parameters:
oLineWidth
The value ranges from 1 to 63. Each indice is a thickness customizable in the page Tools/Options/General/Display/thickness.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same real width , so oLineWidth is valid
catVisPropertyUnDefined
The real width is not the same for all elements of the current selection, so oLineWidth is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oLineWidth is not valid
Example:
The following sample shows how to retrieve real line width of current selection.
 Dim width
 width = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetRealWidth width
 MsgBox "width = " & width
 
o Func GetShow( oShow) As
Returns the state show mode for the current selection.
Note: This property is global for the object.
Example:
The following sample shows how to retrieve show mode of current selection.
 Dim showstate As CatVisPropertyShow
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetShow showstate
 MsgBox "show = " & showstate
 
o Func GetSymbolType( oSymbolType) As
Retrieves the symbol type for the current selection.
Parameters:
oSymbolType
The symbol type. See
SetSymbolType to have values.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same symbol type , so oLineType is valid
catVisPropertiesUnDefined
The symbol type is not the same for all elements of the current selection, so oLineType is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oSymbolType is not valid
Example:
The following sample shows how to retrieve symbol line type of current selection.
 Dim symbol
 symbol = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetSymbolType symbol
 MsgBox "Symbol = " & symbol
 
o Func GetVisibleColor( oRed,
oGreen,
oBlue) As
Retrieves the displayed (visible) color for the current selection.
Parameters:
oRed
a value between 0 and 255
oGreen
a value between 0 and 255
oBlue
a value between 0 and 255
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same visible color, so oRed, oGreen and oBlue are valid
catVisPropertyUnDefined
The visible color is not the same for all elements of the current selection, so oRed, oGreen and oBlue are not valid
Example:
The following sample shows how to retrieve displayed colors of current selection.
 Dim r, g, b 
 r = CLng(0) 
 g = CLng(0) 
 b = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetVisibleColor r, g, b 
 MsgBox "r = " & r & " g = " & g & " b = " & b 
 
o Func GetVisibleInheritance( iPropertyType,
oInheritance) As
Checks if the real property is hidden.
Parameters:
iPropertyType
The type of property : Color, Opacity, Line Width, Line Type
oInheritance
0
No heritance: All parents of each element of the current selection have an inheritance flag to 0.
1
Heritance: one parent of each element, perhaps the element itself, as a inheritance flag to 1.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same inheritance flag for the iPropertyType , so oInheritance is valid
catVisPropertyUnDefined
The inheritance flag for iPropertyType is not the same for all elements of the current selection, so oInheritance is not valid
o Func GetVisibleLineType( oLineType) As
Retrieves the displayed (visible) line type for the current selection.
Parameters:
oLineType
A value ranges from 1 to 63.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same visible line type , so oLineType is valid
catVisPropertyUnDefined
The visible line type is not the same for all elements of the current selection, so oLineType is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oLineType is not valid
Example:
The following sample shows how to retrieve displayed line type of current selection.
 Dim linetype
 linetype = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetVisibleLineType linetype
 MsgBox "linetype = " & linetype
 
o Func GetVisibleOpacity( oOpacity) As
Retrieves the displayed (visible) opacity for the current selection.
Parameters:
oOpacity
a value between 0 (total transparency) and 255 (total opacity)
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same visible opacity value, so oOpacity is valid
catVisPropertyUnDefined
The visible opacity value is not the same for all elements of the current selection, so oOpacity is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oOpacity is not valid
Example:
The following sample shows how to retrieve displayed opacity of current selection.
 Dim op
 op = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetVisibleOpacity op 
 MsgBox "opacity = " & op
 
o Func GetVisibleWidth( oLineWidth) As
Retrieves the displayed (visible) line width for the current selection.
Parameters:
oLineWidth
A value ranges from 1 to 63.
oStatus
Legal value:
catVisPropertyDefined
All elements in the current selection have the same visible width , so oLineWidth is valid
catVisPropertyUnDefined
The visible width is not the same for all elements of the current selection, so oLineWidth is not valid
catVisProperty?
At least one element of the current selection is not concerned by this property, so oLineWidth is not valid
Example:
The following sample shows how to retrieve displayed line width of current selection.
 Dim width
 width = CLng(0) 
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.GetVisibleWidth width
 MsgBox "width = " & width
 
o Sub SetLayer( iLayerType,
iLayerValue)
Sets the layer for the current selection.
Note: This property is global for the object.
Parameters:
iLayerType
the type of the layer
iLayerValue
A value between 0 to 1000
This parameter is used only when the type of the layer is catVisLayerBasic.
Example:
The following sample shows how to change layer of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetLayer catVisLayerBasic, 100
 
o Sub SetPick( iPick)
Sets the state pick mode for the current selection.
Note: This property is global for the object.
Example:
The following sample shows how to change pick mode of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetPick catVisPropertyNoPickAttr
 
o Sub SetRealColor( iRed,
iGreen,
iBlue,
iInheritance)
Sets the real color and the color inheritance flag for the current selection.
Parameters:
iRed
A value between 0 and 255
iGreen
A value between 0 and 255
iBlue
A value between 0 and 255
iInheritance
Legal value:
0
No heritance
1
Heritance
Example:
The following sample shows how to change colour of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetRealColor 255,0,0,1 
 
o Sub SetRealLineType( iLineType,
iInheritance)
Sets the real line type and the line type inheritance flag for the current selection.
Parameters:
iLineType
The value ranges from 1 to 63. Each indice is a line type customizable in the page Tools/Options/General/Display/Line Type.
iInheritance
Legal value:
0
No heritance
1
Heritance
Example:
The following sample shows how to change line type of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetRealLineType 4,1 
 
o Sub SetRealOpacity( iOpacity,
iInheritance)
Sets the opacity and the opacity inheritance flag for the current selection.
Parameters:
iOpacity
A value between 0 (total transparency) and 255 (total opacity).
iInheritance
Legal value:
0
No heritance
Example:
The following sample shows how to change opacity of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetRealOpacity 128,1 
 
o Sub SetRealWidth( iLineWidth,
iInheritance)
Sets the real line width and the line width inheritance flag for the current selection.
Parameters:
iLineWidth
The value ranges from 1 to 63. Each indice is a thickness customizable in the page Tools/Options/General/Display/thickness.
iInheritance
Legal value:
0
No heritance
1
Heritance
Example:
The following sample shows how to change line width of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetRealWidth 4,1 
 
o Sub SetShow( iShow)
Sets the state show mode for the current selection.
Note: This property is global for the object.
Example:
The following sample shows how to change show mode of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetShow catVisPropertyNoShowAttr
 
o Sub SetSymbolType( iSymbolType)
Sets the symbol type.
Note:There is no heritage for symbols. That is why there is only one function "SetSymbolType" and no function "SetRealSymbolType" or "SetVisibleSymbolType"
Parameters:
iSymbolType
The symbol type
legal values:
  • 1 : a cross which looks like a "X".
  • 2 : a cross which looks like a "+"
  • 3 : an unfilled circle
  • 4 : two unfilled concentric circles
  • 5 : a filled circle
  • 6 : a filled square
  • 7 : a star which is the union of a 2D marker CROSS ,a 2D marker PLUS and a 2D marker DOT
  • 8 : a dot
  • 9 : a smalldot (one pixel)
  • 10 : a kind of arrow which points to the bottom-left
    	     /
    	|  /
    	|/__
    	
  • 11 : a kind of arrow which points to the top-rigth
    	    ___ 	
    	      /| 
    	    /  |
    	  /
    	
  • FULLCIRCLE2 : a big 12
  • FULLSQUARE2 : a big 13
Example:
The following sample shows how to change symbol type of current selection.
 Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties 
 visProperties1.SetSymbolType 4
 

Copyright © 2003, Dassault Systèmes. All rights reserved.