Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Using "ug_setPartAttrValue" to set a string attribute with Multiple Values

Status
Not open for further replies.

3dr

Automotive
Jul 10, 2004
456
Using “Attribute Templates”
I’ve set up a string attribute with “Allow Multiple Values” checked.

I can link the children of that attribute into the expression system
Example: If the Name of the attribute is “REV”
The linked children (Multiple values) show up as in the expression system...
REV[0]
REV[1]
REV[2]
And so on…

The question is...
I want to write to the “REV[1]” attribute using “ug_setPartAttrValue”
Using this syntax in the expression system
ug_setPartAttrValue("REV[1]",A1)

It will only populate REV[0) which is the first attribute in the list rather than the second in the list.
So it is respecting the basic name attribute name "REV" but it only places the value in the first value slot of [0]

What expression syntax will allow me to write to the specific children of that attribute???

TIA for any help on this one!


Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Replies continue below

Recommended for you

Correction to that....
ug_setPartAttrValue("REV",A1) only writes to the [0] slot
Not ug_setPartAttrValue("REV[1]",A1)

The target attribute is in between the quote marks.
Whatever you put in there is created if doesn't already exist.
There are no reserve characters when creating an attribute.
The system will literally accept any thing your keyboard will make.



Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Attribute arrays are still fairly new to NX (NX 9ish time frame?). The KF function (ug_setPartAttrValue) may not have been updated to deal with the new attribute arrays. I'd suggest contacting GTAC to see if this is a know issue and, if so, if there is a workaround or new function available.

www.nxjournaling.com
 
Thanks Cowski... I did call it in and it's been forwarded to development.

I'll post the answer here when I get one.
Hope it's not a "can't do". It might be since that command isn't exactly a thing they want to support anymore.

Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
It is a Knowledge Fusion (KF) function; the KF language is still in active support/development. There is likely a new KF function for use with attribute arrays; they often keep the older functions "as-is" so as to not break custom code that users have written. Of course, there is also a chance that it was just overlooked during development, there is no new function, and you are the first person to notice...

www.nxjournaling.com
 
Good to know it hasn't been dropped.
If I get lucky and there is a new function for it It'll be a very nice gain.

I'll be able to bury a lot of attributes that clutter the Bulk Editor interface.

Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
The answer from development is "No can do"
There is no function for that.

I've asked if it will be supported in the future.

Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Seriously.

Allow multiple values is perfect for recording Revision type data that repeats with the same categories.
When using the Bulk editor, you just see an array field, behind it can be buried multiple attributes that would otherwise be cluttering up the screen.

I'm bummed... wanted to loose a whole bunch of attributes this way.



Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Array attributes can be accessed through the NXOpen API (journals or compiled code); but that wouldn't integrate as well with the expression system as KF does. I don't know if this helps you or not...

www.nxjournaling.com
 
I would be happy with that... a journal would work fine too.
It would just need to run "Update For External Change" first, then update the Revision Attributes with the corresponding expression value.

But alas, writing it is over my head.






Dave
Automotive Tooling / Aircraft Tooling / Ground Support Structures

NX11, Win 10 Pro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor