Change a Parameter into a ParameterSet using a MACRO
Change a Parameter into a ParameterSet using a MACRO
(OP)
Good morning,
I am trying to change a parameter from a ParameterSet recording a Macro.
Attached is a screenshot of the location of the parameter "b", the one to change, and the macro script.
I am not sure about what is happening in the script, and why it does not achieve the parameter "b".
The Macro works when I try to change a parameter out of the ParameterSet.
Do you know how can I make it work?????
Thank you very much!!
I am trying to change a parameter from a ParameterSet recording a Macro.
Attached is a screenshot of the location of the parameter "b", the one to change, and the macro script.
I am not sure about what is happening in the script, and why it does not achieve the parameter "b".
The Macro works when I try to change a parameter out of the ParameterSet.
Do you know how can I make it work?????

Thank you very much!!





RE: Change a Parameter into a ParameterSet using a MACRO
CODE --> CATVBA
Dim partDoc As PartDocument Set partDoc = CATIA.ActiveDocument Dim SubParamSet As ParameterSet Set SubParamSet = partDoc.Part.Parameters.RootParameterSet.ParameterSets.GetItem("SubParameterSet") Dim oParameter As Parameter Set oParameter = SubParamSet.AllParameters.GetItem("ParameterInSubParameterSet") MsgBox (oParameter.ValueAsString)indocti discant et ament meminisse periti
RE: Change a Parameter into a ParameterSet using a MACRO
This is the VBS code I´ve use:
Language="VBSCRIPT"
Sub CATMain()
Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Set parameters1 = part1.Parameters
Set parameterSet1 = parameters1.RootParameterSet
Set parameterSets1 = parameterSet1.ParameterSets
Set parameterSet2 = parameterSets1.GetItem("SubParameterSet")
Set parameter=parameterSet2.AllParameters
Set parametertochange=parameter.GetItem("ParameterInSubParameterSet")
Set lenght1=parametertochange
lenght1.Value=35.000
part1.Update
End Sub