Modify level 2D extents for view or list of views

Hi all,

would it be possible to move 2D extents of multiple views for all levels visible in view?

I allready have some filtering done which i used for swapping datum ends of the levels:


See attached script:
Levels aan uit 1 zijde.dyn (43.5 KB)

Hello

I was wondering whether you got anywhere with this idea/question? I am looking to do a similar thing - is this accessible to the API do you know?

Many thanks
Tim

Hi, yea i got this working.
Im not that good with python so i didnt get the script working for multiple views. This is why i use the integer slider to browse trough the views and press run for each view.

You can change the True / false to change which datum end.
You can edit the 0’s and 1’s in the python script to make it work for both ends.

This is the python script:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices

from RevitServices.Persistence import *
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

g = UnwrapElement(IN[0])
b = UnwrapElement(IN[1])
v = UnwrapElement(IN[2])

TransactionManager.Instance.EnsureInTransaction(doc)

for g, b in zip(g, b):
	if b:
		g.ShowBubbleInView(DatumEnds.End1,v)
		g.HideBubbleInView(DatumEnds.End0,v)
	else:
		g.HideBubbleInView(DatumEnds.End1,v)
		g.ShowBubbleInView(DatumEnds.End0,v)
	
TransactionManager.Instance.TransactionTaskDone()

doc.Regenerate()

#OUT = g

Hi Yoeri

This is amazing, thank you very much!

Can I ask quickly what the values are you are inputting into the Element.GetParameterByName node? Please see your graph with markups. Also in green, did you make it work for grids only or can this be applied to levels?

Thank you very much again!
Tim

Better image attached… Thanks!