<?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 Can't select elements in a linked model in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12681983#M6147</link>
    <description>&lt;P&gt;I'm trying to select all columns in a linked model. However this doesn't work. It correctly gets Ids of the column elements, but the final ` uiDoc.Selection.SetElementIds(columnIds);` doesn't select anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    [Transaction(TransactionMode.Manual)]
    public class SelectLinkedColumns : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            // Get the Revit application and document
            UIApplication uiApp = commandData.Application;
            UIDocument uiDoc = uiApp.ActiveUIDocument;
            Document doc = uiDoc.Document;

            try
            {
                // Prompt user to select a linked Revit model
                Reference linkedRef = uiDoc.Selection.PickObject(ObjectType.LinkedElement, "Select a linked Revit model");
                Element linkedElement = doc.GetElement(linkedRef.LinkedElementId);
                RevitLinkInstance linkedInstance = linkedElement as RevitLinkInstance;
                Document linkedDoc = linkedInstance.GetLinkDocument();

                // Select all columns in the linked model
                FilteredElementCollector collector = new FilteredElementCollector(linkedDoc);
                ICollection&amp;lt;ElementId&amp;gt; columnIds = collector.OfCategory(BuiltInCategory.OST_Columns)
                                                            .WhereElementIsNotElementType()
                                                            .ToElementIds();

                // Select the columns
                uiDoc.Selection.SetElementIds(columnIds);

                TaskDialog.Show("Success", $"Selected {columnIds.Count} columns in the linked model.");
            }
            catch (Exception ex)
            {
                TaskDialog.Show("Error", ex.Message);
                return Result.Failed;
            }

            return Result.Succeeded;
        }
    }&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 02 Apr 2024 18:09:17 GMT</pubDate>
    <dc:creator>DanielKP2Z9V</dc:creator>
    <dc:date>2024-04-02T18:09:17Z</dc:date>
    <item>
      <title>Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12681983#M6147</link>
      <description>&lt;P&gt;I'm trying to select all columns in a linked model. However this doesn't work. It correctly gets Ids of the column elements, but the final ` uiDoc.Selection.SetElementIds(columnIds);` doesn't select anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    [Transaction(TransactionMode.Manual)]
    public class SelectLinkedColumns : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            // Get the Revit application and document
            UIApplication uiApp = commandData.Application;
            UIDocument uiDoc = uiApp.ActiveUIDocument;
            Document doc = uiDoc.Document;

            try
            {
                // Prompt user to select a linked Revit model
                Reference linkedRef = uiDoc.Selection.PickObject(ObjectType.LinkedElement, "Select a linked Revit model");
                Element linkedElement = doc.GetElement(linkedRef.LinkedElementId);
                RevitLinkInstance linkedInstance = linkedElement as RevitLinkInstance;
                Document linkedDoc = linkedInstance.GetLinkDocument();

                // Select all columns in the linked model
                FilteredElementCollector collector = new FilteredElementCollector(linkedDoc);
                ICollection&amp;lt;ElementId&amp;gt; columnIds = collector.OfCategory(BuiltInCategory.OST_Columns)
                                                            .WhereElementIsNotElementType()
                                                            .ToElementIds();

                // Select the columns
                uiDoc.Selection.SetElementIds(columnIds);

                TaskDialog.Show("Success", $"Selected {columnIds.Count} columns in the linked model.");
            }
            catch (Exception ex)
            {
                TaskDialog.Show("Error", ex.Message);
                return Result.Failed;
            }

            return Result.Succeeded;
        }
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Apr 2024 18:09:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12681983#M6147</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-04-02T18:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12682698#M6148</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;P&gt;u can see this solution , has code to select link element&lt;/P&gt;&lt;P&gt;&lt;A title="Can not select any linked element in revit using revit api" href="https://forums.autodesk.com/t5/revit-api-forum/can-not-select-any-linked-element-in-revit-using-revit-api/m-p/12655547#M77625" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/can-not-select-any-linked-element-in-revit-using-revit-api/m-p/12655547#M77625&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 00:33:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12682698#M6148</guid>
      <dc:creator>scgq425</dc:creator>
      <dc:date>2024-04-03T00:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12682913#M6149</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Unfortunately, we aren't able to Highlight Linked Model Elements. This feature is not available in Revit API :(.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Highlight Linked Elements discussion threat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/highlight-and-tag-linked-elements/m-p/5294217#M7339" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/highlight-and-tag-linked-elements/m-p/5294217#M7339&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A small suggestion in your code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;  // Prompt user to select a linked Revit model
  // You can directly select Linked Model itself, don't need to select Linked Element
                Reference linkedRef = uiDoc.Selection.PickObject(ObjectType.Element, "Select a linked Revit model");
                Element linkedModel = doc.GetElement(linkedRef);
                RevitLinkInstance linkedInstance = linkedModel as RevitLinkInstance;
                Document linkedDoc = linkedInstance.GetLinkDocument();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 03:42:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12682913#M6149</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-04-03T03:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683374#M6150</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7278275"&gt;@scgq425&lt;/a&gt;&amp;nbsp;by select I mean to select them in the Revit UI - the same way the user selects objects in a linked model by pressing TAB and left mouse button&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 08:29:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683374#M6150</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-04-03T08:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683385#M6151</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8461394"&gt;@Mohamed_Arshad&lt;/a&gt;, do you know where users can vote up this feature to be added to Revit API?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 08:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683385#M6151</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-04-03T08:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683399#M6152</link>
      <description>&lt;P&gt;HI &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Already a threat has been raised in Idea Station and it is also accepted by the Autodesk Team. But I don't why they are not implemented still &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&amp;nbsp;You can post your vote in the below link with a comment. Let's see &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Voting URL: &lt;A href="https://forums.autodesk.com/t5/revit-ideas/highlight-element-selection-in-linked-files/idi-p/7619701" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-ideas/highlight-element-selection-in-linked-files/idi-p/7619701&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this will Help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 08:49:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683399#M6152</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-04-03T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select elements in a linked model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683429#M6153</link>
      <description>&lt;P&gt;Threats won't help us convince autodesk to implementing users' ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but thanks for sharing the link - I've upvoted it as well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way this is not a solution - I've accidentally pressed that button and there doesn't seem to be a way to uncheck it now&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 09:03:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-select-elements-in-a-linked-model/m-p/12683429#M6153</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-04-03T09:03:23Z</dc:date>
    </item>
  </channel>
</rss>

