<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4001721146719322746</id><updated>2026-10-20T00:48:24.690+02:00</updated><category term="DynamoBim"/><category term="Python"/><category term="IronPython"/><category term="Revit"/><category term="RevitAPI"/><category term="AutodeskExpertElite"/><category term="PythonNet"/><category term="Dynamo"/><category term="AutodeskCommunity"/><category term="CPython3"/><category term="PythonNet3"/><category term="BIM"/><category term="CPython"/><category term="Revit API"/><category term="Vecteurs"/><category term="WPF"/><category term="DataFrame"/><category term="DataTable"/><category term="DotNet"/><category term="Pandas"/><category term="DynamoDS API"/><category term="DynamoWin"/><category term="Excel"/><category term="Famille"/><category term="IFC"/><category term="IronPython3"/><category term="Linq"/><category term="PLINQ"/><category term="Produit Vectoriel"/><category term="PythonNetSerie"/><category term="Vectors"/><category term="contextManager"/><category term="module"/><category term="scipy"/><category term="Autocad"/><category term="Catégorie"/><category term="DesignReview"/><category term="Liste"/><category term="Nomenclatures"/><category term="PeriodicMode"/><category term="framework .Net"/><category term=".Net"/><category term=".Net Interface"/><category term="ACC"/><category term="APS"/><category term="Algorithme"/><category term="BIM360"/><category term="Barre de Progression"/><category term="Calque"/><category term="Chemins de Câble"/><category term="Courbe"/><category term="DWFx"/><category term="DWG"/><category term="DataSet"/><category term="Delaunay"/><category term="Design Review"/><category term="DoEvents"/><category term="Décorateur"/><category term="Euroclasses"/><category term="Export"/><category term="Filtres"/><category term="Fittting"/><category term="Formules"/><category term="Geometry"/><category term="Group"/><category term="Handler"/><category term="HorsSujetBIM"/><category term="IA"/><category term="IfcOpenShell"/><category term="IronPython2"/><category term="Lacing"/><category term="Lignes"/><category term="List"/><category term="MVVM"/><category term="NFC 15-100"/><category term="OLE"/><category term="OpenAI"/><category term="Package"/><category term="Parallal"/><category term="Parallèle"/><category term="Paramètres de Projet"/><category term="Polygon"/><category term="Revit &amp; Sélections"/><category term="Selection"/><category term="UltraLeap"/><category term="ViewFilter"/><category term="WinForm"/><category term="WorkSets"/><category term="alphashape"/><category term="logger"/><category term="logging"/><category term="olefile"/><category term="xml"/><category term="+="/><category term=".Net 8"/><category term=".Net API Inheritance"/><category term="2024"/><category term="2025"/><category term="3DView"/><category term="AVF"/><category term="Aggregate"/><category term="AlignedBoundingBox"/><category term="Annotations"/><category term="Aplatir"/><category term="Assembly"/><category term="Attestation de Conformité Verte"/><category term="Audio"/><category term="Autodesk.Revit.DB.Analysis"/><category term="AverageCurve"/><category term="BeautifulSoup"/><category term="Bilan de Puissance"/><category term="Binding"/><category term="Bitmap"/><category term="BoundingBox"/><category term="BrowserOrganization"/><category term="ByMinimum.Volume"/><category term="Cables"/><category term="Canalisation"/><category term="Chemin de cable"/><category term="Chute de tension"/><category term="Class"/><category term="Classe"/><category term="CleanText"/><category term="Collaboration"/><category term="Coller"/><category term="Commandes Vocales"/><category term="Compilation"/><category term="Construction"/><category term="Consuel"/><category term="Coordonnées"/><category term="Copier"/><category term="Coupe"/><category term="CropBox"/><category term="CrossProduct"/><category term="Curve"/><category term="DBSCAN"/><category term="DataGrid"/><category term="Debogage"/><category term="Debug"/><category term="Decorateur"/><category term="Deep Learning"/><category term="Dialux"/><category term="Dialux Evo"/><category term="Dispatcher"/><category term="DynamoCore"/><category term="ERP"/><category term="Eclairement"/><category term="ElementType.Name"/><category term="Enumerable"/><category term="Espace de Nom"/><category term="Event"/><category term="FacingOrientation"/><category term="Fenetre"/><category term="Filter"/><category term="FilteredElementCollector"/><category term="Flatten"/><category term="GC.Collect"/><category term="GenericZones"/><category term="GetBoundaryFaceInfo"/><category term="Graham"/><category term="Géométrie"/><category term="HTML"/><category term="HTTP request"/><category term="Hachures"/><category term="HandOrientation"/><category term="HelixToolKit"/><category term="HostFace"/><category term="IRVE"/><category term="IValueConverter"/><category term="ImportInstance"/><category term="Incendie"/><category term="Interfaces"/><category term="IsInside"/><category term="Json"/><category term="Keras"/><category term="LeapMotion"/><category term="Listes"/><category term="Listes imbriquées"/><category term="Lux"/><category term="Légendes"/><category term="Macro"/><category term="Mandelbrot"/><category term="Markdown"/><category term="Memory"/><category term="Microsoft"/><category term="Model Checker"/><category term="Namespace"/><category term="Net Core"/><category term="Nomenclature"/><category term="OpenXML"/><category term="Ouverture"/><category term="Parralelisme"/><category term="Point"/><category term="Points"/><category term="Polyligne"/><category term="Porte"/><category term="PowerBi"/><category term="PreviewImage"/><category term="Produit Scalaire"/><category term="Purge"/><category term="Python Nested List"/><category term="Python3"/><category term="RAG"/><category term="RPC"/><category term="Raccord"/><category term="Rapport"/><category term="Reflection"/><category term="Revit API 2027"/><category term="Revit version"/><category term="SQL"/><category term="Schedule"/><category term="ScheduleDefinition"/><category term="ScheduleField"/><category term="Script"/><category term="Section"/><category term="Serialization"/><category term="SharpDevellop"/><category term="Sorted"/><category term="SpatialElementGeometryCalculator"/><category term="Speech Recognition"/><category term="Surcharge Opérateurs"/><category term="Tensorflow"/><category term="Transform"/><category term="TransientDisplay"/><category term="Unicode"/><category term="UnicodeDecodeError"/><category term="Utilance"/><category term="VSCode"/><category term="Version"/><category term="ViewRange"/><category term="ViewSchedule"/><category term="ViewSection"/><category term="Visualiseur"/><category term="Vues"/><category term="WebRequest"/><category term="Word"/><category term="Zones HVAC"/><category term="Zones Système"/><category term="autocomplétion"/><category term="bs4"/><category term="clr"/><category term="colinear"/><category term="cosine_similarity"/><category term="cosinus"/><category term="dir"/><category term="dll"/><category term="documentation"/><category term="débogage"/><category term="exception handling"/><category term="import"/><category term="inspect"/><category term="level"/><category term="list level"/><category term="matplotlib"/><category term="members"/><category term="mshtml"/><category term="ndarray"/><category term="operator"/><category term="out Parameter"/><category term="pip"/><category term="pyc"/><category term="pyd"/><category term="requests"/><category term="shapely"/><category term="skLearn"/><category term="sympy"/><category term="tesseract"/><category term="timeit"/><category term="tkinter"/><category term="visibilité &amp; graphisme"/><category term="with"/><category term="Électricité"/><title type='text'>VoltaDynaBim</title><subtitle type='html'>De l&#39;électron à l&#39;octet&#xa;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://voltadynabim.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default?max-results=3&amp;redirect=false'/><link rel='alternate' type='text/html' href='https://voltadynabim.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default?start-index=4&amp;max-results=3&amp;redirect=false'/><author><name>Cyril</name><uri>http://www.blogger.com/profile/08389811365235224682</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY3Iz0xq8QpQu6njnL6IyeBXjbJyBFxD1nsxDcqUHlCs3yQZih7HlcLEre3RYjOSPnDg544905lHz4K6SHzbXgmdITwUktyM_FTkcYSINI0wkNhXcYX_4i9Kx4176Mxm4/s113/1608331968791.jfif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>126</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>3</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4001721146719322746.post-7913101339573004529</id><published>2026-09-30T12:33:33.776+02:00</published><updated>2026-09-30T12:33:33.776+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DataTable"/><category scheme="http://www.blogger.com/atom/ns#" term="GenericZones"/><category scheme="http://www.blogger.com/atom/ns#" term="PythonNet"/><category scheme="http://www.blogger.com/atom/ns#" term="Revit API 2027"/><category scheme="http://www.blogger.com/atom/ns#" term="Zones HVAC"/><category scheme="http://www.blogger.com/atom/ns#" term="Zones Système"/><title type='text'>[Dynamo + Python] Revit 2027 : HVAC Zone → GenericZone (Migration API)</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeqFXLUXbypsOSjuRSseh6f82IKsulGQ1LS1qxEEo4Mhh0nIoCnqGRbrB6y7FrmgxASQ93Va5oxqpDehDWEQQQHLw-SDIcFicg7VHwl7oabwCD87TIXeAY7NjCysUvGAeUXcp4ZP9nYCfvairJ7ASQbtNTRc3Ue-GHxukrOfC0Eo3HHdSn9zN2Qjk2iDKO/s460/Generic%20zone.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;383&quot; data-original-width=&quot;460&quot; height=&quot;333&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeqFXLUXbypsOSjuRSseh6f82IKsulGQ1LS1qxEEo4Mhh0nIoCnqGRbrB6y7FrmgxASQ93Va5oxqpDehDWEQQQHLw-SDIcFicg7VHwl7oabwCD87TIXeAY7NjCysUvGAeUXcp4ZP9nYCfvairJ7ASQbtNTRc3Ue-GHxukrOfC0Eo3HHdSn9zN2Qjk2iDKO/w400-h333/Generic%20zone.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: georgia; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Comment retrouver les zones systèmes (ex CVC) qui sont attachées aux
    espaces avec Revit 2027&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;#DynamoBIM #Revit #Python #RevitAPI #GenericZone #Revit API 2027&amp;nbsp; &amp;nbsp; &amp;nbsp;#AutodeskExpertElite #AutodeskCommunity&amp;nbsp;&lt;a href=&quot;https://www.autodesk.com/expert-elite/&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;50&quot; data-original-width=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj3-npK4uFyHO9Jdk1NzGPoAjxdblUqzui38L8IBpDGyX0dDTXo3OBnvhvS6oVUjAG6kfD7A_qqKaQjE8v28_wy5vmOy5U9kZPzONBbbMdor19FAtuGqqbKxAn9OG44-MxLgH-XbEhq5xFuNxMUjUy8oJTZkmfy5sMt_lkdL1LqS0jmkFH7ojjLqzN5vf73=s16000&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
  &lt;div style=&quot;text-align: right;&quot;&gt;
    &lt;span style=&quot;color: #2b00fe; font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;if this article is not in your language, use the Google Translate
        widget ⬈ (&lt;a href=&quot;#bottom&quot;&gt;bottom of page for Mobile version&lt;span&gt; &lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;#bottom&quot;&gt;⬇&lt;/a&gt;)&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;color: red; font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Les Zones Système (GenericZones) viennent remplacer les Zones HVAC .&amp;nbsp;&lt;/span&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;i&gt;Sur des projets existants, elles sont désormais automatiquement
        converties lors de l’ouverture des projets Revit 2027.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Parmi
        les changements notables :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;
        &lt;ul style=&quot;text-align: left;&quot;&gt;
          &lt;li&gt;
            &lt;span&gt;les HVAC Zones deviennent obsolètes&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;
            &lt;span&gt;Les espaces MEP peuvent être situés dans plusieurs zones.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;span&gt;Les zones dépendent d&#39;un seul niveau (impossibilité de créer une
              zone sur plusieurs niveaux).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;span&gt;Les zones peuvent être :&lt;/span&gt;
          &lt;/li&gt;
          &lt;ul&gt;
            &lt;ul&gt;&lt;li&gt;&lt;span&gt;soit attaché aux espaces&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;soit basées sur une esquisse&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
            
          &lt;/ul&gt;&lt;li&gt;Les Zones Système (GenericZones) sont des zones analytiques.&lt;/li&gt;
        &lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiNWWedOgGdb40Pt86ZNI-PpVm9KYhEZQqZ2Hc4eSJTzlXsg0W8SLMedWxrAoMDcvyXCtBgLTWllnut_t7HzNGZmenRw1GxlTV7wMykouxaQe5wggMeih064KKg3WWQXQ8_no-puTowO0IeFeEdp7CiUuRAnTqtEAqxef2tR3N7NN2WO_VcxdgXEiEH7XVV&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;711&quot; data-original-width=&quot;838&quot; height=&quot;543&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiNWWedOgGdb40Pt86ZNI-PpVm9KYhEZQqZ2Hc4eSJTzlXsg0W8SLMedWxrAoMDcvyXCtBgLTWllnut_t7HzNGZmenRw1GxlTV7wMykouxaQe5wggMeih064KKg3WWQXQ8_no-puTowO0IeFeEdp7CiUuRAnTqtEAqxef2tR3N7NN2WO_VcxdgXEiEH7XVV=w640-h543&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;
      &lt;/span&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Il en résulte plusieurs modifications dans l&#39;API&lt;/span&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
        &lt;table style=&quot;border-collapse: collapse; font-family: sans-serif; width: 100%;&quot;&gt;
          &lt;thead&gt;
            &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
              &lt;th style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; text-align: left;&quot;&gt;
                Migration / Item
              &lt;/th&gt;
              &lt;th style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; text-align: left;&quot;&gt;
                Details
              &lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;
              &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;
                Propriété et BIC dépréciés&lt;/td&gt;
              &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;
                &lt;code&gt;Autodesk.Revit.DB.Mechanical.Space.Zone&lt;/code&gt;,
                &lt;code&gt;BuiltInCategory:OST_HVAC_Zones&lt;/code&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;
                a utilisé en remplacement&lt;/td&gt;
              &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;
                &lt;code&gt;GenericZone&lt;/code&gt;&amp;nbsp;+&amp;nbsp;&lt;code&gt;GetSpaceIds()&lt;/code&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
        &lt;br /&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div&gt;
            Voici un exemple qui combine deux méthodes pour retrouver les
            espaces, tout en stockant le tout dans une Datatable pour faire une
            recherche rapide par &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;ElementId&lt;/code&gt; via &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;Select()&lt;/code&gt;&amp;nbsp;
          &lt;/div&gt;
          &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
          &lt;div&gt;&lt;b&gt;1. Zones basées sur des espaces&lt;/b&gt;&lt;/div&gt;
          &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;div&gt;
          &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div&gt;La méthode la plus rapide consiste à utiliser :&lt;/div&gt;&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
            &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;spaceIds = genericZone.GetSpaceIds()&lt;/code&gt;
          &lt;/div&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;
