Hey.
I want to copy a 3D view 7 times and put the same view template. But i can’t find a way to find my 3D view template.
So far i got this.
Solved it
It’s good practice to show your solution.
A ‘solved it’ won’t help others with the same challenge
Hi @1065553 Nichlas,
Could you share your solution please?
That is actually really close to what I m looking for
Thanks,
Arthur
@1065553 Hey there, I’m also curious of your solution
There’s probably loads of ways to do this depending on where you are starting, but here is an example:
Edit: Ah yes… 3D view templates are still not accessible via the API :-S. Common ADSK! But hey, if you apply your view template to the 3D-view before you duplicate it, all the duplicates should have it applied as well
Think we can apply a plan viewtemplate and should work
Ah ok.
I just remembered that there was something funny going on with 3D view templates
Yes Martin…a really old funny thing so i just look forward how @1065553 handle it, since we had a solution here
Nice!
Here’s my original answer with the setting of the VT incorporated:
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument
#---###Start scripting here:###---#
views = UnwrapElement(IN[0])
vt_Name = IN[1]
fec = FilteredElementCollector(doc).OfClass(View).ToElements()
vt = None
for i in fec:
if i.IsTemplate and i.Name == vt_Name:
vt=i
#Transaction start:
TransactionManager.Instance.EnsureInTransaction(doc)
for i in views:
i.ViewTemplateId = vt.Id
#Transaction end:
TransactionManager.Instance.TransactionTaskDone()
OUT = views
hi,
what package is 0 | viewtemplateset from?
im using the rhytm package but it expects to input to be a view as in floorplan or schedule.
i need to set a view template for an section.view
thanks in adnvance
Hi @niels.van.hove just use ootb set.parameter and feed in a viewtemplate