.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Group text and polyline

1 REPLY 1
Reply
Message 1 of 2
khushboo.singh
384 Views, 1 Reply

Group text and polyline

Hi,

 

I have placed a text on a dwg file and placed a polyline around the same text.

But now I want to make both the text and the polyline as a Group, so that once we select text, the polyline should automatically be selected and vice-versa.

Could anyone please povide me a sample code for the same?

 

The attachment shows the Group, the Polyline and the Text.

1 REPLY 1
Message 2 of 2
_gile
in reply to: khushboo.singh

Hi,

 

May be you can get some inspiration from this :

 

        private static void Group(ObjectIdCollection ids)
        {
            Database db = ids[0].Database;
            Transaction tr = db.TransactionManager.TopTransaction;
            DBDictionary NOD =
                (DBDictionary)tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead);
            DBDictionary groups =
                (DBDictionary)tr.GetObject(NOD.GetAt("ACAD_GROUP"), OpenMode.ForWrite);
            using (Autodesk.AutoCAD.DatabaseServices.Group grp = 
new Autodesk.AutoCAD.DatabaseServices.Group()) { foreach (ObjectId id in ids) { grp.Append(id); } groups.SetAt("*", grp); } }

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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