Create 3D View of Analytical Model

Hi everyone,

I would like to make a short Dynamo script to create automatically a new 3D view showing only the Analytical Model (and other annotations such as loads etc.) but I don’t really know how to proceed…

If someone knows how to do or has an idea to do it that would be awesome

Thanks in advance for your answers :pray:

Arthur

In other words, how could I access to this option of the Visibility/Graphic Overrides (see below) by using Dynamo??

How about just create a view template first, then apply it to the view?

Hi @jshial

Thanks for the reply

It could be a good idea indeed, but I didn’t find out yet how to create a view template and to set its parameters on Dynamo… do you know how to do it?

Thanks

Arthur

Or you can override the visibility settings on each view, hiding the analytical categories you want.
https://www.revitapidocs.com/2019/87a1e1e2-ee81-1a73-19d7-895b1fa10158.htm

Hi jshial, thanks again for your answer.

That is interesting but I still don’t get how this can create a new 3D view with directly the right visibility settings. There is a postable command to create a new 3D view but as far as I know you cannot directly get this newly created view and apply visibility setting in the same run of the script

If you have any idea on this point, it would be great,

Thanks,

Arthur

I actually had a co-worker help me make a Custom Node for this, only working on Annotation Categories (not Analytical Model Categories). I’ll ask if I can share the nodes here, perhaps it will help.

Hi,

Obviously I misunderstood your question, I thought you want to hide all analytical categories.

I just found out View3D.CreateIsometric(doc, viewFamilyTypeId.Id) returns a new 3D view which always has the “Show Analytical Model” unchecked. A workaround would be duplicating a view that already had “Show Analytical Model” checked. Then all views created from it would be good to go.

SourceView ==> DupView

Visiblity settings on DupView

doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
sel = uidoc.Selection

col = FilteredElementCollector(doc)

#Preparing input from dynamo to revit
other_categories = [c for c in doc.Settings.Categories if not c.CategoryType == CategoryType.AnalyticalModel and not "Analytical" in c.Name]

source_view = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

# Duplicate a view
dup_view_id = source_view.Duplicate(ViewDuplicateOption.Duplicate)
dup_view = doc.GetElement(dup_view_id) 
dup_view.Name = "DupView"

# Hidden analytical categories
test = []
for category in other_categories:
	try:
		dup_view.SetCategoryHidden(category.Id, True)
	except:
		test.append(category.Name)

TransactionManager.Instance.TransactionTaskDone()

OUT = test

(Filtering criteria might not be the way you want, it catches “Area Load Tags” so it gets hidden also)

But it seems to be fairly useless since a duplicated view also inherits visibility setting. Setting up a view manually and duplicates a bunch of views later would make more sense than changing settings right after generation.

Attached are the nodes that I mentioned in a previous post. These should work for all the top checkboxes within Visibility/Graphics. Hope this helps!

View.AnalyticalModelCategoriesVisible.dyf (17.6 KB) View.AnnotationCategoriesVisible.dyf (17.6 KB) View.AreAnalyticalModelCategoriesVisible.dyf (13.2 KB) View.AreAnnotationCategoriesVisible.dyf (13.2 KB) View.AreImportCategoriesVisible.dyf (13.2 KB) View.AreModelCategoriesVisible.dyf (13.2 KB) View.ImportCategoriesVisible.dyf (17.6 KB) View.ModelCategoriesVisible.dyf (17.6 KB)

1 Like