Save-as Revit family file and import corresponding DWG file

Hi everyone,
I have 10 DWG files. Goal: I want to create 10 .rfa files. Then, sequentially import the 10 DWG files into the corresponding 10 .rfa files.

Current approach:I created a Importscript and used the BirdTool to accomplish this. However, it seems to be taking quite a bit of time. (May be 20s/unit).

Question: I have come up with a new solution as follows: I will use the “Save-as” node in Dynamo and combine it with the AutoCAD import node. The procedure is as follows: First, I will import a DWG file into a corresponding .rfa file. Then, I will “Save-as” a second .rfa file and continue importing the corresponding DWG file… But it seems that the “Save-as” node is being executed all at once. Is there a way for me to temporarily pause the “Save-as” process to execute the import command?
Thanks!

Here is a dynamo script I made.
Nick_Saveas and import.dyn (36 KB)

I don’t actually know if they would work, but its probably the first thing i would try

As a second troubleshooting step, you might be able to figure out where the data is being held up the logest with a node like this inserted into the streams, you may have the waitfor node in the wrong place.

image

something like this, but i don’t actually know if it would work…worth a try

Python Script
# Import the necessary libraries
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

# Define a function that outputs the current time
def output_current_time():
    import datetime
    current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    return current_time

# Main script
output = output_current_time()
OUT = output
1 Like

Wow. This is the first time I’ve learned about using “Time of Data” to be inserted into the streams. It’s really helpful for me to address different issues. I will give it a try. Thanks.

Its actually not written correctly now that i look at it, but lets see what you get.

Im curious to see what results you got from this.
Any update?

I tried your solution. Although it didn’t work, it’s indeed an interesting approach. I managed to solve my issue. I don’t remember the exact topic I referenced, but I created a Custom Node and combined it with a LoopWhile Node. Here are the Images and dynamo script I used.



ImportAndSaveas.dyf (40.2 KB)
ImportAndSaveas With LoopWhile.dyn (31.0 KB)

1 Like