Jump to content
  • 0
Sign in to follow this  
ed

script?

Question

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

thanks

Ed

Share this post


Link to post

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);

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×