.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
Anonymous
534 Views, 3 Replies

Get entity

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

3 REPLIES 3
Message 2 of 4
Hallex
in reply to: Anonymous

Take a look at this page

 

http://through-the-interface.typepad.com/through_the_interface/2010/08/changing-the-layer-or-color-o...

 

see NestedEntity algorithm, hth

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 4
Anonymous
in reply to: Anonymous

Thanks friend for help

[]'s

Robson

Message 4 of 4
Hallex
in reply to: Anonymous

TRhanks to Kean Smiley Happy

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost