Batch open (Edit) multiple Families within the Project

I searched and gone trough multiple topic but couldn’t find a clear answer / solution.

Is it possible to open (so Edit) multiple Families at the same time from
within the Project?

NB
I don’t have the Families saved somewhere nor do i won’t the moment.
So preferably i don’t want to save them somewhere first and supply a file path.

Depends what you want to modify, if you want to add parameters or make certain changes within the family then you will have to create a script that will save the family out and then modify it.

If you just want to say change parameters for a certain type of family within the families then you should be able to get that type and set the parameter value.

Think there is plenty of examples of both of these on this forum

I only want to basicly open them. Nothing more.

Hi @bvs1982 have you tried these here from genius loci

@sovitek

Yes, but the Families don’t get opened.

you have BG opened the document ? what you want from that ?

If you want to open families(including project files) as a active view so you can manually make changes. Then this does not seem to be able to be done because of how dynamo is hosted onto revit and all the associated events/etc.

I will highlight that if you developed the method as a addin, then you could possibly do it via OpenAndActivateDocument method.

1 Like

You right on the bold part. So i guess i have my answer :sweat_smile:.

arhh now i understand :wink: :wink: hahaha

I will add to this that most/if not all methods to open families or project files require a path to the file in question.

You could test if the “EditFamily Method” and " LoadFamily Method" in python could do what you want, but even then it does the opening in the background and you have to code the changes you want to be applied within.

Another option for you is to code a method to save out only the families you want to modify then you can drag/open them all in revit.

Hey,

I think the limitation is an API one, not a specifically Dynamo one.

I don’t think you can change the active UI (doc) programatically… So you can’t shift from a project doc UI to the edited family doc UI to open the view.

As you say, if you open from a Path using OpenAndActivateDocument, then that’s not an issue.

Hope that’s useful,

Mark

@Mark.Ackerley

To be clear :sweat_smile:.

So you saying i can just open a Family when i use the from file location /path?.
So like open open with an active view and stuff. So no(t) background open(ed).

OpenAndActivateDocument

Is this a node or do you mean something else by this?

There has been a indication else where on the forum that because dynamo is using the idling event this then means revit will not allow the OpenAndActivateDocument API method to change the active document.

If you use the API Method in a macro or revit addin then you should be able to utilise this method and change the active document

Indicated in this previous forum post

Sometimes life can be easy :see_no_evil_monkey:.

Just from the Windows Explorer.

2 Likes

Interesting… Good shout

# Activate the document in the UI
uiapp.OpenAndActivateDocument(file_path)

1 Like

Curious… Why do you want to avoid this?

As for ‘can it be done programmatically from within Dynamo… Well I think so. This building coder blog post gives some initial framework, but you would need the files on disc. I think ideally you would write some Python which saves all files to disc, triggers the standalone application to run after say 10 seconds or so to ensure Dynamo has completed it’s transaction, and then triggers a UI where the user selects ‘ok’. The combination of waiting and forcing the user to click should ensure the standalone application (which is really just performing the right click command you illustrated) starts it’s work after Revit is idling to ensure a (somewhat) smooth experience.

Do watch out when using the windows open way that it opens in the revit version you want.

Not necessarily avoid, but in this case / for this project there is zero reason to do that.

I know, but maybe others don’t so good addition.

I recommend saving out your family library periodically as it helps ensure consistency within the project and within the firm, makes QA easier, and gives you a backup of the families which is the easiest recovery for a few common corruption issues (family separation, missing elements, etc.).

1 Like