oaEvalText
模块: oapy._oa._design
导入: from oapy._oa import _design
概览
oaEvalText 在 oapy 中可用,可通过 _design 模块访问。
本页汇总 oaEvalText 当前在 oapy 中可用的 Python 接口。
详细说明
The oaEvalText class implements an oaEvalText shape that is used to display a piece of text。 The shape is derived from oaText and is very similar。 The difference is that an oaEvalText is evaluated to determine what text string it should display。 The oaEvalText still has a text field, but this is evaluated to generate the actual displayed text string。 To support this capability, an oaTextDataCallBack argument is used to process the evaluation。
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.getLink() |
| ✅ | obj.getExpression(text) |
| ✅ | obj.getEvaluatorName(name) |
| ✅ | obj.setLink(linkIn) |
| ✅ | _design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkIn=NULL, overbar=false, visible=true, drafting=true) |
| ✅ | _design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkName, overbar=false, visible=true, drafting=true) |
方法说明
obj.getLink()
绑定状态: 已绑定
Python 调用: obj.getLink()
This function returns the oaEvalTextLink used by this text object if it's evaluated。
Python 示例
from oapy._oa import _design
# assume obj is a oaEvalText
obj.getLink()
obj.getExpression(text)
绑定状态: 已绑定
Python 调用: obj.getExpression(text)
This function fills out the value text with the non-evaluated text of this oaEvalText object。 To get the evaluated text, use the oaText::getText() API。 The base oaText class function evaluates the text。
Python 示例
from oapy._oa import _design
# assume obj is a oaEvalText
obj.getExpression(text)
obj.getEvaluatorName(name)
绑定状态: 已绑定
Python 调用: obj.getEvaluatorName(name)
This function returns the name of the IEvalText used by this text object。
参数
name: the returned name of this text object's evaluator。
Python 示例
from oapy._oa import _design
# assume obj is a oaEvalText
obj.getEvaluatorName(name)
obj.setLink(linkIn)
绑定状态: 已绑定
Python 调用: obj.setLink(linkIn)
This function sets the oaEvalTextLink used by this text object to interpret the text string。 If the interface is NULL, the text will not be interpreted。
参数
linkIn: The link to an application-provided evalText evaluator implementing the IEvalText class, which is used to interpret the text。
Python 示例
from oapy._oa import _design
# assume obj is a oaEvalText
obj.setLink(linkIn)
_design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkIn=NULL, overbar=false, visible=true, drafting=true)
绑定状态: 已绑定
Python 调用: _design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkIn=NULL, overbar=false, visible=true, drafting=true)
This function creates an evaluated text object with the specified attributes using a dataObserver name as input。 The corresponding oaTextDataObserver object does not have to exist。 The observer object can be instantiated at any time。
参数
block: The block in which to create the evalText。layerNum: The number of the layer on which the evalText is created。purposeNum: The purpose number with which the evalText is created。text: The text string to evaluate。origin: The location of the origin of the evalText。alignment: The horizontal and vertical alignment of the display text with respect to the origin。orient: The orientation of the text。font: The font style with which the text is displayed。height: The height of the display text in user-units。cbName: The name of the dataObserver to pass to the create function。overbar: A boolean value that indicates if an overbar is used in the display of this value; the default is false。visible: A boolean value that indicates if this evalText is displayed; the default is true (this value allows an application to turn ON or OFF the evalText display without having to delete it from the database)。drafting: A boolean value that indicates if the text for this evalText should always be drawn left-to-right or top-to-bottom; the default is true (if drafting is true and the orientation of this evalText is mirrored, the text is drawn backwards)。
Python 示例
from oapy._oa import _design
_design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkIn=NULL, overbar=false, visible=true, drafting=true)
_design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkName, overbar=false, visible=true, drafting=true)
绑定状态: 已绑定
Python 调用: _design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkName, overbar=false, visible=true, drafting=true)
This function creates an evaluated text object with the specified attributes。
参数
block: The block in which to create the evalText。layerNum: The number of the layer on which the evalText is created。purposeNum: The purpose number with which the evalText is created。text: The text string to evaluate。origin: The location of the origin of the evalText。alignment: The horizontal and vertical alignment of the display text with respect to the origin。orient: The orientation of the text。font: The font style with which the text is displayed。height: The height of the display text in user-units。linkIn: This is the oaEvalTextLink for the evalText evaluator。overbar: A boolean value that indicates if an overbar is used in the display of this value; the default is false。visible: A boolean value that indicates if this evalText is displayed; the default is true (this value allows an application to turn ON or OFF the evalText display without having to delete it from the database)。drafting: A boolean value that indicates if the text for this evalText should always be drawn left-to-right or top-to-bottom; the default is true (if drafting is true and the orientation of this evalText is mirrored, the text is drawn backwards)。
Python 示例
from oapy._oa import _design
_design.oaEvalText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, linkName, overbar=false, visible=true, drafting=true)