<?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: AutoCAD Architecture - Select Attribute nested within Multi View Block in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/10139585#M18378</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Thank you very much for responding.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In reality my goal is to get the attribute reference directly by clicking on the attribute by pick as it is possible to do it directly with block reference, using GetNestedEntity.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The multi view block reference has several attributes embedded in the block reference and in this case I wish the user to be able to choose the attribute.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In a way, I managed to solve this by going through the entities inside the reference block, checking the coordinate. But, I would like a better, cleaner solution, without so many contours.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm glad you paid attention to my post and replied.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 17:47:20 GMT</pubDate>
    <dc:creator>Gepaha</dc:creator>
    <dc:date>2021-03-08T17:47:20Z</dc:date>
    <item>
      <title>AutoCAD Architecture - Select Attribute nested within Multi View Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/9774258#M18376</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to select an attribute that is nested within a block and this (the block) is in turn nested within the multi view block.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried with PromptNestedEntityOptions and GetNestedEntity.&amp;nbsp;&lt;SPAN&gt;I expected the block to return but,&lt;/SPAN&gt;&amp;nbsp;the entity returned is the multi view block itself and&amp;nbsp;&lt;SPAN&gt;GetContainers always returns empty.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code I have is minimal because I haven't been able to proceed yet.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;var opt = new PromptNestedEntityOptions("\nSelect an attribute:");
var res = ed.GetNestedEntity(opt);
if (res.Status != PromptStatus.OK)
   return;
using (var tran = res.ObjectId.Database.TransactionManager.StartTransaction())
{
    var ent = (Entity)tran.GetObject(res.ObjectId, OpenMode.ForRead); // always return the multi view block reference
    if (entId.ObjectClass.DxfName.ToUpper() != "ATTRIB")
    {
        var ids = res.GetContainers();
        if (ids.Length &amp;gt; 0) // always is empty
        {                           
            // .......               
        }
    }
    tran.Commit();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can hel I am grateful.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/9774258#M18376</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2020-09-29T12:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD Architecture - Select Attribute nested within Multi View Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/10135484#M18377</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Please see below method&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("MultiViewBlockAttributes")]
        public static void MultiViewBlockAttributes()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            var opt = new PromptSelectionOptions();
            opt.MessageForAdding = "\nSelect Multi-View Block";
            PromptSelectionResult res = ed.GetSelection(opt);
            if (res.Status == PromptStatus.OK)
            {
                using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    
                    foreach (SelectedObject selected in res.Value)
                    {
                        Autodesk.Aec.DatabaseServices.MultiViewBlockReference multiViewBlockRef= tr.GetObject(selected.ObjectId, OpenMode.ForRead) as Autodesk.Aec.DatabaseServices.MultiViewBlockReference;
                        if (multiViewBlockRef.HasAttributes)
                        {
                            Autodesk.Aec.DatabaseServices.MultiViewBlockViewInstanceCollection views = multiViewBlockRef.ViewInstances;

                            foreach (Autodesk.Aec.DatabaseServices.MultiViewBlockViewInstance view in views)
                            {
                                Autodesk.Aec.DatabaseServices.MultiViewBlockAttributeReferenceCollection atts = view.AttributeReferences;
                                foreach (Autodesk.Aec.DatabaseServices.MultiViewBlockAttributeReference att in atts)
                                {

                                    ed.WriteMessage("\nAttribute: " + att.Prompt + " Value: " + att.Attribute.TextString);
                                }
                            }
                        }
                    }
                    tr.Commit();
                }
            }

        }

    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 16:40:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/10135484#M18377</guid>
      <dc:creator>marcin.sachs</dc:creator>
      <dc:date>2021-03-06T16:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD Architecture - Select Attribute nested within Multi View Block</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/10139585#M18378</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you very much for responding.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In reality my goal is to get the attribute reference directly by clicking on the attribute by pick as it is possible to do it directly with block reference, using GetNestedEntity.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The multi view block reference has several attributes embedded in the block reference and in this case I wish the user to be able to choose the attribute.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In a way, I managed to solve this by going through the entities inside the reference block, checking the coordinate. But, I would like a better, cleaner solution, without so many contours.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm glad you paid attention to my post and replied.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 17:47:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-architecture-select-attribute-nested-within-multi-view/m-p/10139585#M18378</guid>
      <dc:creator>Gepaha</dc:creator>
      <dc:date>2021-03-08T17:47:20Z</dc:date>
    </item>
  </channel>
</rss>

