首页 / base / oaConstraint

oaConstraint

模块: oapy._oa._base 导入: from oapy._oa import _base

概览

oaConstraintoapy 中可用,可通过 _base 模块访问。

本页汇总 oaConstraint 当前在 oapy 中可用的 Python 接口。

详细说明

The oaConstraint class provides a base class for all kinds of constraint representations。 All constraint objects are defined by the constraintDef。 They have a value associated with them and potentially a list of constraint parameters。 A constraint may or may not be a hard constraint。 A hard constraint is a constraint that must be met。 oaConstraints always have a value, and are created in the same database as that value。 oaConstraints get applied to objects by being placed in an oaConstraintGroup 。 The oaConstraint class can be observed by deriving from oaObserver

方法总览

状态 Python 调用
obj.getName(name)
obj.getDef()
obj.getValue()
obj.getParams(params)
obj.getID(id)
obj.getDescription(description)
obj.hasParams()
obj.isHard()
obj.setValue(value)
obj.setParams(params)
obj.setHard(isHard)
obj.setID(id)
obj.setDescription(description)
obj.destroy()

方法说明

obj.getName(name)

绑定状态: 已绑定

Python 调用: obj.getName(name)

This function returns the name of this constraint。 If a name wasn't specified on creation one is automatically generated。

参数

  • name: The returned name。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getName(name)

obj.getDef()

绑定状态: 已绑定

Python 调用: obj.getDef()

This function returns the definition for this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getDef()

obj.getValue()

绑定状态: 已绑定

Python 调用: obj.getValue()

This function returns the value for this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getValue()

obj.getParams(params)

绑定状态: 已绑定

Python 调用: obj.getParams(params)

This function returns the parameters associated with this constraint。

参数

  • params: The returned constraint parameters。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getParams(params)

obj.getID(id)

绑定状态: 已绑定

Python 调用: obj.getID(id)

This function returns the id string of this constraint。

参数

  • idOut: The string id of this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getID(id)

obj.getDescription(description)

绑定状态: 已绑定

Python 调用: obj.getDescription(description)

This function returns the description string of this constraint。

参数

  • descOut: The string description of this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.getDescription(description)

obj.hasParams()

绑定状态: 已绑定

Python 调用: obj.hasParams()

This function returns a boolean indicating whether or not the constraint has parameters associated with it。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.hasParams()

obj.isHard()

绑定状态: 已绑定

Python 调用: obj.isHard()

This function returns a boolean indicated whether or not this is a hard constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.isHard()

obj.setValue(value)

绑定状态: 已绑定

Python 调用: obj.setValue(value)

This function sets the value for this constraint。 The old value is destroyed。

参数

  • value: Value to set。

异常

  • oacValueAlreadyOwned
  • oacValueNotInSameDatabase
  • oacInvalidValueForConstraintDef

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.setValue(value)

obj.setParams(params)

绑定状态: 已绑定

Python 调用: obj.setParams(params)

This function sets the parameters for this constraint。 The old parameters are destroyed。

参数

  • params: Constraint parameters to set。

异常

  • oacConstraintParamAlreadyOwned
  • oacConstraintParamNotInSameDB

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.setParams(params)

obj.setHard(isHard)

绑定状态: 已绑定

Python 调用: obj.setHard(isHard)

This function sets a boolean attribute on the constraint indicating whether or not it is hard。

参数

  • isHard: A boolean indicating whether or not the constraint is a hard constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.setHard(isHard)

obj.setID(id)

绑定状态: 已绑定

Python 调用: obj.setID(id)

This function sets the ID string of this constraint。

参数

  • idIn: The string id to be set on this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.setID(id)

obj.setDescription(description)

绑定状态: 已绑定

Python 调用: obj.setDescription(description)

This function sets the description string of this constraint。

参数

  • descIn: The string description to be set on this constraint。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.setDescription(description)

obj.destroy()

绑定状态: 已绑定

Python 调用: obj.destroy()

This function destroys this constraint removing it from any constraint groups it is a part of。

Python 示例

from oapy._oa import _base

# assume obj is a oaConstraint
obj.destroy()