After i made all the Floor Plans ALL the Groups are visible in ALL Views where i need only one Group visible its respective view.
So only Group A visible in View A, only Group B visible in View B, only Group C visible in View C etc.
So for Cropping my Graph ‘needs to know’ which Group to Crop in which View (so same issue).
The Group (Name) might be the same but ultimate all Groups are unique. For that reason i filtered on the Groups Element ID. I might only have 3 groups, but i can have 30 Views because the Groups are copied 10 times each. For now i put the elements ID in the View Name because we can’t have duplicate View Names (i will replace the Element ID for the appartment no. when i get the Graph to work).
This is what it looks like in Revit (when the Views are created).
This image is much more helpful. I think you just need to use list levels (@L1 for both inputs) to get it to work. Because Isolate in View expects a single view input and you’re supplying a list it’s getting confused. You need to use list levels to specify that each view in your list is a separate input.
You can have more the a minute .
It is weekend for me and i can’t do stuff at home atm. I’ll have another look at this monday. Thanks for your help so far.
Really appreciate it!
Here’s a potential solution, at least to the part of creating the isolated views. I don’t see a reason to crop the view if everything has been isolated, so it might just be an extra step that you can eliminate.
So I have a model with some groups in in. They are not rooms, but they are on different levels etc.
As you can see there are some array groups in there so i will filter these out:
Once we have that we can do what you were doing and create a floor plan from Level, then simply rename it. So far so good.
Then we can use this custom code, to isolate a group in a view. Since Groups contain multiple elements, the way the Isolate method works in the API, we actually have to isolate every member of the group so the code would like this:
# Copyright(c) 2019, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
import System
from System import Array
from System.Collections.Generic import *
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
try:
errorReport = None
TransactionManager.Instance.EnsureInTransaction(doc)
for e, v in zip(IN[0], IN[1]):
view = UnwrapElement(v)
view.IsolateElementsTemporary(UnwrapElement(e).GetMemberIds())
view.ConvertTemporaryHideIsolateToPermanent()
TransactionManager.Instance.TransactionTaskDone()
except:
import traceback
errorReport = traceback.format_exc()
if errorReport == None:
OUT = IN[1]
else:
OUT = errorReport
The lines of code to pay attention to are: view.IsolateElementsTemporary(UnwrapElement(e).GetMemberIds()) where I am isolating all of the group memebers, and then in the next line we convert the temporary isolation into a pernament one: view.ConvertTemporaryHideIsolateToPermanent(). The result is something like this:
Long story, short answer; There is also a linked model from a 3rd party for the facade (which is not part of the group) that needs to be visible. Therefor i wanted to crop the group ~500mm around it (facade is like ~400mm).
I will try your dyn monday when i am back at work., but i have no doubt it will work.
Really appreciate your help!
Konrad solution for Isolating the Group members works great, but now i still need to filter each Group specific to it’s View so i can use that for creating a Bounding Box ( = Crop Box).
Another approach would be creating a Curve around the Isolated Elements, but using the Box from the Group seemed a lot easier.
PS. I am only using Dynamo for a year now, so i am still learning. Maybe i bit off more than i can chew .
After putting this aside for a bit i got it to work
(after learning some things from making another Graph). Big thanks to @Konrad_K_Sobon for the Isolate part.
Apply the correct Scope Box to the Views (BEFORE the crop)
Create the Sheets for the Views (and place the Views on the Sheets)
I struggle to find a solution for 2). This is not possible??
I searched these forums and Googled, but can’t find an solution.
So any help for 2) is much appreciated.