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

Bring objects to front/send to back

3 Posts
2 Users
1 Likes
1,109 Views
Hadi Eshraghi
Posts: 6
Customer
Topic starter
(@ftnsbonl38owc63xjps05ixlkbt2)
Active Member
Joined: 3 years ago

Hello,

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

 

Thanks

Topic Tags
2 Replies
Lonnie Chrisman
Posts: 40
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
Customer
(@ftnsbonl38owc63xjps05ixlkbt2)
Joined: 3 years ago

Active Member
Posts: 6

Great, thanks!

Reply
Share: