Jump to content

FSActLayer VS LSActLayer


Recommended Posts

 

Hello, I have 2 rectangles in my document. According to VS Python documentation:

 

- Function FSActLayer returns a handle to the first selected object on the active layer.

- Function LSActLayer returns a handle to the last selected object on the active layer

 

When I select the left object first and the right object second, I receive the following alerts (as shown in attached screenshot)

 

However, when I change the order of selection, by selecting the right object first and the left object second, I still receive the same alert. Wouldn't h1 & h2 order change dynamically based on whether it is selected first or last? 

 

I hope my question makes sense. Thank you!

 

h1 = vs.FSActLayer()
h2 = vs.LSActLayer()
vs.AlrtDialog(h1)
vs.AlrtDialog(h2)

 

Screenshot 2024-03-04 142808.png

Edited by htranbos
Link to comment

I don't think it matters what order you select the items. I believe it is actually using the Stacking Order for the objects.  So the first object drawn will be at the bottom of the stacking order and will be returned by LSActLayer.  The last object drawn will be at the top of the stacking order and will be returned by FSActLayer.

 

You can change the stacking order by using the Send to Back/Send Backward/Send to Front/Send Forward commands.

 

The VS/Python equivalent is MoveBack/MoveBackward/SendFront/SendForward

  • Like 3
Link to comment
11 hours ago, Pat Stanford said:

So the first object drawn will be at the bottom of the stacking order and will be returned by LSActLayer.  The last object drawn will be at the top of the stacking order and will be returned by FSActLayer.

 Hi @Pat Stanford,

   It is the other way around. The first object drawn - at the bottom of the stack, yes - is returned by FSActLayer (or FActLayer, when selection is ignored.) The object at the top of the stack is returned by LSActLayer (or LActLayer, when selection is ignored.)   Everything else is correct.

 

Good night,

Raymond 😉

  • Like 3
Link to comment
On 3/4/2024 at 4:26 PM, Pat Stanford said:

I don't think it matters what order you select the items. I believe it is actually using the Stacking Order for the objects.  So the first object drawn will be at the bottom of the stacking order and will be returned by LSActLayer.  The last object drawn will be at the top of the stacking order and will be returned by FSActLayer.

 

You can change the stacking order by using the Send to Back/Send Backward/Send to Front/Send Forward commands.

 

The VS/Python equivalent is MoveBack/MoveBackward/SendFront/SendForward

Thanks so much Pat! 

Link to comment
Posted (edited)

Thanks Pat and Raymond!! In that case, I think the documentation is a bit misleading. Instead of saying FSActLayer & LSActLayer return the first and last SELECTED objects. It should say FSActLayer & LSActLayer return the first and last drawn objects in the document.

 

Is there a function to return selected objects in order, depending on how each object is selected on screen?

 

 

Edited by htranbos
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...