Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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
Solved! Go to Solution.
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
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?
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.
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
This worked perfectly, thank you!
Hello Trevor,
Is there any way to fill the closed contour line with Color using macro? I am using IsoDraw CAD Process 7.3