NXOpen .NET Reference  12.0.0
Public Types | Public Member Functions | Properties | List of all members
NXOpen.AttributeTemplatesBuilder Class Reference

Represents an NXOpen.AttributeTemplatesBuilder to be used when creating attribute templates. More...

Inheritance diagram for NXOpen.AttributeTemplatesBuilder:
NXOpen.Builder NXOpen.GeometricUtilities.IComponentBuilder

Public Types

enum  TemplatesOptions { Part, Catalog }
 Specifies the templates option when setting or displaying templates. More...
 
enum  ConstraintOptions {
  None, UpperLimit, LowerLimit, UpperAndLowerLimit,
  List
}
 Specifies the constraint data associated with the template. More...
 
enum  DefaultBooleanOptions { True, False }
 Specifies the default value for a template of type Boolean. More...
 
enum  AccessKey {
  Part, ReferenceSet, ComponentInstance, ComponentOccurrence,
  Objects
}
 Specifies the available access keys that determine which objects will have access to this attribute template. More...
 

Public Member Functions

unsafe string[] GetIntegerList ()
 Returns the integer list. More...
 
unsafe void SetIntegerList (string[] integerList)
 Sets the integer list. More...
 
unsafe string[] GetNumberList ()
 Returns the number list. More...
 
unsafe void SetNumberList (string[] numberList)
 Sets the number list. More...
 
unsafe string[] GetStringList ()
 Returns the string list. More...
 
unsafe void SetStringList (string[] stringList)
 Sets the string list. More...
 
unsafe string[] GetNote ()
 Returns the note. More...
 
unsafe void SetNote (string[] note)
 Sets the note. More...
 
unsafe void ImportCatalog ()
 Imports templates from a specified external catalog. More...
 
unsafe void ExportCatalog ()
 Exports templates to a specified external catalog. More...
 
unsafe void UpdateTemplates ()
 Update templates in the part from the external catalog defined in customer defaults. More...
 
unsafe bool Delete (string title, NXOpen.AttributePropertiesBaseBuilder.DataTypeOptions type)
 Delete an attribute template by specifying the title and type of the template. More...
 
unsafe
NXOpen.AttributeTemplatesBuilder.AccessKey[] 
GetAccessKeys ()
 Get the access keys. More...
 
unsafe void SetAccessKeys (NXOpen.AttributeTemplatesBuilder.AccessKey[] accessKeys)
 Set the access keys. More...
 
unsafe void AddAccessKey (NXOpen.AttributeTemplatesBuilder.AccessKey accessKey)
 Add a new access key to the list of access keys. More...
 
unsafe void RemoveAccessKey (NXOpen.AttributeTemplatesBuilder.AccessKey accessKey)
 Remove an access key from the list of access keys. More...
 
- Public Member Functions inherited from NXOpen.Builder
unsafe NXOpen.NXObject Commit ()
 Commits any edits that have been applied to the builder. More...
 
unsafe void Destroy ()
 Deletes the builder, and cleans up any objects created by the builder. More...
 
unsafe NXOpen.NXObject[] GetCommittedObjects ()
 For builders that create more than one object, this method returns the objects that are created by commit. More...
 
unsafe NXOpen.NXObject GetObject ()
 Returns the object currently being edited by this builder. More...
 
unsafe void ShowResults ()
 Updates the model to reflect the result of an edit to the model for all builders that support showing results. More...
 
unsafe bool Validate ()
 Validate whether the inputs to the component are sufficient for commit to be called. More...
 

Properties

unsafe string Alias [get, set]
 Returns or sets the Alias. More...
 
unsafe bool AllowMultipleValues [get, set]
 Returns or sets the flag specifying if an attribute can contain multiple values. More...
 
unsafe string CatalogFilename [get, set]
 Returns or sets the catalog filename. More...
 
unsafe string Category [get, set]
 Returns or sets the category. More...
 
unsafe
NXOpen.AttributeTemplatesBuilder.ConstraintOptions 
Constraint [get, set]
 Returns or sets the constraint. More...
 
unsafe bool CopyAttributeOnObjectCopy [get, set]
 Returns or sets the flag specifying whether the attribute should be copied when the object is copied. More...
 
