cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Macro select by RGB value

SOLVED
Highlighted
Newbie

Macro select by RGB value

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Macro select by RGB value

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

View solution in original post

5 REPLIES 5
Highlighted

Re: Macro select by RGB value

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?

Highlighted

Re: Macro select by RGB value

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.

Highlighted

Re: Macro select by RGB value

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

View solution in original post

Highlighted

Re: Macro select by RGB value

This worked perfectly, thank you!

Highlighted

Re: Macro select by RGB value


Hello Trevor,

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

Announcements