erpj
Aerospace
- Jul 15, 2011
- 24
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?
Etienne
NX8.5.3.3 + TC9.1.2.2
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:
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