Jump to content

A Different Hide Class


Recommended Posts

Thought it might be interesting to show how functionality can be tailored to individual needs. I use this tool mostly for hiding objects that overlay other objects that I need to edit. As such it's a temporary view change, and I wanted a simple way to restore my default view of all classes on. Clicking on open space does that.

Compare this to the one posted by Jonathan below. It doesn't matter to me if I click on "None" so there's no Alert Dialogue warning. I also want to be able to turn off whole groups, so there's no testing for object types with branching to other actions like entering a group. That's the "DoMenuText" part and the attending selection calls in his. He has different needs that his tool is designed to address.

This simple script also shows the use of a function that returns a value (GetClass) directly in a statement as a value, without assigning that value to a variable. Not a big deal, but sometimes it's a nice way to go.

Procedure classWork;

Var

pickit :Handle;

x,y :Real;

Procedure ShowAllClass;

Var

i: integer;

Begin

FOR i:=1 to ClassNum DO

ShowClass(ClassList(i));

End;

Begin

GetPt(x,y);

pickit:=PickObject(x,y);

IF pickit=NIL THEN ShowAllClass

ELSE HideClass(GetClass(pickit));

End;

Run(classWork);

Please notice the homage to Wilson Pickett :-)

I'd like to take this opportunity to say that I think this new forum is a great idea and I will be posting more. Unfortunately, most of mine are tailored to a very narrow purpose, and do nothing without the symbols they are designed to modify. Totally useless to the general population.

Also, it would seem that long (and sometimes not so clearly written) scripts may not be of much value posted in this tiny window. I find the scroll view that Robert switched to hard to read, as I can't see enough of the script at once.

Tried adding the "fully formed" tool with File Manager, but despite the fact that the plugin is .vst, file manager ran into a problem with it. I assume it's the same with .vso. This should be fixed so that object scripts can be shared without users having to recreate the parameter list. Posting .vso's here seems a bit pointless if people can't easily try them in a drawing.

Carry on,

Charles Croft

Just found out why the scroll window after pre-viewing this: all the indent formatting of my pasted script is gone. I do follow that protocol as it does indeed make more complicated scripts a lot easier to follow, and re-write as needed down the road.

Link to comment

Charles, if you use Tabs to indent your lines, replace all Tabs with 3 or 4 NBS characters (Non-Breaking Space - ASCII 0xCA or 202) before pasting the code in the window.

NBS is Option-Space on the Mac. Not sure on Windows. Assuming I indent like you, your code will look something like this (w/ 4 NBS per Tab):

Procedure classWork;

Var

????pickit :Handle;

????x,y :Real;

????Procedure ShowAllClass;

????Var

????????i: integer;

????Begin

????????FOR i:=1 to ClassNum DO

????????????ShowClass(ClassList(i));

????End;

Begin

????GetPt(x,y);

????pickit:=PickObject(x,y);

????IF pickit=NIL THEN ShowAllClass

????ELSE HideClass(GetClass(pickit));

End;

Run(classWork);

{***************}

Raymond

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