Get width/height from lines

Hey everyone,

again I don’t know how to get a certain value out of a selected item.
For example I have this item:

Line ('Line1') {
    width: 1270, height: 2
    global X,Y: 2475.5, 165.5
    parent: Artboard ('Web 1920 – 2')
    stroke: ff707070

I need the width (and height), but with item.width I get nothing out of it.
(For Recangle this works…)

Hope you can help me - Thanks! =)
Jojo

width and height are part of the “bounds” properties (localBounds, boundsInParent, etc.).

Therefore, depending on which of those you need, you’ll be able to access it with either

node.localBounds.width
node.localBounds.height
node.boundsInParent.width
[...]

cf. https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#scenenode

1 Like