Please, can somebody help? i am a programmer, and i am novice in autocad drawings. I had attached a drawing, that i don't know how it was created. it seems that the entities were grouped. but they are not blocks. am I right????
i want to read each group of entities and add a block definition for it if i didn't read similar group before and the group of entities that i read should be a block reference. can i do that using C#?? and are these groups of entities or blocks??
or everything that i said is wrong??
The entities are not grouped or made into blocks. Go to help & you will see that creating blocks are pretty straightforward.
You can tell what an entity is selected by clicking on it & it is hilighted. if the properties window is open you will see what type of entity or entities are there. If you are really good with C# it would be nice if you would share some of your successes.
The advantage to blocks usually is attaching associated data & subnesting other blocks etc. Also the ability to reuse the already defined group of entities called a block.
I do not know of a situation where it makes sense to initially create block with any type of programming.
I personally think that connecting just the entity's xdata directly to a relational database makes more sense than blocks but requires some programming ability.
thanks Mike, I found that there are entities when I created this peace of code.
/// Summary description for Class1.
public class Class1:Autodesk.AutoCAD.Runtime.IExtensionApplication
public void Initialize()
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
BlockTable bt = (BlockTable)trans.GetObject(HostApplicationServices.WorkingDatabase.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
foreach (ObjectId id in btr)
Entity ent = (Entity)trans.GetObject(id, OpenMode.ForWrite, false);
////////////////////////////////The following code i copied it from RonaldF Message in
ObjectId ids = new ObjectId;
ids = ent.Id;
SubentityId index = new SubentityId(SubentityType.Edge, 0);
FullSubentityPath path = new FullSubentityPath(ids, index);