create circle filled region

ameer.mansourWAK8Y
Advocate
Advocate

create circle filled region

ameer.mansourWAK8Y
Advocate
Advocate

I want to create circle as filled region 

 

public FilledRegion CreateFilledRegion(Document _doc, XYZ centre,double radius ,ElementId fillTypeId, ElementId lineStyleId, ElementId viewID)
{



var circle =Arc.Create(centre, radius, RevitUnitConvertor.DegToInternal(0),
RevitUnitConvertor.DegToInternal(360), XYZ.BasisX, XYZ.BasisY);




List<CurveLoop> profileloops = new List<CurveLoop>();
CurveLoop profileloop = new CurveLoop();


profileloop.Append(circle);

profileloops.Add(profileloop);


FilledRegion filledRegion = FilledRegion.Create(_doc, fillTypeId, viewID, profileloops);
filledRegion.SetLineStyleId(lineStyleId);

return filledRegion;
}



 

but it throws an exception. Any thoughts?

0 Likes
Reply
Accepted solutions (1)
594 Views
2 Replies
Replies (2)

RPTHOMAS108
Mentor
Mentor
Accepted solution

Split boundary into two arcs with start and end angle parameters.

1) 0 to pi

2) pi to 2 * pi

0 Likes

ameer.mansourWAK8Y
Advocate
Advocate
Nice Trick!
it worked
thanks
0 Likes