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?
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)
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