Quasar Package Update

It’s working fine. :sunglasses:

Edit: one more here,

Hi Jean,

Can you make the list Sorted?

Cheers!

Hello @interactiverendering, lists have been sorted(by name). :grinning: :smile:

Here is updated script for ViewSelector node view-selector-updated.dyn (7.2 KB) and it will also be updated in Quasar upcoming version.

Thanks mate, have a great day.

2 Likes

Hi

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 repository https://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

hope you can help me with that one. thank you

hi @mohamed.mostafaDQCGU, I’ve written LinkLevelGrid second 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!'
1 Like

I cant seem to get it to work

@vanman, can you flatten template sheet list and try one more time ?, see if fix or not.

1 Like

Hi, no luck unfortunately

@vanman, your template sheet input must be one single element(sheet) like this example below;

Try this way, if not i will take a look at your dyn file.

1 Like

Cool thanks, list first item did the trick

Hey @jean !
Great package Quasar! A lot of useful things!!

I was giving a try to the ViewUtility.ElevationInRoom node and it seems to work pretty well, but it seems like all the views cut all the rooms short in height.

Do you know why this happens?

I tried to have a look at your repo to have a look at the code behind it but I can’t find the specific node.

Thanks,

Andrea

Thanks @ATassera, views cut height are adjustable with the offset parameter value, like as example below; and ZT Nodes repo is here

Thanks for your reply @jean !

The offset would create an homogeneous offset around the original crop of the view, so in order to get the height of the view correct I would have to set an incongruous offset that would probably be too big.

I was looking at the code. Is the reason why all the views get cropped too low this line maybe:
BoundingBoxXYZ bcrop = Utility.crop_box(bbox, Offset / 304.8);

I really don’t understand where that number 304.8 comes from.

Thanks for the help,

Andrea

@ATassera , that’s unit conversion millimeters to feets.

I see @jean
Thanks for clarifying.

So do you get shorter views too or is it just me?

@ATassera if you want shorter (than your room height) views you can provide minus offset value like " -200 " …

@jean sorry for the misunderstanding.

What I’m saying is that the room elevations are coming out shorter from your dynamo node (see the first image I posted above - the elevation has the correct width but a shorter height, hence the top of the room is cut out by the crop box). What I want is actually the view to have the same shape of the room with just an homogeneous offset around it. But, reading the code, it seems it doesn’t depend on that.

That’s why I was wondering if it was happening to you too that the ViewUtility.ElevationInRoom node generates views that have the correct width but the wrong height (again, like in my image above).

@ATassera, Elevations views’ crops are shaped based on the room boundingbox’s max and min values.
On top of that, desire offset will be applied. Which means if you use offset value " 0 ", view crops will be the same shape (height and width) with the room. One of my concern is the unit conversion because, in my node, I have already divided by 304.8 assuming that the project unit is millimeter.

Anyway, I will check again, is this node really have an issue or not?
Thanks mate, have a great day.