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.
- Separate all blocks you want to import to separate files. You can wblock all blocks with a lisp like this: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-wblock-of-blocks-in-drawing/m-p/789693/highlight/true#M15351
- Create a “template” rfa. It’s an empty rfa file, where you will import one block. Set up categories, parameters, in this “template”
- Create a copy of the template rfa named similarly to the exported dwgs. You can use a batch like this:
@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.
- Create a dynamo script which imports dwgs which has the same name as the current file:
To import dwgs I used the dwg nodes from the GeniusLoci package: - Use revit batch processor to cycle through the created rfa files: https://github.com/bvn-architecture/RevitBatchProcessor
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.