<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Invisible entity in BlockReference in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567908#M68871</link>
    <description>Tony, how to regenerate BlockReference?</description>
    <pubDate>Wed, 07 Oct 2009 14:03:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-10-07T14:03:31Z</dc:date>
    <item>
      <title>Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567902#M68865</link>
      <description>I'm triing to add entities to BlockReference. Entities, that I want to add is not in database (created before in code).&lt;BR /&gt;&lt;BR /&gt;
{code}&lt;BR /&gt;
public static void AddEntityToBR(BlockReference br_Inc, Entity[] are_Inc)&lt;BR /&gt;
{&lt;BR /&gt;
   Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
   Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;&lt;BR /&gt;
   Autodesk.AutoCAD.ApplicationServices.Document dCurrentDock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
&lt;BR /&gt;
   ObjectIdCollection oidcAddedEntities = new ObjectIdCollection();&lt;BR /&gt;
&lt;BR /&gt;
   using (Autodesk.AutoCAD.ApplicationServices.DocumentLock DocLock = &lt;BR /&gt;
           dCurrentDock.LockDocument(Autodesk.AutoCAD.ApplicationServices.DocumentLockMode.Write, null, null, true))&lt;BR /&gt;
   {&lt;BR /&gt;
      using (Transaction trans = tm.StartTransaction())&lt;BR /&gt;
      {&lt;BR /&gt;
         try&lt;BR /&gt;
         {&lt;BR /&gt;
            BlockTable bt = (BlockTable)trans.GetObject(dCurrentDock.Database.BlockTableId, OpenMode.ForWrite, true, true);&lt;BR /&gt;
            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);&lt;BR /&gt;
&lt;BR /&gt;
            //Add entities to drawing&lt;BR /&gt;
            foreach (Entity eTmp in are_Inc) &lt;BR /&gt;
            {                             &lt;BR /&gt;
               oidcAddedEntities.Add(btr.AppendEntity(eTmp)); &lt;BR /&gt;
               trans.AddNewlyCreatedDBObject(eTmp, true);                           &lt;BR /&gt;
            } &lt;BR /&gt;
 &lt;BR /&gt;
            //Open BlockTableRecord and all entities forwrite as Tony Tanzillo said here http://discussion.autodesk.com/forums/thread.jspa?messageID=5700703�&lt;BR /&gt;
 &lt;BR /&gt;
            BlockTableRecord btrOfBR = (BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord, OpenMode.ForWrite);&lt;BR /&gt;
            foreach (ObjectId oidCur in oidcAddedEntities) &lt;BR /&gt;
            { &lt;BR /&gt;
               DBObject dboTmp = trans.GetObject(oidCur, OpenMode.ForWrite); &lt;BR /&gt;
            } &lt;BR /&gt;
            btrOfBR.AssumeOwnershipOf(oidcAddedEntities);                         &lt;BR /&gt;
 &lt;BR /&gt;
            trans.Commit(); &lt;BR /&gt;
         } &lt;BR /&gt;
         catch (Exception) &lt;BR /&gt;
         { &lt;BR /&gt;
            trans.Abort(); &lt;BR /&gt;
            throw; &lt;BR /&gt;
         } &lt;BR /&gt;
      } &lt;BR /&gt;
   } &lt;BR /&gt;
} &lt;BR /&gt;
{code} &lt;BR /&gt;
 The code above adds entities to BR (BlockReference), but I don't see them on screen (in the drawing). If I doubleclick on BR in AutoCad (I mean open BlockReference editing mode) and then close BlockReference editing mode with save changes, I can see it in the drawing. &lt;BR /&gt;
I don't know how to make added entities to be visible in the drawing using C#?&lt;BR /&gt;
If I call this function&lt;BR /&gt;
{code}&lt;BR /&gt;
        public static void RegenerateWindow()&lt;BR /&gt;
        {&lt;BR /&gt;
            Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
&lt;BR /&gt;
            object oAcadDoc = doc.AcadDocument;&lt;BR /&gt;
            oAcadDoc.GetType().InvokeMember("Regen", System.Reflection.BindingFlags.InvokeMethod, null, oAcadDoc,&lt;BR /&gt;
            new object[] { 1 });&lt;BR /&gt;
        }&lt;BR /&gt;
{code}&lt;BR /&gt;
added object become visible, but not as member of BR. I mean if i position my cursor on any entity, that belong to BR, whole BR become highlighted. If I position cursor on just added entity, BR do not become highlighted.</description>
      <pubDate>Tue, 06 Oct 2009 10:20:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567902#M68865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T10:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567903#M68866</link>
      <description>Sorry, the discussion software reformatted your code, and I don't have the &lt;BR /&gt;
