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

IsoDraw macro change_line_color

SOLVED
Highlighted
Level 1

IsoDraw macro change_line_color

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: IsoDraw macro change_line_color

Try this

Macro pencolor


activeDoc.pens["Thick"].color.type = "rgbValues"
activeDoc.pens["Thick"].color.RGB = "{RGB 255 116 66}"

End Macro

4 REPLIES

Re: IsoDraw macro change_line_color

Try this

Macro pencolor


activeDoc.pens["Thick"].color.type = "rgbValues"
activeDoc.pens["Thick"].color.RGB = "{RGB 255 116 66}"

End Macro

Re: IsoDraw macro change_line_color

yes......many thanks ....again

That has worked well!!

Re: IsoDraw macro change_line_color

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?

Re: IsoDraw macro change_line_color

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