jzecha
Aerospace
- Jan 20, 2016
- 236
So I am creating an optimized Bounding Box for my company based on some of the other codes I have found and have run into a problem.
I have created multiple bounding boxes and created a Parameter for each boxes' volume.
I have then used those Parameters to try and create an Array that I want to go through and find the smallest volume which would be the smallest Bounding Box.
A couple questions I have:
How do I count the number of Parameters in the Parameter Set?
Every result I have gotten also includes Parameters from the part design itself.
The bigger question, I struggle with the recursive i functions.
Can someone help me out with a way to go through all the parameters and find the smallest value?
Here is the section of code I am working on:
I have created multiple bounding boxes and created a Parameter for each boxes' volume.
I have then used those Parameters to try and create an Array that I want to go through and find the smallest volume which would be the smallest Bounding Box.
A couple questions I have:
How do I count the number of Parameters in the Parameter Set?
Every result I have gotten also includes Parameters from the part design itself.
The bigger question, I struggle with the recursive i functions.
Can someone help me out with a way to go through all the parameters and find the smallest value?
Here is the section of code I am working on:
Code:
Dim strParam10 As StrParam
Set strParam10 = oParameter.Item("Inertia_Bounding_Box 0 Degrees")
Dim strParam11 As StrParam
Set strParam11 = oParameter.Item("Inertia_Bounding_Box 10 Degrees")
Dim strParam12 As StrParam
Set strParam12 = oParameter.Item("Inertia_Bounding_Box 20 Degrees")
Dim strParam13 As StrParam
Set strParam13 = oParameter.Item("Inertia_Bounding_Box 30 Degrees")
Dim strParam14 As StrParam
Set strParam14 = oParameter.Item("Inertia_Bounding_Box 40 Degrees")
Dim strParam15 As StrParam
Set strParam15 = oParameter.Item("Inertia_Bounding_Box 50 Degrees")
Dim strParam16 As StrParam
Set strParam16 = oParameter.Item("Inertia_Bounding_Box 60 Degrees")
Dim strParam17 As StrParam
Set strParam17 = oParameter.Item("Inertia_Bounding_Box 70 Degrees")
Dim strParam18 As StrParam
Set strParam18 = oParameter.Item("Inertia_Bounding_Box 80 Degrees")
'MsgBox strParam17.Value
'MsgBox ("Parameter Count " & oParameter.Count)
'selection1.Search "CATKnowledgeSearch.InternalParameter.Name=*Inertia_Bounding_Box*,all"
Dim BoundingBoxVolumes(8) As Double
SmallestVolume(0) = (strParam10.Value)
SmallestVolume(1) = (strParam11.Value)
SmallestVolume(2) = (strParam12.Value)
SmallestVolume(3) = (strParam13.Value)
SmallestVolume(4) = (strParam14.Value)
SmallestVolume(5) = (strParam15.Value)
SmallestVolume(6) = (strParam16.Value)
SmallestVolume(7) = (strParam17.Value)
SmallestVolume(8) = (strParam18.Value)