<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13754616#M84405</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/17133246"&gt;@b_neterebskiiFSAA9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I find out that it is possible to handle this problem using new Namespace everytime. E.g. with uuid function. Here is the example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;LI-CODE lang="python"&gt;import uuid

class WarningFailureMessageClass(IFailuresPreprocessor):
    __namespace__ = str(uuid.uuid4())

    def PreprocessFailures(self, failuresAccessor):
        fail_acc_list = failuresAccessor.GetFailureMessages()
        for failure in fail_acc_list:
            severity = failure.GetSeverity()
            if severity == FailureSeverity.Warning:
                failuresAccessor.DeleteWarning(failure)
        return FailureProcessingResult.Continue


def suppress_warnings(transaction):
    fail_opt = transaction.GetFailureHandlingOptions()
    preprocessor = WarningFailureMessageClass()
    fail_opt.SetFailuresPreprocessor(preprocessor)
    transaction.SetFailureHandlingOptions(fail_opt)&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;P&gt;Unless i'm doing it wrong, using a uuid for the namespace always crashes Revit for me after 20-30 iterations. I've tried moving the 'family_load_options = FamilyLoadOptions()' line outside of the loop and it does the same thing. I also tried setting a static non-uuid string for the name space like the stackoverflow post and still the same thing. Nothing works for me for long. It's not the other parts of my code either, because if i run it without trying to load the family back into the project, everything works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class FamilyLoadOptions(IFamilyLoadOptions):
    """A Class implementation for loading families"""
    __namespace__ = str(uuid.uuid4())

    def OnFamilyFound(self, familyInUse, overwriteParameterValues):
        """Defines behavior when a family is found in the model."""
        overwriteParameterValues = True
        return True

    def OnSharedFamilyFound(self, sharedFamily, familyInUse, source, overwriteParameterValues):
        """Defines behavior when a shared family is found in the model."""
        source = FamilySource.Project
        # source = FamilySource.Family
        overwriteParameterValues = True
        return True

