Is there any way to batch create families by cad block with dynamo?

I’m sure there are other ways to do this, but I used this approach when I had to convert 100s of .objs to .rfas. This should work with dwgs as well.

@echo off
SETLOCAL EnableDelayedExpansion

SET FILEEXT=DWG
SET TEMPLATEFILENAME=template

for /R "%~dp0" %%f in (*.%FILEEXT%) do (
    echo processing: %%f
        
    copy "%~dp0\%TEMPLATEFILENAME%.rfa" "%~dp0%%~nf.rfa"
    echo "%~dp0%%~nf.rfa">> "%~dp0filelist.txt"
)

Maybe you can also do this in dynamo, I like to do file manipulations in batch or bash, they are quicker.

This workflow doesn’t create true revit geometry from the imported dwgs, they will be only imports. You just have to figure out what you really want, add it to the script, and cycle through the script with BatchProcessor.

7 Likes