<?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: Adding Lines/Circles to a Block in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570431#M15447</link>
    <description>&lt;P&gt;Use block editor (either right click and chose edit block, or type BEDIT and pick your block from the list) and make changes, then use BCLOSE to close the editor and choose to save the changes.&lt;/P&gt;&lt;P&gt;You can use the in place block editor (as above but pick edit in place our type REFEDIT) to add things already drawn outside the block to the block, using REFSET to add or remove objects from the block. Close refedit with REFCLOSE and chose save. While the editors are active the be ribbon should display the options and commands available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/582192"&gt;@JBerns&lt;/a&gt;&amp;nbsp;good catch, I didn't notice which forum this was in.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 18:49:30 GMT</pubDate>
    <dc:creator>cwr-pae</dc:creator>
    <dc:date>2021-08-24T18:49:30Z</dc:date>
    <item>
      <title>Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570393#M15443</link>
      <description>&lt;P&gt;I am unsure how to add new lines/circles to an already created block. I was able to remove lines/circles but when I try to add them they do not show up.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:32:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570393#M15443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T18:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570419#M15444</link>
      <description>&lt;P&gt;One of many ways:&lt;/P&gt;&lt;P&gt;Select the block, r-click, choose "Block Editor"&amp;nbsp; make your edits.&amp;nbsp; &amp;nbsp;Close Block Editor, Be sure to save the changes.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:40:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570419#M15444</guid>
      <dc:creator>tboehler</dc:creator>
      <dc:date>2021-08-24T18:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570422#M15445</link>
      <description>&lt;P&gt;You must &lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_BlockTableRecord_AppendEntity__CallerMustClose__Entity" target="_blank" rel="noopener"&gt;append the entity&lt;/A&gt; to the BlockTableRecord. Afterwards you should &lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_EditorInput_Editor_Regen" target="_blank" rel="noopener"&gt;regen&lt;/A&gt; in order to update block references.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:47:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570422#M15445</guid>
      <dc:creator>miguelmachadoecosta</dc:creator>
      <dc:date>2021-08-24T18:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570425#M15446</link>
      <description>&lt;P&gt;@Anonymous,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are trying to add these lines/circles programmatically? I presume this since you are asking in the AutoCAD .NET forum, not the AutoCAD General Forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:46:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570425#M15446</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2021-08-24T18:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570431#M15447</link>
      <description>&lt;P&gt;Use block editor (either right click and chose edit block, or type BEDIT and pick your block from the list) and make changes, then use BCLOSE to close the editor and choose to save the changes.&lt;/P&gt;&lt;P&gt;You can use the in place block editor (as above but pick edit in place our type REFEDIT) to add things already drawn outside the block to the block, using REFSET to add or remove objects from the block. Close refedit with REFCLOSE and chose save. While the editors are active the be ribbon should display the options and commands available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/582192"&gt;@JBerns&lt;/a&gt;&amp;nbsp;good catch, I didn't notice which forum this was in.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:49:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570431#M15447</guid>
      <dc:creator>cwr-pae</dc:creator>
      <dc:date>2021-08-24T18:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570507#M15448</link>
      <description>&lt;P&gt;I am in the .NET forum so I assumed it was clear I was writing a plugin. I am trying to use c# (But seeing as there is no c# forum .NET instructions work)&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 19:19:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570507#M15448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570513#M15449</link>
      <description>&lt;P&gt;I am in the .NET forum so I assumed it was clear I was writing a plugin. I am trying to use c# (But seeing as there is no c# forum .NET instructions work) But thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 19:21:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570513#M15449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T19:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570528#M15450</link>
      <description>&lt;P&gt;I have tried regen after appending the entity and it isnt working. Ill attach my code here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;   // Open a transaction REQUIRES FOR ANY CHANGES
            using (var transaction = Active.Database.TransactionManager.StartTransaction()) {
                var options = new PromptSelectionOptions {
                    MessageForAdding = "Select AT LEAST TWO blocks to mark as elevator"
                };

                var result = Active.Editor.GetSelection(options);
                if (result.Status != PromptStatus.OK) {
                    Active.Editor.WriteMessage("\nNo block reference selected");
                    return;
                }

                // Must select at least two blocks
                if (result.Value.Count &amp;gt;= 2) {
                    var set = result.Value;

                    // Iterates through set of objects
                    foreach (var id in set.GetObjectIds()) {
                        // Get Block
                        var blockRef = (BlockReference)transaction.GetObject(id, OpenMode.ForWrite);
                        var tableRecord = (BlockTableRecord)transaction.GetObject(blockRef.BlockTableRecord, OpenMode.ForWrite);

                        // Get Blocks attributes and searched for 'P_TYPE'
                        var attCol = blockRef.AttributeCollection;
                        foreach (ObjectId attId in attCol) {
                            var attRef = (AttributeReference)transaction.GetObject(attId, OpenMode.ForWrite);

                            // Set P_TYPE to 10 (Elevator)
                            if (attRef.Tag != "P_TYPE") continue;
                            attRef.TextString = "10";
                            Active.Editor.WriteMessage("\nBlock changed to type Elevator");
                        }
                        
                        // Searched for lines and circles and removes them
                        foreach (var lineId in tableRecord) {
                            var obj = transaction.GetObject(lineId, OpenMode.ForWrite);
                            if (obj is Line || obj is Circle){
                                obj.Erase();
                            }
                        }
                   
                       
                        // TODO add new drawing to block
                        // Circle
                        Circle acCirc = new Circle();
                        acCirc.Center = new Point3d(0, 0, 0);
                        acCirc.Radius = 2;
                        tableRecord.AppendEntity(acCirc);
                        
                        
                       Active.Editor.Regen();
                        
                        
                        
                        
                        
                    }
                } else {
                    Active.Editor.WriteMessage("\nNot enough blocks selected");
                }
                transaction.Commit(); // Commits Change
                    
                Active.Editor.Regen();

            }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 19:26:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570528#M15450</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T19:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570532#M15451</link>
      <description>&lt;P&gt;I am in .NET so I assumed it was clear I am programming. Thank you though.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 19:26:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570532#M15451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T19:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570679#M15452</link>
      <description>&lt;P&gt;Not sure what exactly you want to achieve. But here is what you need to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after you append the circle to the block definition (BlockTableRecord) here:&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-general"&gt;&lt;CODE&gt;tableRecord.AppendEntity(acCirc);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you also &lt;STRONG&gt;NEED TO ADD&lt;/STRONG&gt; the newly created Circle to the transaction, following the above line of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;transaction.AddNewlyCreatedDBObject(acCirc, true);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you only call Editor.Regen() &lt;STRONG&gt;AFTER&lt;/STRONG&gt; the transaction is committed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 20:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10570679#M15452</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-08-24T20:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572555#M15453</link>
      <description>&lt;P&gt;Thanks! That did it!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 13:13:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572555#M15453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T13:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572590#M15454</link>
      <description>&lt;P&gt;Hey. So that has done it but I only want it to edit the shape of the currently selected block, when I do this it changes the Insert Blocks shape as well as any others of that type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I only effect the one selected?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 13:26:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572590#M15454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T13:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572833#M15455</link>
      <description>&lt;P&gt;What you're asking goes against the concept of blocks. You have one definition of a block and then you can insert it multiple times. How would you do what you want in the AutoCAD gui? You would have to copy the block to a new block definition and then insert the copy. You need to do the same thing with code.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 14:35:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572833#M15455</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2021-08-25T14:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572853#M15456</link>
      <description>&lt;P&gt;I apologize for being such a novice. I have never used AutoCAD before but have been tasked to make a plugin for it for my coworkers.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 14:41:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572853#M15456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T14:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572872#M15457</link>
      <description>&lt;P&gt;In AutoCAD what would I need to do to use a blockReference as a template but add on or remove to/from the drawing without effecting the original template blockReference or creating a new one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to use the blockReference as a template of sorts.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 14:46:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10572872#M15457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T14:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Lines/Circles to a Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10573380#M15458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;I apologize for being such a novice. I have never used AutoCAD before but have been tasked to make a plugin for it for my coworkers.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In my opinion, you cannot claim to program AutoCAD if you do not master at least the basics of the software, especially in this case, the notions of block definition (&lt;STRONG&gt;&lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_BlockTableRecord" target="_blank" rel="noopener"&gt;BlockTableRecord&lt;/A&gt;&lt;/STRONG&gt;) and block reference (&lt;STRONG&gt;&lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_BlockReference" target="_blank" rel="noopener"&gt;BlockReference&lt;/A&gt;&lt;/STRONG&gt;). You should at least read &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-5AE8AD29-14EE-4636-A17D-EC86ED7047AF" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;this section&lt;/STRONG&gt;&lt;/A&gt; of the AutoCAD .NET documentation and the related topics.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 17:43:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/adding-lines-circles-to-a-block/m-p/10573380#M15458</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2021-08-25T17:43:46Z</dc:date>
    </item>
  </channel>
</rss>