time to format it to be readable.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;VIAVITAE&gt; wrote in message news:6266396@discussion.autodesk.com...&lt;BR /&gt;
I'm triing to add entities to BlockReference. Entities, that I want to add &lt;BR /&gt;
is not in database (created before in code).&lt;BR /&gt;
{code} public static void AddEntityToBR(BlockReference br_Inc, Entity[] &lt;BR /&gt;
are_Inc) { Database db = HostApplicationServices.WorkingDatabase; &lt;BR /&gt;
Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = &lt;BR /&gt;
db.TransactionManager; Autodesk.AutoCAD.ApplicationServices.Document &lt;BR /&gt;
dCurrentDock = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; &lt;BR /&gt;
ObjectIdCollection oidcAddedEntities = new ObjectIdCollection(); using &lt;BR /&gt;
(Autodesk.AutoCAD.ApplicationServices.DocumentLock DocLock = &lt;BR /&gt;
dCurrentDock.LockDocument(Autodesk.AutoCAD.ApplicationServices.DocumentLockMode.Write, &lt;BR /&gt;
null, null, true)) { using (Transaction trans = tm.StartTransaction()) { try &lt;BR /&gt;
{ BlockTable bt = &lt;BR /&gt;
(BlockTable)trans.GetObject(dCurrentDock.Database.BlockTableId, &lt;BR /&gt;
OpenMode.ForWrite, true, true); BlockTableRecord btr = &lt;BR /&gt;
(BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], &lt;BR /&gt;
OpenMode.ForWrite); //Add entities to drawing foreach (Entity eTmp in &lt;BR /&gt;
are_Inc) { oidcAddedEntities.Add(btr.AppendEntity(eTmp)); &lt;BR /&gt;
trans.AddNewlyCreatedDBObject(eTmp, true); } //Open BlockTableRecord and all &lt;BR /&gt;
entities forwrite as Tony Tanzillo said here &lt;BR /&gt;
http://discussion.autodesk.com/forums/thread.jspa?messageID=5700703? &lt;BR /&gt;
BlockTableRecord btrOfBR = &lt;BR /&gt;
(BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord, &lt;BR /&gt;
OpenMode.ForWrite); foreach (ObjectId oidCur in oidcAddedEntities) { &lt;BR /&gt;
DBObject dboTmp = trans.GetObject(oidCur, OpenMode.ForWrite); } &lt;BR /&gt;
btrOfBR.AssumeOwnershipOf(oidcAddedEntities); trans.Commit(); } catch &lt;BR /&gt;
(Exception) { trans.Abort(); throw; } } } } {code} The code above adds &lt;BR /&gt;
entities to BR (BlockReference), but I don't see them on screen (in the &lt;BR /&gt;
drawing). If I doubleclick on BR in AutoCad (I mean open BlockReference &lt;BR /&gt;
editing mode) and then close BlockReference editing mode with save changes, &lt;BR /&gt;
I can see it in the drawing. I don't know how to make added entities to be &lt;BR /&gt;
visible in the drawing using C#? If I call this function {code} public &lt;BR /&gt;
static void RegenerateWindow() { &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Document doc = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; &lt;BR /&gt;
object oAcadDoc = doc.AcadDocument; oAcadDoc.GetType().InvokeMember("Regen", &lt;BR /&gt;
System.Reflection.BindingFlags.InvokeMethod, null, oAcadDoc, new object[] &lt;BR /&gt;
{ 1 }); } {code} added object become visible, but not as member of BR. I &lt;BR /&gt;
mean if i position my cursor on any entity, that belong to BR, whole BR &lt;BR /&gt;
become highlighted. If I position cursor on just added entity, BR do not &lt;BR /&gt;
become highlighted.&lt;/VIAVITAE&gt;</description>
      <pubDate>Tue, 06 Oct 2009 10:24:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567903#M68866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T10:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567904#M68867</link>
      <description>Tony, here is post without formatting.&lt;BR /&gt;
