Jump to content

select by color script - what color is that?


Recommended Posts

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.

Pat

Link to comment

Henry,

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;

R1,G1,B1,R2,G2,B2:LongInt;

Procedure SelectIt(ThisObject:Handle);

Begin

GetPenFore(ThisObject,R2,G2,B2);

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

End;

Begin

H1:=FSActLayer;

GetPenFore(H1,R1,G1,B1);

DSelectAll;

SetSelect(H1);

ForEachObject(SelectIt,ALL);

End;

Run(SelectColorMatch);

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.

Regards,

Pat

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