I have scripts that I use to position component ports and corresponding labels on diagrams; one script places the labels inside the component boundary next to the port and one script places the labels outside the component boundary next to the port.
On diagrams that I create manually (drag component onto diagram, enable ports of interest, etc), these scripts properly move the ports and their labels as expected. I can move these ports and labels around, run the scripts and the ports and labels are moved back to their position. Nothing unusual here.
I created a script that creates a diagram, adds components and their ports to the diagram. Running my port/label placement scripts results in the ports being moved to their expected positions on the component boundaries. The labels however appear to at their default position (outside the component, slightly below the port and extending away from the component). If I move the port manually, the label remains that the same positional offset from the port. I can manually move the label on the diagram. When I run my scripts, the port is moved back into position but the label does not move where I expect; the label remains at the same positional offset from the port after I had manually moved them.
If I hide the ports for a given component on that diagram (select component, right-click, Structural Elements, None) and then show the ports (select component, right-click, Structural Elements, All), the ports and labels go to the positions that would occur if I manually dragged the component onto the diagram. When I run my scripts, these ports and labels get moved into proper position; the labels for ports on other components continue to remain in their default positions.
Is there an attribute for these diagram objects that needs to be set to allow the labels to be moved?