This node can relocate sheet view ports based on your provided template sheet view port location.
Below attached GIF and AlignViewports_Demo.dyn (7.0 KB)
for your info.
Is there anyway to modify the nodes creating views out of rooms…specially ElevationinRoom.to be working with area elements as well please…that would be great help
Hello @mohamed.mostafaDQCGU , if you want to modify and use“ElevationInRoom” Node or any other nodes in the Quasar package, you can directly go to the source code repositoryhttps://github.com/mgjean/quasar.
Thanks mate, have a great day.
Thank you jean, unfortunately am not a well python user and i hope you can help me in making an update to the LinkLevelGrid node which used to hide levels and grids from links , i need it to run on all views not just the current view
hi @mohamed.mostafaDQCGU, I’ve written LinkLevelGridsecond version which applied for these view types (floor plans, ceiling plans, elevations, and sections views). I hope whoever needs to use this script, will use it wisely.
# tested dynamo version - 1.x.x , 2.x.x
# __author__ = 'min.naung/mgjean @https://twentytwo.space/contact'
# import common language runtime
import clr
# clr.AddReference loads and imports .net assembly(dll) as module
# load RevitAPI.dll and RevitServices.dll
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
# import system for dotnet List
import System
from System.Collections.Generic import List
# import all classes from Revit DB
from Autodesk.Revit.DB import *
# import document manager
from RevitServices.Persistence import DocumentManager
# import transaction manager
from RevitServices.Transactions import TransactionManager
# instantiate current document
doc = DocumentManager.Instance.CurrentDBDocument
# start transaction
TransactionManager.Instance.EnsureInTransaction(doc)
# active view
active_view = doc.ActiveView
# filter name "can name anything"
ifilter = 'GiveFilterAName'
endWiths = 'Anything'
# filter check
found = False
# input[0] boolean
hide = False if IN[0] else True
# collect floor plans and ceiling plans views
plans_views = FilteredElementCollector(doc).OfClass(ViewPlan).ToElements()
# collect elevations and sections views
sects_elevs_views = FilteredElementCollector(doc).OfClass(ViewSection).ToElements()
# combine list two view list
views = list(plans_views)
views.extend(sects_elevs_views)
# collect all filter elements
allFilters = FilteredElementCollector(doc).OfClass(FilterElement).ToElements()
# get filters from current view
viewFilters = active_view.GetFilters()
# collect filters' names
viewFiltersName = [doc.GetElement(i).Name.ToString() for i in viewFilters]
# ifilter element
ifilter_elem = [filter for filter in allFilters if ifilter == filter.Name.ToString()]
if ifilter_elem:
found = True
for view in views:
try:
# add filter
view.AddFilter(ifilter_elem[0].Id)
# set filter visibility
view.SetFilterVisibility(ifilter_elem[0].Id, hide)
except:
# set filter visibility
view.SetFilterVisibility(ifilter_elem[0].Id, hide)
# already applied
pass
# if filter not found in doc
if not found:
# all grids in doc
grids = FilteredElementCollector(doc).OfClass(Grid).ToElements()
# all levels in doc
levels = FilteredElementCollector(doc).OfClass(Level).ToElements()
# collect category id from grid and level
CateIds = List[ElementId]([grids[0].Category.Id,levels[0].Category.Id])
# type ids from grids
gridTypeIds = set([i.GetTypeId() for i in grids])
# type ids from levels
levelTypeIds = set([i.GetTypeId() for i in levels])
# get grid type element
type_elems = [doc.GetElement(i) for i in gridTypeIds]
# get level type element
type_elems.extend([doc.GetElement(l) for l in levelTypeIds])
# loop type elements
for elem in type_elems:
# if endwiths not include in type name
if not endWiths in elem.LookupParameter('Type Name').AsString():
# add endwiths in type name
elem.Name = elem.LookupParameter('Type Name').AsString() + endWiths
# get type names
type_names = [i.LookupParameter('Type Name').AsString() for i in type_elems]
# type name parameter id
paramId = type_elems[0].LookupParameter('Type Name').Id
# create a "not ends with" filter rule
notendswith = ParameterFilterRuleFactory.CreateNotEndsWithRule(paramId,endWiths,False)
# create parameter filter element
paramFilterElem = ParameterFilterElement.Create(doc, ifilter,CateIds,[notendswith])
# for all views
for view in views:
# set filter overrides (same with add filter)
view.SetFilterOverrides(paramFilterElem.Id, OverrideGraphicSettings())
# set filter visibility
view.SetFilterVisibility(paramFilterElem.Id, hide)
# transaction done
TransactionManager.Instance.TransactionTaskDone()
# output
OUT = 'DONE!'