<?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: Revit API 2022 PostableCommand CopyMonitorSelectLink in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11606337#M15182</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so just to be sure I'm in the right direction, I added some more code to select the Levels after I posting the command but it seems like Revit stops the CopyMonitor function at that point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other approach to make the task done except programmatically providing input which otherwise the&lt;/P&gt;&lt;P&gt;user would have to do manually as you mentioned on your website here:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.html#3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; Uiapp.PostCommand(RevitCommandId.LookupPostableCommandId(PostableCommand.CopyMonitorSelectLink));

            FilteredElementCollector collector = new FilteredElementCollector(doc);
            IList&amp;lt;Element&amp;gt; elems = collector
            .OfCategory(BuiltInCategory.OST_RvtLinks)
            .OfClass(typeof(Level))
            .ToElements();

            List&amp;lt;ElementId&amp;gt; icollection = new List&amp;lt;ElementId&amp;gt;();
            foreach (Element e in elems)
            {
                icollection.Add(e.Id);
            }

            Uidoc.Selection.SetElementIds(icollection);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 11:11:12 GMT</pubDate>
    <dc:creator>TomB.ADV</dc:creator>
    <dc:date>2022-12-08T11:11:12Z</dc:date>
    <item>
      <title>Revit API 2022 PostableCommand CopyMonitorSelectLink</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11605943#M15180</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed there is a Copy Monitor related command in the 2022 API version which I'm not sure how to use.&lt;BR /&gt;I want to automate the Copy-Monitor process for levels and grids which we are doing manually for each new&lt;BR /&gt;Revit project file. I have the below code where I get the RevitCommandId but I can't figure out how to proceed...&lt;BR /&gt;&lt;BR /&gt;I don't have much experience with postable commands, any help would be very appreciated !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;namespace AdvTools.Commands
{
    [Transaction(TransactionMode.Manual)]
    public class CopyMonitor : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            ExternalCommandData CommandData = commandData;
            UIApplication Uiapp = CommandData.Application;
            Application App = Uiapp.Application;
            UIDocument Uidoc = CommandData.Application.ActiveUIDocument;
            Document document = Uidoc.Document;

            RevitCommandId id = RevitCommandId.LookupPostableCommandId(PostableCommand.CopyMonitorSelectLink);
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 07:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11605943#M15180</guid>
      <dc:creator>TomB.ADV</dc:creator>
      <dc:date>2022-12-08T07:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API 2022 PostableCommand CopyMonitorSelectLink</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11606243#M15181</link>
      <description>&lt;P&gt;Okey-doke. Well, one place to check for samples and documentation on getting started with that is The Building Coder topic group on PostCommand:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.3&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 10:28:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11606243#M15181</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-12-08T10:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Revit API 2022 PostableCommand CopyMonitorSelectLink</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11606337#M15182</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so just to be sure I'm in the right direction, I added some more code to select the Levels after I posting the command but it seems like Revit stops the CopyMonitor function at that point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other approach to make the task done except programmatically providing input which otherwise the&lt;/P&gt;&lt;P&gt;user would have to do manually as you mentioned on your website here:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.html#3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; Uiapp.PostCommand(RevitCommandId.LookupPostableCommandId(PostableCommand.CopyMonitorSelectLink));

            FilteredElementCollector collector = new FilteredElementCollector(doc);
            IList&amp;lt;Element&amp;gt; elems = collector
            .OfCategory(BuiltInCategory.OST_RvtLinks)
            .OfClass(typeof(Level))
            .ToElements();

            List&amp;lt;ElementId&amp;gt; icollection = new List&amp;lt;ElementId&amp;gt;();
            foreach (Element e in elems)
            {
                icollection.Add(e.Id);
            }

            Uidoc.Selection.SetElementIds(icollection);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-api-2022-postablecommand-copymonitorselectlink/m-p/11606337#M15182</guid>
      <dc:creator>TomB.ADV</dc:creator>
      <dc:date>2022-12-08T11:11:12Z</dc:date>
    </item>
  </channel>
</rss>

