Editing parameters in Revit Links

Hi everyone,

I’ve been a firm follower of the blog since I started with dynamo some months ago. Now I would like to ask you about the possibilities existing for a situation.

I’m working with a Revit file with many Revit links inside. The idea is that I can obtain information from all the elements belonging to the links with Dynamo, but on top of that I want to modify some of these parameters (instance or type parameters, I tried both). The problem is that I get the message you can see in the picture below “Attempt to modify the model outside of transaction”

.

I’ve tried the Dynamo script inside each link and it works, so the problem is precisely the attempt to modify information when you work since the central model. Does someone know if there’s any possibility to edit properties of the links?

I appreciate in advance any idea or advise that can be of help

Just like you can’t edit them natively in Revit, you can’t use Dynamo to edit linked model information… from within your document.

However, you can use Dynamo to open the linked model and edit data from within its own document.

I have to ask though, why are you wanting to edit data in a linked model? If it’s your own link couldn’t you just run Dynamo on that document instead? If it’s another sub’s link do you really want to modify their data?

1 Like

Hi Nick,
Of course I should explain further the main goal of this and I will try :slight_smile: Indeed, it’s my own link, but I’m trying to manage a model with over than 60 links, that’s why I’d like to manage information from the central model instead of opening link by link.

Every Revit element in each link has an Assembly Code parameter which helps me to organise the elements depending of their function when I extract quantities out of the central model (I have specific code if the element belongs to a bridge deck, or if it belongs to an abutment). Based on this classification, now I would like to add more information on top of that, for instance, if 10 bridges need a specific concrete material in their decks, my idea is assigning this kind of info to all the bridges in one time, instead of bridge by bridge.

Hope this explanation can clarify a bit my intentions with Dynamo.

Thanks

It will probably be a slow process with that many links, but it should be possible. It might be worth splitting your workflow into two tasks - 1) for pushing all your data to Excel (be sure to include IDs or GUIDs) and 2) for applying that data to elements in your linked models.

The important part here is that you will have to open each link in the background, make your changes, then save and close. Rhythm has some nodes to get you started with the background document portion. The rest should be mostly standard stuff.

1 Like

Thanks for your collaboration Nick. Actually that it’s exactly what I have. I export the info I already have in Revit, and I drop it in an Excel file, but the problem is that my intention now is trying to modify some parameters which belong to each Revit link so that I can drop again all the information already updated in an Excel.

I’d thought about the idea of managing these changes from the central model because I have the same parameter value for elements belonging to different links. That’s why I’ve been trying to do it in a faster way by using dynamo, but then I’ve faced the inability to edit links from the central file… I’ve been looking forward to find an option to edit information in links :cry:

That’s what the Rhythm nodes are for. They allow you to open another document and work from within it. You will most likely need to use some Python as you’ll need to specify the document for your elements now. There are some packages that have this capability already but it’s possible you’ll need more functionality than what they cover.

Oh, I see, thank you Nick. I’ll try to use them to see if I can achieve what I would like to. I’ll come back with some feedback :slight_smile:

Hi i would like to see if that rhythm node would actually work open document background only works certain way. Can you let me know if you succeed. However if you are only talking of parameter change doing everything in python is the way to go. In my experience rhythm open doc node never worked if you add nodes or tasks in between document close. If anyone out there managed to do this please prove me wrong…been to every single topics about running simple graphs like load families on multiple revit files still didnt find any solution. Always boils down to Dynamo Automation by Andreas Diekmann. None of the heavy lifters of dynamo has come and contribute or share their code. I know its totally possible but all done by python…just an observation to a long unsolve question.

Correct. The problem is that most nodes make the assumption that you’re working in the active document. There are a few nodes that take a document input though. Using Python, or modifying custom nodes that use Python, is a way to get around this by specifying the document rather than defaulting to the active one.

1 Like

