Hello,
I wonder how to get an entity within a BlockReference and whether the entity is online and pick up the StartPoint the same endpoint.
using System;
using System.Collections.Generic;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
namespace bloco_cotas
{
public class Class1
{
[CommandMethod("cotas")]
public void main()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
BlockTable tbBlock = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);
foreach (ObjectId blocoID in tbBlock)
{
BlockTableRecord rBlock = (BlockTableRecord)trans.GetObject(blocoID, OpenMode.ForRead);
//Entity ent = (Entity) ... ... ...
// Pegar startpoint endpoint se a entidade for linha.
}
}
}
}
}
Att, Robson
Take a look at this page
see NestedEntity algorithm, hth
~'J'~