unsafe
NXOpen.AttributePropertiesBaseBuilder.DataTypeOptions 
DataType [get, set]
 Returns or sets the data type. More...
 
unsafe NXOpen.DateBuilder DateConstraint [get]
 Returns the date constraint. More...
 
unsafe
NXOpen.AttributeTemplatesBuilder.DefaultBooleanOptions 
DefaultBoolean [get, set]
 Returns or sets the default boolean. More...
 
unsafe NXOpen.DateBuilder DefaultDate [get]
 Returns the default date. More...
 
unsafe int DefaultInteger [get, set]
 Returns or sets the default integer. More...
 
unsafe double DefaultNumber [get, set]
 Returns or sets the default number. More...
 
unsafe string DefaultString [get, set]
 Returns or sets the default string. More...
 
unsafe bool EnforcedConstraints [get, set]
 Returns or sets the enforced constraints. More...
 
unsafe bool LockOnSave [get, set]
 Returns or sets the flag specifying if the attribute should be locked on save. More...
 
unsafe int MaxInteger [get, set]
 Returns or sets the max integer. More...
 
unsafe double MaxNumber [get, set]
 Returns or sets the max number. More...
 
unsafe string MaxString [get, set]
 Returns or sets the max string. More...
 
unsafe int MinInteger [get, set]
 Returns or sets the min integer. More...
 
unsafe double MinNumber [get, set]
 Returns or sets the min number. More...
 
unsafe string MinString [get, set]
 Returns or sets the min string. More...
 
unsafe bool Persistent [get, set]
 Returns or sets the persistent flag. More...
 
unsafe string ProxyAttributeForLocking [get, set]
 Returns or sets the proxy attribute for locking. More...
 
unsafe
NXOpen.AttributeTemplatesBuilder.TemplatesOptions 
Templates [get, set]
 Returns or sets the templates option. More...
 
unsafe string Title [get, set]
 Returns or sets the title. More...
 
unsafe string Units [get, set]
 Returns or sets the units. More...
 

Detailed Description

Represents an NXOpen.AttributeTemplatesBuilder to be used when creating attribute templates.

An attribute template is optional for an attribute and lives in the depository. It's main purpose is to provide extra data to further describe a referencing attribute. All attributes that are created from a template will take on the characteristics of the template, most notable the title, type, and units (for templates of type number only). The template contains other data, such as input assisting data (ranges and lists of values) to be used when creating a value on the attribute. The template may also contain a category, which allows attributes to be grouped together and easily sorted. A note may also be set on a template to provide further description about a referencing attribute.

Each template must contain a unique title and a type. If the type is number, then the units must also be set. All other data is optional.

There are six types of attribute templates: Null, Boolean, Integer, Number, String, and Date. Each type requires a title, type, and can optionally contain a note and a category. Other data varies depending on the type. Below describes the differences betweeen the types.

Null - No other data can be set for a template of type Null.

Boolean - A default boolean can be set to True or False. This can be set by calling SetDefaultBoolean.

Integer - A default integer can be set to assist when creating an attribute referencing an integer template. The integer type also allows for constraints to be set. If the constraint is set to Range, then the min integer and max integer need to be set to define the range. If the constraint is set to List, then the value integer list will need to be set to define the acceptable list of values. If constraint is set to None, then no constraints will be enforced. The default value must comply with all constraints in order for the template to be created successfully.

Number - A default floating point number and constraints can be set in the exact same fashion as with the integer, the only difference being that the number fields will be used instead of the integer fields. The units must be set to define the template's measure. Only the measure (Length, Area, Volume, etc) is considered required information, the units themselves (mm, kg, etc) will only be used along with the default value as input assistance when creating an attribute referencing a number template.

String - A default string can be set. The string type also allows for a list of values to be set as input assistance. To do this, the constraint must be set to List and the string list will need to be populated with the desired values. The string type does not allow for the constraint to be set to Range, it must be set to either List or None. The default string must be contained in the list of values if Constraint is set to List.

Date - No other data can be set for a template of type Date. The current date will always be used as input assistance when creating an attribute referencing a date template.

