Mass save model groups to path

Hi All,

I am working on a project that has 60 + flat layouts drawn in model groups. The team are manually exporting these from a flat type model into the the given building models and its a slow process.

I am looking to take the given model groups and mass save them to a Folder.

I have found this thread on saving Revit families to a path. but i do not have enough knowledge yet of the API to adapt it to be able to save .rvt model groups.

Any direction would be appriciated?

Thanks

Ben

I’d hate to disappoint you, but there doesn’t seem to be a method to save a group out to a file in the API, even though there’s a method to do so through the user interface. There seems to be a postable command but that won’t help you for automating the process.

One thing you could try is possibly automating the export with the help of a journal file.

So you’re looking to script the save as library function?

Try this first:

That only does one Group at a time.

Whitehead (?) developed a journal file (at least it sounds like a journal file) to achieve this. I don’t think he’s made it publicly available, however.

Hi Jacob

that is the workflow currently but it needs to be repeated 100+ times. So the aim is automated the AsLibary Group process

I guess I misunderstood the scope some…

I haven’t tested this so it may not work and there could be a few lumps along the way. Consider making a Revit file with model text that matches the group name as a test as I’m sure your stuff will take longer to work with. But you could try this.

  1. Save a new copy of the file so you can go back in case of failure. It’s likely that no one will be able to work in this file during step two anyway.

  2. Group all the groups. Yes this could be bad as nested groups cause issues like the really leader gremlin from the late 80’s movie ‘Gremlins’. Hence step 1.

  3. Save out the nested super group as a library.

  4. Open that file and ungroup the super group. You now have a file (non-work shared) with nothing but the groups you wanted to save out. Ensure there are no nested groups once you purge the super group. If there are than kill them off by exploding selected instances as they will cause issues with step six. You may want to consider using nested families to produce that type of behavior in the future as they are more stable, reliable, and in my experience behave better from a programatic perspective.

  5. Use Dynamo to count the number of groups, and copy the file that many times, using the group name or number or whatever identifier you were planning on for each file.

  6. Use Dynamo and a backround open process method to select all groups, filter out ones with a name or number or whatever identifier you are using that matches the name of the file being processed, and delete everything other group.

  7. Verify your results and purge unwanted/content for all files.

This is likely worth some additional conversation prior to proceeding as I could be overlooking something obvious.

2 Likes

Interesting workaround!

I would add a 1.5… create a Dynamo script to place all the groups.

Doesnt saving out the super group as a mode group produce a model with the single super group (and all contained groups) already placed? Or is the intent to move the groups to the origin? Really I’m kinda lost by the overall workflow as it’s quite a bit different than my usual method.

You can’t make a Group of unplaced elements. The Groups first need to be placed, then they can be Grouped.

Do you not use Groups?

Typically I avoid them, as they are usually a shortcut that causes problems.

My understanding is that grouping the already placed groups into supergroup, then saving the super group out as a library will create a file with the super group containing all the previously placed groups in place inside the super group. By unbundling the super group the groups will be in place right?

I’ll test this out tomorrow. Maybe do a screencast or something.

Yes, that’s correct. I was assuming that the groups hadn’t been placed yet.

Groups are great provided you don’t use non-system hosted families or line-based families.

Is anyone aware of a method that works for saving model GroupTypes from a project out to a file directory in mass with Dynamo, rather than doing one at a time with File>Save As>Library>Group?

Give a shot to the list of steps I posted above. There still doesn’t appear to be any API for this at the moment so that type of work-around will be required.

1 Like

@JacobSmall Any update for this in the 2020 or 2021 API or Dynamo for Revit 2.0?

Not that I am aware of. I haven’t checked the 2021 API very closely yet though.

@JacobSmall
Trying to do what you suggest.
Any ideas when I am trying to save as from supergroup.rvt into multiple rvt with given names of “smaller groups” ?

Thanks