I need to add entry and exit anchors at the position of selected nodes.
If 2 nodes are selected the entry anchor should be inserted at first selected node.
I tried to run the Script by @mekkablue but it does not add anchors at selected node. I need to manually move the nodes after I run the script.
I’m not very proficient in python.
Any help is appreciated.
Thanks and regards.
There is not really a first selected node. You probably mean the left/right most from the two.
Have a look at the script, you might be able to adjust it.
I figured out a hack which works for me right now.
myEntry = GSAnchor( "entry", NSPoint( myEntryPoint.x, myEntryPoint.y - 153) )
hardcoded “- 153”, which is my horizontal stem, at line 55.
Will try to optimize it to remove the hard coded value.
Any suggestions are welcome.
You can access the selected nodes in
layer.selection. A node has a position that can be used to initialize the anchor.