OptionsManager Class¶
-
class
NXOpen.Options.
OptionsManager
¶ Bases:
object
Manages options.
OptionsManager methods use an option name as a unique identifier for accessing individual options and throw an error if an option with a given name is not found. All existing option names are listed in the Online Documentation.
If a level parameter is not supplied to a query method then the option value effective in current session is returned. If a level parameter is supplied then then value that is stored at the specified level is returned. This may not be the same as the value effective in the current session and may take effect only after the session is restarted.
To obtain an instance of this class, refer to
NXOpen.Session
New in version NX4.0.0.
Methods¶
Method | Description |
---|---|
GetAllOptions | Gets the names of all available options. |
GetIntValue | Gets the value of an :py:class:` OptionsOptionType.Int < OptionsOptionType>` option. |
GetLogicalValue | Gets the value of a :py:class:` OptionsOptionType.Logical < OptionsOptionType>` option. |
GetOptionType | Returns an option’s type. |
GetRealValue | Gets the value of a :py:class:` OptionsOptionType.Real < OptionsOptionType>` option. |
GetReorderSelectableStringListValue | Gets the value of a :py:class:` OptionsOptionType.ReorderSelList < OptionsOptionType>` option. |
GetScope | Returns scope of an option. |
GetStringListValue | Gets the value of a :py:class:` OptionsOptionType.StringList < OptionsOptionType>` option. |
GetStringValue | Gets the value of a :py:class:` OptionsOptionType.String < OptionsOptionType>` option. |
GetUserComment | Returns then user comment at the specified level. |
GetUtf8stringValue | Gets the value of a :py:class:` OptionsOptionType.Utf8string < OptionsOptionType>` option. |
IsLevelLockedByDefault | Returns true if the option’s values at the specified level are locked by default. |
IsValueLocked | Returns true if the option value is locked at the specified level. |
IsValueSet | Returns true if the option value exists at the specified level. |
NewOptionsChangeList | Creates an instance of NXOpen.Options.ChangeList class, in order to edit a set of options. |
NewOptionsDraftingStandardChangeList | Creates an instance of NXOpen.Options.DraftingStandardChangeList class, in order to edit a set of options. |
Method Detail¶
GetAllOptions¶
-
OptionsManager.
GetAllOptions
¶ Gets the names of all available options.
Signature
GetAllOptions()
Returns: List of names of all available options. Return type: list of str New in version NX4.0.0.
License requirements: None.
GetIntValue¶
-
OptionsManager.
GetIntValue
¶ Overloaded method GetIntValue
GetIntValue(name)
GetIntValue(name, level)
-------------------------------------
Gets the value of an :py:class:` OptionsOptionType.Int < OptionsOptionType>` option. Throws an error if option type is not :py:class:` OptionsOptionType.Int < OptionsOptionType>`.
Signature
GetIntValue(name)
Parameters: name (str) – Option name. Returns: Option value Return type: int New in version NX4.0.0.
License requirements: None.
-------------------------------------
Gets the value of an :py:class:` OptionsOptionType.Int < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.Int < OptionsOptionType>`.
Signature
GetIntValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: int
New in version NX4.0.0.
License requirements: None.
-------------------------------------
GetLogicalValue¶
-
OptionsManager.
GetLogicalValue
¶ Overloaded method GetLogicalValue
GetLogicalValue(name)
GetLogicalValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Logical < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.Logical < OptionsOptionType>`.
Signature
GetLogicalValue(name)
Parameters: name (str) – Option name. Returns: Option value. Return type: bool New in version NX4.0.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Logical < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.Logical < OptionsOptionType>`.
Signature
GetLogicalValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: bool
New in version NX4.0.0.
License requirements: None.
-------------------------------------
GetOptionType¶
-
OptionsManager.
GetOptionType
¶ Returns an option’s type.
Signature
GetOptionType(name)
Parameters: name (str) – Option name Returns: Option type Return type: NXOpen.Options.OptionType
New in version NX4.0.0.
License requirements: None.
GetRealValue¶
-
OptionsManager.
GetRealValue
¶ Overloaded method GetRealValue
GetRealValue(name)
GetRealValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Real < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.Real < OptionsOptionType>`.
Signature
GetRealValue(name)
Parameters: name (str) – Option name. Returns: Option value. Return type: float New in version NX4.0.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Real < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.Real < OptionsOptionType>`.
Signature
GetRealValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: float
New in version NX4.0.0.
License requirements: None.
-------------------------------------
GetReorderSelectableStringListValue¶
-
OptionsManager.
GetReorderSelectableStringListValue
¶ Overloaded method GetReorderSelectableStringListValue
GetReorderSelectableStringListValue(name)
GetReorderSelectableStringListValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.ReorderSelList < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.ReorderSelList < OptionsOptionType>`.
Signature
GetReorderSelectableStringListValue(name)
Parameters: name (str) – Option name. Returns: a tuple Return type: A tuple consisting of (value, selection) value is a list of str. Option value selection is a list of bool. the selection bit New in version NX7.5.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.ReorderSelList < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.ReorderSelList < OptionsOptionType>`.
Signature
GetReorderSelectableStringListValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: a tuple
Return type: A tuple consisting of (value, selection) value is a list of str. Option value selection is a list of bool. the selection bit
New in version NX7.5.0.
License requirements: None.
-------------------------------------
GetScope¶
-
OptionsManager.
GetScope
¶ Returns scope of an option.
Signature
GetScope(name)
Parameters: name (str) – Option name Returns: Option scope Return type: NXOpen.Options.OptionsScope
New in version NX12.0.0.
License requirements: None.
GetStringListValue¶
-
OptionsManager.
GetStringListValue
¶ Overloaded method GetStringListValue
GetStringListValue(name)
GetStringListValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.StringList < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.StringList < OptionsOptionType>`.
Signature
GetStringListValue(name)
Parameters: name (str) – Option name. Returns: Option value. Return type: list of str New in version NX4.0.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.StringList < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.StringList < OptionsOptionType>`.
Signature
GetStringListValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: list of str
New in version NX4.0.0.
License requirements: None.
-------------------------------------
GetStringValue¶
-
OptionsManager.
GetStringValue
¶ Overloaded method GetStringValue
GetStringValue(name)
GetStringValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.String < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.String < OptionsOptionType>`.
Signature
GetStringValue(name)
Parameters: name (str) – Option name. Returns: Option value. Return type: str New in version NX4.0.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.String < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.String < OptionsOptionType>`.
Signature
GetStringValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: str
New in version NX4.0.0.
License requirements: None.
-------------------------------------
GetUserComment¶
-
OptionsManager.
GetUserComment
¶ Returns then user comment at the specified level.
User comments are not supported at the :py:class:` OptionsLevelType.Shipped < OptionsLevelType>` level.
Signature
GetUserComment(name, level)
Parameters: - name (str) – Option name
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: User comment text.
Return type: str
New in version NX4.0.0.
License requirements: None.
GetUtf8stringValue¶
-
OptionsManager.
GetUtf8stringValue
¶ Overloaded method GetUtf8stringValue
GetUtf8stringValue(name)
GetUtf8stringValue(name, level)
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Utf8string < OptionsOptionType>` option. Throws an error if the option is not of type :py:class:` OptionsOptionType.Utf8string < OptionsOptionType>`.
Signature
GetUtf8stringValue(name)
Parameters: name (str) – Option name. Returns: Option utf8 value. Return type: str New in version NX6.0.0.
License requirements: None.
-------------------------------------
Gets the value of a :py:class:` OptionsOptionType.Utf8string < OptionsOptionType>` option at the specified level. Throws an error if the option is not of type :py:class:` OptionsOptionType.String < OptionsOptionType>`.
Signature
GetUtf8stringValue(name, level)
Parameters: - name (str) – Option name.
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Option value
Return type: str
New in version NX6.0.0.
License requirements: None.
-------------------------------------
IsLevelLockedByDefault¶
-
OptionsManager.
IsLevelLockedByDefault
¶ Returns true if the option’s values at the specified level are locked by default.
Locked by default means that if an option value does not exist at this level, then it is locked.
Signature
IsLevelLockedByDefault(level)
Parameters: level ( NXOpen.Options.LevelType
) – Options level.Returns: True if options values are locked by default Return type: bool New in version NX4.0.0.
License requirements: None.
IsValueLocked¶
-
OptionsManager.
IsValueLocked
¶ Returns true if the option value is locked at the specified level.
Locks are not supported at :py:class:` OptionsLevelType.User < OptionsLevelType>` and :py:class:` OptionsLevelType.Shipped < OptionsLevelType>` levels.
Signature
IsValueLocked(name, level)
Parameters: - name (str) – Option name
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: Lock status
Return type: bool
New in version NX4.0.0.
License requirements: None.
IsValueSet¶
-
OptionsManager.
IsValueSet
¶ Returns true if the option value exists at the specified level.
Always true for the :py:class:` OptionsLevelType.Shipped < OptionsLevelType>` level.
Signature
IsValueSet(name, level)
Parameters: - name (str) – Option name
- level (
NXOpen.Options.LevelType
) – Options level.
Returns: True if value is set
Return type: bool
New in version NX4.0.0.
License requirements: None.
NewOptionsChangeList¶
-
OptionsManager.
NewOptionsChangeList
¶ Creates an instance of
NXOpen.Options.ChangeList
class, in order to edit a set of options.It is not possible to create an instance of
NXOpen.Options.ChangeList
for :py:class:` OptionsLevelType.Shipped < OptionsLevelType>` level, or for a level that is not defined or is not writeable.Signature
NewOptionsChangeList(level, lockedByDefault)
Parameters: - level (
NXOpen.Options.LevelType
) – Options level. - lockedByDefault (
NXOpen.Options.LevelLockedByDefault
) – Specifies whether Options level is locked by default. Ignored at :py:class:` OptionsLevelType.User < OptionsLevelType>` level as locks at :py:class:` OptionsLevelType.User < OptionsLevelType>` level are not supported. If specified default lock status is different from the current one, then all exisitng locks are cleared.
Returns: An instanse of
NXOpen.Options.ChangeList
classReturn type: New in version NX4.0.0.
License requirements: None.
- level (
NewOptionsDraftingStandardChangeList¶
-
OptionsManager.
NewOptionsDraftingStandardChangeList
¶ Creates an instance of
NXOpen.Options.DraftingStandardChangeList
class, in order to edit a set of options.It is not possible to create an instance of
NXOpen.Options.DraftingStandardChangeList
for :py:class:` OptionsLevelType.Shipped < OptionsLevelType>` level, or for a level that is not defined or is not writeable.Signature
NewOptionsDraftingStandardChangeList(level, filename)
Parameters: - level (
NXOpen.Options.LevelType
) – Options level. - filename (str) – Specifies the filename to save/save as.
Returns: An instanse of
NXOpen.Options.DraftingStandardChangeList
classReturn type: New in version NX5.0.0.
License requirements: None.
- level (