## This is in a 'for' loop
family_load_options = FamilyLoadOptions()
famDoc.LoadFamily(doc, family_load_options)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 05 Aug 2025 14:00:56 GMT</pubDate>
    <dc:creator>LoganAC34</dc:creator>
    <dc:date>2025-08-05T14:00:56Z</dc:date>
    <item>
      <title>[Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/11996943#M11680</link>
      <description>&lt;P&gt;When I call `&lt;SPAN&gt;familyDoc.LoadFamily(doc, FamilyLoadOptions())` in Revit 2024 I get following error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; TypeError: interface takes exactly one&lt;BR /&gt;&amp;nbsp; &amp;nbsp; argument [' File "«string›", line 97, in&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;module&amp;gt;\n']&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code used to work, but the method seems to no longer accept the second argument, which doesn't seems correct. Is this my bug or a bug in Revit 2024 Python API or maybe a API change, or am I missing something else??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I originally posted the question with more context in dynamobim forums:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forum.dynamobim.com/t/how-do-i-define-a-family-parameter-in-revitapi-2024-using-python-block-in-designscript/89816/4?u=jakub.podlaha" target="_blank"&gt;https://forum.dynamobim.com/t/how-do-i-define-a-family-parameter-in-revitapi-2024-using-python-block-in-designscript/89816/4?u=jakub.podlaha&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Entire source code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
import clr
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

## Input parameters
familyName = IN[0]
family = UnwrapElement(IN[1])


## Test if family already contains the parameter
def familyHasParameter(family, parameterName):
        currentParams = family.FamilyManager.GetParameters()
        for k in range(len(currentParams)):
                if currentParams[k].Definition.Name == parameterName:
                        return True
        return False


## Get Family document from family instance
def getFamilyDoc(fam, doc):
        if isinstance(fam, Autodesk.Revit.DB.FamilyInstance):
                return (Document.EditFamily(doc, fam.Symbol.Family))
        else:
                if fam.IsInPlace == False:
                        return (Document.EditFamily(doc, fam))


## Implementation of family load options - always override existing family
class FamilyLoadOptions(IFamilyLoadOptions):
        def     OnFamilyFound(self, familyInUse, overwriteParameterValues):
                overwriteParameterValues = True
                return True

        def     OnSharedFamilyFound(self, sharedFamily, familyInUse, source, overwriteParameterValues):
                source = FamilySource.Family
                overwriteParameterValues = True
                return True


###########################################################


TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()

doc = DocumentManager.Instance.CurrentDBDocument


print("-- Editing family: " + familyName)
familyDoc = getFamilyDoc(family, doc)


TransactionManager.Instance.EnsureInTransaction(doc)
trans = Transaction(familyDoc, "Edit family params")
trans.Start()


parameterName = "TEST"
groupTypeId = Autodesk.Revit.DB.GroupTypeId.Data
specTypeId = Autodesk.Revit.DB.SpecTypeId.Current
isInstance = True

if familyHasParameter(familyDoc, parameterName):
    print(("-- Parameter already exists on family: " + parameterName))
else:
    print(("-- Adding parameter to family: " + parameterName))
    familyDoc.FamilyManager.AddParameter(parameterName, groupTypeId, specTypeId, isInstance)
    
trans.Commit()
trans.Dispose()

TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()

print("-- Saving family to project")
familyDoc.LoadFamily(doc, FamilyLoadOptions())
    
TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 21:38:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/11996943#M11680</guid>
      <dc:creator>j.podlaha</dc:creator>
      <dc:date>2023-05-29T21:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/11997397#M11681</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;This is definetly CPython3 problem. I've made a short test. And LoadFamily method accepts load options just fine if you use IronPython2 in Dynamo instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;f_doc = doc.EditFamily(family)

TransactionManager.Instance.EnsureInTransaction(f_doc)
f_doc.FamilyManager.NewType("Test")
TransactionManager.Instance.TransactionTaskDone()

f_doc.LoadFamily(doc, FamilyLoadOptions())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Worked fine in Revit 2024. But when I switched to CPython3 the same error happened.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 05:18:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/11997397#M11681</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-05-30T05:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12012656#M11682</link>
      <description>&lt;P&gt;Hey, thanks a lot for helping to figure this out. How should I handle this issue now? Is there a bugtracker to report this to? Switching back to IronPython2 currently doesn't work for me (I struggle to do the switch in current Revit).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 18:32:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12012656#M11682</guid>
      <dc:creator>j.podlaha</dc:creator>
      <dc:date>2023-06-05T18:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12013939#M11683</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I think the best way to report the bug is in their repository on Github. But first, read &lt;A href="https://github.com/DynamoDS/Dynamo/wiki/Work-in-progress-to-improve-Python-3-support" target="_blank" rel="noopener"&gt;this article&lt;/A&gt;, maybe this bug is already listed there.&lt;/P&gt;
&lt;P&gt;As for using IronPython2 - it works fine. If you write more details about what you're having trouble with, maybe I can help. In my opinion it's a better option than waiting for Dynamo CPython3 developers to fix all the bugs.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 09:03:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12013939#M11683</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-06-06T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12022700#M11684</link>
      <description>&lt;P class="lia-align-left"&gt;I've shared this a few times in the Dynamo forum, but apparently not to a wide enough audience, so I'll post this here as well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This isn't an issue with CPython, but more likely with Python 3 entirely as IronPython3 fails similarly. As such reporting to the Dynamo GitHub wont' help much - you'll have to go to the Python one instead. The reason this fails now is that classes required a namespace to pass to the .net environment cleanly. If you provide a namespace things should work without issue for the first run.&lt;BR /&gt;&lt;BR /&gt;However namespaces cannot be duplicated in the same kernal, and as the class with it's namespace has been passed once already it either needs to be disposed after run (haven't tested this as it isn't something which I have needed in my work of late) or a unique namespace needs to be generated for each run (works without issue for a few hundred runs while developing code anyway).&lt;/P&gt;
&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;A non-Revit centered version of the problem and the same solution can be found here:&amp;nbsp;&lt;A href="https://stackoverflow.com/a/50462691" target="_blank" rel="noopener"&gt;https://stackoverflow.com/a/50462691&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 12:17:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/12022700#M11684</guid>
      <dc:creator>jacob.small</dc:creator>
      <dc:date>2023-06-09T12:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13389651#M11685</link>
      <description>&lt;P&gt;I find out that it is possible to handle this problem using new Namespace everytime. E.g. with uuid function. Here is the example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import uuid

class WarningFailureMessageClass(IFailuresPreprocessor):
    __namespace__ = str(uuid.uuid4())

    def PreprocessFailures(self, failuresAccessor):
        fail_acc_list = failuresAccessor.GetFailureMessages()
        for failure in fail_acc_list:
            severity = failure.GetSeverity()
            if severity == FailureSeverity.Warning:
                failuresAccessor.DeleteWarning(failure)
        return FailureProcessingResult.Continue


def suppress_warnings(transaction):
    fail_opt = transaction.GetFailureHandlingOptions()
    preprocessor = WarningFailureMessageClass()
    fail_opt.SetFailuresPreprocessor(preprocessor)
    transaction.SetFailureHandlingOptions(fail_opt)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Mar 2025 14:35:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13389651#M11685</guid>
      <dc:creator>b_neterebskiiFSAA9</dc:creator>
      <dc:date>2025-03-25T14:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13715389#M84253</link>
      <description>&lt;P&gt;Works like a charm! I would never have come up with this solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems a bit strange though. It deliberatly obfuscates the namespace for the .NET interpreter. Could this cause some sort of degredation of the&amp;nbsp;.NET interpreter functionality in the long run, or are these new namespaces not stored after a run where this class is instantiated?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 08:38:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13715389#M84253</guid>
      <dc:creator>e.j.nap</dc:creator>
      <dc:date>2025-07-08T08:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13754616#M84405</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/17133246"&gt;@b_neterebskiiFSAA9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I find out that it is possible to handle this problem using new Namespace everytime. E.g. with uuid function. Here is the example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;LI-CODE lang="python"&gt;import uuid

class WarningFailureMessageClass(IFailuresPreprocessor):
    __namespace__ = str(uuid.uuid4())

    def PreprocessFailures(self, failuresAccessor):
        fail_acc_list = failuresAccessor.GetFailureMessages()
        for failure in fail_acc_list:
            severity = failure.GetSeverity()
            if severity == FailureSeverity.Warning:
                failuresAccessor.DeleteWarning(failure)
        return FailureProcessingResult.Continue


def suppress_warnings(transaction):
    fail_opt = transaction.GetFailureHandlingOptions()
    preprocessor = WarningFailureMessageClass()
    fail_opt.SetFailuresPreprocessor(preprocessor)
    transaction.SetFailureHandlingOptions(fail_opt)&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;P&gt;Unless i'm doing it wrong, using a uuid for the namespace always crashes Revit for me after 20-30 iterations. I've tried moving the 'family_load_options = FamilyLoadOptions()' line outside of the loop and it does the same thing. I also tried setting a static non-uuid string for the name space like the stackoverflow post and still the same thing. Nothing works for me for long. It's not the other parts of my code either, because if i run it without trying to load the family back into the project, everything works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class FamilyLoadOptions(IFamilyLoadOptions):
    """A Class implementation for loading families"""
    __namespace__ = str(uuid.uuid4())

    def OnFamilyFound(self, familyInUse, overwriteParameterValues):
        """Defines behavior when a family is found in the model."""
        overwriteParameterValues = True
        return True

    def OnSharedFamilyFound(self, sharedFamily, familyInUse, source, overwriteParameterValues):
        """Defines behavior when a shared family is found in the model."""
        source = FamilySource.Project
        # source = FamilySource.Family
        overwriteParameterValues = True
        return True

## This is in a 'for' loop
family_load_options = FamilyLoadOptions()
famDoc.LoadFamily(doc, family_load_options)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 Aug 2025 14:00:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/13754616#M84405</guid>
      <dc:creator>LoganAC34</dc:creator>
      <dc:date>2025-08-05T14:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/14108661#M85564</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;No need for the "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;IFamilyLoadOptions&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Just use:&lt;BR /&gt;success&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.LoadFamily(&lt;/SPAN&gt;&lt;SPAN&gt;path&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 09:23:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/14108661#M85564</guid>
      <dc:creator>Trinh_TH</dc:creator>
      <dc:date>2026-04-28T09:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: [Revit 2024] In Python node in Dynamo doc.LoadFamily does not accept loadoptions anymore.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/14108708#M85565</link>
      <description>&lt;P&gt;Per the &lt;A href="https://help.autodesk.com/view/RVT/2026/ENU/?guid=6a91dc8e-6c2b-52b9-dfc4-d56fa472852b" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;, the call&amp;nbsp;&lt;STRONG&gt;doc.LoadFamily(path)&lt;/STRONG&gt;&amp;nbsp;will only work if there isn't a family with the same name in the document. If there is a matching family you'll get an warning.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 10:00:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2024-in-python-node-in-dynamo-doc-loadfamily-does-not/m-p/14108708#M85565</guid>
      <dc:creator>jacob.small</dc:creator>
      <dc:date>2026-04-28T10:00:15Z</dc:date>
    </item>
  </channel>
</rss>

