Jump to content

Classes how to create subclasses?


Recommended Posts

  • Vectorworks, Inc Employee

To create subclasses, you only need to add a - so "Glass-Clear" would be a subclass of "Glass"

To move an existing class into a subclass of another, youd add MainClassName- to the front of the name of the original class. This system is a bit clunky and has been marked for improvement.

  • Like 2
Link to comment

And make sure you use a hyphen (short dash), not an en-dash or em-dash (longer dashes) as only the hyphen is recognized as the subclass separator.

 

I believe you can make sub-classes up to 4 levels deep (Class plus 3 nested sub-classes. After that hyphens don't make a deeper subclass but can be used in the name.

 

You also need to make sure Hierarchical display is turned on in the Organization dialog box and the Navigation Palette.

  • Like 2
Link to comment
  • 1 year later...

 

Hi @JimW @Pat Stanford 

 

This is indeed a simple way to move classes to subclasses but only efficient when you want to move a few classes by manually adding a prefix. 

I usually import a lot of DWGs and mostly add a prefix to keep them organized once imported from import settings, but I'm wondering how would you move, say 100 classes to sub-classes if it's not done when importing. 

I hope I'm able to explain well.

 

Thanks

Kohli

 

 

  • Like 2
Link to comment
6 hours ago, Kohli said:

I don't see the point of paying for Vectorworks and then program to make basic tools.

Quite a few of us think the same way, it has been requested before that VW tries to make this either available or part of the base program (base meaning the US international version on which localised versions are based). Especially for those of us working internationally this can be an issue if some tool that could be considered basic/essential is only available locally as it can cause issues with editability of drawings.

Link to comment

Well, even though I have the Edit Class Names command, I still regularly use this script created by @Matt Panzer in 1997!

 

It simply adds a prefix to all classes in a file. Typical scenario is when I import dwg I do so into a blank file that has this script, run the script adding a "z-" prefix to all classes. Maybe clean out the dwg a bit more before importing it into my project file. All the random dwg classes will be nicely collapsed away at the bottom of my class list.

{
Written by:
Matthew G. Panzer
PanzerCAD Services, Inc.
1997
}
PROCEDURE ChangeClassNames;
VAR
Count: INTEGER;
ClassName: STRING;
PrefixStr: STRING;

BEGIN
PrefixStr := StrDialog('Add prefix(to all classes):', 'DWG-');
IF (ClassNum>1)
AND
YNDialog('This will rename all of your classes! Are you sure you wish to continue?')
THEN
BEGIN
FOR Count := 3 TO ClassNum DO BEGIN
RenameClass( ClassList(Count), ConCat(PrefixStr, ClassList(Count)) );
END;
END;
END;
RUN(ChangeClassNames);

 

 

Link to comment
19 minutes ago, Boh said:

Well, even though I have the Edit Class Names command, I still regularly use this script created by @Matt Panzer in 1997!

I'll take the Edit Class Names command over the script, if only because I need to rename sets of classes afterwards when things change greatly in the drawings.😊

 

One would think that VW would consider this to be a basic feature that would be of benefite for a lot of VW users and therefore included it in the base version for all VW versions/localisations. Let's hope it will be included in VW2020.

  • Like 1
Link to comment

@Art V sorry for my naive question but how can providing tools which are already tested ok elsewhere cause issues with editability of same file format drawings, because of their geographical locations? I honestly fail to understand the real cause behind it but that's not my concern unless i'm provided a software which helps me focus on my design projects rather than unnecessary programming.  🙂

Link to comment
4 hours ago, Kohli said:

Are you aware of any other script which allows me to rename multiple classes instead of ALL classes? 

Sorry no. There is a class mapping feature which lets you map the classes of regularly imported classes. Though I have never used that feature.  

Link to comment
16 hours ago, Kohli said:

@Art V sorry for my naive question but how can providing tools which are already tested ok elsewhere cause issues with editability of same file format drawings, because of their geographical locations? I honestly fail to understand the real cause behind it but that's not my concern unless i'm provided a software which helps me focus on my design projects rather than unnecessary programming.  🙂

For example... I have some custom tool that creates objects that you can see but cannot fully edit as intended unless you have that tool yourself. So if you get a file from someone in another part of the world where they use such kind of a tool then you may not be able to edit it at all or only in a (very) limited way or after converting it into a dumb object.

 

In the case of a rename tool this is not going to be much of an issue, but with some other tools it may be an issue.

 

Link to comment
16 hours ago, Boh said:

Sorry no. There is a class mapping feature which lets you map the classes of regularly imported classes. Though I have never used that feature.  

I tried using the class mapping feature on another occasion while i was on vw2018, it wasn't very user-friendly and eventually, I did things manually. Thanks for reminding though, I'll dig into it again on vw2019.

Link to comment
6 hours ago, Art V said:

For example... I have some custom tool that creates objects that you can see but cannot fully edit as intended unless you have that tool yourself. So if you get a file from someone in another part of the world where they use such kind of a tool then you may not be able to edit it at all or only in a (very) limited way or after converting it into a dumb object.

 

In the case of a rename tool this is not going to be much of an issue, but with some other tools it may be an issue.

 

I see what you mean, which means providing as many of such tools in the base package would avoid causing the issues of editability. I hope the future versions include these exclusive additional features in their base package.

Link to comment
  • 3 months later...

I been using VW for 20 years and now finally having a look at managing the seemingly endless string of classes that are part of every DWG file I import - (generally a Topographical survey).  Until now been always deleting all imported classes because it made a mess out of my files.

 

So let me get this straight - the only way to clean up and organize these things is to manually - one by one- change the class name or use some form of programming code???

 

Seriously???

 

Why the hell cant we just create a 'new' sub class and drag em all in there...come on guys

  • Like 1
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...