×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Attribute updated by journal, how to control the context? (ObjectOptions is obsolete)

Attribute updated by journal, how to control the context? (ObjectOptions is obsolete)

Attribute updated by journal, how to control the context? (ObjectOptions is obsolete)

(OP)
Hi Everyone,

A lot of my journals use the "AttributePropertiesBaseBuilder.ObjectOptions" Enumeration to define in which context the attribute will be created. However, it appears that starting from NX8.5 this Enumeration is obsolete. The help documentation says:

("Deprecated in NX8.5.0. Use AttributePropertiesBaseBuilder.SetAttributeObjects instead.")

However, it is unclear to me how this method replaces the "ObjectOptions". How could you use SetAttributeObjects to specify that you want this attribute to be applied to all instances, or only one occurrence, or the part itself...

As an example, here is a snippet of code I use to apply the same CALLOUT to multiple components, how could I implement the new method in this script?

CODE --> VB

For Each tempComp As Component in CompList

	' ----------------------------------------------
	'   Update of the CALLOUT attribute
	' ----------------------------------------------
	objects(0) = tempComp

	attributePropertiesBuilder1 = workpart.PropertiesManager.CreateAttributePropertiesBuilder(objects)
	attributePropertiesBuilder1.ObjectPicker = AttributePropertiesBaseBuilder.ObjectOptions.ComponentInstance
	attributePropertiesBuilder1.DataType = AttributePropertiesBaseBuilder.DataTypeOptions.String
	attributePropertiesBuilder1.Category = "DB Component Instance"
	attributePropertiesBuilder1.IsReferenceType = False
	attributePropertiesBuilder1.Title = "CALLOUT"
	attributePropertiesBuilder1.IsArray = False
	attributePropertiesBuilder1.StringValue = StartCallout.ToString()
	'CStr(Int((1000 - 0 + 1) * Rnd) + 0)
	attributePropertiesBuilder1.Commit()
				
	Processed = Processed + 1

Next 

Etienne
NX8.5.3.3 + TC9.1.2.2

RE: Attribute updated by journal, how to control the context? (ObjectOptions is obsolete)

Looks like SetAttributeObjects(NXObject[]) accepts array of NXObjects. So to assign part attribute you pass in the Part object, to assign attribute to instances you pass in NXOpen.Assemblies.Component objects and to assign Component attribute you pass in workPart.ComponentAssembly.RootComponent object.

I think to assign attributes to all occurrences you need to pass in all the component instances now. Even interactively I could not find the option to apply attributes to all occurrences.

Suresh
www.technisites.com.au

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources