<?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: Simple code crashes Revit in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3474182#M80828</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;...Apparently Revit doesn't like this.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The Essential question is, what did happen to your main thread of the add-in after the modeless dialog was launched? Because that is the only thread you can call Revit API.&lt;/P&gt;</description>
    <pubDate>Mon, 28 May 2012 05:07:08 GMT</pubDate>
    <dc:creator>ollikat</dc:creator>
    <dc:date>2012-05-28T05:07:08Z</dc:date>
    <item>
      <title>Simple code crashes Revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3473378#M80826</link>
      <description>&lt;P&gt;I'm trying to get code from this sample:&amp;nbsp; &lt;A target="_blank" href="http://thebuildingcoder.typepad.com/blog/2010/05/duplicate-legend-component.html"&gt;http://thebuildingcoder.typepad.com/blog/2010/05/duplicate-legend-component.html&lt;/A&gt;&amp;nbsp; to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Revit 2013 so I had to make some changes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ICollection&amp;lt;ElementId&amp;gt; SelectedIds = m_UIDoc.Selection.GetElementIds();
Group group = m_doc.Create.NewGroup(SelectedIds);


&lt;/PRE&gt;&lt;P&gt;Revit died on the NewGroup call.&amp;nbsp; There was one ElementId in the selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put an exception handler around it and got this message:&lt;/P&gt;&lt;P&gt;"External component has thrown an exception."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, is there any other way to clone/copy an Element?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2012 02:49:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3473378#M80826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-26T02:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Simple code crashes Revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3473610#M80827</link>
      <description>&lt;P&gt;FYI:&amp;nbsp; I found the problem was that I was calling the code from a &lt;STRONG&gt;modeless&lt;/STRONG&gt; dialog box.&amp;nbsp; Apparently Revit doesn't like this.&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2012 16:30:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3473610#M80827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-26T16:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simple code crashes Revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3474182#M80828</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;...Apparently Revit doesn't like this.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The Essential question is, what did happen to your main thread of the add-in after the modeless dialog was launched? Because that is the only thread you can call Revit API.&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2012 05:07:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/simple-code-crashes-revit/m-p/3474182#M80828</guid>
      <dc:creator>ollikat</dc:creator>
      <dc:date>2012-05-28T05:07:08Z</dc:date>
    </item>
  </channel>
</rss>

