Jump to content
Sign in to follow this  
Henry Finch

select by color script - what color is that?

Recommended Posts

I want to select objects by color from a file sent to me. How do I find what out what that color is to put in custom selction tool script?

Share this post

Link to post

If you select one of the objects, you can see in the Object Info Palette where in the polor palette the color falls. This will let you use the color picker in the Custom Selection dialog box to pick the same color.

If you want to manually edit the script and change the color numbers, you need to dig a little deeper. The information you want is in the VectorScript Appendix of the on-line help.

Select Help from the VectorWorks Help Menu. Select VS Function Reference. In the Right hand window click the link for the VS Function Reference.html. This will open a new browser window. In the top left pane, select Additional Resources, then the in bottom left pane select VectorScript Appendix.

Once you get to the appendix, scroll down until you see the color chart. Each cell in the chart has the reference number that you need for the script.


Share this post

Link to post

Thanks Pat,

However, when selecting the object with the unknown color and then looking at the attributes color palette, the object color is not shown or highlighted in the 16x16 color chart.


Share this post

Link to post


That is very strange, I though all the colors were mapped to their closest match on the 16x16 palette. Ok, how about this script.

Procedure SelectColorMatch;

{Patrick Stanford, Coviana, Inc.}

{www.vectortasks.com, www.podcad.tv}

{Copyright 2007, Coviana, Inc.}

{Released for public use}

Var H1:Handle;


Procedure SelectIt(ThisObject:Handle);



If ((R1=R2) & (G1=G2) & (B1=B2)) then SetSelect(ThisObject);










If you are looking for something other than the primary line color, you could replace teh GetPenFore with GetFillFore or GetFillBack or even Get Pen Back.

Copy everything between (and including) the Procedure SelectColorMatch) and the Run(SelectColorMatch); and paste them into a blank Vectorscript (created from the Resource Browser).

Touse the script, select one object of the desired color and run the script. Every object in the drawing with the same color will be selected.

Hope this helps.



Share this post

Link to post

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.

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.

  • Create New...