Transfer Project Standard to multiple rvt files

Hello all,
Is there a way to transfer project standard (Model Line weight table setting to be exact) from one rvt to multiple rvt with Dynamo ?

A bit of the background: Revit know issue is that when Save as Group from a rvt to a separate rvt for linking purposes, Revit did not use any Model Line weight setting of the original file that used to create these groups, there for all the saved group (rvt) has totally different Model LIne weight setting. We have a lot of saved group that will be linked to the Main file and it will be a real pain to open each rvt to do the Transfer Project Standard command :(((

I have been talking to Autodesk and apparently there is no easy way to get into the Model Line Weight Table Setting via API or Dynamo ?

Any guru out there ???

Ngoc

Hi,

The good question is, you can do it as an API.
https://www.revitapidocs.com/2020/f6ccdc1b-6ac3-9c49-d0bb-8a7d1877eab0.htm
Here’s an example:

import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitAPIUI")
import Autodesk

from Autodesk.Revit.UI import RevitCommandId
from Autodesk.Revit.UI import UIApplication
from Autodesk.Revit.UI import ExternalCommandData

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication

Run = IN[0]

if Run == True:
	CmndID = RevitCommandId.LookupCommandId("ID_TRANSFER_PROJECT_STANDARDS")
	CmId = CmndID.Id
	uiapp.PostCommand(CmndID)
	sonuc = "Başarılı"
else:
	sonuc = "Tekrar Dene"

#Assign your output to the OUT variable
OUT = sonuc

hi Durmur , Thanks for taking the time.
No I dont know API.
So the Python node seems to allow you to read the Line Weight ?

Hi Durmur, I just checked out your Python and it worked for 1 on 1. Can we do it for multiple files ? meaning run the script to transfer the line weight setup from 1 file to other 30 files ?

I can open 30 files in the background using Rhythm nodes.
Thanks.

Hi,

Right! Try again.

import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.UI import RevitCommandId
from Autodesk.Revit.UI import UIApplication
from Autodesk.Revit.UI import ExternalCommandData
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

inputdoc = UnwrapElement(IN[1])
if inputdoc == None:
	doc = DocumentManager.Instance.CurrentDBDocument
elif isinstance (inputdoc, RevitLinkInstance) :
	doc = inputdoc.GetLinkDocument()
elif isinstance (inputdoc, Document) :
	doc = inputdoc
else: doc = None

uiapp = DocumentManager.Instance.CurrentUIApplication

Run = IN[0]

if Run == True:
	CmndID = RevitCommandId.LookupCommandId("ID_TRANSFER_PROJECT_STANDARDS")
	CmId = CmndID.Id
	uiapp.PostCommand(CmndID)
	sonuc = "Başarılı"
else:
	sonuc = "Tekrar Dene"

#Assign your output to the OUT variable
OUT = sonuc
1 Like

Thanks Durmur I still could not get it work yet. Can you shed some light ?

Many thanks.
Ngoc

It’s an exemplary scenario, and this isn’t a do-my-business platform. Please share your Dynamo scenario to get more help.

so I was doing exactly the same. But I want to push out the lineweight setting from the current document to all the opened documents ( which are linked file)…

3 Likes

So what’s the problem?

I cant seem to get it push out to multiple rvt files…:((test 2.dyn (13.0 KB)

Any other ideas to transfer Model Lineweight Setting from one file to multiple files ?

Many thanks.
Ngoc

Just a heads up, you cannot write to a link file in Revit.
So you will need to open all the required files to achieve what you are after

Has there been any resolution to this? I have attempted to recreate the script but still not working 100%.

Scenario:

Open File (OF) 1 (Source for transferring project standards)
Open File (OF) 2 (Needed to enable transfer project standards pop up window)
Background Opened Files (BOF) 1-10 (Actual files needing project standards transferred to)

Outcome:

Running the script seems to only apply the standards to OF 2, as well as BOF 10. BOF 1-9 remain unchanged. My assumption is that as BOF 10 was the last file to be opened it is seen as the active file and therefore has the standards applied to it.

Also, I have created the script in two parts due to my lack of Dynamo knowledge. Ideally it would need to run > open files in background > wait till all files are opened > run script > select options of which standards to transfer > process all background opened files > save and close all background opened files.

If there are any suggestions to simplify this it would be great.

Many Thanks

Travis

Also trying to do this to transfer standard lineweights to a whole library of families, anyone have any further input?

is there also a way to just enter a list into the python of the categories you want to transfer, so you don’t get the menu