Henry Finch Posted September 6, 2007 Share Posted September 6, 2007 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? Quote Link to comment
Pat Stanford Posted September 6, 2007 Share Posted September 6, 2007 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 Quote Link to comment
Henry Finch Posted September 7, 2007 Author Share Posted September 7, 2007 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. Henry Quote Link to comment
Pat Stanford Posted September 7, 2007 Share Posted September 7, 2007 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 Quote Link to comment
Gerard Jonker Posted September 8, 2007 Share Posted September 8, 2007 Hi Pat and Henri, If you want to dive into VectorWorks colours, I can only suggest this article: http://www.vectorlab.info/wiki/index.php?title=Colours Regards, Gerard Quote Link to comment
_c_ Posted September 9, 2007 Share Posted September 9, 2007 I'd suggest to wait until the new VW comes out, the article might be obsolete. http://www.vectorworks2008.net/ Quote Link to comment
Recommended Posts
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.