However I didn’t find any solution to the following problem: getting those parameters and subsequently setting these parameters into another parameter inside the Link. Anyone can help me? For God’s sake!
(Sorry about the gramatical mistakes. English isn’t my native language)
The issue is: I want to use some instances of a Link, but set diferent values
to the parameters of the elements inside those links based on the link parameter called “Name”. However the links come from the same project.
@Einar_Raknes that’s almost accurate. You don’t have to close the current document, so long as you open the other one. You can have multiple documents open at the same time. Now, there are no OOTB nodes in Dynamo that allow this type of manipulation of linked models. You would need to script that kind of functionality with Python/C# etc. I know that @john_pierson has a node in his package that allows for opening the model. I am not sure how that would fit into what the OP wants to do though.
So you want to link one Revit file into your document and set elements to have varying parameter values based on the name you give the one file?
I may be wrong, but I don’t think that is a thing. You can have one family with various types but there is no such thing as ‘project types’ which allow multiple instances of the same document to have differing values for the elements inside them. Need multiple projects instead, which I would wager is not conductive to your overall workflow. If I knew more maybe I could help better. Perhaps design options or maybe project parameters? What element types and parameters are you trying to vary?
@Konrad_K_Sobon I believe you will get an error as long as you have a linked file in memory in the same Revit session. It’s probably possible to unload the link temporarily, or work around it by changing the name:
Luckily we can work around the current limitations when the linked files needed for editing are workshared. We can in fact achieve this in the same session without unloading or requiring the user to open a separate Revit session by following these simple steps:
Make sure to not use the right-click option shown above (obviously!)
Navigate to the original linked central file and open through Revit’s Open dialog in the same session. If it is a valid Central File, Revit will automatically create a Local File by appending your username to it and happily open it for editing.
This is exactly what Document.Open() method would do. You can set the options to create new local and if what David is saying in his post is true that would not Unload the link.
Your python code above i think will solve my python code issue having on a totally different purpose. I just want to ask if its correct to assume that your code above saves the linked document as i can see you are closing the linked file but no saving code before that. Also this also assume that its only 1 linked file at a time is that correct coz you are actively selecting it (the linked model) can i unload all linked file in one go? Apologies i am not hijacking the topic just admiring your code coz i think this will solve a lot of my unanswered topics. Thanks…
I will try to explain with the images. Imagine that you have only one model of a house. You link this model twice in an empty Revit file. However you need to make them different by setting different values to the parameter “WBS” wich is inside of the elements (like walls, floors) of each link. So, you use the parameter “Name” (in my case, it’s “Nome”), which is a parameter of the linked files, and type “10” to the first file and “20” to the second. Once you have finished you try to set the parameter “Name” inside the elements of each linked file what will make them different. I have been thinking about this and I’m starting to realize that this sounds unreasonable because in fact in the moment that you set the different values to the parameter WBS (using the paramater “Name”) inside of the same linked file, you are creating new files! In my opinion this is the big mistake of my method.
I have been thinking also about a way to circumvent this problem and I don’t know if Dynamo can to this. In the moment that you set different values to the parameter WBS, would be possible to save this “new file” in an specific directory on your computer? What do you think?
PS.: Probably this text has a lot of grammar mistakes. Sorry, English is not my native language. However I’m trying to do my best alone.
If you select an element (a wall) that is inside of any linked file, you will find a parameter called “EAP” which is the same of WBS (Work Breakdown System). The value of this parameter is created by a sum of others parameters (Dynamo) which are also inside of the element that you selected before. This parameter (EAP) is used to indicate the task of the construction like Concrete Wall, Ceramic Floor, etc and is linked with a Planned Start Date and a Finish End Date that are in a Planning Schedule. However, in my Planning Schedule there are more than one “house” which differ by their “Number”.
Nowadays I do the following: I run the Dynamo script and the House “258” is created. After that I save it. This number comes from a Project Parameter. Then I change this Project Parameter to “260”, run the Dynamo script again and the save it again. This process is effective but it is not efficient.
With this problem in my hands what I have imagined: If one selects a linked file it will be possible to see the parameter “Name”, which is an instance parameter of each Linked File (probably in your case it will be Name. In my case is “Nome”, because my language is Portuguese).
My proposal is to change the “location” of the parameter that contains the number of the Houses from that Project Parameter (that I can change when the model of a single House is open) to this parameter “Name” of the Linked file. These linked files come from the same model that in the file that I’m sharing with you is the House “258”. I have already changed the value of the instance parameter “Name” to 258 in a model and 260 in other.
To finish I’m trying to create a Dynamo script that takes this parameter “Name” in each instance of linked file and set to the elements inside of each linked files what would create elements of the house 258 and elements of the house 260.
This is the maximun that I can do to explain to you. With Dynamo I could get the parameters from the lonked files, but in the moment that I make a routine to send back the summed parameter with different values it shows an error message.
Speaking of link files. I think that may be my problem right now. I am trying to batch upgrade files and my graph works when the files does not include link files. But when I run it with files that has multiple links it does not work. please help me