&lt;/blockquote&gt;
&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
            Chaque ElementId correspond à un espace associé à la zone.
          &lt;/div&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
        &lt;div&gt;&lt;b&gt;2. Zones basées sur une esquisse&lt;/b&gt;&lt;/div&gt;
        &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;border-color: currentcolor; border-image: none; border-style: none; border-width: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;div&gt;
            Les zones créées à partir d&#39;un contour ne possèdent pas
            d&#39;association directe avec les espaces.
          &lt;/div&gt;&lt;/span&gt;
      &lt;/span&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;
      &lt;/span&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div&gt;L&#39;alternative consiste à :&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;div style=&quot;text-align: left;&quot;&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
          &lt;ul&gt;
            &lt;ul&gt;&lt;li&gt;récupérer le polygone de la zone&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
          &lt;/ul&gt;
        &lt;/ul&gt;
        &lt;ul style=&quot;text-align: left;&quot;&gt;
          &lt;ul&gt;
            &lt;ul&gt;&lt;li&gt;récupérer le point de calcul de chaque espace et vérifier si ce
              dernier est dans le polygone (avec l&#39;API Dynamo&amp;nbsp;&amp;nbsp;&lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;Polygon.ContainmentTest()&lt;/code&gt;&amp;nbsp;)
            &lt;/li&gt;&lt;/ul&gt;
          &lt;/ul&gt;
        &lt;/ul&gt;&lt;/span&gt;
    &lt;/span&gt;&lt;/div&gt;

    &lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;div&gt;
      &lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import System
from System.Collections.Generic import List
from System.Linq import Enumerable
from System.Collections.Generic import IEnumerable

clr.AddReference(&#39;ProtoGeometry&#39;)
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

clr.AddReference(&#39;RevitAPI&#39;)
import Autodesk
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Analysis import *

clr.AddReference(&#39;RevitServices&#39;)
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
sdkNumber = int(app.VersionNumber)

clr.AddReference(&#39;RevitNodes&#39;)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)

clr.AddReference(&#39;System.Data&#39;)
from System.Data import *

clr.AddReference(&quot;System.Core&quot;)
clr.ImportExtensions(System.Linq)


import traceback
input_space = UnwrapElement(IN[0])

fecSpace = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_MEPSpaces).WhereElementIsNotElementType().ToElements()

def get_ZoneGetSpaceIds(zone):
    try:
        if zone.GeometricDefinition == ZoneGeometricDefinition.Spaces:
            return zone.GetSpaceIds()
        else:
            zone_sketch = doc.GetElement(zone.GetSketchId())
            profile : DB.CurveArrArray = zone_sketch.Profile
            zone_polygon = DS.Polygon.ByPoints([c.GetEndPoint(0).ToPoint() for c in profile[0]])
            level1Filter = ElementLevelFilter(zone.LevelId)
            fecLvlSpaceId = (
                FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_MEPSpaces).WhereElementIsNotElementType().WherePasses(level1Filter)
                .Where(System.Func[System.Object, System.Boolean](lambda space: space.Area &amp;gt; 0 and isinstance(space.Location, DB.LocationPoint)) )
                .Where(System.Func[System.Object, System.Boolean](lambda space: zone_polygon.ContainmentTest(space.Location.Point.ToPoint() ) ))
                .Select[System.Object, DB.ElementId](System.Func[System.Object, DB.ElementId](lambda x: x.Id))
                .ToList()
            )
            return fecLvlSpaceId
    except Exception as ex:
        print(traceback.format_exc())
        return List[ElementId]()

if sdkNumber &amp;lt; 2027:
    OUT = [[s.Name , s.Zone.Name ] for s in fecSpace]
else:
    # Global variable DataTable                                
    dt_zone = DataTable(&quot;GZone&quot;)
    dt_zone.Columns.Add(&#39;SpaceId&#39;, DB.ElementId)
    dt_zone.Columns.Add(&#39;SpaceIdValue&#39;, System.Int64)
    dt_zone.Columns.Add(&#39;Zone&#39;, DB.Analysis.GenericZone)     
    dt_zone.Columns.Add(&#39;ZoneName&#39;, System.String)  
    #
    dt_zone.BeginLoadData()
    lst_zones = (
                FilteredElementCollector(doc).OfClass(GenericZone)
                .SelectMany[DB.Element, DB.ElementId, DataRow](
                                                System.Func[DB.Element, IEnumerable[DB.ElementId]](lambda z : get_ZoneGetSpaceIds(z) ),
                                                System.Func[DB.Element, DB.ElementId, DataRow](lambda z, space_id : dt_zone.Rows.Add(space_id, space_id.Value, z, z.Name)
                                                ))
                .ToList()
    )
    
    dt_zone.EndLoadData()
    #
    #OUT = [[s.Name , dt_zone.Select(f&quot;[SpaceIdValue] = &#39;{s.Id.Value}&#39;&quot;).Cast[DataRow]().FirstOrDefault() ] for s in fecSpace]
    # 
    out = []
    for s in fecSpace:
        dataRow_spaces = dt_zone.Select(f&quot;[SpaceIdValue] = &#39;{s.Id.Value}&#39;&quot;).Cast[DataRow]()#.FirstOrDefault() 
        if dataRow_spaces is not None:
            out.append([s.Name, [r[&#39;ZoneName&#39;] for r in dataRow_spaces] ])
            
    if input_space is not None:
        dataRow_spaces = dt_zone.Select(f&quot;[SpaceIdValue] = &#39;{input_space.Id.Value}&#39;&quot;).Cast[DataRow]()
        print(len(list(dataRow_spaces)))
        dataRow_ZDM = dt_zone.Select(f&quot;[SpaceIdValue] = &#39;{input_space.Id.Value}&#39; AND [ZoneName] Like &#39;%ZDM%&#39;&quot;).Cast[DataRow]().FirstOrDefault() 
        dataRow_ZDA = dt_zone.Select(f&quot;[SpaceIdValue] = &#39;{input_space.Id.Value}&#39; AND [ZoneName] Like &#39;%ZDA%&#39;&quot;).Cast[DataRow]().FirstOrDefault() 
        if dataRow_spaces is not None:
            out.insert(0, [
                            input_space.Name, 
                            [r[&#39;ZoneName&#39;] for r in dataRow_spaces], 
                            dataRow_ZDM[&#39;ZoneName&#39;] if dataRow_ZDM is not None else None,
                            dataRow_ZDA[&#39;ZoneName&#39;] if dataRow_ZDA is not None else None
                        ])
    OUT = out
&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
      . .
    &lt;/div&gt;
    &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
    &lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;
    &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
    &lt;div&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;« Ce n’est pas que nous ayons peu de temps, c’est que nous en perdons
          beaucoup. »&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Sénèque&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
  ...
  &lt;a id=&quot;bottom&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://voltadynabim.blogspot.com/feeds/7913101339573004529/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='https://voltadynabim.blogspot.com/2026/09/dynamo-python-revit-2027-hvac-zone.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/7913101339573004529'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/7913101339573004529'/><link rel='alternate' type='text/html' href='https://voltadynabim.blogspot.com/2026/09/dynamo-python-revit-2027-hvac-zone.html' title='[Dynamo + Python] Revit 2027 : HVAC Zone → GenericZone (Migration API)'/><author><name>Cyril</name><uri>http://www.blogger.com/profile/08389811365235224682</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY3Iz0xq8QpQu6njnL6IyeBXjbJyBFxD1nsxDcqUHlCs3yQZih7HlcLEre3RYjOSPnDg544905lHz4K6SHzbXgmdITwUktyM_FTkcYSINI0wkNhXcYX_4i9Kx4176Mxm4/s113/1608331968791.jfif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeqFXLUXbypsOSjuRSseh6f82IKsulGQ1LS1qxEEo4Mhh0nIoCnqGRbrB6y7FrmgxASQ93Va5oxqpDehDWEQQQHLw-SDIcFicg7VHwl7oabwCD87TIXeAY7NjCysUvGAeUXcp4ZP9nYCfvairJ7ASQbtNTRc3Ue-GHxukrOfC0Eo3HHdSn9zN2Qjk2iDKO/s72-w400-h333-c/Generic%20zone.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4001721146719322746.post-4527036482983012636</id><published>2026-09-04T23:50:00.000+02:00</published><updated>2026-09-05T13:53:48.466+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AutodeskExpertElite"/><category scheme="http://www.blogger.com/atom/ns#" term="DynamoBim"/><category scheme="http://www.blogger.com/atom/ns#" term="Export"/><category scheme="http://www.blogger.com/atom/ns#" term="IFC"/><category scheme="http://www.blogger.com/atom/ns#" term="Revit API"/><title type='text'>[Dynamo += Python] Export IFC : configurations Utilisateur (MAJ 05/09/2026)</title><content type='html'>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEheNCMuJClyySo2riXYwP2paAn--xN4axsaCmmR58pn48A9VUQecyl4Fq_8MpxUy_MBtOuD3CAYjv5_GsD685g35K65ajQEUpuzMNS0Z64L5Kv5os6joVOxC2gqevp5nDYpDZsQ3KOYMLF3_Wqw7szRiTgPoNRRZPRdkQbigIONHzM4f7NdMOlLpGGMr5Su&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEheNCMuJClyySo2riXYwP2paAn--xN4axsaCmmR58pn48A9VUQecyl4Fq_8MpxUy_MBtOuD3CAYjv5_GsD685g35K65ajQEUpuzMNS0Z64L5Kv5os6joVOxC2gqevp5nDYpDZsQ3KOYMLF3_Wqw7szRiTgPoNRRZPRdkQbigIONHzM4f7NdMOlLpGGMr5Su=w400-h400&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Une astuce pour obtenir les données des configurations d&#39;Export IFC&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;#DynamoBIM #Revit #Python #RevitAPI #IFC #ConfigurationIFC
    #AutodeskExpertElite&amp;nbsp;#AutodeskCommunity&amp;nbsp;&lt;a href=&quot;https://www.autodesk.com/expert-elite/&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;50&quot; data-original-width=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj3-npK4uFyHO9Jdk1NzGPoAjxdblUqzui38L8IBpDGyX0dDTXo3OBnvhvS6oVUjAG6kfD7A_qqKaQjE8v28_wy5vmOy5U9kZPzONBbbMdor19FAtuGqqbKxAn9OG44-MxLgH-XbEhq5xFuNxMUjUy8oJTZkmfy5sMt_lkdL1LqS0jmkFH7ojjLqzN5vf73=s16000&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
  &lt;div style=&quot;text-align: right;&quot;&gt;
    &lt;span style=&quot;color: #2b00fe; font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;if this article is not in your language, use the Google Translate
        widget ⬈ (&lt;a href=&quot;#bottom&quot;&gt;bottom of page for Mobile version&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;#bottom&quot;&gt;⬇&lt;/a&gt;)&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: red; font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;MAJ 05/09/2026 : Mise à jour pour Revit 2027&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: red; font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Dans le présent article, depuis Revit, nous cherchons à récupérer les données
  des configurations utilisateur d&#39;export IFC.&lt;/span&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgXueGzeiBl4VwrEPXsVaTD6LW5V7sAxbNCwA_73iFlDOBwOcO6SeLgvK0lqzdipDPGIp19opoP5soQpJxu9xOcyzE1QSaeUZLjPXdoUDKyUDE1Y7VafyIXX_6ZJ9InqMUDh0J4A9Mshs2_a4WOIGuHT22-JCg6zV-9ZVVX9qy1rmM6ofGGfBei3r35FXpL&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;440&quot; data-original-width=&quot;722&quot; height=&quot;390&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgXueGzeiBl4VwrEPXsVaTD6LW5V7sAxbNCwA_73iFlDOBwOcO6SeLgvK0lqzdipDPGIp19opoP5soQpJxu9xOcyzE1QSaeUZLjPXdoUDKyUDE1Y7VafyIXX_6ZJ9InqMUDh0J4A9Mshs2_a4WOIGuHT22-JCg6zV-9ZVVX9qy1rmM6ofGGfBei3r35FXpL=w640-h390&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
    Le but étant de permettre un export IFC depuis Dynamo suivant une
    configuration précise sans avoir à faire un export-import de celle-ci (au
    format json)
  &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Le code Python&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;

import clr
import sys
import System

# Import RevitAPI
clr.AddReference(&quot;RevitAPI&quot;)
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from Autodesk.Revit.Attributes import *
from Autodesk.Revit.DB.IFC import *


clr.AddReference(&quot;RevitServices&quot;)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
sdkNumber = int(app.VersionNumber)


IFCExportConfiguration = None
IFCExportConfigurationsMap = None
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)
pf_data_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData)
ifc_bundle_path = &quot;{0}\\Autodesk\\ApplicationPlugins\\IFC {1}.bundle\\Contents\\{1}&quot;.format(pf_data_path, sdkNumber)
if System.IO.Directory.Exists(ifc_bundle_path):
    print(&quot;pass1&quot;)
    sys.path.append(ifc_bundle_path)
    if sdkNumber &amp;lt; 2027:
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication
    else:
        clr.AddReference(&quot;Revit.IFC.Export&quot;)
        from Revit.IFC.Export.Utility import IFCExportConfigurationsMap, IFCExportConfiguration
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCCommandOverrideApplication
else:
    ifc_addin_path = &quot;{}\\Autodesk\\Revit {}\\AddIns\IFCExporterUI&quot;.format(pf_path, sdkNumber)
    if System.IO.Directory.Exists(ifc_addin_path):
        print(&quot;pass2&quot;)
        sys.path.append(ifc_addin_path)
        clr.AddReference(&quot;Autodesk.IFC.Export.UI&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication

import json

ifc_dict_config = {}
if IFCExportConfigurationsMap is not None:
    idfdocA = IFCCommandOverrideApplication.TheDocument
    if idfdocA is None:
        propinfo = clr.GetClrType(IFCCommandOverrideApplication).GetProperty(&#39;TheDocument&#39;)
        propinfo.SetValue(None, doc)
    configurationsMap = IFCExportConfigurationsMap(doc)
    configurationsMap.AddBuiltInConfigurations()
    configurationsMap.AddSavedConfigurations({})
    
    for config in configurationsMap.Values:
        dict_ifc_version_str = {&quot;IFC_Version_str&quot;: config.IFCVersion.ToString() }
        dict_config = json.loads(config.SerializeConfigToJson())
        # merge dictionaries
        merge_dict_3 = dict(dict_ifc_version_str,**dict_config)
        ifc_dict_config[config.Name] = merge_dict_3
  
OUT = ifc_dict_config

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Note 1&lt;/span&gt;&lt;/b&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;il existe 2 addin export IFC, celui de base (qui est livré d&#39;origine avec
    Revit) et celui que l&#39;on met à jour manuellement par la suite via le
    &lt;a href=&quot;https://github.com/Autodesk/revit-ifc&quot; target=&quot;_blank&quot;&gt;Repo Github d&#39;Autodesk&lt;/a&gt;, ce dernier vient remplacer le 1er, mais ne partage pas le même
    dossier.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Il faut donc veiller à charger la bonne assembly (voir code ci
    dessus)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Note 2&lt;/span&gt;&lt;/b&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Une petite explication concernant ces lignes&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
idfdocA = IFCCommandOverrideApplication.TheDocument
if idfdocA is None:
	propinfo = clr.GetClrType(IFCCommandOverrideApplication).GetProperty(&#39;TheDocument&#39;)
	propinfo.SetValue(None, doc)
&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
    Ces lignes de code effectuent une opération de réflexion (.NET Reflection)
    pour modifier dynamiquement la propriété
    &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;TheDocument&lt;/code&gt;
    d&#39;une instance de la classe
    &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;IFCCommandOverrideApplication&lt;/code&gt;.
  &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
    Le but de ces lignes est de s&#39;assurer que l&#39;application d&#39;exportation IFC
    &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;IFCCommandOverrideApplication&lt;/code&gt;
    est configurée pour utiliser le document Revit actuel (doc) comme contexte
    pour l&#39;exportation. Cela peut être nécessaire si l&#39;application d&#39;exportation
    IFC n&#39;est pas automatiquement configurée pour utiliser le bon document Revit
    ou si vous devez réaffecter explicitement le document cible pour
    l&#39;exportation dans des scénarios spécifiques.
  &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Résultat&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj4o3CUj1ftaUTrZ6BcucHMvMaDjdj2kr0XHQprlLZjL5E9Ok5QrGOSeod-hbuVfmgCRFI_Li_aBAwBdDxvRjQ-_sl2M9av5bsF_M46Q4xcCp9G9whTo2KNAEAjfeZJ8ZBlyPgCMvSadaoIbhwvKYoy7O-viYTb5j-umgMwiwqjQCq-UurRwBlEdlnM_CUg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;872&quot; data-original-width=&quot;1127&quot; height=&quot;495&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj4o3CUj1ftaUTrZ6BcucHMvMaDjdj2kr0XHQprlLZjL5E9Ok5QrGOSeod-hbuVfmgCRFI_Li_aBAwBdDxvRjQ-_sl2M9av5bsF_M46Q4xcCp9G9whTo2KNAEAjfeZJ8ZBlyPgCMvSadaoIbhwvKYoy7O-viYTb5j-umgMwiwqjQCq-UurRwBlEdlnM_CUg=w640-h495&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Export IFC à partir des valeurs d&#39;une configuration&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;Vous pouvez ensuite compléter le script dynamo en rajoutant par exemple
      le nœud &lt;/span&gt;&lt;b&gt;Export IFC&lt;/b&gt;&lt;span&gt; du package&amp;nbsp;&lt;/span&gt;&lt;b&gt;GeniusLoci&amp;nbsp;&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhC_qVYNvhVb49oSLBQgKolH_zAI6DPvzLZgb4Po51EYdf80wFvR3HUcoXWetycPaiOnTBTMwdweYyrFwShB7xMB_qZVfNqHOYZN6tpBZYXVvRkppl3GCROQobjE6Q3E3tKmS2WFNZX7NH8e_u4EYBwqNEbyuul2Xbgz9hpy0_mhAqO3zQWfBNSNzkGdMpM&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;881&quot; data-original-width=&quot;1893&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhC_qVYNvhVb49oSLBQgKolH_zAI6DPvzLZgb4Po51EYdf80wFvR3HUcoXWetycPaiOnTBTMwdweYyrFwShB7xMB_qZVfNqHOYZN6tpBZYXVvRkppl3GCROQobjE6Q3E3tKmS2WFNZX7NH8e_u4EYBwqNEbyuul2Xbgz9hpy0_mhAqO3zQWfBNSNzkGdMpM=s16000&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Export IFC direct à partir d&#39;un&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;IFCExportConfiguration&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Une autre solution consiste de transférer les valeurs une instance d&#39;un
IFCExportConfiguration&amp;nbsp;vers une instance IFCExportOptions avec la méthode&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; Void UpdateOptions(Autodesk.Revit.DB.IFCExportOptions, Autodesk.Revit.DB.ElementId)&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh79uPsYC7ATaPXvUkGUPBS4Y8losAEhA-o8Vi80TRW0m1feTzEamRHbq32BRDibL1IOitK_yNjta8OeqlhunqxuP3n2UlMwUSvGTg7X_3hUFCf9VM46qoCnr3CR2e6fQ24FaAfDUyQTd3szYbPkz1I68BEwEbB7ulztT4k7zYtLPISFe3Xql1va8pjuKlS&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;500&quot; data-original-width=&quot;1509&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh79uPsYC7ATaPXvUkGUPBS4Y8losAEhA-o8Vi80TRW0m1feTzEamRHbq32BRDibL1IOitK_yNjta8OeqlhunqxuP3n2UlMwUSvGTg7X_3hUFCf9VM46qoCnr3CR2e6fQ24FaAfDUyQTd3szYbPkz1I68BEwEbB7ulztT4k7zYtLPISFe3Xql1va8pjuKlS=s16000&quot; /&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
  
.&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;CODE 1 (extraction des configurations)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;.
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import sys
import System

# Import RevitAPI
clr.AddReference(&quot;RevitAPI&quot;)
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from Autodesk.Revit.Attributes import *
from Autodesk.Revit.DB.IFC import *


clr.AddReference(&quot;RevitServices&quot;)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
sdkNumber = int(app.VersionNumber)


IFCExportConfiguration = None
IFCExportConfigurationsMap = None
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)
pf_data_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData)
ifc_bundle_path = &quot;{0}\\Autodesk\\ApplicationPlugins\\IFC {1}.bundle\\Contents\\{1}&quot;.format(pf_data_path, sdkNumber)
if System.IO.Directory.Exists(ifc_bundle_path):
    print(&quot;pass1&quot;)
    sys.path.append(ifc_bundle_path)
    if sdkNumber &amp;lt; 2027:
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication
    else:
        clr.AddReference(&quot;Revit.IFC.Export&quot;)
        from Revit.IFC.Export.Utility import IFCExportConfigurationsMap, IFCExportConfiguration
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCCommandOverrideApplication
else:
    ifc_addin_path = &quot;{}\\Autodesk\\Revit {}\\AddIns\IFCExporterUI&quot;.format(pf_path, sdkNumber)
    if System.IO.Directory.Exists(ifc_addin_path):
        print(&quot;pass2&quot;)
        sys.path.append(ifc_addin_path)
        clr.AddReference(&quot;Autodesk.IFC.Export.UI&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication

import json

ifc_dict_config = {}
if IFCExportConfigurationsMap is not None:
    idfdocA = IFCCommandOverrideApplication.TheDocument
    if idfdocA is None:
        propinfo = clr.GetClrType(IFCCommandOverrideApplication).GetProperty(&#39;TheDocument&#39;)
        propinfo.SetValue(None, doc)
    configurationsMap = IFCExportConfigurationsMap(doc)
    configurationsMap.AddBuiltInConfigurations()
    configurationsMap.AddSavedConfigurations({})
    
    for config in configurationsMap.Values:
        dict_ifc_version_str = {&quot;IFC_Version_str&quot;: config.IFCVersion.ToString() }
        dict_config = json.loads(config.SerializeConfigToJson())
        # merge dictionaries
        merge_dict_3 = dict(dict_ifc_version_str,**dict_config)
        ifc_dict_config[config.Name] = merge_dict_3
  
OUT = ifc_dict_config
&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;    
      
.&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;CODE 2 (Export IFC)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Actuellement (sous Pythonnet3 + Revit 2027.1 ) une erreur se produit avec &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;Document.Export(String, String, IFCExportOptions)&lt;/code&gt; , une solution de contournement consiste à utiliser la Reflection.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;.
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import sys
import System
from System.Collections.Generic import *

clr.AddReference(&#39;ProtoGeometry&#39;)
from Autodesk.DesignScript.Geometry import *


clr.AddReference(&quot;System.Reflection&quot;)
from System.Reflection import BindingFlags

clr.AddReference(&quot;System.Core&quot;)
clr.ImportExtensions(System.Linq)

# Import RevitAPI
clr.AddReference(&quot;RevitAPI&quot;)
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from Autodesk.Revit.Attributes import*
from Autodesk.Revit.DB.IFC import*

# Import DocumentManager and TransactionManager
clr.AddReference(&quot;RevitServices&quot;)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
sdkNumber = int(app.VersionNumber)

IFCExportConfiguration = None
IFCExportConfigurationsMap = None
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)
pf_data_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData)
ifc_bundle_path = &quot;{0}\\Autodesk\\ApplicationPlugins\\IFC {1}.bundle\\Contents\\{1}&quot;.format(pf_data_path, sdkNumber)
if System.IO.Directory.Exists(ifc_bundle_path):
    sys.path.append(ifc_bundle_path)
    if sdkNumber &amp;lt; 2027:
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication
    else:
        clr.AddReference(&quot;Revit.IFC.Export&quot;)
        from Revit.IFC.Export.Utility import IFCExportConfigurationsMap, IFCExportConfiguration
        clr.AddReference(&quot;Revit.IFC.Common&quot;)
        from Revit.IFC.Common.Extensions import IFCClassificationMgr
        clr.AddReference(&quot;IFCExporterUIOverride&quot;)
        from BIM.IFC.Export.UI import IFCCommandOverrideApplication
else:
    ifc_addin_path = &quot;{}\\Autodesk\\Revit {}\\AddIns\IFCExporterUI&quot;.format(pf_path, sdkNumber)
    if System.IO.Directory.Exists(ifc_addin_path):
        print(&quot;pass2&quot;)
        sys.path.append(ifc_addin_path)
        clr.AddReference(&quot;Autodesk.IFC.Export.UI&quot;)
        from BIM.IFC.Export.UI import IFCExportConfigurationsMap, IFCExportConfiguration, IFCCommandOverrideApplication
        
        
def exportIfc(current_doc, pathfolder, name, ifcExportConfig, view3DId=ElementId.InvalidElementId):
    global error
    #
    if name.endswith(&quot;.rvt&quot;):
        name = name.replace(&quot;.rvt&quot;, &quot;.ifc&quot;)
    #
    #When using transactions with documents other than the primary document,better luck creating transactions from scratch.
    TransactionManager.Instance.ForceCloseTransaction()
    # define options
    options = IFCExportOptions()
    if ifcExportConfig is not None :
        #Define the of a 3d view to export
        
        # copy settings of the myIFCExportConfiguration to the IFCExportOptions
        if sdkNumber &amp;lt; 2027:
            exportViewId = ElementId.InvalidElementId # or None -&amp;gt; add view in options
            ifcExportConfig.UpdateOptions(options, exportViewId)
        else:
            # Revit 2027 and above
            if view3DId == ElementId.InvalidElementId:
                ifcExportConfig.UseActiveViewGeometry = False
                ifcExportConfig.VisibleElementsOfCurrentView = False
            else:
                ifcExportConfig.VisibleElementsOfCurrentView = True
                ifcExportConfig.ActiveViewId = view3DId
            #
            if ifcExportConfig.ExportUserDefinedPsets:
                userDefinedPsetsFileName = System.IO.Path.GetFileName(ifcExportConfig.ExportUserDefinedPsetsFileName)
                ifcExportConfig.ExportUserDefinedPsetsFileName = System.IO.Path.Combine(pathfolder, userDefinedPsetsFileName)
            #
            if ifcExportConfig.ExportUserDefinedPsets:
                userDefinedParameterMappingFileName = System.IO.Path.GetFileName(ifcExportConfig.ExportUserDefinedParameterMappingFileName)
                ifcExportConfig.ExportUserDefinedParameterMappingFileName = System.IO.Path.Combine(pathfolder, userDefinedParameterMappingFileName)
                
            ifcExportConfig.UpdateOptions(current_doc, options, view3DId, False)
            # call this before the Export IFC transaction starts, as it has its own transaction.
            IFCClassificationMgr.DeleteObsoleteSchemas(current_doc)
    
    #
    t = Transaction(current_doc, &#39;Export IFC&#39;)
    t.Start()
    failureOptions = t.GetFailureHandlingOptions()
    failureOptions.SetClearAfterRollback(False)
    t.SetFailureHandlingOptions(failureOptions)
    #
    try:
        #
        current_doc.Regenerate()
        result = current_doc.GetType().InvokeMember(&quot;Export&quot;, BindingFlags.InvokeMethod , None, current_doc, (pathfolder, name, options) )
    except Exception as ex:
        print(ex)
        t.RollBack()
        t.Dispose()
        return 0
    else:
        t.RollBack() # instead of t.Dispose()
        t.Dispose()
        return pathfolder + &#39;\\&#39; + name
        
        
ifc_config_map = IN[0]
pathfolder = IN[1]
name = IN[2]
ifc_config_name = IN[3]

ifcExportConfig = ifc_config_map[ifc_config_name]

exportIfc(doc, pathfolder, name, ifcExportConfig)

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4HgFuJk4zVeKpNmwucWpZreKpzZOBpQqo_radBVXbUZASA0RgV22C7l3quNPgcMCJfm4gIZe9PC5ixaV4VB9JF_lAUIXwyUHCfYloj467kxIu_FiQlmI3Cjkr9cMPEsTVCVV5MSDjfYBLCz3dMSCYkJWbxA-WeOXrhvXBJLi95lgin6RQk-CK0lwozNS/s1024/le%20monde%20se%20divise%20en%202%20categories.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4HgFuJk4zVeKpNmwucWpZreKpzZOBpQqo_radBVXbUZASA0RgV22C7l3quNPgcMCJfm4gIZe9PC5ixaV4VB9JF_lAUIXwyUHCfYloj467kxIu_FiQlmI3Cjkr9cMPEsTVCVV5MSDjfYBLCz3dMSCYkJWbxA-WeOXrhvXBJLi95lgin6RQk-CK0lwozNS/w400-h400/le%20monde%20se%20divise%20en%202%20categories.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;         
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          &lt;i&gt;Le monde se divise en deux catégories......&lt;br /&gt;NWC&amp;nbsp; VS&amp;nbsp;
            IFC&lt;br /&gt;Close&amp;nbsp; VS&amp;nbsp; Open&lt;br /&gt;sans hôte&amp;nbsp; VS&amp;nbsp;
            hôte par face&lt;br /&gt;Modèle Générique&amp;nbsp; VS&amp;nbsp; Site&lt;br /&gt;Etc...&lt;br /&gt;&lt;br /&gt;La
            meilleure, c&#39;est celle qui fait avancer le projet…&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;div&gt;
    &lt;a id=&quot;bottom&quot;&gt; &lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://voltadynabim.blogspot.com/feeds/4527036482983012636/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='https://voltadynabim.blogspot.com/2024/04/dynamo-python-export-ifc-configurations.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/4527036482983012636'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/4527036482983012636'/><link rel='alternate' type='text/html' href='https://voltadynabim.blogspot.com/2024/04/dynamo-python-export-ifc-configurations.html' title='[Dynamo += Python] Export IFC : configurations Utilisateur (MAJ 05/09/2026)'/><author><name>Cyril</name><uri>http://www.blogger.com/profile/08389811365235224682</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY3Iz0xq8QpQu6njnL6IyeBXjbJyBFxD1nsxDcqUHlCs3yQZih7HlcLEre3RYjOSPnDg544905lHz4K6SHzbXgmdITwUktyM_FTkcYSINI0wkNhXcYX_4i9Kx4176Mxm4/s113/1608331968791.jfif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEheNCMuJClyySo2riXYwP2paAn--xN4axsaCmmR58pn48A9VUQecyl4Fq_8MpxUy_MBtOuD3CAYjv5_GsD685g35K65ajQEUpuzMNS0Z64L5Kv5os6joVOxC2gqevp5nDYpDZsQ3KOYMLF3_Wqw7szRiTgPoNRRZPRdkQbigIONHzM4f7NdMOlLpGGMr5Su=s72-w400-h400-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4001721146719322746.post-7482987268360532166</id><published>2026-07-26T23:53:00.848+02:00</published><updated>2026-07-26T23:53:00.848+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AutodeskCommunity"/><category scheme="http://www.blogger.com/atom/ns#" term="AutodeskExpertElite"/><category scheme="http://www.blogger.com/atom/ns#" term="Compilation"/><category scheme="http://www.blogger.com/atom/ns#" term="module"/><category scheme="http://www.blogger.com/atom/ns#" term="pyc"/><category scheme="http://www.blogger.com/atom/ns#" term="pyd"/><category scheme="http://www.blogger.com/atom/ns#" term="PythonNet"/><title type='text'>[Dynamo += Python] Compilation de librairies personalisé Python</title><content type='html'>&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsipvpmKJoSF4wWTR8axrZxeGFs3mlMfuNNEMpN8F3mLnqaTd_1gaplZLelSnTEtls4gzaRtcS7K0xJ9lcwGG0mQTjdetGSor4kTXv128SKm_nAMMAEpt8fdFGTgcgrHauZX9EMQECzId4rwYb9fMBnQIJ7BmEDPRHMzdclaQu6SITJX-nKJcrLD7sP_q2/s1408/Gemini_Generated_Image_ci772cci772cci77.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1408&quot; height=&quot;350&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsipvpmKJoSF4wWTR8axrZxeGFs3mlMfuNNEMpN8F3mLnqaTd_1gaplZLelSnTEtls4gzaRtcS7K0xJ9lcwGG0mQTjdetGSor4kTXv128SKm_nAMMAEpt8fdFGTgcgrHauZX9EMQECzId4rwYb9fMBnQIJ7BmEDPRHMzdclaQu6SITJX-nKJcrLD7sP_q2/w640-h350/Gemini_Generated_Image_ci772cci772cci77.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&amp;nbsp;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Compilation de code Python et l&#39;utiliser dans Dynamo, c&#39;est possible
    ?&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;#DynamoBIM #Python #pyc #pyd #compile #AutodeskExpertElite
    #AutodeskCommunity&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.autodesk.com/expert-elite/&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;50&quot; data-original-width=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj3-npK4uFyHO9Jdk1NzGPoAjxdblUqzui38L8IBpDGyX0dDTXo3OBnvhvS6oVUjAG6kfD7A_qqKaQjE8v28_wy5vmOy5U9kZPzONBbbMdor19FAtuGqqbKxAn9OG44-MxLgH-XbEhq5xFuNxMUjUy8oJTZkmfy5sMt_lkdL1LqS0jmkFH7ojjLqzN5vf73=s16000&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
    &lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; text-align: right;&quot;&gt;
      &lt;span style=&quot;color: #2b00fe; font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;if this article is not in your language, use the Google Translate
          widget ⬈ (&lt;a href=&quot;#bottom&quot;&gt;bottom of page for Mobile version&lt;span&gt; &lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;#bottom&quot;&gt;⬇&lt;/a&gt;)&lt;/i&gt;&lt;/span&gt;
    &lt;/div&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
    Si vous développez en Python, vous savez probablement que vous pouvez
    importer vos propres classes/modules Python sous forme de fichier py, mais
    savez-vous qu&#39;il existe des fichiers
    &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;pyc&lt;/code&gt;
    et
    &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;pyd&lt;/code&gt;
    ?&amp;nbsp;
  &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Voyons cela.&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
  &lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      1. Le classique : le module sous forme de fichier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.py&lt;/code&gt;
    &lt;/span&gt;
  &lt;/span&gt;
&lt;/h3&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Avantages :&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Lisibilité absolue : C&#39;est du texte brut, compréhensible par n&#39;importe
      quel développeur (et éditable avec un simple bloc-notes)
    &lt;/span&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Simplicité : aucun processus de compilation complexe n&#39;est requis pour
      tester son code.&lt;br /&gt;&lt;br /&gt;
    &lt;/span&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Débogage facile : en cas de plantage, pas besoin de recompiler.&lt;/span&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Inconvénients :&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Lenteur relative : le code doit être analysé et compilé en &quot;bytecode&quot; par
      l&#39;interpréteur à chaque lancement (si aucun fichier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
      n&#39;est disponible).
    &lt;/span&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Propriété intellectuelle : Si vous distribuez votre application sous forme
      de fichiers .py, n&#39;importe qui peut lire votre code source (surtout si
      celui-ci contient des informations sensibles).
    &lt;/span&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
  &lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      2. Le compilé bytecode : le module sous forme de fichier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
    &lt;/span&gt;
  &lt;/span&gt;
&lt;/h3&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Présentation&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Le &quot;c&quot; signifie compiled (compilé). Lorsqu&#39;un module .py est importé pour
      la première fois, Python le traduit dans un format intermédiaire appelé
      bytecode et le sauvegarde dans un fichier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
      (généralement caché dans un dossier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;__pycache__&lt;/code&gt;). Le bytecode est une série d&#39;instructions optimisées que la machine
      virtuelle Python (CPython) peut exécuter beaucoup plus rapidement que du
      texte brut.
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Avantages :&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
          Temps de chargement réduit : si vous utilisez des fichiers .py pour
          charger des modules personnalisés, vous pouvez les remplacer par des
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;, ce qui accélère le démarrage du script.
        &lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
          Légère obfuscation : le code n&#39;est plus en texte clair, ce qui offre
          une (très) mince couche de protection contre la lecture directe par un
          novice.
        &lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Inconvénients :&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
          Dépendance à la version de Python : un fichier
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
          généré par Python 3.9 pourrait ne pas fonctionner sur Python 3.11.
        &lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
          Ce n&#39;est pas de la vraie sécurité : Des outils de &quot;décompilation&quot;
          (comme uncompyle6 ou
          &lt;a href=&quot;https://pylingual.io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;PyLingual&lt;/a&gt;) peuvent facilement recréer un fichier .py presque identique à
          partir d&#39;un
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;.
        &lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Comment le générer ?&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;
      Vous pouvez forcer la génération de fichiers
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
      pour tout un projet en utilisant le module intégré &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;compileall&lt;/code&gt;.&amp;nbsp;
    &lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;

&lt;div&gt;
  &lt;ul style=&quot;text-align: left;&quot;&gt;
    &lt;li&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Exemple de génération de fichier
        &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
        à partir d&#39;un nœud Python Dynamo.&lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Ici on récupère le contenu du code Python d&#39;un nœud et on le compile en
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyc&lt;/code&gt;
      directement depuis Dynamo.&lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;..&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import System
from System.Collections.Generic import List

clr.AddReference(&quot;System.Core&quot;)
clr.ImportExtensions(System.Linq)

# Add Revit API References
clr.AddReference(&#39;RevitAPI&#39;)
clr.AddReference(&quot;RevitServices&quot;)
clr.AddReference(&quot;RevitNodes&quot;)

import RevitServices
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

import Autodesk
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Document reference
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument

clr.AddReference(&#39;DynamoRevitDS&#39;)
import Dynamo 
#reference dynamo core to update node values
clr.AddReference(&#39;DynamoCore&#39;)
from Dynamo.Graph import UpdateValueParams

#access to the current Dynamo instance and workspace
dynamoRevit = Dynamo.Applications.DynamoRevit()
engine = dynamoRevit.RevitDynamoModel.EngineController
currentWorkspace = dynamoRevit.RevitDynamoModel.CurrentWorkspace
model = dynamoRevit.RevitDynamoModel

import os

folder = IN[0]
name_pyc = IN[1]
py_path = f&quot;{folder}\\{name_pyc}.py&quot;
pyc_path = f&quot;{folder}\\{name_pyc}.pyc&quot;

nodeK = next((i for i in currentWorkspace.Nodes\
                if i.Name == &quot;Python Script | Module1&quot;), None)
code_py = nodeK.Script
code_py = code_py.replace(&quot;\r&quot;,&quot;&quot;)
with open(py_path, &quot;w&quot;, encoding=&#39;utf-8&#39;) as f:
    f.write(code_py)

import py_compile
py_compile.compile(py_path, cfile=pyc_path)

os.remove(py_path)

OUT = folder
&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLfIdgPgjAlzclS074iabFXArQDw5JczCCg_UjO-QrSW6Mhd9AVRaNZ1NE5QEuotrIVxIOjc49IbLpedLx6o0hAvydbQVmKYZqhuYjjXnhgCcaVyLVr7cQAnpLEJZLdzN9EoakGYIfRg_Xy_a_varkOJEpaGpRtwzInXukSwyGQIdWWHKaAYRQG6qXvW-x/s1919/Screenshot_6_pyc.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1029&quot; data-original-width=&quot;1919&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLfIdgPgjAlzclS074iabFXArQDw5JczCCg_UjO-QrSW6Mhd9AVRaNZ1NE5QEuotrIVxIOjc49IbLpedLx6o0hAvydbQVmKYZqhuYjjXnhgCcaVyLVr7cQAnpLEJZLdzN9EoakGYIfRg_Xy_a_varkOJEpaGpRtwzInXukSwyGQIdWWHKaAYRQG6qXvW-x/s16000/Screenshot_6_pyc.png&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;h3 style=&quot;text-align: left;&quot;&gt;
      &lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;3. La DLL : Le fichier
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyd&lt;/code&gt;&lt;/span&gt;
      &lt;/span&gt;
    &lt;/h3&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;Présentation&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Le fichier
      &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyd&lt;/code&gt;
      est une bibliothèque de liens dynamiques (DLL) spécifique à Windows (son
      équivalent sous Linux/macOS est le fichier .so).&amp;nbsp;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Ce n&#39;est plus du Python : c&#39;est du code compilé (généralement à partir de
      C, C++ ou Rust) qui a été empaqueté pour être importable directement dans
      un script Python comme n&#39;importe quel autre module (ex: import
      mon_module_pyd).&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;Avantages :&lt;/b&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Performances élevées : le code s&#39;exécute à la vitesse du C. C&#39;est
          idéal pour les calculs lourds, le traitement d&#39;images ou
          l&#39;intelligence artificielle.&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Protection du code source : le code est compilé en langage machine.
          Il est extrêmement difficile (voire impossible sans ingénierie inverse
          lourde) de retrouver le code source d&#39;origine.&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Accès bas niveau : permet d&#39;interagir directement avec le matériel ou
          des API système de manière très pointue.&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;Inconvénients :&lt;/b&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Complexité de développement : il faut maîtriser d&#39;autres langages
          (C/C++) et comprendre l&#39;API C de Python.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Pour compiler en
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyd&lt;/code&gt;, il faut obligatoirement installer Python sur votre PC&amp;nbsp; (même
          version que celle de Python dans Dynamo) ainsi que les&amp;nbsp;Microsoft
          Visual C++ Build Tools&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;L&#39;environnement Python intégré dans le nœud Dynamo est une
              version &quot;allégée&quot; et encapsulée, optimisée pour l&#39;exécution. Elle
              ne contient pas de bibliothèques de développement.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Perte de portabilité : un
          &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyd&lt;/code&gt;
          compilé pour Windows 64 bits ne fonctionnera ni sur Windows 32 bits,
          ni sur Linux, ni sur macOS. Il faut recompiler le module pour chaque
          architecture et système d&#39;exploitation cible.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span data-index-in-node=&quot;129&quot; data-path-to-node=&quot;1&quot;&gt;Dépendance stricte à la version mineure de Python : un pyd compilé
            en 3.11 ne pourra pas être importé avec Python 3.12&lt;/span&gt;&lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;b&gt;Comment le générer ?&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;La création d&#39;un
        &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;.pyd&lt;/code&gt;
        est un processus de compilation. Voici les méthodes les plus courantes
        :&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;En utilisant &lt;b&gt;Cython &lt;/b&gt;(à ne pas confondre avec C&lt;b&gt;P&lt;/b&gt;ython) :
        on écrit un code hybride Python/C (fichier .pyx), puis vous utilisez un
        script
        &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;setup.py&lt;/code&gt;
        (via setuptools) pour le compiler en .pyd.&lt;br /&gt;&lt;br /&gt;Note : dans le
        fichier pyx , vous pouvez utiliser le typage statique ( en utilisant le
        mot-clé cdef), cela accélérera la vitesse d&#39;exécution.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;En écrivant cdef int i ou cdef double x, vous donnez une instruction
          stricte au compilateur : &quot;N&#39;utilise pas un objet Python dynamique pour
          cette variable. Crée une vraie variable C directement dans la mémoire
          vive.&quot;&lt;/i&gt;&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;Si, pour des raisons de tests, votre code à compiler est déjà
        dans votre espace Dynamo (nœud Python), vous pouvez utiliser le module
        subprocess pour générer le pyd directement depuis Dynamo comme suit
        :&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;code pour générer le pyd&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import System
from System.Collections.Generic import List

clr.AddReference(&quot;System.Core&quot;)
clr.ImportExtensions(System.Linq)

# Add Revit API References
clr.AddReference(&#39;RevitAPI&#39;)
clr.AddReference(&quot;RevitServices&quot;)
clr.AddReference(&quot;RevitNodes&quot;)

import RevitServices
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

import Autodesk
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Document reference
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument

clr.AddReference(&#39;DynamoRevitDS&#39;)
import Dynamo 
#reference dynamo core to update node values
clr.AddReference(&#39;DynamoCore&#39;)
from Dynamo.Graph import UpdateValueParams

#access to the current Dynamo instance and workspace
dynamoRevit = Dynamo.Applications.DynamoRevit()
engine = dynamoRevit.RevitDynamoModel.EngineController
currentWorkspace = dynamoRevit.RevitDynamoModel.CurrentWorkspace
model = dynamoRevit.RevitDynamoModel

import os
import subprocess 
import sysconfig
# standard library path
sys.path.append(sysconfig.get_path(&quot;platstdlib&quot;))
# site-package library path
sys.path.append(sysconfig.get_path(&quot;platlib&quot;))

folder = IN[0]
name_pyd = IN[1]
py_path = f&quot;{folder}\\{name_pyd}.pyx&quot;
pyc_path = f&quot;{folder}\\{name_pyd}.pyd&quot;
setup_path = f&quot;{folder}\\setup.py&quot;

python_exe = r&quot;C:\Users\sneep\AppData\Local\Programs\Python\Python311\python.exe&quot; 

# write the py file from a python node
nodeK = next((i for i in currentWorkspace.Nodes if i.Name == &quot;Python Script | Module1&quot;), None)
code_py = nodeK.Script
code_py = code_py.replace(&quot;\r&quot;,&quot;&quot;)
with open(py_path, &quot;w&quot;, encoding=&#39;utf-8&#39;) as f:
    f.write(code_py)

contenu_setup = f&quot;&quot;&quot;# Généré automatiquement via Dynamo
from setuptools import setup
from Cython.Build import cythonize

setup(
    ext_modules = cythonize(&quot;{name_pyd}.pyx&quot;)
)
&quot;&quot;&quot;
with open(setup_path, &quot;w&quot;, encoding=&#39;utf-8&#39;) as f:
    f.write(contenu_setup)
    
# compilation via Subprocess
commande = [python_exe, setup_path, &quot;build_ext&quot;, &quot;--inplace&quot;]

try:
    resultat = subprocess.run(
        commande,
        cwd=folder,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        text=True,
        shell=True
    )
    
    # return
    if resultat.returncode == 0:
        OUT = resultat.stdout, 
    else:
        OUT = resultat.stderr, 
        
except Exception as e:
    OUT = str(e), 

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;ul style=&quot;text-align: left;&quot;&gt;
    &lt;li&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;Exemple de code à générer en pyd (non optimisé )&lt;/span&gt;
      &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;Ici on reste sur une syntaxe
    &lt;span style=&quot;background-color: #01ffff;&quot;&gt;C&lt;b&gt;P&lt;/b&gt;ython&lt;/span&gt;.&lt;/span&gt;
&lt;/div&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import sys
import clr
import System
import math

clr.AddReference(&#39;ProtoGeometry&#39;)
from Autodesk.DesignScript.Geometry import *

class Utils:
    guid = &quot;a8c3aa76-f731-4086-ae08-8cb41464e425&quot;

       
    def __name__(self):
        return &quot;Utils&quot;
    
    @staticmethod   
    def filter_points(flat_points, pt_center, radius):
        inside_points = []
        center_x, center_y, center_z = pt_center.X, pt_center.Y, pt_center.Z
        r_square = radius ** 2
        
        for p in flat_points:
            x, y, z = p.X, p.Y, p.Z
            
            dist_square = (x - center_x)**2 + (y - center_y)**2 + (z - center_z)**2
            
            if dist_square &amp;lt;= r_square:
                inside_points.append(p)
                
        return inside_points

OUT = Utils

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;br /&gt;
  &lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;Exemple de code à compiler en pyd (optimisé)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
    &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span&gt;&lt;span&gt;Dans ce 2ᵉ exemple, on est sur un langage
          &lt;span style=&quot;background-color: #01ffff;&quot;&gt;&lt;b&gt;C&lt;/b&gt;ython&lt;/span&gt;,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;il s&#39;agit d&#39;un langage hybride (techniquement un &quot;sur-ensemble&quot; de
        Python) créé spécifiquement pour servir de pont entre les deux mondes
        (le C et le Python).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;On a ajouté des déclarations de types statiques du C (cdef).
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import sys
import clr
import System
import math

clr.AddReference(&#39;ProtoGeometry&#39;)
from Autodesk.DesignScript.Geometry import *

class Utils:
    guid = &quot;a8c3aa76-f731-4086-ae08-8cb41464e425&quot;
    def __name__(self):
        return &quot;Utils&quot;
    
    @staticmethod   
    def filter_points_fast(points, pt_center, double radius):
        # variables declarations
        cdef double center_x, center_y, center_z
        cdef double r_square
        cdef double x, y, z, dist_square
        
        inside_points = []
        
        center_x = pt_center.X
        center_y = pt_center.Y
        center_z = pt_center.Z
        r_square = radius * radius
        
        for p in points:
            x = p.X
            y = p.Y
            z = p.Z
            
            dist_square = (x - center_x)*(x - center_x) + (y - center_y)*(y - center_y) + (z - center_z)*(z - center_z)
            
            if dist_square &amp;lt;= r_square:
                inside_points.append(p)
                
        return inside_points

OUT = Utils

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;Note : on pourrait également dans cet exemple passer directement les
        valeurs numériques des points au lieu des objets &quot;.Net&quot; , ce qui
        accélérerait encore plus l&#39;exécution, notamment au niveau de la boucle
        &lt;b&gt;for&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin3SpXBGVDbNGARE_h2F34nZKXefKjiheqtkNhfOT76vh31O-7tIBk3Yhdt3sJ4hnKgpTZfpwOCO2YzfdQ1jKg-_Lh1ENbfrqVUqRmimMoJePDUQK_HgzUO-hIdEgophP9aTWADebA1mU_eZuaE5b6Qkxgf-bxy1wNFvAD_Rujx-M1TUlEF9pmfajkAkp_/s1202/results%20pyd%20compil.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;637&quot; data-original-width=&quot;1202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin3SpXBGVDbNGARE_h2F34nZKXefKjiheqtkNhfOT76vh31O-7tIBk3Yhdt3sJ4hnKgpTZfpwOCO2YzfdQ1jKg-_Lh1ENbfrqVUqRmimMoJePDUQK_HgzUO-hIdEgophP9aTWADebA1mU_eZuaE5b6Qkxgf-bxy1wNFvAD_Rujx-M1TUlEF9pmfajkAkp_/s16000/results%20pyd%20compil.jpg&quot; /&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;h3&gt;
      &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;4. L&#39;importation et l&#39;utilisation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;L&#39;importation se fait de la même manière pour les 3 types de fichiers
          (py, pyc, pyd) via le module &lt;code class=&quot;nocode&quot; style=&quot;background: rgb(240, 240, 240); border-radius: 3px; border: 1px solid rgb(208, 208, 208); font-family: courrier; font-size: 17.3333px; padding-left: 2px; padding-right: 2px; text-align: justify;&quot;&gt;sys&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;prettyprint&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;font size=&quot;2.5pt&quot;&gt;
import clr
import System

import sys
import os
import importlib
import inspect

pyd_folder_path = IN[0] # the folder path of py/pyc/pyd file (NOT THE FILEPATH)
flat_points = IN[1]
pt_center = IN[2]

sys.path.append(pyd_folder_path) 

import Utils2
# optionnal : reload the module if it has already been loaded
importlib.reload(Utils2)

from Utils2 import Utils
# optionnal : check the filepath of module (py, pyc, pyd)
pyd_file_path = inspect.getfile(Utils2)

OUT =  Utils.filter_points(flat_points, pt_center, radius=4), pyd_file_path

&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;h3 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;
          &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;4. Résultats&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;table style=&quot;border-collapse: collapse; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 5px; font-family: sans-serif; font-size: 15px; margin: 20px 0px; width: 100%;&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th style=&quot;background-color: #2c3e50; border: 1px solid rgb(221, 221, 221); color: white; font-weight: bold; padding: 12px 15px; text-align: left;&quot;&gt;
          Format du module
        &lt;/th&gt;
        &lt;th style=&quot;background-color: #2c3e50; border: 1px solid rgb(221, 221, 221); color: white; font-weight: bold; padding: 12px 15px; text-align: left;&quot;&gt;
          Fonction testée
        &lt;/th&gt;
        &lt;th style=&quot;background-color: #2c3e50; border: 1px solid rgb(221, 221, 221); color: white; font-weight: bold; padding: 12px 15px; text-align: left;&quot;&gt;
          Temps d&#39;exécution moyen
        &lt;/th&gt;
        &lt;th style=&quot;background-color: #2c3e50; border: 1px solid rgb(221, 221, 221); color: white; font-weight: bold; padding: 12px 15px; text-align: left;&quot;&gt;
          Nombre de tests
        &lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr style=&quot;background-color: white;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;strong&gt;pyc&lt;/strong&gt; (Bytecode standard)
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;code style=&quot;background-color: rgba(0, 0, 0, 0.05); border-radius: 4px; font-family: monospace; padding: 2px 6px;&quot;&gt;test_from_pyc&lt;/code&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          75.186 ms
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          4
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #f8f9fa;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;strong&gt;pyd&lt;/strong&gt; (CPython/Cython non optimisé)
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;code style=&quot;background-color: rgba(0, 0, 0, 0.05); border-radius: 4px; font-family: monospace; padding: 2px 6px;&quot;&gt;test_from_pyd_not_optimised&lt;/code&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          56.692 ms
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          4
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #e8f5e9; color: #2e7d32; font-weight: bold;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;strong&gt;pyd&lt;/strong&gt; (Cython optimisé)
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          &lt;code style=&quot;background-color: rgba(0, 0, 0, 0.1); border-radius: 4px; color: #2e7d32; font-family: monospace; padding: 2px 6px;&quot;&gt;test_from_pyd_optimised&lt;/code&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          43.488 ms
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 12px 15px; text-align: left;&quot;&gt;
          4
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;font-family: georgia; font-size: medium;&quot;&gt;&lt;i&gt;
        Soyez gentil, car tous ceux que vous rencontrez mènent un dur combat.&lt;br /&gt;Ian
        Maclaren (John Watson)
      &lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
  ...
  &lt;a id=&quot;bottom&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://voltadynabim.blogspot.com/feeds/7482987268360532166/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='https://voltadynabim.blogspot.com/2026/07/dynamo-python-compilation-de-librairies.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/7482987268360532166'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4001721146719322746/posts/default/7482987268360532166'/><link rel='alternate' type='text/html' href='https://voltadynabim.blogspot.com/2026/07/dynamo-python-compilation-de-librairies.html' title='[Dynamo += Python] Compilation de librairies personalisé Python'/><author><name>Cyril</name><uri>http://www.blogger.com/profile/08389811365235224682</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY3Iz0xq8QpQu6njnL6IyeBXjbJyBFxD1nsxDcqUHlCs3yQZih7HlcLEre3RYjOSPnDg544905lHz4K6SHzbXgmdITwUktyM_FTkcYSINI0wkNhXcYX_4i9Kx4176Mxm4/s113/1608331968791.jfif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsipvpmKJoSF4wWTR8axrZxeGFs3mlMfuNNEMpN8F3mLnqaTd_1gaplZLelSnTEtls4gzaRtcS7K0xJ9lcwGG0mQTjdetGSor4kTXv128SKm_nAMMAEpt8fdFGTgcgrHauZX9EMQECzId4rwYb9fMBnQIJ7BmEDPRHMzdclaQu6SITJX-nKJcrLD7sP_q2/s72-w640-h350-c/Gemini_Generated_Image_ci772cci772cci77.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>