Loading and placing revit families from a csv

First time on the forums so apologies if this is in the wrong place.

I am a 3rd year drafting tech student with little coding knowledge working on a dynamo project that would automatically load families from a library. Dynamo is not part of my curriculum so I’m learning on my own

The project consists of a database of a few hundred common modular parts that can attach to a common chassis, think along the lines of modular housing.
I have made all these parts into Revit families and placed on a google drive.

The invent is to have a requested BoM from a .csv. then have dynamo load the families I need from that .csv into the project then if possible place them at certain coordinates of on a reference plane.

Here is where i am getting stuck. I can get the list (using a small sample of just 2 doors) and the file path to where the files exist is correct but i can’t get them to actually load into the project.

I am using the orchid package. Any other recommended packages would be helpful as would be any other learning resources other than dynamo forums/primer.

put aside any packges you plan to use and lets focus on the bottom right of your image first, that Document.LoadFamily takes a document as input and you are offering a text string. Do you have access to node “Document.Current”? Try hook it to Document.LoadFamily.

I think you might run into some issues if the library isn’t local to disc; cloud mirroring isn’t all it’s cracked up to be. If you can move to a local network or your C drive I recommend doing so, even if just for the POC.

Yes i have that node, plugged it in to Document.LoadFamily and it is giving me a new error.

moved this small batch of families to my locale drive as @jacob.small recommended.

I’ve only done it programmatically though. In my vague memory, there’s package that handles this. If you don’t get a working solution by the time I return to office, lets work this out together then. But bear in mind, it will be code heavy.

@Floch1923 roughly, you could do it this way. I put some simple checks on the input path, then load the family and get the family types if Revit loads it successfully. You could place family instances with the types you get from this (dictionary values).

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import os

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

def load_fams(paths):
    result = {}
    
    for p in paths:
        if isinstance(p, str) and os.path.isfile(p): # when p is a file path
            fam: Family = None
            loaded = doc.LoadFamily(p, fam)
            success = loaded[0]
            types = None if not success else list(map(lambda id: doc.GetElement(id), loaded[1].GetFamilySymbolIds()))
            result[os.path.basename(p)] = (success, types)
    
    return result

fam_paths = IN[0] if isinstance(IN[0], list) else [IN[0]]

TransactionManager.Instance.EnsureInTransaction(doc)

TransactionManager.Instance.TransactionTaskDone()
     
OUT = load_fams(fam_paths)