how to fill color inside a Closed polyline (Rectangle) in .net C#

how to fill color inside a Closed polyline (Rectangle) in .net C#

Anonymous
Not applicable
2,010 Views
3 Replies
Message 1 of 4

how to fill color inside a Closed polyline (Rectangle) in .net C#

Anonymous
Not applicable

Hi ,

 

I am creating a rectangle with below code.I have set a color as well for the line.But instead of that,I want to fill the inside of rectangle with a color .Is it possible to do from C#.please help

 

 double[]  coordinate = GlobalVariable.stringToDoubleArray(areapoints, ',');

//create polyline
polylineObject = null;

polylineObject = acadDocument.ModelSpace.AddPolyline(coordinate);

if (polylineObject != null)
{
polylineObject.Closed = true;
polylineObject.color = (ACAD_COLOR)GlobalVariable.colorDictionary[(parameter.GetElementColor().ToString())];
polylineObject.Linetype = GlobalVariable.lineTypeDictionary[lineTypeName[0].ToString().ToUpper()];
}

 

Thanks in advance,

Anu

0 Likes
Accepted solutions (2)
2,011 Views
3 Replies
Replies (3)
Message 2 of 4

vkpunique
Advocate
Advocate
Accepted solution

Hi anupaman, you need to use Hatch object.

Follow this reference : AutoCAD .NET Developer's Guide: Edit Hatch Patterns (autodesk.com)

0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks,I will check .can you please tell me which namespace does this belong to or the dll I have to refer.Mine is Autodesk 2020.
0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution
You can ignore this , I could get the AcadHatch from Interop.AutoCAD dll ..Thanks once again
0 Likes