Jump to content
Developer Wiki and Function Reference Links ×

Class hide tool and Layer hide tool


Recommended Posts

Someone made up a script for me a while back that worked in versions 9 and 10, but now in 11 they don't work correctly. Can someone familayr with scripts review them? Petri gave me a new script to shut off a selected class, however you have to select the objects first, then hit the tool. His script was

HIDECLASS(GETCLASS(FSACTLAYER));

A simple one liner. I'd rather click the tool and then select all the classes or layers I want ot shut off. The original script follows:

This is the hide class script following...

Procedure show_hideClass;

VAR

pX, pY:REAL;

Objekth: HANDLE;

CurrentClassStr,ClassToHideStr:String;

Begin

GetPt(pX, pY);

Objekth:=PickObject(pX, pY);

IF Objekth<>NIL Then Begin

CurrentClassStr:=ActiveClass;

ClassToHideStr:=GetClass(Objekth);

IF ((GetCVis(ClassToHideStr))=-1) THEN Begin

ShowClass(ClassToHideStr);

AlrtDialog(Concat('The Class *',ClassToHideStr,'* is set to visible'));

END

ELSE Begin

HideClass(ClassToHideStr);

AlrtDialog(Concat('The Class *',ClassToHideStr,'* is set to invisible'));

END;

NameClass(CurrentClassStr);

IF (CurrentClassStr=ClassToHideStr) & ((GetCVis(ClassToHideStr))=-1) THEN

AlrtDialog('you have set the active Class to Invisible. Select a different Class in the menu bar to take effect of this action');

END

ELSE

AlrtDialog('No Object selected');

Redrawall;

END;

This is the hide layer script following....

Procedure show_hideLayer;

VAR

pX, pY:REAL;

Objekth: HANDLE;

CurrentLayerStr,LayerToHideStr:String;

Begin

GetPt(pX, pY);

Objekth:=PickObject(pX, pY);

IF Objekth<>NIL Then Begin

CurrentLayerStr:=GetLName(ActLayer);

LayerToHideStr:=GetLName(GetLayer(Objekth));

Layer(LayerToHideStr);

IF ((GetLVis(GetLayer(Objekth)))=-1) THEN Begin

ShowLayer;

AlrtDialog(Concat('The Layer *',LayerToHideStr,'* is set to visible'));

END

ELSE Begin

HideLayer;

AlrtDialog(Concat('The Layer *',LayerToHideStr,'* is set to invisible'));

END;

Layer(CurrentLayerStr);

IF (CurrentLayerStr=LayerToHideStr) & ((GetLVis(GetLayer(Objekth)))=-1) THEN

AlrtDialog('you have set the active Layer to Invisible. Select a different Layer in the menu bar to take effect of this action');

END

ELSE

AlrtDialog('No Object selected');

RedrawAll;

END;

Thank you to anyone that can lend a helping hand.

Edward Koenig

Carmelhill Architects

Link to comment
  • 3 months later...

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