I’ve tried to use the Rhythm nodes, but actually I get the same results than what I already got from the node of Archi-lab_Grimshaw package. I can obtain the elements within the links, and with the Archi-lab node I can make the selection based on the category of the element, which for me results more useful than by element type… The problem with both is that at the end, when I try to set parameters in these elements, I get the same error as explained before, so for now not possible to edit… :frowning_face:

This won’t be possible as you can only edit elements in an open transaction and Dynamo is designed to open and commit transactions on the active document (since all transaction objects require a document as an input), which means if you want to open a transaction on an external Revit file like in your case, you need to use Python or C# and create your own transactions using the link document object as the input to the transaction.

In addition, just like in Revit, it’s not possible to open a link if its host document is also open without getting the following warning. While its easy to dismiss this dialog using C#, the underlying rules cant be changed, i.e it would still need to unloaded even if it was automated:

In theory, working with these rules, it would be possible to automate updates to links by: dismissing the warning message, accepting this restriction and unloading the link, performing the update to the link, save, reload in the active document. The user wont even realise that the link has been unloaded, although if you have rooms or other elements bound to the link its all going to become un-associated, which creates a huge problem (unloading any file with constraints will cause this - as stated Dynamo is bound by the rules of Revit, it doesn’t create its own rules or behaviours!).

Option 2 and the best option (with a but) would be to set up worksharing on the link. In this scenario, it would be possible to create a local copy of the link, make edits to that copy, then synchronise back to Central. Finally, reload the link in the active document, and voila, you’ve just updated the link! Again, if this is all automated, then the process can operate without the user realising all of the steps going on behind the scenes - all they will see is the link updating.

3 Likes

Hi Thomas,
Thank you so much for your explanation. I really see in your option 2 a possible solution, as I’m already working with a workshared file (Every time I open a local copy of the central file which contains all the links). I would like to ask you for some clarifications as I don’t understand well how I can edit with dynamo each link (or local copy of each link) without opening each file separately. Is that possible working on the central file?

Hello…i would like to try my workflow with your topic. Can you post either here or dropbox or somewhere we can freely download a test revit files, dyn, excel and any other files we need to replicate your work and i will try if my workflow can help you in any way. I know its possible and thomas mahon is spot on and i have no doubt that using python along the lines that thomas explained above this can be achieved. I just hope others would contribute and for once solve this issue. Tnx

Here is a similar discussion with a python script to edit a parameter in a linked file

1 Like

Hi, I’ve prepared a central file with 3 links (I send the central and the links), and also my dynamo file. I must say that I’m using also the package Data-Shapes, so that the script can be used with DynamoPlayer (Revit 2017). I really appreciate your help, as have little knowledge of python…and I must admit that I really don’t know how to implement your suggestions to make them work in the code.

Thank you so much in advance for your help. Any advice is more than welcome :slight_smile:

1 Like

No probs i will see what i can do. I did not download the files yet but just in case you said there was an excel file did you include that and can you also make sure its clear what parameters you want to edit? Thanks

Oh yes, I named the excel file but it’s just to export the information afterwards, that’s why it’s not necessary at this point.

Regarding the parameters, of course I will explain a bit, sorry I didn’t before, now I guess it will be easier to understand the process. The script runs and first it asks you to select the bridge you want to modify, next it asks you about the Assembly Codes of the elements you want to modify (you can just try with any code, because all the elements contain the parameters I want to fill in so no problem at this point because it’s just to filter the selection of the revit elements). And then, you have to select any of the parameters you will see available (Production Method, Armour, Material) and in the next step you can select the value you want for each parameter.

Hope that the process can be quite clear with this “short” explanation and the files. Please ask any doubt about the procedure. Thank you :slight_smile:

Got the files now…i will let you know once i have some answers…

Hi…just saw your revit files and dyn. Your are using UI++ nodes and player i presume. I was not expecting that. What i can only offer is that open multiple revit files from a folder edit parameters with predefined values save and close. What you have is a bit hard to mimic in python. Sorry…

Oh, so then there’s no possibility to just create something to edit the info in the links, although I use those UI++ nodes? Anyway thank you so much for trying to help @4bimfercesp :slight_smile: