.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hatch boundary tracing

0 REPLIES 0
Reply
Message 1 of 1
SaddamShaikh77
365 Views, 0 Replies

Hatch boundary tracing

Hello forum,

I am trying to read hatches from the drawing and want to trace the boundary of each hatch.

This is my code.
foreach (SelectedObject acSSObj in acsSet)
{
Entity acEnt = (Entity)acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForWrite);
if (acEnt != null)
{
string entLayer = acEnt.Layer;
string entType = acEnt.GetType().Name;
if (entType.Contains("Hatch"))
{
Hatch acHatch = acEnt as Hatch;
Extents3d? ext = acHatch.Bounds;
Point3d pt= ext.Value.MaxPoint;
Point3d pt1 = new Point3d( pt.X - 0.5,pt.Y - 0.5,pt.Z);
hatchPoints.Add(pt1);
}

}

}

foreach (Point3d internalPoint in hatchPoints)
{
DBObjectCollection objs = ed.TraceBoundary(internalPoint, true);
objCollection.Add(objs);
}

Here, while tracing boundary I am getting DBObjectCollection as null for most of the hatches. I am not getting why this is happening.

SaddamShaikh77_0-1619440946152.png

Here is my output. Yellow lines are the ones I am getting after tracing boundary and the rest are not getting traced properly.

Please guide me how can I get hatch boundary for each hatch independently.

I am attaching dwg for reference.

Thank you.

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report