TransmittedModelOptions Enumeration

Hi there, does anybody knows how to apply TransmittedModelOptions to a transmitted revit model when opening it? i had a bunch of transmitted model that requires to be opened and saved as central using that option. Any help is much appreciated

This is just a guess, but would you be able to open the document using the OpenDocumentFile method, detach it from central, and then save as central? I don’t see any parts of the API using this enumeration apart from the TransmittedModelExceptions class.

here is the snapshot of the API.

i tried using that method and it doesnt work :frowning:

@stillgotme Have a look below.

Hi @salvatoredragotta, sorry to say but the link you sent me is not of any use for this topic :frowning:

To give a better understanding, when i open a workshared transmitted model, a dialogue will appear as shown below:
Obviously i can do it manually to all my workshared transmitted model, but i was hoping that there is an API to do it and hence i will be able to batch do it. So i found the API as stated above

But i do not know where to use that enumeration in anywhere of the script.

I tried using opendocument file and save as central but its still give me the same result.

Since you are here, do you have any idea how to use that particular API??

@stillgotme can you share your dyn? Have you got a sample transmitted Revit file for testing?

Hold on…

here is the sample transmitted file: Sample transmitted files.rvt (352 KB)

and i do not have a specific dyn for transmitted model cause i honestly have no idea where to start :slight_smile: but i can share with you my open and resave as central dyn:
Open and resave as central.dyn (8.1 KB)

I don’t often do this, but @erfajo (sorry Erik) or @john_pierson (sorry John) are probably the guys to help… Orchid package has nodes for background opening and saving, and I think John was saying he was expanding the Rhythm functionality, but I don’t think either have what you’re after. I’ve dug around in the API and can’t see anything you’ve missed.



1 Like

No apologies needed! :slight_smile:

My nodes do not include functionality for resaving as central, so I don’t think Rhythm solves this issue at the moment. If there is any questions regarding how my background document nodes work, Rhythm is open source and the code for Application is here, .

This dialogue is not showing up for me when a document is opened in the background.

Unfortunately, I think that is all of the help I have to offer right now. I do have some updates for Rhythm background document nodes coming, but they are more of a “Stability upgrade” as referenced in the thread here.

1 Like

Thanks John, you won’t get the message until you open the file…

I think the OP needs the code to ‘save as new central file in same location’ but the API doesn’t seem to give guidance on how that might be achieved?

It only defines the enumeration you would use in that method, not the method itself? Would you know where (if) that is squirreled away?



Ah I see, I missed that part. The new file would still have the property.

This should do it.

Setting IsTransmitted to false on the newly saved as file via TransmissionData.


You are a gent :smiley:

1 Like

@john_pierson Does that mean that if i were to edit my another dyn (the one that i used transmission data to unload links without opening it), and set IsTransmitted(false), i will still get my central model with the rvt link that i had unloaded or changed path without the dialogue of saving as new central file?

And thank you @Mark.Ackerley for directing him to this topic :slight_smile:

1 Like

I think so… I have not had a chance to test myself, but that seems to be the way. I would say to give it a shot and let us know what happens. :grin:

I find some of the API really hard to work out from first principles…

When you read Transmission Data Class ‘A class representing information on all external file references in a document.’

It really puts you off from thinking that it could be applicable to transmitted project files themselves.

right??? totally agree with you man

1 Like

Thanks for the files. Below my solution just for one file (I’ll leave to you to loop for multiple files)


Hi @salvatoredragotta, so sorry to say. It does not transmit the data required when IsTransmitted(false) is set… it is required to be set to true

okay i got it to work from your concept. However the IsTransmitted=False has to be put after i save as central. below is the attached code if anyone is dealing with transmitted model:

import clr
from Autodesk.DesignScript.Geometry import *

# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.Attributes import*

import clr
from  Autodesk.Revit.UI import *

# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

# Import Revit Nodes
import Revit

# Import python library
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
import os
from System.IO import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

worksharingOptions = WorksharingSaveAsOptions()
worksharingOptions.SaveAsCentral = True

SaveOptions = SaveAsOptions()
SaveOptions.MaximumBackups = 50
SaveOptions.OverwriteExistingFile = True
SaveOptions.Compact = True

rOptions = RelinquishOptions(False)
rOptions.StandardWorksets = True
rOptions.ViewWorksets = True
rOptions.FamilyWorksets = True
rOptions.UserWorksets = True
rOptions.CheckedOutElements = True

sOptions = SynchronizeWithCentralOptions()
sOptions.Compact = True
sOptions.SaveLocalBefore = True
sOptions.SaveLocalAfter = True

tOptions = TransactWithCentralOptions()


filepaths = IN[0]

RVer = "R" + app.VersionNumber[-2:]

docpath = []

if IN[1] == True:
		for filepath in filepaths:
			file = FileInfo(filepath)
			filein = file.FullName
			modelpath = FilePath(filein)
			transData = TransmissionData.ReadTransmissionData(modelpath)
			if transData.IsDocumentTransmitted(modelpath):
				z = TransmittedModelOptions.SaveAsNewCentral
				newdoc = app.OpenDocumentFile(filepath)
				if RVer not in filepath:
					if "Central" in filepath:
						x = filepath.split("_")
						y = "_".join(x)
						x = filepath[:-4]
						y = x + "_" + RVer + ".rvt"
					y = filepath
				transData.IsTransmitted = False
				newdoc = app.OpenDocumentFile(filepath)
				if RVer not in filepath:
					if "Central" in filepath:
						x = filepath.split("_")
						y = "_".join(x)
						x = filepath[:-4]
						y = x + "_" + RVer + ".rvt"
					y = filepath
		OUT = [filepaths,docpath] 	
	except Exception,e:
		OUT = str(e)
	OUT = "Please set it to true"

Huge thanks to @salvatoredragotta & @john_pierson & @Mark.Ackerley for your help :slight_smile: