oaLayerConstraint
模块: oapy._oa._tech
导入: from oapy._oa import _tech
概览
oaLayerConstraint 在 oapy 中可用,可通过 _tech 模块访问。
本页汇总 oaLayerConstraint 当前在 oapy 中可用的 Python 接口。
详细说明
The oaLayerConstraint class represents a constraint object that constrains objects on a specific layer。 In addition to the layer, the oaLayerConstraint is described by its oaLayerConstraintDef 。 A layer constraint has a value associated with it and potentially a list of constraint parameters。 A layer constraint may or may not be a hard constraint。 A hard constraint is a constraint that must be met。 oaLayerConstraints always have a value, and are created in the same database as that value。 oaLayerConstraints get applied to objects by being placed in an oaConstraintGroup 。 If a purpose is specified along with the layer associated with the oaLayerConstraint, the constraint applies only between shapes with the specified purpose on that layer。
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.getLayer() |
| ✅ | obj.getPurpose() |
| ✅ | _tech.oaLayerConstraint.create(layer, def, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerConstraint.create(layer, def, name, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerConstraint.create(layer, purpose, def, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerConstraint.create(layer, purpose, def, name, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerConstraint.find(group, layer, def, hardOnly=false) |
| ✅ | _tech.oaLayerConstraint.find(group, layer, purpose, def, hardOnly=false) |
| ✅ | _tech.oaLayerConstraint.getConstraints(group, layer, def=NULL) |
方法说明
obj.getLayer()
绑定状态: 已绑定
Python 调用: obj.getLayer()
This function returns layer number associated with this layer constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerConstraint
obj.getLayer()
obj.getPurpose()
绑定状态: 已绑定
Python 调用: obj.getPurpose()
This function returns the purpose number associated with this layer constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerConstraint
obj.getPurpose()
_tech.oaLayerConstraint.create(layer, def, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.create(layer, def, value, isHard=true, params=NULL)
This function creates an explicitly named constraint。 The new layer constraint is created with the specified purpose in the same database as the value specified。
参数
layer: The layer associated with the constraint。purpose: The purpose number for this constraint。def: The layer constraint definition。name: The constraint name。value: The constraint value。isHard: A Boolean indicating whether the constraint must be met。params: Optional constraint parameters。
异常
oacInvalidBasePurposeNumber。oacValueAlreadyOwned。oacInvalidDatabaseForLayerConstraint。oacConstraintParamAlreadyOwned。oacConstraintParamNotInSameDB。oacInvalidValueForConstraintDef。oacInvalidDBForConstraintDef。oacConstraintNameExists。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.create(layer, def, value, isHard=true, params=NULL)
_tech.oaLayerConstraint.create(layer, def, name, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.create(layer, def, name, value, isHard=true, params=NULL)
This function creates an auto-named constraint。 The new layer constraint is created with the specified purpose in the same database as the value specified。
参数
layer: The layer associated with the constraint。purpose: The purpose number for this constraint。def: The layer constraint definition。value: The constraint value。isHard: A Boolean indicating whether the constraint must be met。params: Optional constraint parameters。
异常
oacInvalidBasePurposeNumber。oacValueAlreadyOwned。oacInvalidDatabaseForLayerConstraint。oacConstraintParamAlreadyOwned。oacConstraintParamNotInSameDB。oacInvalidValueForConstraintDef。oacInvalidDBForConstraintDef。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.create(layer, def, name, value, isHard=true, params=NULL)
_tech.oaLayerConstraint.create(layer, purpose, def, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.create(layer, purpose, def, value, isHard=true, params=NULL)
This function creates an explicitly named constraint with the specified attributes。 The constraint is created in the same database as the value。 The constraint parameters must also exist in the same database as the value。
参数
layer: The layer associated with the constraint。def: The layer constraint definition。name: The constraint name。value: The constraint value。isHard: A Boolean indicating whether the constraint must be met。params: Optional constraint parameters。
异常
oacValueAlreadyOwned。oacConstraintParamAlreadyOwned。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.create(layer, purpose, def, value, isHard=true, params=NULL)
_tech.oaLayerConstraint.create(layer, purpose, def, name, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.create(layer, purpose, def, name, value, isHard=true, params=NULL)
This function creates an auto-named constraint with the specified attributes。 The constraint is created in the same database as the value。 The constraint parameters must also exist in the same database as the value。
参数
layer: The layer associated with the constraint。def: The layer constraint definition。value: The constraint value。isHard: A Boolean indicating whether the constraint must be met。params: Optional constraint parameters。
异常
oacValueAlreadyOwned。oacConstraintParamAlreadyOwned。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.create(layer, purpose, def, name, value, isHard=true, params=NULL)
_tech.oaLayerConstraint.find(group, layer, def, hardOnly=false)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.find(group, layer, def, hardOnly=false)
This function returns the first constraint in this group that matches the definition, layer, purpose, and isHard attribute specified。 If no such constraint is found, NULL is returned。 If the purpose number is oavPurposeNumberAny, the returned constraint can have any purpose。 If the purpose number is oavPurposeNumberNo, the returned constraint must have no purpose specified。
参数
group: The group to match。purpose: The purpose number to match。layer: The layer to match。def: The layer constraint definition to match。hardOnly: A boolean indicating whether the constraint to match is hard or soft。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.find(group, layer, def, hardOnly=false)
_tech.oaLayerConstraint.find(group, layer, purpose, def, hardOnly=false)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.find(group, layer, purpose, def, hardOnly=false)
This function returns the first hard or soft constraint in this group that matches the definition, and layer specified。 If no such constraint is found, NULL is returned。
参数
group: The group to match。layer: The layer to match。def: The layer constraint definition to match。hardOnly: A boolean indicating a hard or soft constraint。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.find(group, layer, purpose, def, hardOnly=false)
_tech.oaLayerConstraint.getConstraints(group, layer, def=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerConstraint.getConstraints(group, layer, def=NULL)
This function returns a collection of layer constraints in the specified group the definition of which matches the one given。 If no definition is specified, all layer constraints on that layer in that group are returned。
参数
group: The group to search in。layer: The layer to search for。def: The layer constraint definition to filter with。
Python 示例
from oapy._oa import _tech
_tech.oaLayerConstraint.getConstraints(group, layer, def=NULL)