<?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 2017.1 Python Macro Manager / General API concerns in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6810685#M60968</link>
    <description>&lt;P&gt;As for the API change which caused the error,&amp;nbsp;it was the use of Segment.Curve. The new API uses a function which is Segment.GetCurve()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example wrong code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options = Autodesk.Revit.DB.SpatialElementBoundaryOptions()&lt;BR /&gt;boundsegs = room.GetBoundarySegments(options)&lt;BR /&gt;&lt;BR /&gt;for bound in boundsegs:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for seg in bound:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crv = seg.Curve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fixed code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for bound in boundsegs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for seg in bound:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crv = seg.GetCurve()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm sure there are plenty of these sort of instances in old custom Dynamo nodes, and your fix could be something as simple as this. Thanks for the help Jeremy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2017 14:51:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-17T14:51:46Z</dc:date>
    <item>
      <title>Revit 2017.1 Python Macro Manager / General API concerns</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6802566#M60964</link>
      <description>&lt;P&gt;A custom python node for Dynamo lost functionality with the 2017.1 Revit update. I found by making a new script that the following statement causes a crash:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import clr&lt;/P&gt;&lt;P&gt;# Import RevitAPI&lt;BR /&gt;clr.AddReference("RevitAPI")&lt;BR /&gt;import Autodesk&lt;BR /&gt;from Autodesk.Revit.DB import *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In an effort to debug, I opened the Revit Macro Manager, and found that attempting to run the basic python module crashed the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else come across these issues? Also, if there is a link to the Python specific 2017.1 API I would greatly appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6802566#M60964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-12T23:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2017.1 Python Macro Manager / General API concerns</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6805778#M60965</link>
      <description>&lt;P&gt;Can you confirm that the exact same Dynamo code works fine in the macro manager in Revit 2017?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 16:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6805778#M60965</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-01-14T16:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2017.1 Python Macro Manager / General API concerns</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6809379#M60966</link>
      <description>&lt;P&gt;Hello Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually made a very basic mistake, but made one discovery. I didn't realize that Dynamo must be opened from within Revit in order to gain API access. It makes sense, but just a beginner mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I also found one change to the API, which is documented in the C# / VB Api, and was simple to correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will reply with the change tomorrow, upon access to my work computer. I'm wondering if there is a document of api contents for Python. I am fluent in C#, so the conversion should generally be straightforward, but is there a resource for the Python API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, and I'll have an additional post which will hopefully help someone else with this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 00:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6809379#M60966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-17T00:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2017.1 Python Macro Manager / General API concerns</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6809737#M60967</link>
      <description>&lt;P&gt;Congratulations on that fundamental discovery &amp;nbsp;&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;The Revit API can only be used within a valid Revit API context, and such a context is only provided within the scope of event handler method called by Revit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A typical example of an event handler (the most typical) is the external command Execute method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Revit API is purely .NET based.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any programming language supporting .NET can be used, including C# and IronPython, which is what both Dynamo and the built-in Revit SharpDevelop macro IDE are based on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, the Revit API documentation is completely generic&amp;nbsp;and applies to all programming languages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can access it from the Revit API developer centre, by downloading the Revit SDK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.autodesk.com/developrevit" target="_blank"&gt;www.autodesk.com/developrevit&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also suggest&amp;nbsp;working through the generic Revit API getting started material:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#2" target="_blank"&gt;thebuildingcoder.typepad.com/blog/about-the-author.html#2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will significantly help you understand the architecture of normal Revit add-ins, and also Dynamo, built on top of that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 07:36:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6809737#M60967</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-01-17T07:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2017.1 Python Macro Manager / General API concerns</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6810685#M60968</link>
      <description>&lt;P&gt;As for the API change which caused the error,&amp;nbsp;it was the use of Segment.Curve. The new API uses a function which is Segment.GetCurve()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example wrong code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options = Autodesk.Revit.DB.SpatialElementBoundaryOptions()&lt;BR /&gt;boundsegs = room.GetBoundarySegments(options)&lt;BR /&gt;&lt;BR /&gt;for bound in boundsegs:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for seg in bound:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crv = seg.Curve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fixed code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for bound in boundsegs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for seg in bound:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crv = seg.GetCurve()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm sure there are plenty of these sort of instances in old custom Dynamo nodes, and your fix could be something as simple as this. Thanks for the help Jeremy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 14:51:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2017-1-python-macro-manager-general-api-concerns/m-p/6810685#M60968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-17T14:51:46Z</dc:date>
    </item>
  </channel>
</rss>

