pycatia.knowledge_interfaces.parameters¶
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.knowledge_interfaces.parameters.Parameters(com_object)¶
Note
CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.CollectionParametersRepresents the Parameters collection of the part or theproduct.The following example shows how to retrieve it:Dim CATDocs As DocumentsSet CATDocs = CATIA.DocumentsDim part1 As DocumentSet part1 = CATDocs.Add(“CATPart”)Dim parameterList As ParametersSet parameterList = part1.Part.Parameters- all_parameters()¶
- Returns:
list(Parameter())
- create_boolean(i_name: str, i_value: bool) BoolParam ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateBoolean(CATBSTR iName,boolean iValue) As BoolParamCreates a boolean parameter and adds it to the part’s collection ofparameters.Parameters:iNameThe parameter nameiValueThe parameter valueExample:This example creates the checked boolean parameter and adds it to thenewly created part:Dim CATDocs As DocumentsSet CATDocs = CATIA.DocumentsDim part1 As DocumentSet part1 = CATDocs.Add(“CATPart”)Dim chk As BooleanParamSet chk = part1.Part.Parameters.CreateBoolean (“checked”, False)
- Parameters:
i_name (str) –
i_value (bool) –
- Return type:
- create_dimension(i_name: str, i_magnitude: str, i_value: float) Dimension ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateDimension(CATBSTR iName,CATBSTR iMagnitude,double iValue) As DimensionCreates a user dimension and adds it to the part’s collection ofparameters.Parameters:iNameThe dimension nameiMagnitudeThe dimension magnitude. Units are those of the IS system. Validmagnitudes are:“LENGTH”: the unit is the meter.“ANGLE”: the unit is the radian.The Dimension object provides the Dimension.ValuateFromString method withwhich you may express the value in any unit for a given dimension (see theexample below).iValueThe dimension value provided as a real numberExample:This example creates a LENGTH dimension and adds it to the newlycreated part. The initial value is expressed in meters. The new value isexpressed in millimeters.Dim depth As DimensionSet depth = parameters.CreateDimension(“depth”, “LENGTH”, 20)depth.ValuateFromString(“300mm”);
The documentation from the CHM file is incomplete here as many more magnitude types are available. For example: TIME, MASS, VOLUME, DENSITY, AREA … If you need to find the magnitude value for the dimension type you wish to create use the macro recorder and manually create the parameter. The macro script generated will reveal the magnitude value required.
- Parameters:
i_name (str) –
i_magnitude (str) –
i_value (float) –
- Return type:
- create_integer(i_name: str, i_value: int) IntParam ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateInteger(CATBSTR iName,long iValue) As IntParamCreates an integer parameter and adds it to the part’s collection ofparameters.Parameters:iNameThe parameter nameiValueThe parameter valueExample:This example creates the RevisionNumber integer parameter and adds itto the newly created part:Dim CATDocs As DocumentsSet CATDocs = CATIA.DocumentsDim part1 As DocumentSet part1 = CATDocs.Add(“CATPart”)Dim revision As IntParamSet revision = part1.Part.Parameters.CreateInteger (“RevisionRumber”, 17)
- Parameters:
i_name (str) –
i_value (int) –
- Return type:
- create_list(i_name: str) ListParameter ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateList(CATBSTR iName) As ListParameterCreates a list parameter and adds it to the part’s collection ofparameters.Parameters:iNameThe parameter nameExample:This example creates the ListName list parameter and adds it to thenewly created part:Set CATDocs = CATIA.DocumentsSet part1 = CATDocs.Add(“CATPart”)Set list1 = part1.Part.Parameters.CreateList (“ListName”)
- Parameters:
i_name (str) –
- Return type:
- create_real(i_name: str, i_value: float) RealParam ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateReal(CATBSTR iName,double iValue) As RealParamCreates a real parameter and adds it to the part’s collection ofparameters.Parameters:iNameThe parameter nameiValueThe parameter valueExample:This example creates the ReliabilityRate real parameter and adds it tothe newly created part:Dim CATDocs As DocumentsSet CATDocs = CATIA.DocumentsDim part1 As DocumentSet part1 = CATDocs.Add(“CATPart”)Dim rate As RealParamSet rate = part1.Part.Parameters.CreateReal (“ReliabilityRate”, 2.5 )
- Parameters:
i_name (str) –
i_value (float) –
- Return type:
- create_set_of_parameters(i_father: AnyObject) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub CreateSetOfParameters(AnyObject iFather)Creates a set of parameters and appends it to argument iFather.
- Parameters:
i_father (AnyObject) –
- Return type:
None
- create_string(i_name: str, i_value: str) StrParam ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func CreateString(CATBSTR iName,CATBSTR iValue) As StrParamCreates a string parameter and adds it to the part’s collection ofparameters.Parameters:iNameThe parameter nameiValueThe parameter valueExample:This example creates the responsible string parameter and adds it tothe newly created part:Set CATDocs = CATIA.DocumentsSet part1 = CATDocs.Add(“CATPart”)Set density = part1.Part.Parameters.CreateString (“responsible”, “The Boss”)
- Parameters:
i_name (str) –
i_value (str) –
- Return type:
- get_name_to_use_in_relation(i_object: AnyObject) str ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func GetNameToUseInRelation(AnyObject iObject) As CATBSTRReturns a correct name of a feature to use it in a relation.
- Parameters:
i_object (AnyObject) –
- Return type:
str
- has_parameters()¶
- Returns:
bool
- is_list_parameter(index: cat_variant)¶
- Parameters:
index (cat_variant) – parameter name or parameter number
- Returns:
bool
- Return type:
bool
- is_parameter(index: cat_variant)¶
- Parameters:
index (cat_variant) – parameter name or parameter number
- Return type:
bool
- item(index: cat_variant) any_parameter ¶
Note
- CAA V5 Visual Basic help
- Itemo Func Item( CATVariant iIndex) As ParameterRetrieves a parameter using its index or its name from the from theParameters collection.Parameters:iIndexThe index or the name of the parameter to retrieve fromthe collection of parameters.As a numeric, this index is the rank of the parameterin the collection.The index of the first parameter in the collection is 1, andthe index of the last parameter is Count.As a string, it is the name you assigned to the parameter usingtheactivateLinkAnchor(‘AnyObject’,’Name’,’AnyObject.Name’) property or whencreating the parameter.Examples:This example retrieves the last parameter in the parameterscollection:Set lastParameter = parameters.Item(parameters.Count)
- Parameters:
index (cat_variant) –
- Return type:
any_parameter
- remove(i_index: cat_variant) None ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Sub Remove(CATVariant iIndex)Removes a parameter from the Parameters collection.Parameters:iIndexThe index or the name of the parameter to remove from thecollection of parameters. As a numerics, this index is the rank of theparameter in the collection. The index of the first parameter in the collectionis 1, and the index of the last parameter is Count. As a string, it is the nameyou assigned to the parameter using theAnyObject.Name property or when creating the parameter.Example:This example removes the “depth” parameter from the parameterscollection.parameters.Remove(“depth”)
- Parameters:
i_index (cat_variant) –
- Return type:
None
- property root_parameter_set: ParameterSet¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
- o Property RootParameterSet() As ParameterSet (Read Only)Returns the root parameter set of a document. If it doesn’t exist, it iscreated.
- Return type:
- sub_list(i_object: AnyObject, i_recursively: bool) Parameters ¶
Note
- CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
- o Func SubList(AnyObject iObject,boolean iRecursively) As ParametersReturns a sub-collection of parameters aggregated to anobject.Parameters:iObjectThe object used to filter the whole parameter collection to get theresulting sub-collection.iRecursivelyA flag to specify if children parameters are to be searched for inthe returned collectionExample:This example shows how to retrieve a collection of parameters thatare associated to a Pad.Dim Parameters1 As ParametersSet Parameters1 = CATIA.ActiveDocument.Part.Parameters gets the collection of parametersin the partDim Body0 As AnyObjectSet Body0 = CATIA.ActiveDocument.Part.Bodies.Item ( “MechanicalTool.1” )Dim Pad1 As AnyObjectSet Pad1 = Body0.Shapes.Item ( “Pad.1” ) gets the pad Pad.1Dim Parameters2 As ParametersSet Parameters2 = Parameters1.SubList(Pad1,TRUE) gets the collection of parameters thatare under the pad Pad.1
- Parameters:
i_object (AnyObject) –
i_recursively (bool) –
- Return type: