Skip to content

Add Family.LoadFromFile node with a FamilyLoadOptions object #3434

Open

Description

@johnpierson

Summary

Dynamo for Revit has no out-of-the-box way to load a family (.rfa) into the active document from a file path. Requesting a new Family.LoadFromFile node, with load behavior controlled by a new FamilyLoadOptions object.

Motivation

  • Samples: The adaptive components sample graph depends on AdaptivePanel.rfa, which ships in the Dynamo samples data folder (e.g. C:\Program Files\Autodesk\Revit 2027\AddIns\DynamoForRevit\Samples\Data) but is not loaded in the Snowdon Towers sample model. Users have to leave Dynamo, locate the file, load it manually in Revit, then return and fix the family selection. With this node the sample could load its own dependency. See https://forum.dynamobim.com/t/revit-adaptive-components-sample-file/115215
  • Forum: Loading families from a directory is a recurring forum request.
  • Python migration: Today the only routes are custom packages or a Python node. The Python route requires implementing the IFamilyLoadOptions .NET interface, which is a common reason package authors cite for being unable to move off IronPython 2.

Proposed API

Family.LoadFromFile(filePath, familyLoadOptions = null) -> Family

Wraps Document.LoadFamily(string, IFamilyLoadOptions, out Family).

  • filePath (string): path to the .rfa file.
  • familyLoadOptions (optional): when omitted, uses default options so the simple case stays a single-input node.
  • Idempotent on re-execution: if the family is already loaded and unchanged, return the existing Family rather than null or a failure.
  • Clear warnings for a missing file, a non-.rfa path, or an invalid document context (e.g. family editor restrictions).

FamilyLoadOptions.ByProperties(overwriteExisting = true, overwriteParameterValues = false, sharedFamilySource = "Family")

A Dynamo-side class implementing IFamilyLoadOptions, so users never have to implement the interface themselves.

  • overwriteExisting: return value of OnFamilyFound / OnSharedFamilyFound (whether to continue loading when the family already exists).
  • overwriteParameterValues: maps to the overwriteParameterValues out parameter.
  • sharedFamilySource: maps to FamilySource (Family or Project) for nested shared families.

Follow-up

Once available, update the adaptive components sample graph to load AdaptivePanel.rfa from the samples data folder automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions