NX Open C++ Reference Guide
|
Associative text class creates text associated to object and part attributes as well as object properties such as a drawing sheet name. More...
Public Member Functions | |
NXString | GetEvaluatedText (NXOpen::Annotations::Annotation *ann, const NXString &text) |
Evaluate the associative text specified. More... | |
NXString | GetEvaluatedText (NXOpen::Annotations::Annotation *ann, const char *text) |
Evaluate the associative text specified. More... | |
bool | GetObjectAttribute (const NXString &text, NXOpen::NXObject **object, NXString *attributeTitle) |
Returns the title and owning object of the object attribute referenced in the associative text. More... | |
bool | GetObjectAttribute (const char *text, NXOpen::NXObject **object, NXString *attributeTitle) |
Returns the title and owning object of the object attribute referenced in the associative text. More... | |
NXString | GetObjectAttributeText (NXOpen::NXObject *object, const NXString &attributeTitle) |
Returns the associative text for the input object and attribute title. More... | |
NXString | GetObjectAttributeText (NXOpen::NXObject *object, const char *attributeTitle) |
Returns the associative text for the input object and attribute title. More... | |
NXString | GetObjectPropertyText (NXOpen::NXObject *object, NXOpen::Annotations::AssociativeText::PropertyType type) |
Returns the associative text for the input object and its property. More... | |
bool | GetPartAttribute (const NXString &text, NXString *attributeTitle) |
Returns the title of the part attribute referenced in the associative text. More... | |
bool | GetPartAttribute (const char *text, NXString *attributeTitle) |
Returns the title of the part attribute referenced in the associative text. More... | |
NXString | GetPartAttributeText (const NXString &attributeTitle) |
Returns the associative text for the part attribute title. More... | |
NXString | GetPartAttributeText (const char *attributeTitle) |
Returns the associative text for the part attribute title. More... | |
virtual | ~AssociativeText () |
Frees the object from memory. More... | |
Public Member Functions inherited from NXOpen::TransientObject | |
void * | GetHandle () |
Handle of the internal object represented by this object. More... | |
Associative text class creates text associated to object and part attributes as well as object properties such as a drawing sheet name.
The associative text is constructed using special NX text control sequences.
The text created using this class can be added to a table cell, note text, dimension appended text etc...
Use functions in this class to query/extract information from text and create associative text.
The client shouldn't parse NX text control sequences to extract informtation. The text control sequences can change from release to release.
Created in NX8.0.0.
the associative text property type to be used with the object
|
virtual |
Frees the object from memory.
After this method is called, it is illegal to use the object. In .NET, this method is automatically called when the object is deleted by the garbage collector.
Created in NX8.0.0.
License requirements : None
NXString NXOpen::Annotations::AssociativeText::GetEvaluatedText | ( | NXOpen::Annotations::Annotation * | ann, |
const NXString & | text | ||
) |
Evaluate the associative text specified.
Convert associative text to the string that it represents. The following associative text control sequences will be evaluated: part attribute references, object attribute references, expression references, and object property references. Example: The value of part attribute "ATT1" is "Value1". The text that represents the reference to part attribute "ATT1" is "\<W\@ATT1\>" The value of expression "p1" is "3.00". The text that represents the reference to expression "p1" is "\<X0.2\@p1\>". The value of object property "\<WRef1*0\@$SH_SHEET_NAME\>" is "Sheet 1". Given the input text "\<WRef1*0\@$SH_SHEET_NAME\> \<X0.2\@p1\> \<W\@ATT1\>" the evaluated text returned will be "Sheet 1 3.00 Value1"
ann | Annotation used to determine the object property value when the object is not specified. For example, given annotation 123 and 456 where 123 resides in "Sheet 1" and 456 resides in "Sheet 2" then the evaluated text returned for the input text "\<W\@$SH_SHEET_NAME\>" for annotation 123 is "Sheet 1" and for annotation 456 is "Sheet 2" |
text | the text containing associative text to evaluate |
NXString NXOpen::Annotations::AssociativeText::GetEvaluatedText | ( | NXOpen::Annotations::Annotation * | ann, |
const char * | text | ||
) |
Evaluate the associative text specified.
Convert associative text to the string that it represents. The following associative text control sequences will be evaluated: part attribute references, object attribute references, expression references, and object property references. Example: The value of part attribute "ATT1" is "Value1". The text that represents the reference to part attribute "ATT1" is "\<W\@ATT1\>" The value of expression "p1" is "3.00". The text that represents the reference to expression "p1" is "\<X0.2\@p1\>". The value of object property "\<WRef1*0\@$SH_SHEET_NAME\>" is "Sheet 1". Given the input text "\<WRef1*0\@$SH_SHEET_NAME\> \<X0.2\@p1\> \<W\@ATT1\>" the evaluated text returned will be "Sheet 1 3.00 Value1"
ann | Annotation used to determine the object property value when the object is not specified. For example, given annotation 123 and 456 where 123 resides in "Sheet 1" and 456 resides in "Sheet 2" then the evaluated text returned for the input text "\<W\@$SH_SHEET_NAME\>" for annotation 123 is "Sheet 1" and for annotation 456 is "Sheet 2" |
text | the text containing associative text to evaluate |
bool NXOpen::Annotations::AssociativeText::GetObjectAttribute | ( | const NXString & | text, |
NXOpen::NXObject ** | object, | ||
NXString * | attributeTitle | ||
) |
Returns the title and owning object of the object attribute referenced in the associative text.
The reference is considered found if the syntax of the text control sequence reflects an object attribute reference.
Example 1: "\<WRef2*0@PartAttTitle\>" is an existing reference to part attribute "PartAttTitle" so the reference will be considered a part attribute reference. No object or title will be returned.
Example 2: "\<W@AttTitle\>" uses the part attribute syntax so the reference will be considered a part attribute reference. No object or title will be returned.
Example 3: "\<WRef1*0@ObjAttTitle\>" is an existing reference to object attribute "ObjAttTitle" so the reference will be considered an object attribute reference. The object containing the attribute and "ObjAttTitle" will be returned as the attribute title. Note that the object that contains the attribute will reside in the part that owns the associative text object.
Example 4: "\<WRef10*0@AttTitle\>" where "Ref10*0" reference does not exist will be considered an object attribute reference. No object will be returned but "AttTitle" will be returned as the attribute title. Note that the existance of "Ref10*0" is only checked for in the part that owns the associative text object.
text | the associative text to query |
object | the object |
attributeTitle | the object attribute title |
bool NXOpen::Annotations::AssociativeText::GetObjectAttribute | ( | const char * | text, |
NXOpen::NXObject ** | object, | ||
NXString * | attributeTitle | ||
) |
Returns the title and owning object of the object attribute referenced in the associative text.
The reference is considered found if the syntax of the text control sequence reflects an object attribute reference.
Example 1: "\<WRef2*0@PartAttTitle\>" is an existing reference to part attribute "PartAttTitle" so the reference will be considered a part attribute reference. No object or title will be returned.
Example 2: "\<W@AttTitle\>" uses the part attribute syntax so the reference will be considered a part attribute reference. No object or title will be returned.
Example 3: "\<WRef1*0@ObjAttTitle\>" is an existing reference to object attribute "ObjAttTitle" so the reference will be considered an object attribute reference. The object containing the attribute and "ObjAttTitle" will be returned as the attribute title. Note that the object that contains the attribute will reside in the part that owns the associative text object.
Example 4: "\<WRef10*0@AttTitle\>" where "Ref10*0" reference does not exist will be considered an object attribute reference. No object will be returned but "AttTitle" will be returned as the attribute title. Note that the existance of "Ref10*0" is only checked for in the part that owns the associative text object.
text | the associative text to query |
object | the object |
attributeTitle | the object attribute title |
NXString NXOpen::Annotations::AssociativeText::GetObjectAttributeText | ( | NXOpen::NXObject * | object, |
const NXString & | attributeTitle | ||
) |
Returns the associative text for the input object and attribute title.
object | the object |
attributeTitle | the object attribute title |
NXString NXOpen::Annotations::AssociativeText::GetObjectAttributeText | ( | NXOpen::NXObject * | object, |
const char * | attributeTitle | ||
) |
Returns the associative text for the input object and attribute title.
object | the object |
attributeTitle | the object attribute title |
NXString NXOpen::Annotations::AssociativeText::GetObjectPropertyText | ( | NXOpen::NXObject * | object, |
NXOpen::Annotations::AssociativeText::PropertyType | type | ||
) |
Returns the associative text for the input object and its property.
For example, to obtain a reference to a drawing name, the object is the Drawings::DraftingView of the Drawings::DrawingSheet . It is not the Drawings::DrawingSheet itself, but rather the type is Annotations::AssociativeText::PropertyType::DrawingSheetName .
object | the object |
type | the object property |
bool NXOpen::Annotations::AssociativeText::GetPartAttribute | ( | const NXString & | text, |
NXString * | attributeTitle | ||
) |
Returns the title of the part attribute referenced in the associative text.
Text references such as "Ref2*0" "\<WRef2*0\@title\>" must exist as a part attribute reference in the part that owns the associative text object in order to be considered part attributes. The reference is considered found if the syntax of the text control sequence reflects a part attribute reference.
Example 1: "\<WRef2*0\@PartAttTitle\>" is an existing reference to part attribute "PartAttTitle" so the reference will be considered a part attribute reference. "PartAttTitle" will be returned as the title. Note that "Ref2*0" must exist as a part attribute reference in the part that owns the associative text.
Example 2: "\<W\@AttTitle\>" uses the part attribute syntax so the reference will be considered a part attribute reference. "AttTitle" will be returned as the title.
Example 3: "\<WRef1*0\@ObjAttTitle\>" is an existing reference to object attribute "ObjAttTitle" so the reference will be considered an object attribute reference. No title will be returned.
Example 4: "\<WRef10*0\@AttTitle\>" where "Ref10*0" reference does not exist will be considered an object attribute reference. No title will be returned.
text | the text containing associative text to query |
attributeTitle | the part attribute title |
bool NXOpen::Annotations::AssociativeText::GetPartAttribute | ( | const char * | text, |
NXString * | attributeTitle | ||
) |
Returns the title of the part attribute referenced in the associative text.
Text references such as "Ref2*0" "\<WRef2*0\@title\>" must exist as a part attribute reference in the part that owns the associative text object in order to be considered part attributes. The reference is considered found if the syntax of the text control sequence reflects a part attribute reference.
Example 1: "\<WRef2*0\@PartAttTitle\>" is an existing reference to part attribute "PartAttTitle" so the reference will be considered a part attribute reference. "PartAttTitle" will be returned as the title. Note that "Ref2*0" must exist as a part attribute reference in the part that owns the associative text.
Example 2: "\<W\@AttTitle\>" uses the part attribute syntax so the reference will be considered a part attribute reference. "AttTitle" will be returned as the title.
Example 3: "\<WRef1*0\@ObjAttTitle\>" is an existing reference to object attribute "ObjAttTitle" so the reference will be considered an object attribute reference. No title will be returned.
Example 4: "\<WRef10*0\@AttTitle\>" where "Ref10*0" reference does not exist will be considered an object attribute reference. No title will be returned.
text | the text containing associative text to query |
attributeTitle | the part attribute title |
NXString NXOpen::Annotations::AssociativeText::GetPartAttributeText | ( | const NXString & | attributeTitle | ) |
Returns the associative text for the part attribute title.
attributeTitle | the part attribute title |
NXString NXOpen::Annotations::AssociativeText::GetPartAttributeText | ( | const char * | attributeTitle | ) |
Returns the associative text for the part attribute title.
attributeTitle | the part attribute title |