This class will also allow for the import and export of attribute templates. The export feature will save all templates currently in the depository to an external catalog file so they can be imported at a later time to another part file. To use this feature, the catalog filename must be set to specify the external file. Similarly, the import feature will take all templates contained in the specified catalog file and instantiate them in the part. If the title, type, or measure of an imported template conflicts with a template already in the depository, then the template will not be imported. If the optional data of an imported template conflicts with a template already in the depository, then the data from the imported template will overwrite the data in the depository.

To create a new instance of this class, use NXOpen.PropertiesManager.CreateAttributeTemplatesBuilder

Default values.

Property Value

Constraint

None

CopyAttributeOnObjectCopy

True

DataType

String

DefaultBoolean

True

DefaultInteger

0

DefaultNumber

0

MaxInteger

0

MaxNumber

0

MinInteger

0

MinNumber

0

ProxyAttributeForLocking

Created in NX8.0.0

Member Enumeration Documentation

Specifies the available access keys that determine which objects will have access to this attribute template.

Enumerator
Part 

This attribute template will be accessible by parts

ReferenceSet 

This attribute template will be accessible by reference sets

ComponentInstance 

This attribute template will be accessible by component instances

ComponentOccurrence 

This attribute template will be accessible by component occurrences

Objects 

This attribute template will be accessible by all non-part related objects including solids, features, etc

Specifies the constraint data associated with the template.

All constraints are enabled for templates of type integer, number, string, and date.

Enumerator
None 

No constraint data, no further action is needed

UpperLimit 

This template has an upper limit but no lower limit.

The max value must be set. Available for integer, number, string, and date types.

LowerLimit 

This template has a lower limit but no upper limit.

The min value must be set. Available for integer, number, string, and date types.

UpperAndLowerLimit 

This template has a lower limit and an upper limit.

The min and max must also be set. Available for integer, number, string, and date types.

List 

List of values, the value list must also be set.

Only available for integer, number, and string types.

Specifies the default value for a template of type Boolean.

Enumerator
True 

True

False 

False

Specifies the templates option when setting or displaying templates.

Enumerator
Part 

Templates currently residing in the part

Catalog 

Templates currently residing in the loaded catalog.

These are initially loaded from the external file specified in customer defaults and can be managed using Import and Export. Each template in the catalog can be defined as persistent or transient. A persistent template will be copied into the part when an attribute is created. A transient template will assist in the creation of an attribute but will not be stored in the part.

Member Function Documentation

unsafe void NXOpen.AttributeTemplatesBuilder.AddAccessKey ( NXOpen.AttributeTemplatesBuilder.AccessKey  accessKey)

Add a new access key to the list of access keys.

If this access key alreadys exists, it will not be added.

Created in NX8.0.0

License requirements: None.

Parameters
accessKey
unsafe bool NXOpen.AttributeTemplatesBuilder.Delete ( string  title,
NXOpen.AttributePropertiesBaseBuilder.DataTypeOptions  type 
)

Delete an attribute template by specifying the title and type of the template.

The template will be deleted from the depository specified by the current Templates Option. The deleted flag will return true if the template was successfully deleted.

Created in NX8.0.0

License requirements: None.

Parameters
title
type
Returns
unsafe void NXOpen.AttributeTemplatesBuilder.ExportCatalog ( )

Exports templates to a specified external catalog.

All templates from the loaded catalog will be saved to disk at the location specified by the catalog filename. Any templates the previously existed in the external catalog will be deleted.

The catalog filename must be set to the location of the external catalog on disk.

Created in NX8.0.0

License requirements: None.

unsafe NXOpen.AttributeTemplatesBuilder.AccessKey [] NXOpen.AttributeTemplatesBuilder.GetAccessKeys ( )

Get the access keys.

The access keys define which objects will have access to this attribute template.

Created in NX8.0.0

License requirements: None.

Returns
unsafe string [] NXOpen.AttributeTemplatesBuilder.GetIntegerList ( )

Returns the integer list.

Only valid if the type is Integer and the contraint is set to list.

Created in NX8.0.0

License requirements: None.

