Jump to content
  • 0

Shortcut To Change Classes?


trashcan

Question

Recommended Posts

  • 0

I use the eye dropper tool all the time for changing an object’s class. There just needs to be another object nearby already in the reqd class. I’ve even changed the shortcut key for it to ‘E’.

 

Another way is in the nav palette. Right click on the class and select “assign to selection”.

Edited by Boh
  • Like 2
Link to comment
  • 0

@markdd that's pretty great

@Boh I use the eyedropper all the time for this purpose! shift-E is one of the first shortcuts I learned 🙂! Didn't know about the right click on the class and assign to selection. 

 

Was hoping for something like press "F" type "Assign to Class" type "class name" - that would be incredible. so much time saving. 

Link to comment
  • 0
1 hour ago, trashcan said:

Didn't know about the right click on the class and assign to selection. 

This one is handy as it saves a lot of scrolling through the class drop down list in the oip.

 

Another trick is to use scripts. I have some for commonly used classes that simply place the selected object in a specified class.

 

Then there is also the custom tools command where you can create scripts to draw an objects and also have them placed in specified classes.

Below is a bunch of scripts I created for drawing 2d details. All the objects take on the class attributes so it makes drawing details very quick.

 

image.png.dc255d5519db5fcfa0abfbf289f0ac7f.png

 

  • Like 3
Link to comment
  • 0

woah @Boh - I haven't made my own scripts for VWX yet but that seems like a promising solve. I am talking about classes I use and reuse from file to file so this could be the solution here. 

 

Am I correct in assuming that's a custom tool pallet you've added to your workspace and filled with your scripts? Do they come up in Quick Search? Trying to spend less time on the mouse and more on the keyboard 🤑

 

 

Link to comment
  • 0

Yes quick ways to do repetitive tasks are definitely worth the time to set up!

 

50 minutes ago, trashcan said:

Am I correct in assuming that's a custom tool pallet you've added to your workspace and filled with your scripts?

There are at least a few ways to make scripts in VW without having to know how to actually write them. When you make the script you need to stick them in a palette. If you don't have any custom palettes then VW will ask you to make one.

 

I've made a few scripts to place objects in certain classes. This is one which will place selected objects into the "None" class. To customise it for other classes you just need to replace "None" to "Whatever is the name of the class you want to place the objects in".

 

Procedure SetTheClass;
CONST
	kCName = 'None';
VAR
	gh1 : HANDLE;
	
Function DoIt(h1 : HANDLE) : BOOLEAN;
BEGIN	
	SetClassN(h1, kCName, True);
END;

BEGIN
	Locus(0, 0);
	gh1 := LNewObj;
	ForEachObjectInList(DoIt, 2, 2, FInGroup(GetParent(gh1)));
	DelObject(gh1);
END;
Run(SetTheClass);

 

I

55 minutes ago, trashcan said:

Do they come up in Quick Search?

You can use quick search toggle custom script palettes on and off. You would still need to click on the script you want.

 

Hope this is helpful in your efficiency drive!

  • Like 1
Link to comment
  • 0

Great details! 

 

If you use that script to create a new plug-in menu command script, you can add to menus and then it'll show up in quick search:

image.thumb.png.727bdf0fade553a4877e589d39d6caaa.png

 

This means that virtually anything you can script you can add as a menu item, which then you can add a hotkey if you want, or just use it in quick search.

 

Amazing. 

 

Figured this out by reading this post:

 

Link to comment
  • 0

Yes! I've done that too and created a whole bunch of custom selection scripts for various common objects like lines, circles, spaces, text, etc etc and made them all commands in custom menus. Another advantage of making them commands over resource scripts is that scripts in the RM are file specific whereas commands are available to use on any file.

 

One thing I do like with palettes though is that you can have them right next to where you are workin,g which is what I do when I am using them a lot, and when finished  you can switch them off. I have a bunch of scripts in custom palettes in our drawing template files.

 

Thanks for the reminder about the quick search function. TBH I had totally forgotten about both that and the smart options display. I'll have to try and start using them in my daily workflow.

 

Link to comment
  • 0

I'd love to be able to combine this script:

https://forum.vectorworks.net/index.php?/topic/51890-make-all-attributes-by-class/&do=findComment&comment=352627

 

and this script (above):

https://forum.vectorworks.net/index.php?/topic/89851-shortcut-to-change-classes/&do=findComment&comment=412274

 

into one script. Sort of like a master reset for active class & attributes. I tried but failed so would love some help 🙂 

  • Like 3
Link to comment
  • 0

@Boh - coming back here, quick question - that command will show up in quick search if I add to menus. is there a way to for those command scripts to show up without doing that work around?

 

Also curious about how to write a script that is Create New Class and Assign to Selected Objects - essentially combining your change class to none and create class scripts. Any pointers?

Link to comment
  • 0
1 hour ago, trashcan said:

