Cleaning up (arrange) the connections/components in a compound element generated by script


For my applications I sometimes need to generate a compound element from a script. However, all the created components are overlapping upon creation (I’ve attached a screenshot of an instance), which makes the circuit visually unclear. I’m wondering if there is a way to get the components automatically re-arranged into a clean circuit diagram?

Thank you very much.


Hello @xyan,

You can place the objects in the circuit when you create them in the script by setting their “x position” and “y position” properties with the “set” command:

set("x position", 0);
set("y position", 0);

I find that offsetting the elements by around 150 in both directions tends to work well, depending on the size of the element.

Let me know if you have any questions.

@kjohnson Thank you so much! The set commands and your suggested offset make the circuit look great!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.