Author Topic: Explode block with annotative state  (Read 1497 times)

0 Members and 1 Guest are viewing this topic.

latour_g

  • Newt
  • Posts: 184
Explode block with annotative state
« on: August 28, 2017, 04:01:29 PM »
Hi,

I need to explode a block that contains annotative objects.   The problem I have is the annotative state get loose after the explode.  Here is what I have :

Code - C#: [Select]
  1. DBObjectCollection coll = new DBObjectCollection();
  2. br.Explode(coll);
  3. System.Collections.IEnumerator iter = coll.GetEnumerator();
  4.  
  5. while (iter.MoveNext())
  6. {
  7.        Entity ent = (Entity)iter.Current;
  8.        ent.SetDatabaseDefaults();
  9.        btr.AppendEntity(ent);
  10.        tr.AddNewlyCreatedDBObject(ent, true);
  11. }
  12.  
  13. br.Erase();
  14. coll.Dispose();

When debugging, I see that "ent" has AnnotativeState at true.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Explode block with annotative state
« Reply #1 on: August 29, 2017, 12:06:20 AM »
That may involve deep clone. I clone objects and they do not copy the xdata so you may have the same problem.
basically you deep clone the objects from the block and transform them using the blockref.BlockTransform

latour_g

  • Newt
  • Posts: 184
Re: Explode block with annotative state
« Reply #2 on: August 30, 2017, 03:05:55 PM »
Thanks Bryco I'm gonna check this out