Thanks for your suggestion.
I managed creating a circle with a pattern.
But I'm still unable to change the color.
Also I have changed the filling pattern, but I cant change it to the Pattern "<Solid fill>".
Below I've added my code.
public void drawCircle(Document doc, XYZ center, double radius)
{
FilteredElementCollector fillRegionTypes= new FilteredElementCollector(doc).OfClass(typeof(FilledRegionType));
foreach (FilledRegionType frt in fillRegionTypes)
{
List<CurveLoop> profileloops = new List<CurveLoop>();
double xMax = center.X + radius;
double xMin = center.X - radius;
double step = Math.PI/8;
List<XYZ> pointList = new List<XYZ>();
for (double phi = 0; phi <= (2*Math.PI); phi = phi + step)
{
double x1 = center.X + radius * Math.Cos(phi);
double y1 = center.Y + radius*Math.Sin(phi);
pointList.Add(new XYZ(x1, y1, 0));
}
pointList.Add(new XYZ(center.X + radius * Math.Cos(0), center.Y + radius*Math.Sin(0), 0));
CurveLoop profileloop = new CurveLoop();
XYZ successor = null;
foreach (XYZ point in pointList)
{
if (successor != null && point != null)
{
Line line = Line.CreateBound(successor, point);
profileloop.Append(line);
}
successor = point;
}
profileloops.Add(profileloop);
ElementId activeViewId = doc.ActiveView.Id;
using (Transaction transaction = new Transaction(doc))
{
if (transaction.Start("Create filled region") == TransactionStatus.Started)
{
FilledRegion filledRegion1 = FilledRegion.Create(doc, frt.Id, activeViewId, profileloops);
transaction.Commit();
}
}
break;
}
}