首页 / design / oaText

oaText

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

概览

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

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

详细说明

The oaText class implements a text shape。 The class is contained in a block and is used to display text strings。 The origin of the text and its orientation define a line used for the bottom of normal characters, and the height defines the top of the normal characters。 Characters with descenders or ascenders may extend outside of this range。 The bBox of the oaText will enclose such descenders and ascenders。 For example, an oaText created at (0,0) with an orientation of oacR0 and the string “jackal” will descend below a y-value of 0 because of the “j”。 It’s bBox will have a bottom() value < 0。

方法总览

状态 Python 调用
obj.getOrigin(origin)
obj.getText(text)
obj.getAlignment()
obj.getOrient()
obj.getFont()
obj.getHeight()
obj.hasOverbar()
obj.isVisible()
obj.isDrafting()
obj.setOrigin(origin)
obj.setText(text)
obj.setAlignment(alignment)
obj.setOrient(orient)
obj.setFont(font)
obj.setHeight(height)
obj.setOverbar(overbar)
obj.setVisible(visible)
obj.setDrafting(drafting)
_design.oaText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, overbar=false, visible=true, drafting=true)

方法说明

obj.getOrigin(origin)

绑定状态: 已绑定

Python 调用: obj.getOrigin(origin)

This function returns the origin of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getOrigin(origin)

obj.getText(text)

绑定状态: 已绑定

Python 调用: obj.getText(text)

This function returns the value or text of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getText(text)

obj.getAlignment()

绑定状态: 已绑定

Python 调用: obj.getAlignment()

This function returns the alignment of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getAlignment()

obj.getOrient()

绑定状态: 已绑定

Python 调用: obj.getOrient()

This function returns the orientation of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getOrient()

obj.getFont()

绑定状态: 已绑定

Python 调用: obj.getFont()

This function returns the font of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getFont()

obj.getHeight()

绑定状态: 已绑定

Python 调用: obj.getHeight()

This function returns the height of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.getHeight()

obj.hasOverbar()

绑定状态: 已绑定

Python 调用: obj.hasOverbar()

This function returns a boolean value that indicates if this text has an overbar on it。

返回

  • true or false。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.hasOverbar()

obj.isVisible()

绑定状态: 已绑定

Python 调用: obj.isVisible()

This function returns a boolean value that indicates if this text is displayed。

返回

  • true or false。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.isVisible()

obj.isDrafting()

绑定状态: 已绑定

Python 调用: obj.isDrafting()

This function returns a boolean value that indicates if this text is displayed in drafting style。

返回

  • true or false。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.isDrafting()

obj.setOrigin(origin)

绑定状态: 已绑定

Python 调用: obj.setOrigin(origin)

This function sets the origin for this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setOrigin(origin)

obj.setText(text)

绑定状态: 已绑定

Python 调用: obj.setText(text)

This function sets the text string for this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setText(text)

obj.setAlignment(alignment)

绑定状态: 已绑定

Python 调用: obj.setAlignment(alignment)

This function sets the alignment for this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setAlignment(alignment)

obj.setOrient(orient)

绑定状态: 已绑定

Python 调用: obj.setOrient(orient)

This function sets the orientation for this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setOrient(orient)

obj.setFont(font)

绑定状态: 已绑定

Python 调用: obj.setFont(font)

This function sets the font used by this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setFont(font)

obj.setHeight(height)

绑定状态: 已绑定

Python 调用: obj.setHeight(height)

This function sets the height of this text object。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setHeight(height)

obj.setOverbar(overbar)

绑定状态: 已绑定

Python 调用: obj.setOverbar(overbar)

This function sets the flag that indicates if this text object is displayed with an overbar。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setOverbar(overbar)

obj.setVisible(visible)

绑定状态: 已绑定

Python 调用: obj.setVisible(visible)

This function sets the flag that indicates if this text object is visible。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setVisible(visible)

obj.setDrafting(drafting)

绑定状态: 已绑定

Python 调用: obj.setDrafting(drafting)

This function sets the flag that indicates if this text object is displayed in drafting mode。

Python 示例

from oapy._oa import _design

# assume obj is a oaText
obj.setDrafting(drafting)

_design.oaText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, overbar=false, visible=true, drafting=true)

绑定状态: 已绑定

Python 调用: _design.oaText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, overbar=false, visible=true, drafting=true)

This function creates a text shape object in the design with the specified attributes。

参数

  • block: The block on which to create the text object。
  • layerNum: The number of the layer on which to create the text object。
  • purposeNum: The number of the layer purpose on which to create the text object。
  • text: The text string of this shape text。
  • origin: The location of the origin of this text shape。
  • 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。
  • overbar: Indicates if an overbar is used in the text string display; the default is false。
  • visible: Indicates if this text shape is displayed; the default is true (this allows applications to turn on or off the display of text shapes without having to delete them from the database)。
  • drafting: Indicates if the text for this text shape should always be drawn left-to-right or top-to-bottom; the default is true (if drafting is true and the orientation of this text is mirrored, text is drawn backwards)。

Python 示例

from oapy._oa import _design

_design.oaText.create(block, layerNum, purposeNum, text, origin, alignment, orient, font, height, overbar=false, visible=true, drafting=true)