
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using realDwg to fetch 2d shape form a dwg file.
I found I get too much geom which is not showing in the autoCAD.
I found the problem is that the BlockTableRecord contains too many useless BlockReferences.
Each one has its own entity of Curves and shapes.
Here is my code:
foreach (ObjectId id in ms)
{
Entity ent = (Entity)tr.GetObject(id, OpenMode.ForRead);
//if entity is text polyline, or other stuff, just save them and show them in svg later
if(ent is BlockReference) {
BlockReference br = (BlockReference)mBlockReferenceList[i];
BlockTableRecord blockRecord = (BlockTableRecord)tr.GetObject(br.BlockTableRecord, OpenMode.ForRead);
foreach (ObjectId subId in blockRecord)
{
//get text, curve, splines and so on
}
}
}
The dwg file showing in the AUTOCAD is like the image of AutoCAD.PNG, what I did is now showing like MyFetch.PNG.
Apparently I get too much useless stuff. But I don't know how to filter them. And I think the problem is caused by the BlockReference or the entity is invisible or hidden, but i tried to compare all the properties they all seems like same no matter the entity should show or should not show.
Any ideas ?
Any help is appreciated!
Thanks a huge!
Solved! Go to Solution.