Jump to content
  • 0

script?


ed

Question

1 answer 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

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