Jump to content

quickly hide specifc classes

Recommended Posts

Hey Andy,

very interesting. I would also love to have some tool like that, only: What do I do with that kind of a script? May seem a stupid question, but, you know, I'm just clicking on things. So I suppose I should give it some kind of a name an put it into the plug-ins folder, but what kind of a command will I have to access after that?

(I hope for something like the AutoCAD command to switch of classes, you click on some object whose class you know, and the whole thing disappears from view)

Link to comment

Hey Esther,

First copy copy the script code(the tekst) to your clipboard. Then go to your resource pallet and, choose 'new script'.VW will ask you to give the script a name and a place to store the script. Paste te text into the script.Click OK. Go back to your resource pallet and locate the script. You will have to dubble click the script's name to activate it

Link to comment

It is a bit goofy how you have to do this, so I will try and explain. I do not know if scripts are different for mac and PC, but I am on a PC

Go to organize>create plug-inClick new...Select the "tool" radio button and click OKThis will add a tool called Untitled Plug-In to the list.Click re-name and name it.(turn off object class)Click the script button and paste this script into the box:

Procedure TurnOffClass;var xpoint, ypoint, dummynum : Real;thisobject, thissubobject : Handle;classname : String;BEGINdummynum := 123;WHILE NOT GetPickObjectInfo(xpoint, ypoint, thisobject, thissubobject, dummynum) DO GetPt(xpoint,ypoint);IF (thissubobject = NIL) THENBEGINClassName := GetClass(thisobject); HideClass(ClassName);END;IF (thissubobject <> NIL) THENBEGINClassName := GetClass(thissubobject);HideClass(ClassName); END;END;Run(TurnOffClass);

Click Done, then OK(If you want to get fancy you click on properties and replace the default icon with something else)

Now click on File>Workspaces>Workspace Editor>Edit Current Workspace.Click the "Tools" tab then scroll down to where it says Miscellaneous - Your new tool should be there. Now all you need to do is select the pallet you want to place it in from the right side list and drag it over there. You can even add a shortcut key if you want.

Click OK to exit the worspace editor.

Now it's in your workspace and you just click on the tool and then the object whose class you want to turn off. It doesn't work on groups for some reason. Maybe someone else can fix the code so that it will.

The method that Ruud suggested is simpler and will also work, but it will not stay with you when you start a new drawing. This way you will always have it.

Hope that helps.

[ 06-29-2002: Message edited by: AndyM7777 ]

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.

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