Jump to content

graphic attribut by class by defaut ?


Recommended Posts

Hello :)

components of symbols are "often" maybe always with local attribut instead of by class...

Is a quickly way to put it by class ?

the only way I've found is to edit the component select all and put all attribut by class
image.png.2f7d55cb474774426f9ea93dd64a2429.png
so is a tick box such as for the class to put all attribut by class when you import the symbol?

Or, as I do for now, the only way is to edit all symbol put the attribut by class and record it, and next time import that symbol instead of this one comming from vectorworks library ?

 

 

Link to comment
On 11/10/2024 at 7:30 PM, Jesse Cogswell said:

Do you need this as two separate scripts, one doing 2D geometry and one doing 3D geometry, or are you looking for a script to do both at the same time?  If you want to happen to ALL geometry in a symbol at once, it's actually pretty easy.  Doing them separately gets a little trickier, but is still doable.

I'm looking for a script to do both at the same time :)

 thanks a lot !

 

Link to comment

@Ben3B I had some time this evening, so I wrote a script for you.  Please keep in mind that this is very lightly tested, so do please let me know if it doesn't work as expected.

 

Running the menu command will open a dialog box listing all of the Symbols found in the drawing, sorted by Symbol Folder (marked "-" if not placed in a folder).  You will need to select which symbols you would like set By Class by placing a check mark in the Select column.  There is a button to Select All as well as a button to Select None.  When you press the OK button, all of the geometry within the chosen symbols will have the fill pattern, fill color, pen style, pen color, opacity, and lineweight set By Class.  This tool will not set markers or Text Style By Class.

 

image.thumb.png.99e304fe1057b7d49ddc9a55c21442c7.png

 

Attached to this post is a .vsm file called Set Symbols By Class.vsm.  It should work with all versions of Vectorworks 2019 or newer.  You will need to install this plug-in and put it into your workspace by following the instructions below:

  1. Download the attached .vsm file to a handy place.
  2. Open up your User Folder in an Explorer or Finder window.  The quick and dirty way to get to this is to open up the Vectorworks Preferences, go to the User Folder tab, and press the button marked Explore (Windows) or Open in Finder (Mac).
  3. Place the downloaded file within the Plug-ins folder of the User Folder.
  4. Restart Vectorworks.
  5. Once restarted, go to Tools - Workspaces - Edit Current Workspace.
  6. Select the Menus tab.
  7. In the box on the left, find and expand the category named JNC.
  8. In the box on the right, find a menu to place the command in, such as Edit, Modify, or Tools.
  9. Click and drag the Set Symbols By Class command from the box on the left to the desired menu in the box on the right.
  10. Press OK.

When I have a bit more time, I will flesh this out a bit with the ability to select which attributes to set and will add separate columns for choosing 2D or 3D geometry (there are many symbols from the Vectorworks library that I always want to set 2D by class but want to leave 3D as is).

 

Oh, I should also mention that if you want to localize the plug-in to your native language, you can totally do that.  To do so, follow these instructions (in English, so things might be labeled differently):

  1. Go to Tools - Plug-ins - Plug-in Manager.
  2. Click on the Third-party Plug-ins tab.
  3. Select the Set Symbols By Class command.
  4. Press the Customize button.
  5. Select the Strings tab.
  6. Double-click one of the three categories.
  7. Double-click any of the strings listed and enter your preferred text.
  8. Press OK.
  9. Once you've updated all of the strings you desire, press OK until you are back in the Plug-in Manager, then press Close.

The strings are divided up into three categories:

  • 3000 - Dialog Strings
    • These are strings that make up the elements of the dialog box.  Any and all of these can be changed.
  • 4000 - Dialog Help Strings
    • These are strings that populate the Help Box at the bottom of the dialog when you hover over dialog elements with your mouse.  These can also be freely changed.
  • 5000 - Misc Strings
    • These are assorted strings such as alerts and image locations.  You may change the following:
      • 5002 - This what will appear in the Symbol Folder column when a symbol is not inside a folder
      • 5003 - This is a warning that will appear if no Symbol Definitions are found in the drawing
      • 5004 - This is an alert that will pop up displaying the total number of symbols that have been updated.  This should start with an empty space.

 

Please refrain from changing strings 5000 and 5001 unless you'd rather have some other icon than a checkbox in the Select column.  Should be changed only if you really know what you are doing.

 

Hopefully this script does everything that you need for the moment and doesn't break anything.  Let me know if it does and I'll get it fixed as soon as I can.

Set Symbols By Class.vsm

Link to comment

Thank @Jesse Cogswell it works well thanks for your time !

there is the same limit as in the @MullinRJ script, it doesn't put the texture by class .

 

I often use the texture by class, for example for the speakers:

in all my files there are green in 2d plot and 3d wireframe, but black in shaded with a black texture applied to cabinets and grill texture to grill...

It is pretty easy and quick as soon as the symbols are well build with different class for cabinet and grill ;)

image.thumb.png.38c5f03e01161be124f82d4691ace209.png

Link to comment

Good call.  Texturing with script can get very complicated depending on texture parts (such as texture overrides by face), but I've added the ability for my script to set the overall texture By Class.  Depending on how your symbols are textured, this should work.  Unfortunately there is no code that I know of to poll the number of texture parts for an object, so setting overall is the best that I can do at the moment.

Set Symbols By Class.vsm

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