03-25-2024
02:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-25-2024
02:13 PM
Hello.
I have a code that allows you to create and delete a parameter.
But the problem is that when creating a parameter using code, it is created not as a multi-valued parameter, but as a single parameter. At the same time, the program does not issue any errors.
If I understand correctly, the logic of the ArrayList code is broken.
Please help me solve this problem.
Thank you.
'MultiValue.SetList("Capacity_Type", "Container CIP solutions", "Pressure_damping_capacity") 'Capacity_Type = "Container CIP solutions" Dim oParams As Parameters Dim oAssemblyDoc As AssemblyDocument = ThisDoc.Document Dim oAssemblyCompDef As AssemblyComponentDefinition = oAssemblyDoc.ComponentDefinition Dim oComp As AssemblyComponentDefinition = oAssemblyDoc.ComponentDefinition oParams = oAssemblyCompDef.Parameters Dim oUPs As UserParameters = oComp.Parameters.UserParameters Dim oUP As UserParameter Dim ParamName As String = "Diameter_of_the_intake_pipe" Dim List As New ArrayList List.Add("80") List.Add("100") List.Add("125") List.Add("150") If Capacity_Type = "Container CIP solutions" Then Try Test = oUPs.Item(ParamName).Value Catch oUP = oUPs.AddByExpression(ParamName, List.Item(3), UnitsTypeEnum.kMillimeterLengthUnits) Parameter("Container CIP:1", "Diameter_of_the_intake_pipe") = Parameter(ParamName) End Try ElseIf Capacity_Type = "Pressure_damping_capacity" Then Try oUP = oUPs.Item(ParamName) oUP.Delete Catch End Try Parameter("Container CIP:1", "Diameter_of_the_intake_pipe") = False End If
Solved! Go to Solution.