<?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: Looking for a Guide for Revit Libraries in Pythonshell in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6779909#M61283</link>
    <description>&lt;P&gt;babysatch,&lt;/P&gt;&lt;P&gt;the problem you are addressing is not a problem of a lack of documentation of the revit api nor is it an issue resulting of the use of the revit python shell as jeremy suggests.&lt;/P&gt;&lt;P&gt;the dynamo addin (application) implements a own document manager and a own task manager. why this is done? consult the dynamo branch on github.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you now have a python code that accesses a document (what you most certainly will do)&amp;nbsp;or make changes to the revit database you have different options depending if you are in a dynamo environment or not..&lt;/P&gt;&lt;P&gt;i.e python shell.:&lt;/P&gt;&lt;PRE&gt;import clr&lt;BR /&gt;clr.AddReference('RevitAPI') &lt;BR /&gt;clr.AddReference('RevitAPIUI')	&lt;BR /&gt;&lt;BR /&gt;#.......&lt;BR /&gt;&lt;BR /&gt;uidoc = __revit__.ActiveUIDocument&lt;BR /&gt;doc = __revit__.ActiveUIDocument.Document&lt;BR /&gt;&lt;BR /&gt;#.......any code to get an elementid&lt;BR /&gt;&lt;BR /&gt;wall = doc.GetElement(element.id)
t= Transaction(doc,"set wall parameter")
t.Start()
wall.LookupParameter("Any shared Parameter").Set(value)
t.Commit()&lt;/PRE&gt;&lt;P&gt;dynamo python code:&lt;/P&gt;&lt;PRE&gt;clr.AddReference(“RevitServices”)
import RevitServices&lt;BR /&gt;&lt;SPAN&gt;from RevitServices.Persistence import DocumentManager&lt;/SPAN&gt;
from RevitServices.Transactions import TransactionManager&lt;BR /&gt;&lt;SPAN&gt;doc = DocumentManager.Instance.CurrentDBDocument&lt;/SPAN&gt;
#......

wall = doc.GetElement(element.Id)
TransactionManager.Instance.EnsureInTransaction(doc)
wall.LookupParameter("Any shared Parameter).Set(value)

TransactionManager.Instance.TransactionTaskDone()
OUT = wall&lt;/PRE&gt;&lt;P&gt;best peter&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 16:02:20 GMT</pubDate>
    <dc:creator>office</dc:creator>
    <dc:date>2017-01-03T16:02:20Z</dc:date>
    <item>
      <title>Looking for a Guide for Revit Libraries in Pythonshell</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6770124#M61281</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have noticed often, that people add a reference in their python code in Dynamo to RevitServices by the following code in order to use DocumentManager and TransactionManager:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'# Import DocumentManager and TransactionManager&lt;BR /&gt;clr.AddReference(“RevitServices”)&lt;BR /&gt;import RevitServices&lt;BR /&gt;from RevitServices.Persistence import DocumentManager&lt;BR /&gt;from RevitServices.Transactions import TransactionManager&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have an idea where I can find all methods, properties and members of the Revit librares &lt;STRONG&gt;"RevitServices"&lt;/STRONG&gt; and &lt;STRONG&gt;"RevitNodes"&lt;/STRONG&gt;. I cannot find them in RevitAPI.chm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2016 19:26:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6770124#M61281</guid>
      <dc:creator>babysatch</dc:creator>
      <dc:date>2016-12-26T19:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a Guide for Revit Libraries in Pythonshell</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6770756#M61282</link>
      <description>&lt;P&gt;I would suggest you discuss this with the creators of RevitPythonShell, either in its GitHub source repository, or on StackOverflow, as explained&amp;nbsp;there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/architecture-building-systems/revitpythonshell" target="_blank"&gt;https://github.com/architecture-building-systems/revitpythonshell&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/architecture-building-systems/revitpythonshell#support" target="_blank"&gt;https://github.com/architecture-building-systems/revitpythonshell#support&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy New Year to you!&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, 27 Dec 2016 11:25:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6770756#M61282</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-12-27T11:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a Guide for Revit Libraries in Pythonshell</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6779909#M61283</link>
      <description>&lt;P&gt;babysatch,&lt;/P&gt;&lt;P&gt;the problem you are addressing is not a problem of a lack of documentation of the revit api nor is it an issue resulting of the use of the revit python shell as jeremy suggests.&lt;/P&gt;&lt;P&gt;the dynamo addin (application) implements a own document manager and a own task manager. why this is done? consult the dynamo branch on github.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you now have a python code that accesses a document (what you most certainly will do)&amp;nbsp;or make changes to the revit database you have different options depending if you are in a dynamo environment or not..&lt;/P&gt;&lt;P&gt;i.e python shell.:&lt;/P&gt;&lt;PRE&gt;import clr&lt;BR /&gt;clr.AddReference('RevitAPI') &lt;BR /&gt;clr.AddReference('RevitAPIUI')	&lt;BR /&gt;&lt;BR /&gt;#.......&lt;BR /&gt;&lt;BR /&gt;uidoc = __revit__.ActiveUIDocument&lt;BR /&gt;doc = __revit__.ActiveUIDocument.Document&lt;BR /&gt;&lt;BR /&gt;#.......any code to get an elementid&lt;BR /&gt;&lt;BR /&gt;wall = doc.GetElement(element.id)
t= Transaction(doc,"set wall parameter")
t.Start()
wall.LookupParameter("Any shared Parameter").Set(value)
t.Commit()&lt;/PRE&gt;&lt;P&gt;dynamo python code:&lt;/P&gt;&lt;PRE&gt;clr.AddReference(“RevitServices”)
import RevitServices&lt;BR /&gt;&lt;SPAN&gt;from RevitServices.Persistence import DocumentManager&lt;/SPAN&gt;
from RevitServices.Transactions import TransactionManager&lt;BR /&gt;&lt;SPAN&gt;doc = DocumentManager.Instance.CurrentDBDocument&lt;/SPAN&gt;
#......

wall = doc.GetElement(element.Id)
TransactionManager.Instance.EnsureInTransaction(doc)
wall.LookupParameter("Any shared Parameter).Set(value)

TransactionManager.Instance.TransactionTaskDone()
OUT = wall&lt;/PRE&gt;&lt;P&gt;best peter&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 16:02:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-a-guide-for-revit-libraries-in-pythonshell/m-p/6779909#M61283</guid>
      <dc:creator>office</dc:creator>
      <dc:date>2017-01-03T16:02:20Z</dc:date>
    </item>
  </channel>
</rss>

