Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I need to change the color of a pen to....
Define Mycolor as ColorSpec
Mycolor.type = "rgbValues"
Mycolor.rgb.red = 255
Mycolor.rgb.green = 116
Mycolor.rgb.blue = 66
I found this......
activeDoc.pens["Thick"].color.type = "colorRef"
activeDoc.pens["Thick"].color.color = "Mycolor"
activeDoc.pens["Thick"].color.tone = 1
...but I'm confused about the syntax
any help most appreciated
Solved! Go to Solution.
Try this
Macro pencolor
activeDoc.pens["Thick"].color.type = "rgbValues"
activeDoc.pens["Thick"].color.RGB = "{RGB 255 116 66}"
End Macro
Try this
Macro pencolor
activeDoc.pens["Thick"].color.type = "rgbValues"
activeDoc.pens["Thick"].color.RGB = "{RGB 255 116 66}"
End Macro
yes......many thanks ....again
That has worked well!!
This macro works great if you always know the pen name, but is there a way to make it search all pens and change there color reguardless of the name?
This may help. This makes all pens that have names that start with 0 have a black color.
Macro Make Pens Black DEFINE p AS Integer DEFINE i AS Integer DEFINE BkCr AS String Select None i = ActiveDoc.PenCount p = 1 #Starts loop that goes through all existing pens. While ((p <> i + 1) = True) If (Left(ActiveDoc.Pens[p].Name, 1) = "0") then BkCr = ActiveDoc.Pens[p].Name activeDoc.pens[BkCr].color.type = "colorRef" activeDoc.pens[BkCr].color.color = "Black" activeDoc.pens[BkCr].color.tone = 1 p = p + 1 Else p = p + 1 End if End While End macro