Jump to content
  • 0

script?


ed

Question

6 answers to this question

Recommended Posts

  • 0

quote:

Originally posted by ed:
Hello,have someone a scriptthat if you select a object than it's goesdirect to the right layer.

thanks

Ed

Hi Ed, try the one below. You can run it from a cript palette or put the code into a menu command or a Tool. HTH,

Hannescopy all below the line:**************************************************

Procedure setActiveLayer;

{Hannes Lackner 2002, Hannes Lackner@aon.at, free for everyone. This script allows the user to pick a object, then the object's Layer willbe set to active layer}

VARH:Handle;BoolMouse:Boolean;px,py:Real;LOptions:Integer;LName:String;

Begin

LOptions:=GetLayerOptions;SetLayerOptions(5);{<<<sets the Layer options temporarily to show/snap/modify other's, because the Object you want to select may be on a Layer which is current not editable} GetPt(pX, pY);

h:=PickObject(pX, pY);

IF h<> Nil Then Begin LName:=GetLName(GetLayer(h)); Layer(LName); AlrtDialog(Concat('Active Layer is: ',LName)); END Else Begin AlrtDialog('SET ACTIVE LAYER TOOL: no object was selected, please try again');END;

SetLayerOptions(LOptions);{<<<reset the Layer Option}

END;

Run(setActiveLayer);

Link to comment
  • 0

If you have your layer options set to anything other than Show/Snap/Modify Others, then you should be able to right click on an object and choose Force Select and it will change the active layer (and class, and other things) to allow the object to be selected.

 

No script necessary.

 

Won't work if you have Modify Others set as you will already (as long as the layer scale is the same) be able to select the object.

  • Like 1
Link to comment
  • 0
On 6/13/2025 at 1:57 PM, Pat Stanford said:

If you have your layer options set to anything other than Show/Snap/Modify Others

@Pat Stanford So the brains says ... if there are multiple Design Layers visible, and one needs to Modify items on any of these Design Layers, set the Layer Options to  Show/Snap/Modify Others ...

 

 

and there in lies the rub !

 

 

ForceSelectHELP.thumb.png.5c009c247a38e269710b6af6e2aee95d.png

 

So ... for others who may have assumed that Force Select  just did not work as described - Please take note of Pats helpful advice.

 

Thanks

 

Peter

Link to comment
  • 0

I don't know the logic behind Force Select to know how it decides what parameters to change. I just know that it will adjust the visible and selectable layers and classes as necessary to make the Force Selected object selectable.

 

Based on the help description above it sounds like like it will change the Layer Options (and probably the Class Options), but in a simple test that I just ran (two layers, one object on each layer, Show/Snap Others), the only thing that changed was the Active Layer to make for Force Selected object selected.

  • Like 1
Link to comment
  • 0

My reading of the help text says that Force Select will merely activate the needed Class / Layer of the selected item depending on the current Class / Layer option settings, it would not change the option settings.  So if your Class Option is Show/Snap/Modify and your Layer Option is Show/Snap, Force Select will activate the selected object's Layer, but would not affect the active Class.  If you had your Class Option to Show/Snap, it would activate the Class as well.

 

Personally, I almost always have my Class Option set to Show/Snap/Modify (learned the hard way early on when using Symbols made up with different classes), and my Layer Option to either Show/Snap or Gray/Snap others.  It's fairly rare that I need to select objects on more than one layer, and I love having the ability to Ctrl + A to grab everything on a layer without fearing that I'm also going to grab the floor or walls.  It also helps avoiding moving the floor around when I'm trying to marquee select a bunch of objects.  But I have worked with plenty of folks who believe that if they can see an object, it should mean that they can select the object and use Show/Snap/Modify as a result.  But I'll give you two guesses as to which one is more likely to have objects on the wrong layer...

  • Like 1
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
Answer this question...

×   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...