Skip to main content
1-Visitor
April 2, 2015
Solved

Macro select by RGB value

  • April 2, 2015
  • 2 replies
  • 2304 views

I'm trying to create a macro that will select a fill by an RGB value (R:252, G:249, B:206). So far I haven't been able to get this to work, can anyone help? Please & Thanks

Best answer by thendricks

You'll need to load both the macro and submacro, but this should work for your specific need.

Macro SelectFill

Define el as Element

Define RedGreenBlue as String

Define id as String

Select None

#Select if Type is not equal to "Line"

Select All

el = ActiveDoc.FirstSelectedElement

On Error Goto skipError

While (exists(el))

RedGreenBlue = el.fill.colSpec.rgb

#message "~" + RedGreenBlue + "~"

if(RedGreenBlue <> "{RGB 252 249 206}")

Create object_info el

id = el.info.id

Select Object id Toggle

else

end if

RedGreenBlue = ""

el = el.nextSelectedElement

End While

End Macro

SubMacro skipError

End SubMacro

2 replies

5-Regular Member
April 2, 2015

Hi Justin,

Could you let us know what product you are working on this for, and what process you have tried so far that has been unsuccessful?

1-Visitor
April 2, 2015

I'm using IsoDraw 7.1. Most of the time I can just record the steps i'm doing and that's good enough. I usually go Edit>Select and they choose how/what i want from there. There are no options for select by rgb or cmyk. Thats about where i got stuck.

12-Amethyst
April 29, 2015

You'll need to load both the macro and submacro, but this should work for your specific need.

Macro SelectFill

Define el as Element

Define RedGreenBlue as String

Define id as String

Select None

#Select if Type is not equal to "Line"

Select All

el = ActiveDoc.FirstSelectedElement

On Error Goto skipError

While (exists(el))

RedGreenBlue = el.fill.colSpec.rgb

#message "~" + RedGreenBlue + "~"

if(RedGreenBlue <> "{RGB 252 249 206}")

Create object_info el

id = el.info.id

Select Object id Toggle

else

end if

RedGreenBlue = ""

el = el.nextSelectedElement

End While

End Macro

SubMacro skipError

End SubMacro

1-Visitor
June 17, 2015


Hello Trevor,

Is there any way to fill the closed contour line with Color using macro? I am using IsoDraw CAD Process 7.3