Trying to change color of filled region type


I am trying to pass in a filled region type and change the color, however, I dont think I have my syntax quite right. I have attached an image with simple script and error message.


You can use:

NewFill.BackgroundPatternColor = DB.Color(R,G,B)

or probably: 
NewFill.ForegroundPatternColor = DB.Color(R,G,B)

The color is a property, so cannot be used as a function()

Also put your t.Commit() outside the for loop!

amazing thankyou!

1 Like

Out of interest, why didnt my go work, using:



Your NewFill is an object, objects have properties and methods.

A property is, as its saying, a property. For a e.g. Line this can be the Startpoint, Centerpoint or Length. Methods are actions you do with the object. Stuff like Move, Rotate. (You could say property is a noun, methods are verbs). Methods and properties are written like:


The color of a NewFill is a property. You called it as a Method, but you had to change the property

1 Like