Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EKL Parameter Search 2

Status
Not open for further replies.

Caprig4005

Aerospace
Dec 5, 2011
14
0
0
US
Does anyone know of a way to search through a parameter list for a specific named parameter and use its related value in a UDF? I have been trying to get some automation done using EKL and right now all I have been able to do is put the name or the value of the parameter in a list but I have not been able to tie the two items together. I would like the code to either search for a parameter name and return a specific value or search through the list of parameter names and return the integer location in the list and then use GetItem to pull that specific value from the parameter value list.

Any help or insight into getting this to work would be greatly appreciated. Thanks.

Ryan Capriglione
NX/CATIA Power User
 
Replies continue below

Recommended for you

let myString (String)
Set myString = myParameterSet.GetAttributeString("MyStringParamameterName")

Eric N.
indocti discant et ament meminisse periti
 
playing with 2 lists one for name , one for value is not the easiest solution, better GetAttributeXXX ("name") from parameter father

Eric N.
indocti discant et ament meminisse periti
 
The Set myString code did not grab the parameter value.

At the end of this I am trying to iterate through a list of different pocket lists. So I need to start with BAY1_ZN1 and end with, say, BAY4_ZN6. I want to be able to search a specific parameter based on BAY and ZONE. I have several parameters that relate to those items. If I can't pull the exact parameter value via the parameter name, I thought being able to pull integer location from searching through the name list would get me the right parameter value.

Ryan Capriglione
NX/CATIA Power User
 
did you define myParametersSet according to your Part / Product ?

I really suggest you focus on finding your parameter from name using GetAttributesXXX ("the name")

Eric N.
indocti discant et ament meminisse periti
 
Caprig4005, something along these lines:
I have a parameter called PLATFORM in my root param set, the one called Parameters:

let myString (String)
let myParameterSet (AdvisorParameterSet)

myParameterSet =Parameters
set myString=myParameterSet.GetAttributeString("PLATFORM")
Message("Value: ", myString)


regards,
LWolf
 
LWolf,

That code unfortunately does not return the value of the parameter in my parameter tree. The parameter I am searching for is outside of the Knowledge Pattern Editor.

If you look at the attachment, I am looking for a simple way to grab a specific parameter, say SKIN_POCKET_THK_BAY2_ZN4, and its value in a UDF. I found a way to do it in V6 using ValuePointer but the command that I could use in V6 does not exist in V5. I need to grab the parameter using iterators as well as I move bay-by-bay and zone-by-zone.

The other option that I was looking at was to find the location in a list of the specific name of the parameter and the use that location as an integer to pull the parametric value from a list of the length values.

I'm sorry if this seems like it is going around and around but I am fairly new to using EKL and I am still unsure how to use some of the commands within EKL.

Your help has been greatly appreciated.


Ryan Capriglione
NX/CATIA Power User
 
 https://files.engineering.com/getfile.aspx?folder=679465eb-3737-4d34-b637-5a85fe35dcaf&file=Parameter_Tree.jpg
so you have to find the parameterset "Parameters.Skin_POCKET_THK" then do a GetAttributesReal ("SKIN_POCKET_THK_BAYx_ZNy ")


Code:
let myPocketPS (AdvisorParameterSet) 
set myPocketPS =  GetRootUI().Find("AdvisorParameterSet", "x.Name==\"Parameters.SKIN_POCKET_THK\" ", true)

let myValue(LENGTH)
myValue = myPocketPS.GetAttributeReal ("SKIN_POCKET_THK_BAY1_ZN2")*1m

Message("#", myValue)



Eric N.
indocti discant et ament meminisse periti
 
Thank you for the help.

Here is what I ended up with that seems work well:

Code:
Let myPocketPS (AdvisorParameterSet)
Let myValue (LENGTH)

Let iInt (Integer)
Let jInt (Integer)

Let sPocket (String)

iInt = 1
jInt = 1

sPocket = "SKIN_POCKET_THK_BAY" + ToString(iInt) + "_ZN" + ToString(jInt)

myPocketPS = `Parameters.SKIN_POCKET_THK` 
myValue = myPocketPS -> GetAttributeReal(sPocket)

Message("#", myValue)

Let me know if you think I am missing something. The GetRootUI() command is not available to me.

Thanks again for your help working through this.

Ryan Capriglione
NX/CATIA Power User
 
Status
Not open for further replies.
Back
Top