oaLayerPairConstraint
模块: oapy._oa._tech
导入: from oapy._oa import _tech
概览
oaLayerPairConstraint 在 oapy 中可用,可通过 _tech 模块访问。
本页汇总 oaLayerPairConstraint 当前在 oapy 中可用的 Python 接口。
详细说明
The oaLayerPairConstraint class represents a constraint object that constrains interactions between two ordered layers。 In addition to the layers, the oaLayerPairConstraint is described by its oaLayerPairConstraintDef 。 A layerPair constraint has a value associated with it and potentially a list of constraint parameters。 A layerPair constraint may or may not be a hard constraint。 A hard constraint is a constraint that must be met。 oaLayerPairConstraints always have a value, and are created in the same database as that value。 oaLayerPairConstraints get applied to objects by being placed in an oaConstraintGroup 。 If a purpose is specified corresponding to one or both of the layers associated with the oaLayerPairConstraint, the constraint applies only between shapes on those layers with the specified purpose or purposes。
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.getLayer1() |
| ✅ | obj.getLayer2() |
| ✅ | obj.getPurpose1() |
| ✅ | obj.getPurpose2() |
| ✅ | _tech.oaLayerPairConstraint.create(layer1, layer2, def, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerPairConstraint.create(layer1, layer2, def, name, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, name, value, isHard=true, params=NULL) |
| ✅ | _tech.oaLayerPairConstraint.find(group, layer1, layer2, def, hardOnly=false) |
| ✅ | _tech.oaLayerPairConstraint.find(group, layer1, purpose1, layer2, purpose2, def, hardOnly=false) |
| ✅ | _tech.oaLayerPairConstraint.getConstraints(group, layer1, layer2, def=NULL) |
方法说明
obj.getLayer1()
绑定状态: 已绑定
Python 调用: obj.getLayer1()
This function returns the first layer associated with this constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerPairConstraint
obj.getLayer1()
obj.getLayer2()
绑定状态: 已绑定
Python 调用: obj.getLayer2()
This function returns the second layer associated with this constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerPairConstraint
obj.getLayer2()
obj.getPurpose1()
绑定状态: 已绑定
Python 调用: obj.getPurpose1()
This function returns the purpose number associated with the first layer of the pair for this constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerPairConstraint
obj.getPurpose1()
obj.getPurpose2()
绑定状态: 已绑定
Python 调用: obj.getPurpose2()
This function returns the purpose number associated with the second layer of the pair for this constraint。
Python 示例
from oapy._oa import _tech
# assume obj is a oaLayerPairConstraint
obj.getPurpose2()
_tech.oaLayerPairConstraint.create(layer1, layer2, def, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.create(layer1, layer2, def, value, isHard=true, params=NULL)
This function creates an explicitly named constraint with the specified attributes。 The new layer pair constraint is created with the specified purposes in the same database as the value specified。
参数
layer1: Layer associated with constraint。purpose1: The layer1 purpose。layer2: The second layer associated with this constraint。purpose2: The layer2 purpose。def: Layer pair 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。oacInvalidDatabaseForLayerPairConstraint。oacConstraintParamAlreadyOwned。oacConstraintParamNotInSameDB。oacInvalidValueForConstraintDef。oacInvalidDBForConstraintDef。oacConstraintNameExists。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.create(layer1, layer2, def, value, isHard=true, params=NULL)
_tech.oaLayerPairConstraint.create(layer1, layer2, def, name, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.create(layer1, layer2, def, name, value, isHard=true, params=NULL)
This function creates an auto-named constraint with the specified attributes。 The new layer pair constraint is created with the specified layer purposes in the same database as the value specified。
参数
layer1: The first layer of the pair associated with this constraint。purpose1: The layer1 purpose。layer2: The second layer of the pair associated with this constraint。purpose2: The layer2 purpose。def: Layer pair constraint definition。value: Constraint value。isHard: Boolean indicating whether constraint must be met。params: Optional constraint parameters。
异常
oacInvalidBasePurposeNumber。oacValueAlreadyOwned。oacInvalidDatabaseForLayerPairConstraint。oacConstraintParamAlreadyOwned。oacConstraintParamNotInSameDB。oacInvalidValueForConstraintDef。oacInvalidDBForConstraintDef。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.create(layer1, layer2, def, name, value, isHard=true, params=NULL)
_tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, value, isHard=true, params=NULL)
This function creates an explicitly name 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。
参数
layer1: Layer associated with constraint。layer2: Second layer associated with a constraint。def: Layer pair constraint definition。name: Constraint name。value: Constraint value。isHard: Boolean indicating whether constraint must be met。params: Optional constraint parameters。
异常
oacValueAlreadyOwned。oacConstraintParamAlreadyOwned。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, value, isHard=true, params=NULL)
_tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, name, value, isHard=true, params=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, 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。
参数
layer1: Layer associated with constraint。layer2: Second layer associated with a constraint。def: Layer pair constraint definition。value: Constraint value。isHard: Boolean indicating whether constraint must be met。params: Optional constraint parameters。
异常
oacValueAlreadyOwned。oacConstraintParamAlreadyOwned。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.create(layer1, purpose1, layer2, purpose2, def, name, value, isHard=true, params=NULL)
_tech.oaLayerPairConstraint.find(group, layer1, layer2, def, hardOnly=false)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.find(group, layer1, layer2, def, hardOnly=false)
This function returns the first constraint in this group that matches the definition, layers, purposes, and hardOnly attributes specified。 If no such constraint is found NULL is returned。 If the purpose number is oavPurposeNumberAny, the returned constraint can have any purpose for the layer。 If the purpose number is oavPurposeNumberNo, the returned constraint must have no purpose specified for the layer。
参数
group: The group to match。layer1: The first layer to match。purpose1: The purpose of the first layer。layer2: The second layer to match。purpose2: The purpose of the second layer。def: The layer pair constraint definition to match。hardOnly: A boolean indicating whether the constraint to match is hard。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.find(group, layer1, layer2, def, hardOnly=false)
_tech.oaLayerPairConstraint.find(group, layer1, purpose1, layer2, purpose2, def, hardOnly=false)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.find(group, layer1, purpose1, layer2, purpose2, def, hardOnly=false)
This function returns the first hard or soft constraint in this group that matches the definition, and layers specified。 If no such constraint is found NULL is returned。
参数
group: Group to search。layer1: First layer to search for。layer2: Second layer to search for。def: Layer pair constraint definition to search for。hard: Boolean indicating whether or not the constraint to be searched for is hard or soft。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.find(group, layer1, purpose1, layer2, purpose2, def, hardOnly=false)
_tech.oaLayerPairConstraint.getConstraints(group, layer1, layer2, def=NULL)
绑定状态: 已绑定
Python 调用: _tech.oaLayerPairConstraint.getConstraints(group, layer1, layer2, def=NULL)
This function returns a collection of layer pair constraints in the specified group whose definition matches the one given。 If no definition is specified, all layer constraints on that layer in that group are returned。
参数
group: Constraint group to search in。layer1: First layer to search for。layer2: Second layer to search for。def: Layer pair constraint definition to filter with。
Python 示例
from oapy._oa import _tech
_tech.oaLayerPairConstraint.getConstraints(group, layer1, layer2, def=NULL)