&lt;BR /&gt;
I'm triing to add entities to BlockReference. Entities, that I want to add is not in database (created before in code).&lt;BR /&gt;
&lt;BR /&gt;
public static void AddEntityToBR(BlockReference br_Inc, Entity[] are_Inc)&lt;BR /&gt;
{&lt;BR /&gt;
   Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
   Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;&lt;BR /&gt;
   Autodesk.AutoCAD.ApplicationServices.Document dCurrentDock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
 &lt;BR /&gt;
   ObjectIdCollection oidcAddedEntities = new ObjectIdCollection();&lt;BR /&gt;
 &lt;BR /&gt;
   using (Autodesk.AutoCAD.ApplicationServices.DocumentLock DocLock = &lt;BR /&gt;
           dCurrentDock.LockDocument(Autodesk.AutoCAD.ApplicationServices.DocumentLockMode.Write, null, null, true))&lt;BR /&gt;
   {&lt;BR /&gt;
      using (Transaction trans = tm.StartTransaction())&lt;BR /&gt;
      {&lt;BR /&gt;
         try&lt;BR /&gt;
         {&lt;BR /&gt;
            BlockTable bt = (BlockTable)trans.GetObject(dCurrentDock.Database.BlockTableId, OpenMode.ForWrite, true, true);&lt;BR /&gt;
            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);&lt;BR /&gt;
 &lt;BR /&gt;
            //Add entities to drawing&lt;BR /&gt;
            foreach (Entity eTmp in are_Inc) &lt;BR /&gt;
            {                             &lt;BR /&gt;
               oidcAddedEntities.Add(btr.AppendEntity(eTmp)); &lt;BR /&gt;
               trans.AddNewlyCreatedDBObject(eTmp, true);                           &lt;BR /&gt;
            } &lt;BR /&gt;
 &lt;BR /&gt;
            //Open BlockTableRecord and all entities forwrite as Tony Tanzillo said here http://discussion.autodesk.com/forums/thread.jspa?messageID=5700703&lt;BR /&gt;
 &lt;BR /&gt;
            BlockTableRecord btrOfBR = (BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord, OpenMode.ForWrite);&lt;BR /&gt;
            foreach (ObjectId oidCur in oidcAddedEntities) &lt;BR /&gt;
            { &lt;BR /&gt;
               DBObject dboTmp = trans.GetObject(oidCur, OpenMode.ForWrite); &lt;BR /&gt;
            } &lt;BR /&gt;
            btrOfBR.AssumeOwnershipOf(oidcAddedEntities);                         &lt;BR /&gt;
 &lt;BR /&gt;
            trans.Commit(); &lt;BR /&gt;
         } &lt;BR /&gt;
         catch (Exception) &lt;BR /&gt;
         { &lt;BR /&gt;
            trans.Abort(); &lt;BR /&gt;
            throw; &lt;BR /&gt;
         } &lt;BR /&gt;
      } &lt;BR /&gt;
   } &lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The code above adds entities to BR (BlockReference), but I don't see them on screen (in the drawing). If I doubleclick on BR in AutoCad (I mean open BlockReference editing mode) and then close BlockReference editing mode with save changes, I can see it in the drawing.&lt;BR /&gt;
