Create Shared Site

I need dynamo to automate this process, unfortunately I’m not to good a using python and the API just yet…

I think I found one of the methods in the API that I will have to leverage
Duplicate Project position:

Here’s what I have so far: UpdateSharedSite.dyn (15.1 KB)

I’m open to any suggestions


I have made decent progress today, I think I’m slowly getting the hang of this i have hit a snag though.

I have been able to make a function to duplicate the project location in the current document but I can’t get it to work on linked documents.

By now I’ve tried probably 95+ iterations to no avail. (transaction issues, sublist issues, various other issues that are still over my head)

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

# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

input = UnwrapElement(IN[0])

linkDoc = []
for x in input:

def DupeLocation(loc):
	name = loc.Name
	newPos = loc.Duplicate(name +"Dupe1")
	pos = newPos.ProjectPosition[XYZ(0,0,0)]
	angle = pos.Angle
	ew = pos.EastWest
	e = pos.Elevation
	ns = pos.NorthSouth
	return [ newPos, angle, ew, ns, e]

#locations = doc.ProjectLocations
linkLocations = linkDoc.ProjectLocations

#Assign your output to the OUT variable.
#OUT = [GetValues(x) for x in locations]
#OUT = [DupeLocation(x) for x in locations]
OUT = [DupeLocation(x) for x in linkLocations]
#OUT = [input, linkDoc]


The development of this script continued on these threads.

It is coming together nicely. :grinning:

1 Like