Jump to content
  • 0
Sign in to follow this  
AndyM

Turn off classes

Question

How about a tool to turn off classes. You click on the tool then start selecting objects and that class turns off. Maybe someone has written a script for this already.

Share this post


Link to post

15 answers to this question

Recommended Posts

  • 0

Give this a try.Dave grin.gif" border="0

Procedure ClassPick;{Does not hide the none class}VAR pX, pY:REAL; obj:HANDLE; classname:STRING;

BEGIN GetPt(pX, pY); obj:= PickObject(pX, pY); SetSelect(obj); classname:= GetClass(obj); HideClass(classname);

END;RUN (ClassPick);

Share this post


Link to post
  • 0

Here is a script you can use that does the same thing as Fuge's, but will also work if you click on an object embedded in a wall, group or symbol.

Procedure TurnOffClass;var xpoint, ypoint, dummynum : real;thisobject, thissubobject : handle;classname : string;Procedure HideObject;var xpoint, ypoint, dummynum : real;thisobject, thissubobject : handle;classname : string;

BEGINDSelectAll;dummynum := 123;WHILE NOT GetPickObjectInfo(xpoint,ypoint,thisobject,thissubobject,dummynum) DO BEGIN GetPt(xpoint,ypoint);END;

IF (thissubobject = NIL) THEN BEGIN SetSelect(thisobject); END;IF (thissubobject <> NIL) THEN BEGIN SetSelect(thissubobject); END;Hide(SEL);

END;

Run(HideObject);BEGINdummynum := 123;WHILE NOT GetPickObjectInfo(xpoint,ypoint,thisobject,thissubobject,dummynum) DO BEGIN GetPt(xpoint,ypoint);END;IF (thissubobject = NIL) THEN BEGIN ClassName := GetClass(thisobject); HideClass(ClassName); END;IF (thissubobject <> NIL) THEN BEGIN ClassName := GetClass(thissubobject); HideClass(ClassName); END;END;Run(TurnOffClass);

Also, here is a script that will just hide the object you click. This is useful if you don't want to change the structure of your file, but just need to temporarily get to an object for some other reason. (Like snapping, or selecting something that is obscured) It will reappear next time the file is refreshed to the screen.

Procedure HideObject;var xpoint, ypoint, dummynum : real;thisobject, thissubobject : handle;classname : string;

BEGINDSelectAll;dummynum := 123;WHILE NOT GetPickObjectInfo(xpoint,ypoint,thisobject,thissubobject,dummynum) DO BEGIN GetPt(xpoint,ypoint);END;

IF (thissubobject = NIL) THEN BEGIN SetSelect(thisobject); END;IF (thissubobject <> NIL) THEN BEGIN SetSelect(thissubobject); END;Hide(SEL);

END;

Run(HideObject);

Hope that helps,Matthew Giampapa

Share this post


Link to post
  • 0

These are great scripts.

Now anybody have a simple script that will turn all classes back on? rolleyes.gif" border="0

Share this post


Link to post
  • 0

Yes tongue.gif" border="0 Dave---------------Procedure Showallclasses;VAR numberofclasses,ClassIndex:LONGINT;ClassVisibility:INTEGER;ClassName:STRING; BEGIN numberofclasses:=ClassNum; ClassIndex:=0;

FOR ClassIndex := 1 TO numberofclasses DO BEGIN ClassName:= ClassList( ClassIndex ); ClassVisibility:= GetCVis( ClassName );

IF ClassVisibility = -1 THEN BEGIN ShowClass( ClassName ); END; END; END;RUN ( Showallclasses );

Share this post


Link to post
  • 0

These are great! thank you all very much for making them available.

Could Nemetscek add an area to it's web site where other scripts could be posted?

Share this post


Link to post
  • 0

These are great! thank you all very much for making them available.

Could Nemetscek add an area to it's web site where other scripts could be posted?

Share this post


Link to post
  • 0

When I run Mathew's Hide Class script, I get the following error.

Line #31: Run(HideObject);

| { Error: Expected BEGIN }

Any ideas?

Thanks

Lonnie lrafaela@aol.com

Share this post


Link to post
  • 0

Lonnie,

Most likely when you did a copy and pasteto grab the script you may have either missedpart of the script or there may be a hiddencharacter that is causing the script not to run.One tiny thing being off will cause a problem.

That's my best guess.Dave

Share this post


Link to post
  • 0

Dave

I have copied and pasted it a few times but to no avail.

Can you give paste it in again and I will try that one?

Thank you,

Lonnie

Share this post


Link to post
  • 0

I'm afraid there was really some double-pasting on Matthew's original post.

Anyway, here are Matthew's ?turn off class by object? and Fuge's ?turn on all classes? scripts in plug-in form:

abav/vectorscript/

Issues: the class menu won't update before some redraw (i.e. pan). I had trouble with multiple visible layers.

[ 03-04-2002: Message edited by: Alexandre B A Villares ]

Share this post


Link to post
  • 0

Thanks for the scripts but when I use the Hide Class, I click the tool, the cursor changes to a small + and then I click on an object and the cursor turns into a hand momentarily but nothing happens

Also, how do you create custom Tool buttons with new pictures

Thanks

Share this post


Link to post
  • 0
Guest

quote:

Originally posted by CEA:
These are great! thank you all very much for making them available.

Could Nemetscek add an area to it's web site where other scripts could be posted?

There is also a section on the Tech Board called VectorScripts for this sort of discussion as well.

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.

×