I don't know how to make added entities to be visible in the drawing using C#?&lt;BR /&gt;
If I call this function&lt;BR /&gt;
&lt;BR /&gt;
public static void RegenerateWindow()&lt;BR /&gt;
        {&lt;BR /&gt;
            Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
 &lt;BR /&gt;
            object oAcadDoc = doc.AcadDocument;&lt;BR /&gt;
            oAcadDoc.GetType().InvokeMember("Regen", System.Reflection.BindingFlags.InvokeMethod, null, oAcadDoc,&lt;BR /&gt;
            new object[] { 1 });&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
added object become visible, but not as member of BR. I mean if i position my cursor on any entity, that belong to BR, whole BR become highlighted. If I position cursor on just added entity, BR do not become highlighted.</description>
      <pubDate>Tue, 06 Oct 2009 11:21:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567904#M68867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T11:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567905#M68868</link>
      <description>Sorry, what you're trying to do makes no sense.&lt;BR /&gt;
&lt;BR /&gt;
You're adding new objects to the database, and then&lt;BR /&gt;
using AssumeOwnershipOf() to transfer them to another&lt;BR /&gt;
owner block. There is no point in doing that.&lt;BR /&gt;
&lt;BR /&gt;
Just add the new entities to the block that you want&lt;BR /&gt;
to be the owner.&lt;BR /&gt;
&lt;BR /&gt;
Lastly, It's difficult to read code that has identifiers&lt;BR /&gt;
that are prequalified with the namespace.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;VIAVITAE&gt; wrote in message news:6266398@discussion.autodesk.com...&lt;BR /&gt;
Tony, here is post without formatting.&lt;BR /&gt;
&lt;BR /&gt;
I'm triing to add entities to BlockReference. Entities, that I want to add&lt;BR /&gt;
is not in database (created before in code).&lt;BR /&gt;
&lt;BR /&gt;
public static void AddEntityToBR(BlockReference br_Inc, Entity[] are_Inc)&lt;BR /&gt;
{&lt;BR /&gt;
   Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
   Autodesk.AutoCAD.DatabaseServices.TransactionManager tm =&lt;BR /&gt;
db.TransactionManager;&lt;BR /&gt;
   Autodesk.AutoCAD.ApplicationServices.Document dCurrentDock =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
&lt;BR /&gt;
   ObjectIdCollection oidcAddedEntities = new ObjectIdCollection();&lt;BR /&gt;
&lt;BR /&gt;
   using (Autodesk.AutoCAD.ApplicationServices.DocumentLock DocLock =&lt;BR /&gt;
           dCurrentDock.LockDocument(Autodesk.AutoCAD.ApplicationServices.DocumentLockMode.Write,&lt;BR /&gt;
null, null, true))&lt;BR /&gt;
   {&lt;BR /&gt;
      using (Transaction trans = tm.StartTransaction())&lt;BR /&gt;
      {&lt;BR /&gt;
         try&lt;BR /&gt;
         {&lt;BR /&gt;
            BlockTable bt =&lt;BR /&gt;
(BlockTable)trans.GetObject(dCurrentDock.Database.BlockTableId,&lt;BR /&gt;
OpenMode.ForWrite, true, true);&lt;BR /&gt;
            BlockTableRecord btr =&lt;BR /&gt;
(BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace],&lt;BR /&gt;
OpenMode.ForWrite);&lt;BR /&gt;
&lt;BR /&gt;
            //Add entities to drawing&lt;BR /&gt;
            foreach (Entity eTmp in are_Inc)&lt;BR /&gt;
            {&lt;BR /&gt;
               oidcAddedEntities.Add(btr.AppendEntity(eTmp));&lt;BR /&gt;
               trans.AddNewlyCreatedDBObject(eTmp, true);&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
            //Open BlockTableRecord and all entities forwrite as Tony&lt;BR /&gt;
Tanzillo said here&lt;BR /&gt;
http://discussion.autodesk.com/forums/thread.jspa?messageID=5700703&lt;BR /&gt;
&lt;BR /&gt;
            BlockTableRecord btrOfBR =&lt;BR /&gt;
(BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord,&lt;BR /&gt;
OpenMode.ForWrite);&lt;BR /&gt;
            foreach (ObjectId oidCur in oidcAddedEntities)&lt;BR /&gt;
            {&lt;BR /&gt;
               DBObject dboTmp = trans.GetObject(oidCur, OpenMode.ForWrite);&lt;BR /&gt;
            }&lt;BR /&gt;
            btrOfBR.AssumeOwnershipOf(oidcAddedEntities);&lt;BR /&gt;
&lt;BR /&gt;
            trans.Commit();&lt;BR /&gt;
         }&lt;BR /&gt;
         catch (Exception)&lt;BR /&gt;
         {&lt;BR /&gt;
            trans.Abort();&lt;BR /&gt;
            throw;&lt;BR /&gt;
         }&lt;BR /&gt;
      }&lt;BR /&gt;
   }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The code above adds entities to BR (BlockReference), but I don't see them on&lt;BR /&gt;
screen (in the drawing). If I doubleclick on BR in AutoCad (I mean open&lt;BR /&gt;
BlockReference editing mode) and then close BlockReference editing mode with&lt;BR /&gt;
save changes, I can see it in the drawing.&lt;BR /&gt;
I don't know how to make added entities to be visible in the drawing using&lt;BR /&gt;
C#?&lt;BR /&gt;
If I call this function&lt;BR /&gt;
&lt;BR /&gt;
public static void RegenerateWindow()&lt;BR /&gt;
        {&lt;BR /&gt;
            Autodesk.AutoCAD.ApplicationServices.Document doc =&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
&lt;BR /&gt;
            object oAcadDoc = doc.AcadDocument;&lt;BR /&gt;
            oAcadDoc.GetType().InvokeMember("Regen",&lt;BR /&gt;
System.Reflection.BindingFlags.InvokeMethod, null, oAcadDoc,&lt;BR /&gt;
            new object[] { 1 });&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
added object become visible, but not as member of BR. I mean if i position&lt;BR /&gt;
my cursor on any entity, that belong to BR, whole BR become highlighted. If&lt;BR /&gt;
I position cursor on just added entity, BR do not become highlighted.&lt;/VIAVITAE&gt;</description>
      <pubDate>Tue, 06 Oct 2009 14:48:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567905#M68868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T14:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567906#M68869</link>
      <description>I think, that code below is what you advise me to do.&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
            Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
            TransactionManager tm = db.TransactionManager;&lt;BR /&gt;
            Document dCurrentDock = Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
&lt;BR /&gt;
            ObjectIdCollection oidcAddedEntities = new ObjectIdCollection();&lt;BR /&gt;
&lt;BR /&gt;
            using (DocumentLock DocLock = dCurrentDock.LockDocument(DocumentLockMode.Write, null, null, true))&lt;BR /&gt;
            {&lt;BR /&gt;
                using (Transaction trans = tm.StartTransaction())&lt;BR /&gt;
                {&lt;BR /&gt;
                    try&lt;BR /&gt;
                    {&lt;BR /&gt;
                        BlockTableRecord btrOfBR = (BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord, OpenMode.ForWrite);&lt;BR /&gt;
                        foreach (Entity eTmp in are_Inc)&lt;BR /&gt;
                        {&lt;BR /&gt;
                            oidcAddedEntities.Add(btrOfBR.AppendEntity(eTmp));&lt;BR /&gt;
                            trans.AddNewlyCreatedDBObject(eTmp, true);&lt;BR /&gt;
                        }&lt;BR /&gt;
&lt;BR /&gt;
                        trans.Commit();&lt;BR /&gt;
                    }&lt;BR /&gt;
                    catch (Exception)&lt;BR /&gt;
                    {&lt;BR /&gt;
                        trans.Abort();&lt;BR /&gt;
                        throw;&lt;BR /&gt;
                    }&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
But situation didn't changed. Newly added entities is invisible. If only I enter BlockReference edit mode, they become vivsible.</description>
      <pubDate>Tue, 06 Oct 2009 17:32:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567906#M68869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T17:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567907#M68870</link>
      <description>You have to regenerate the block references.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;VIAVITAE&gt; wrote in message news:6266769@discussion.autodesk.com...&lt;BR /&gt;
I think, that code below is what you advise me to do.&lt;BR /&gt;
Database db = HostApplicationServices.WorkingDatabase; TransactionManager tm &lt;BR /&gt;
= db.TransactionManager; Document dCurrentDock = &lt;BR /&gt;
Application.DocumentManager.MdiActiveDocument; ObjectIdCollection &lt;BR /&gt;
oidcAddedEntities = new ObjectIdCollection(); using (DocumentLock DocLock = &lt;BR /&gt;
dCurrentDock.LockDocument(DocumentLockMode.Write, null, null, true)) { using &lt;BR /&gt;
(Transaction trans = tm.StartTransaction()) { try { BlockTableRecord btrOfBR &lt;BR /&gt;
= (BlockTableRecord)trans.GetObject(br_Inc.BlockTableRecord, &lt;BR /&gt;
OpenMode.ForWrite); foreach (Entity eTmp in are_Inc) { &lt;BR /&gt;
oidcAddedEntities.Add(btrOfBR.AppendEntity(eTmp)); &lt;BR /&gt;
trans.AddNewlyCreatedDBObject(eTmp, true); } trans.Commit(); } catch &lt;BR /&gt;
(Exception) { trans.Abort(); throw; } } } }&lt;BR /&gt;
But situation didn't changed. Newly added entities is invisible. If only I &lt;BR /&gt;
enter BlockReference edit mode, they become vivsible.&lt;/VIAVITAE&gt;</description>
      <pubDate>Tue, 06 Oct 2009 18:59:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567907#M68870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-06T18:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567908#M68871</link>
      <description>Tony, how to regenerate BlockReference?</description>
      <pubDate>Wed, 07 Oct 2009 14:03:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567908#M68871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-07T14:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Invisible entity in BlockReference</title>
      <link>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567909#M68872</link>
      <description>I have founded solution.&lt;BR /&gt;
To regenerate BlockReference you have to regenerate layer, where BR is placed.&lt;BR /&gt;
To regenerate layer watch here http://discussion.autodesk.com/forums/thread.jspa?threadID=467019</description>
      <pubDate>Fri, 09 Oct 2009 18:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/invisible-entity-in-blockreference/m-p/2567909#M68872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-09T18:30:25Z</dc:date>
    </item>
  </channel>
</rss>

