Answers for "get all worksets project revit api"

0

get all worksets project revit api

import clr

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager


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

doc = DocumentManager.Instance.CurrentDBDocument
existWorksets = list()

##Get list of worksets filtered b user worksets only
fwc = FilteredWorksetCollector(doc).OfKind(WorksetKind.UserWorkset)


for ws in fwc:						##For each of the worksets:
	Pair=list()						#Container for list pair of name + ID
	Pair.append(ws.Name)			#Append Name
	Pair.append(ws.Id)				#Add ID
	existWorksets.append(Pair)	#Add pair to output

OUT = existWorksets
Posted by: Guest on July-30-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language