Returns
unsafe string [] NXOpen.AttributeTemplatesBuilder.GetNote ( )

Returns the note.

Optional data for templates of all types.

Created in NX8.0.0

License requirements: None.

Returns
unsafe string [] NXOpen.AttributeTemplatesBuilder.GetNumberList ( )

Returns the number list.

Only valid if the type is Number and the contraint is set to list.

Created in NX8.0.0

License requirements: None.

Returns
unsafe string [] NXOpen.AttributeTemplatesBuilder.GetStringList ( )

Returns the string list.

Only valid if the type is String and the contraint is set to list.

Created in NX8.0.0

License requirements: None.

Returns
unsafe void NXOpen.AttributeTemplatesBuilder.ImportCatalog ( )

Imports templates from a specified external catalog.

The current catalog of templates will be erased and replaced with the templates from the external catalog. Import will not instantiate templates in the part, it only modifies what templates are currently available in the loaded catalog.

The catalog filename must be set to the location of the external catalog on disk.

Created in NX8.0.0

License requirements: None.

unsafe void NXOpen.AttributeTemplatesBuilder.RemoveAccessKey ( NXOpen.AttributeTemplatesBuilder.AccessKey  accessKey)

Remove an access key from the list of access keys.

Created in NX8.0.0

License requirements: None.

Parameters
accessKey
unsafe void NXOpen.AttributeTemplatesBuilder.SetAccessKeys ( NXOpen.AttributeTemplatesBuilder.AccessKey[]  accessKeys)

Set the access keys.

The access keys define which objects will have access to this attribute template. If no access keys are provided, the attribute template will be visible to all objects.

Created in NX8.0.0

License requirements: None.

Parameters
accessKeys
unsafe void NXOpen.AttributeTemplatesBuilder.SetIntegerList ( string[]  integerList)

Sets the integer list.

Must be set if the type is Integer and the contraint is set to list. The default integer value must be contained in this list.

Created in NX8.0.0

License requirements: None.

Parameters
integerList
unsafe void NXOpen.AttributeTemplatesBuilder.SetNote ( string[]  note)

Sets the note.

Optional data for templates of all types.

Created in NX8.0.0

License requirements: None.

Parameters
note
unsafe void NXOpen.AttributeTemplatesBuilder.SetNumberList ( string[]  numberList)

Sets the number list.

Must be set if the type is Number and the contraint is set to list. The default number value must be contained in this list.

Created in NX8.0.0

License requirements: None.

Parameters
numberList
unsafe void NXOpen.AttributeTemplatesBuilder.SetStringList ( string[]  stringList)

Sets the string list.

Must be set if the type is String and the contraint is set to list. The default string value must be contained in this list.

Created in NX8.0.0

License requirements: None.

Parameters
stringList
unsafe void NXOpen.AttributeTemplatesBuilder.UpdateTemplates ( )

Update templates in the part from the external catalog defined in customer defaults.

The title and type must match for the update to take place.

Created in NX8.0.0

License requirements: None.

Property Documentation

unsafe string NXOpen.AttributeTemplatesBuilder.Alias
getset

Returns or sets the Alias.

This is the alias or synonym for the title of the template and must be unique.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe bool NXOpen.AttributeTemplatesBuilder.AllowMultipleValues
getset

Returns or sets the flag specifying if an attribute can contain multiple values.

If true, then any attributes created from this template will be treated as a VLA (variable length array) and will support multiple values.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.CatalogFilename
getset

Returns or sets the catalog filename.

Used during import and export of catalogs. This should be set to a full path location on disk.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.Category
getset

Returns or sets the category.

Optional category for templates of all types. This allows for templates to be grouped together.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe NXOpen.AttributeTemplatesBuilder.ConstraintOptions NXOpen.AttributeTemplatesBuilder.Constraint
getset

Returns or sets the constraint.

Informs the template which method of constraints to use. If constraints are used the default value must satisfy the given constraints. Constraints are supported by templates of type Integer, Number, String, and Date.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe bool NXOpen.AttributeTemplatesBuilder.CopyAttributeOnObjectCopy
getset

Returns or sets the flag specifying whether the attribute should be copied when the object is copied.

