首页 / design / oaAttrDisplay

oaAttrDisplay

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

概览

oaAttrDisplayoapy 中可用,可通过 _design 模块访问。

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

详细说明

The oaAttrDisplay is a shape similar to an oaText object, except it presents a string that is the value of a specific, built-in attribute of the attached object。 Whenever the value of the attribute changes, calling the getText function on this oaAttrDisplay object returns the updated text string that represents the new attribute value。 The oaAttrDisplay is contained in the design that contains the attached design object。 Note: The attribute is specified using one of many defined values。 Each object type has its own set of values。

方法总览

状态 Python 调用
obj.getText(ns, text)
obj.getObject()
obj.getAttribute()
obj.setObject(object)
_design.oaAttrDisplay.create(object, attribute, layerNum, purposeNum, origin, alignment, orient, font, height, format=oacNameTextDisplayFormat, overbar=false, visible=true, drafting=true)

方法说明

obj.getText(ns, text)

绑定状态: 已绑定

Python 调用: obj.getText(ns, text)

This function returns the value of this attribute display according to the given nameSpace。 The nameSpace is only valid for name type attributes。

Python 示例

from oapy._oa import _design

# assume obj is a oaAttrDisplay
obj.getText(ns, text)

obj.getObject()

绑定状态: 已绑定

Python 调用: obj.getObject()

This function returns the object whose attribute is displayed by this oaAttrDisplay object。

Python 示例

from oapy._oa import _design

# assume obj is a oaAttrDisplay
obj.getObject()

obj.getAttribute()

绑定状态: 已绑定

Python 调用: obj.getAttribute()

This function returns the attribute displayed by this oaAttrDisplay object。

Python 示例

from oapy._oa import _design

# assume obj is a oaAttrDisplay
obj.getAttribute()

obj.setObject(object)

绑定状态: 已绑定

Python 调用: obj.setObject(object)

This function sets the object whose attribute is displayed by this attrDisplay object。 An exception will be thrown if the object is not in the same database as this attrDisplay object or its type is different from that of the object currently associated with this attrDisplay object。

参数

  • object: A pointer to the owner object, which must be in the same database as the attrDisplay object and whose type must be the same as that of the current owner object。

异常

  • oacInvalidObjectForAttrDisplay

Python 示例

from oapy._oa import _design

# assume obj is a oaAttrDisplay
obj.setObject(object)

_design.oaAttrDisplay.create(object, attribute, layerNum, purposeNum, origin, alignment, orient, font, height, format=oacNameTextDisplayFormat, overbar=false, visible=true, drafting=true)

绑定状态: 已绑定

Python 调用: _design.oaAttrDisplay.create(object, attribute, layerNum, purposeNum, origin, alignment, orient, font, height, format=oacNameTextDisplayFormat, overbar=false, visible=true, drafting=true)

This function creates an oaAttrDisplay object that displays the specified attribute of the specified object。 The object must be contained in a design database, and the attribute must be an attribute type of the object。 The object on which an oaAttrDisplay can be created must be one of an oaNet , oaInst , oaTerm , oaInstTerm , oaAssignment , or oaDesign or an oacInvalidObjectForAttrDisplay exception is thrown。

参数

  • object: A pointer to the owner object, which must be one of an oaNet , oaInst , oaTerm , oaInstTerm , oaAssignment , or oaDesign 。
  • attribute: The attribute of interest on the owner object。
  • layer: The layer on which the attrDisplay is created。
  • purpose: The purpose on which the attrDisplay is created。
  • origin: The location of the origin of the attrDisplay。
  • 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 in which the text is displayed。
  • height: The height of the display text in user units。
  • format: The format used to create the textDisplay。
  • overbar: A boolean value that indicates if an overbar is used in the display of this value。
  • visible: A boolean value that indicates if this attrDisplay is displayed; this allows the application to turn on or off the attrDisplay display without having to delete it from the database。
  • drafting: A boolean value that indicates if the text for this attrDisplay should always be drawn left to right or top to bottom (if drafting is true and the orientation of this attrDisplay is mirrored, the text is drawn backwards)。

异常

  • oacNonDesignTextDisplay
  • oacInvalidObjectForAttrDisplay

Python 示例

from oapy._oa import _design

_design.oaAttrDisplay.create(object, attribute, layerNum, purposeNum, origin, alignment, orient, font, height, format=oacNameTextDisplayFormat, overbar=false, visible=true, drafting=true)