Also curious about how to write a script that is Create New Class and Assign to Selected Objects - essentially combining your change class to none and create class scripts. Any pointers?

 

If you've already selected the objects, is that not possible in the OIP? Seems like roughly the same number of clicks. That said, seems like this command should already exist. Let me check AutoPlot... 

 

BTW Michael's wish was fulfilled in v2022 but the command may need to be added to your workspace:

 

120602193_ScreenShot2022-04-28at2_00_12PM.thumb.png.68a69cc1563ae2eb08abda23d3bb3d2f.png

Link to comment
  • 0
23 minutes ago, trashcan said:

Create Class with Selected Attributes works as a work around but there are some obvious caveats to it - like if you have objects in a group with multiple attributes, then it's not the droids you're looking for 😢

 

Right but if you:

  1. Select objects
  2. Click Class in the OIP
  3. Click New Class... 

I don't see any extra clicks from a context click to run a script:

  1. Select objects
  2. Right-Click on an object or nothing aka "document"
  3. Click Create new class from selection... 

Maybe I'm missing something or...  You must unlearn what you have learned.

 

Btw I've been populating my custom workspace context clicks with my favorite commands from Sam's AP workspace, along with some great suggestions from other users, because I hate throwing my cursor around a huge screen (and there's not always a shortcut for everything), but I'm getting to a point where any more commands I add have to earn a spot in there before it gets too crowded (law of diminishing returns).

 

On that note, Sam will be presenting those commands at the next NYC VUG.

Link to comment
  • 0

@trashcanBe careful what you wish for.

 

Try this script. If you like the way it behaves you can create a Plug-in Menu Command from it, add it to your workspace and give it a keyboard shortcut.

 

I hope you type better than I do. 😉

 

Extremely lightly tested. Use at your own risk. Test on a non-critical file before using.

 

Procedure Reclass;
{May3, 2022}
{©2022 Patrick Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

{No Warranty Expressed of Implied. Use at your own risk.}

{Opens a dialog box to allow the user to type the name of the Class}
{to set to the visible selected objects. If the class does not}
{exist it asks for confirmation before creating it. Set the active}
{class back to that set before the script is executed}

VAR	TheClass, ActClass	:String;
	L1					:LongInt;
	Exists, Create		:Boolean;


Procedure Execute(Hd1:Handle);
	BEGIN
		SetClass(Hd1, TheClass);
		ResetObject(Hd1);
	End;
	
BEGIN
	ActClass:=ActiveClass;
	Exists:=False;
	Create:=False;
	TheClass:=StrDialog('New Class Name', 'None');
	For L1 := 1 to ClassNum DO
		If ClassList(L1) = TheClass then Exists := True;
	If Not Exists THEN
		BEGIN
			Create:=YNDialog('Class does not exist. Create it?');
			If Create then NameClass(TheClass);
		End;
	ForEachObject(Execute, ((VSEL=TRUE)));
	NameClass(ActClass);
	RedrawSelection;
End;

Run(Reclass);

 

  • Like 2
  • Love 1
Link to comment
  • 0

I have a keyboard shortcut I use at least 20 times a day to change layers of selected objects for the same reason you want to change classes.  

 

I keep meaning to put guardrails on it so it's safe for anyone to drive.  If that interests you let me know and I'll make it safe and post it.

Link to comment
  • 0

I get that - all the other software I use is adding Sherlock like capabilities with a hotkey and it is amazing how much it's improved my workflow. Quick search kind of does that, but it doesn't verify against existing data (ditto for Vectorworks scripts). Like your amazing RECLASS script, if it had verification, as you filled out the class it would autocomplete against existing classes. Takes a little of the guess work out of it. 

Link to comment
  • 0
16 hours ago, trashcan said:

Like your amazing RECLASS script, if it had verification, as you filled out the class it would autocomplete against existing classes. Takes a little of the guess work out of it. 

 

Data Validation is something I've discussed / requested with Sam but it sounds like VW has an issue with accomplishing that for some reason. Would love to be wrong about this as I use data validation regularly elsewhere.

Link to comment
  • 0

 

2 hours ago, Mark Aceto said:

Data Validation is something I've discussed / requested with Sam but it sounds like VW has an issue with accomplishing that for some reason.

 

Data Validation is an issue with pull down menus in the OIP and Worksheets when trying to paste a drop down value into multiple selections.  I understand the problem but they have conquered many harder tasks that were not as sorely needed.

As for validation while typing, I don't see VS ever doing that.  VW is capable of it as we see in the new VS editor, to a really annoying extent.

  • Like 2
Link to comment
  • 0

Is it possible to run a script to re-assign classes in a hybrid symbol? What I would love to do is re-class truss and lighting symbols in spotlight so that they conform to my class structure. Im having to do this manually at the moment and it gets tedious very quickly when having to do a new series of truss, for example. Of course, once I do this - I save all re-classed symbols into a favourites file.

 

 

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
Answer this question...

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