Skip to content
Bring objects to fr...
 
Notifications
Clear all

Bring objects to front/send to back

3 Posts
2 Users
1 Reactions
2,265 Views
Hadi Eshraghi
Posts: 6
Topic starter
(@ftnsbonl38owc63xjps05ixlkbt2)
Active Member
Joined: 4 years ago

Hello,

How do I bring objects to front or send them to back programmatically?

 

Thanks

Topic Tags
2 Replies
Lonnie Chrisman
Posts: 44
Admin
(@lchrisman)
Member
Joined: 14 years ago

The Front-to-back is determined by the z-order, which is stored in the NodeLocation attribute.  It is an integer, and can be positive or negative.  Nodes with larger Z-order display over nodes with lower Z-order.  When you select "Bring to Front" on the right-mouse context menu, it sets the Z-order to a number that is larger than the other z-orders on the same diagram.

Here is a UDF to do it:

Function Send_to_front(o : Object)

Definition:

Local z := NodeLocation::z of Contains of isin of o;
NodeLocation::z of o := Max([10,z+1])

Function Send_to_back(o : Object)

Local z := NodeLocation::z of Contains of isin of o;
NodeLocation::z of o := Min([-10,z-1])

 

Reply
1 Reply
Hadi Eshraghi
(@ftnsbonl38owc63xjps05ixlkbt2)
Joined: 4 years ago

Active Member
Posts: 6

Great, thanks!

Reply
Share:

Download Free Analytica


    We hate spam as much as you. We won't share your email with third parties.
    The free edition of Analytica includes these key Analytica features:
    Free Analytica has no time limit. The only constraint is it won’t let you create more than 100 variables or other objects. But your model can be quite substantial since each variable can be a multidimensional array. It also lets you explore, change inputs, and run existing models of any size (excluding features unique to the Enterprise or Optimizer editions).