If false, the attribute copy is disallowed.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe NXOpen.AttributePropertiesBaseBuilder.DataTypeOptions NXOpen.AttributeTemplatesBuilder.DataType
getset

Returns or sets the data type.

Must be set for each template and cannot be changed once the template has been created.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe NXOpen.DateBuilder NXOpen.AttributeTemplatesBuilder.DateConstraint
get

Returns the date constraint.

Only used if the data type is Date. The default date must satisfy the constraints defined by this object.

Created in NX8.0.0

License requirements: None.

unsafe NXOpen.AttributeTemplatesBuilder.DefaultBooleanOptions NXOpen.AttributeTemplatesBuilder.DefaultBoolean
getset

Returns or sets the default boolean.

Optional default value for a template of type Boolean.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe NXOpen.DateBuilder NXOpen.AttributeTemplatesBuilder.DefaultDate
get

Returns the default date.

Optional if no date constraints exists, otherwise it must satisfy the constraint data.

Created in NX8.0.0

License requirements: None.

unsafe int NXOpen.AttributeTemplatesBuilder.DefaultInteger
getset

Returns or sets the default integer.

Optional if the constraint is set to None, otherwise it must satisfy the constraint data.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe double NXOpen.AttributeTemplatesBuilder.DefaultNumber
getset

Returns or sets the default number.

Optional if the constraint is set to None, otherwise it must satisfy the constraint data.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.DefaultString
getset

Returns or sets the default string.

Optional if the constraint is set to None, otherwise it must satisfy the constraint data.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe bool NXOpen.AttributeTemplatesBuilder.EnforcedConstraints
getset

Returns or sets the enforced constraints.

Determines if the template constraints will be enforced.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe bool NXOpen.AttributeTemplatesBuilder.LockOnSave
getset

Returns or sets the flag specifying if the attribute should be locked on save.

If true, then any attributes created from this template will become locked when the part is saved (and reloaded).

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe int NXOpen.AttributeTemplatesBuilder.MaxInteger
getset

Returns or sets the max integer.

Only to be set if the data type is Integer and the constraint specifies an upper limit. The default integer value must be less than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe double NXOpen.AttributeTemplatesBuilder.MaxNumber
getset

Returns or sets the max number.

Only to be set if the data type is Number and the constraint specifies an upper limit. The default number value must be less than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.MaxString
getset

Returns or sets the max string.

Only to be set if the data type is String and the constraint specifies an upper limit. The default string value must be less than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe int NXOpen.AttributeTemplatesBuilder.MinInteger
getset

Returns or sets the min integer.

Only to be set if the data type is Integer and the constraint specifies a lower limit. The default integer value must be greater than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe double NXOpen.AttributeTemplatesBuilder.MinNumber
getset

Returns or sets the min number.

Only to be set if the data type is Number and the constraint specifies a lower limit. The default number value must be greater than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.MinString
getset

Returns or sets the min string.

Only to be set if the data type is String and the constraint specifies a lower limit. The default string value must be greater than or equal to this value.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe bool NXOpen.AttributeTemplatesBuilder.Persistent
getset

Returns or sets the persistent flag.

If a template is marked as persistent, then the template will be saved with the part when a template attribute is created. This flag is only used when editing templates in the catalog file, during which the default is false. If editing templates in the part, the template will be created in the part, making it persistent by definition.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.ProxyAttributeForLocking
getset

Returns or sets the proxy attribute for locking.

This must be PDM attribute available in the Access Control List. This functionality is available only in managed mode. Specify relevent proxy attribute based on NXOpen.AttributeTemplatesBuilder.TemplatesOptions .

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe NXOpen.AttributeTemplatesBuilder.TemplatesOptions NXOpen.AttributeTemplatesBuilder.Templates
getset

Returns or sets the templates option.

This option determines which set of templates will be modified.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.Title
getset

Returns or sets the title.

This is the identifier of the template and must be unique.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.

unsafe string NXOpen.AttributeTemplatesBuilder.Units
getset

Returns or sets the units.

Represents the units associated with a template of type Number.

Created in NX8.0.0

License requirements to get this property: None.

License requirements to set this property: None.


The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.