Jump to content

Layers & Classes turning off


Recommended Posts

Does VW have a tool bar or shortcut command that allows you to select and item on the screen and that item's layer or classes is automatically shut off. I am looking for a toll like Autocad's Express Tools ofr shutting off and freezing layers without having to go through the layers/classes dialgue window. Thank you.

Maybe you know if this is a feature of Jullian's VW Essentials?

Link to comment

Here's a super-sleek version that lacks the niceties of Hannes' script, but gets the job done:

code:


HideClass(GetClass(FSActLayer));


Obviously, there's no looping or other handling of multiple selected objects. But if you create a plug-in menu command and paste the above script in, you can set it's properties to require a selection and prohibit multiple selection, and it should work fine. The only other thing to watch out for is that if the object you select is in the currently selected class (the one shown in the data bar), then the class will be set to invisible but (since it's the current class) the objects will still be visible until you switch to some other class. Phew... that's hard to say than to understand... just play with it a bit and you'll see what I mean.

[This message has been edited by Caleb Strockbine (edited 06-13-2001).]

Link to comment

My last posted script doesn't redraw the sreen after hide the Class/Layer, so please us this instead of. I also added one script for Classes.

If you find the Alert Dialogs annoying

just remove the lines 'AlrtDialog('');'from the script.

Copy the show/hide Class script between the lines:

----------------------------------

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;

Run(show_hideClass);

----------------------------------

Copy the show/hide Layer script between the lines:

----------------------------------

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;

Run(show_hideLayer);

----------------------------------

[This message has been edited by Hannes (edited 06-14-2001).]

Link to comment

Sorry Caleb, but this:

HideClass(GetClass(FSActLayer));

Doesn't work. The other longer one does.

Might be because I'm just learning this. Maybe I input it wrong.

I get an error...

Line #1: HideClass(GetClass(FSActLayer))

|

{ Error: End of file in middle of program. }

Seconds to Compile: 0.00

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