ATTR Attribute
ATTR is a relatively generic primitive that means:
- It expresses one of multiple attributes composed of a KEY-VALUE pair.
- It can be displayed on the canvas and controls what content is displayed, as well as style and position.
When the affiliation ID is not specified, it defaults to the current block-level primitive.
json
{ "type": "ATTR", "id": "UUID", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": false, "zIndex": 0.1, "parentId": "UUID", "key":"string", "value":"string", "keyVisible":false, "valueVisible":false, "positionX":200, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|1
2
2
- type attribute name: ATTR.
- id unique ID.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- parentId affiliation ID: the primitive it belongs to,
""means it belongs to the current block. Default block is the file. - key attribute Key.
- value attribute Value.
- keyVisible whether to display Key.
- valueVisible whether to display Value.
- positionX position X: fixed to
nullfor attributes that have never been displayed. - positionY position Y: fixed to
nullfor attributes that have never been displayed. - rotation rotation angle, rotated around
position. - color color.
- fillColor background color.
- fontFamily font name.
- fontSize font size, same unit as coordinates.
- strikeout whether to strike out.
- underline whether to underline.
- italic whether italic.
- fontWeight whether bold.
- vAlign vertical alignment: 0 top, 1 middle, 2 bottom.
- hAlign horizontal alignment: 0 left, 1 center, 2 right.
When the attribute Value contains the ~ character, XTools needs to implement overline text from the start to the end: text is overlined starting at odd-numbered ~ and ending at even-numbered ~.