Accessing user parameters

Hello everybody,

I am new to NX programming and I created a face selection UI.
Is it possible to access the user parameters from the selected face?
I haven't really found a solution online because the face selection
is a taggedobject and you can only access the user parameters if its
an NXopen object, can i convert this or are there other ways around?

Thank you in advance.

If you are using "Option Strict Off" in your code, you can assign the tagged object to a variable of the proper type and the compiler will do the conversion for you; something like the following:

Dim myTaggedObject as TaggedObject = Nothing
'code does something here to get a reference to a tagged object
'
'
dim myFaceObject as Face = Nothing

If typeOf(myTaggedObject) Is NXOpen.Face then
'the object will be converted when we assign it to the new variable
myFaceObject = myTaggedObject
end if

'do something with myFaceObject

If you are using "Option Strict On" in your code, you will need to use one of the cast operators to explicitly convert the object.

https://msdn.microsoft.com/en-us/library/hcb26cc8.aspx

https://www.dotnetperls.com/trycast

Thank you very much, works perfect !