Finding something from API for Tool.AssemblyView

Hi, I’m trying to add Create Generic Model Schedule to the Tool.AssemblyViews node. I’m struggling to find it in the 2017.1 API website. Never used it so I’m pretty lost. Got here. Maybe its CreateSingleCategorySchedule Method? Help would be greatly appreciated. Even with adding the code if its simple for you. I’m bound to screw it up

image

#python nodes in dynamo 1.0
#proposed by Julien Benoit @jbenoit44 
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

elt = []
for i in IN[0]:
	elt.append(UnwrapElement(i).Id)
	
tb=UnwrapElement(IN[13]).Id
	
catid=doc.GetElement(elt[0]).Category.Id
	
collection=List[ElementId](elt)
viewlist=[]
schedlist=[]
sheetlist=[]
# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for a in elt:
	views=[]
	if IN[1] == 1:
		v=AssemblyViewUtils.Create3DOrthographic(doc,a)
		views.append(v)
	if IN[2] == 1:	
		ds2=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.HorizontalDetail)
		views.append(ds2)
	if IN[3] == 1:	
		ds3=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationTop)
		views.append(ds3)
	if IN[4] == 1:	
		ds4=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationBottom)
		views.append(ds4)
	if IN[5] == 1:	
		ds5=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationLeft)
		views.append(ds5)
	if IN[6] == 1:	
		ds6=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationRight)
		views.append(ds6)
	if IN[7] == 1:	
		ds7=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationFront)
		views.append(ds7)
	if IN[8] == 1:	
		ds8=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.ElevationBack)
		views.append(ds8)
	if IN[9] == 1:	
		ds9=AssemblyViewUtils.CreatePartList(doc,a)
		views.append(ds9)
	if IN[10] == 1:	
		ds10=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.DetailSectionA)
		views.append(ds10)
	if IN[11] == 1:	
		ds11=AssemblyViewUtils.CreateDetailSection(doc,a,AssemblyDetailViewOrientation.DetailSectionB)
		views.append(ds11)
	viewlist.append(views)
	if IN[12] == 1:
		sh=AssemblyViewUtils.CreateSheet(doc,a,tb)
		for v in views:
			if Viewport.CanAddViewToSheet(doc,sh.Id,v.Id) == 1:
				Viewport.Create(doc,sh.Id,v.Id,XYZ(0,0,0))
			else:
				ScheduleSheetInstance.Create(doc,sh.Id,v.Id,XYZ(0,0,0))
		sheetlist.append(sh)
doc.Regenerate()
# End Transaction
TransactionManager.Instance.TransactionTaskDone()

OUT=viewlist,sheetlist
1 Like

tried changing this

if IN[9] == 1:	
		ds9=AssemblyViewUtils.CreatePartList(doc,a)
		views.append(ds9)

to

if IN[9] == 1:	
		ds9=AssemblyViewUtils.CreateSingleCategorySchedule(doc,a)
		views.append(ds9)

no luck though

I don’t know if it will help, but this method seems to have at least 3 parameters instead of 2:
CreateSingleCategorySchedule(Document, ElementId, ElementId)
CreateSingleCategorySchedule(Document, ElementId, ElementId, ElementId, Boolean)

1 Like

Thanks man, theres also an example under AssemblyViewUtils Class that uses CreateSingleCategory Schedule. I dont know enough to do anything with it all though. Heres the node below if anyone can help

Tool.AssemblyViews.AddedGenricSchedule.dyf (15.4 KB)

I suppose you’ve seen this thread already:

1 Like

Thanks but i’m not sure if it helps me. Have 140 assemblies to create a generic model schedule for. Might just do this one by hand.

so far to do this task we use this one.
would be great to see it in the Too.AssemblyView Node.
Assembly - 03 - Multiple Schedule from Template.dyn (24.7 KB)

1 Like