htranbos Posted March 4 Share Posted March 4 (edited) 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) Edited March 4 by htranbos Quote Link to comment
Pat Stanford Posted March 4 Share Posted March 4 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 3 Quote Link to comment
MullinRJ Posted March 5 Share Posted March 5 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 😉 3 Quote Link to comment
htranbos Posted March 8 Author Share Posted March 8 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! Quote Link to comment
htranbos Posted March 8 Author Share Posted March 8 (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 March 8 by htranbos Quote Link to comment
Pat Stanford Posted March 8 Share Posted March 8 No way to easily get selection order. You could create your own selection tool that would make a list of the object you clicked on an then use that, but not using the built in selection tools. 1 Quote Link to comment
Pat Stanford Posted March 8 Share Posted March 8 No there are separate commands for FSObject and LSObject that return the first and last object in the drawing. FSActLayer and LSActLayer actually do return only selected object only on the active layer. 1 Quote Link to comment
Recommended Posts
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.