The layer has two nodes independently.
and I want to calculate the bounds size and position through the following script.
But it feedback the wrong values, which can’t calculate the values including the two independent nodes.
Adding the section one by one can be VERY slow. So this is much faster:
newSelection = []
for path in Layer.paths:
newSelection.extend(path.nodes)
newSelection.extend(Layer.anchors)
for component in Layer.components:
newSelection.append(component)
Layer.selection = newSelection
But what are you trying to do? What do you need the bounds for?
You could write a function that gets the bound from all nodes: