Message 1 of 11
Not applicable
08-30-2011
12:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to capture the real point of a line within a block?
I used the following method to captured some entities from a block.
I need the point of the entities, to redesign a dimension.
But if I move the original block, and then run my program. The dimension is redesigned in the original location of the block.
Basically the code looks like this:
private void FilterDimension()
{
TypedValue[] typedValue = new TypedValue[2];
typedValue.SetValue(new TypedValue((int)DxfCode.Start, "INSERT"), 0);
typedValue.SetValue(new TypedValue((int)DxfCode.LayerName, "Dimension"), 1);
SelectionFilter selectionFilter = new SelectionFilter(typedValue);
ObjectId[] objectIdList = editor.SelectAll(selectionFilter).Value.GetObjectIds();
for (int i = 0; i < objectIdList.Length; i++)
{
ObjectId objectId = objectIdList[i];
BlockReference blockReference = (BlockReference)objectId.GetObject(OpenMode.ForRead);
BlockTableRecord blockTableRecord = (BlockTableRecord)blockReference.BlockTableRecord.GetObject(OpenMode.ForRead);
//Listas de objetos
List<Line> lineList = new List<Line>();
List<DBText> dBTextList = new List<DBText>();
List<Arc> arcList = new List<Arc>();
List<Hatch> hatchList = new List<Hatch>();
foreach (ObjectId item in blockTableRecord)
{
DBObject dBObject = (DBObject)item.GetObject(OpenMode.ForRead);
if (dBObject.GetType() == typeof(Line))
{
lineList.Add((Line)dBObject);
}
else if (dBObject.GetType() == typeof(DBText))
{
dBTextList.Add((DBText)dBObject);
}
else if (dBObject.GetType() == typeof(Arc))
{
arcList.Add((Arc)dBObject);
}
else if (dBObject.GetType() == typeof(Hatch))
{
hatchList.Add((Hatch)dBObject);
}
}
}
}But if I use use the End / Start Point captured in "LineList" for example, he did not return the value if the block was moved.
How could I fix it?
Now, thanks!
![]()
Solved! Go to Solution.