Zone Hvac or system - Geometries

Can you try to better explain exactly what you’re after? Any relevant images would be helpful as well.

Hi Nick,
Here some png to explain differences.
With Zone HVAC lines are spaces lines and not only the peripherical line of the zone
z.Boundary give directely lines

With System Zone line are draw manually and they are in peripherical of the zone
line are in 3rd level Geometry, GeometryElement and lines

And the last, is what i try to do : 3 periphery lines for 3 SSi zones (Fire plan)
If i do that with region in color it need 3 plans, with only peripherical line with some offset
i draw only one plan.
Daniel OLIVÈS





Have you tried getting this info with Python? RevitLookup is wonderful for learning and applying the Revit API since it shows you exactly what the methods and properties look like and how everything is connected.

Hi,
I try to do that but with System-Zone i don’t find a solution to get line
Daniel OLIVÈS

PJ: Fire plan sample

You haven’t shown what you’ve tried though. How are you trying to get the boundary lines?

Is this what you’re expecting?

Solution with boundaries of spaces from Hvac Zone
same request here

import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

	
def groupCurves(lstCurve, i = 0, max_iter = 10000):
	if len(lstCurve) > 0 and i < max_iter:
		loopCurve = [lstCurve.pop(0)]
		lst_idx = []
		while i < max_iter: 
			i += 1
			lenStart = len(lst_idx)
			for idx, c in enumerate(lstCurve):
				if any(c.DistanceTo(j) < 0.1 for j in loopCurve) and idx not in lst_idx:
					lst_idx.append(idx)
					loopCurve.append(c)
			if len(lst_idx) == lenStart:
				break

		otherCurves = [c for i, c in enumerate(lstCurve) if i not in lst_idx]
		return [DS.PolyCurve.ByJoinedCurves(loopCurve)] + groupCurves(otherCurves, i)
	else:
		return []

zone = UnwrapElement(IN[0])

optSpace = SpatialElementBoundaryOptions()
optSpace.SpatialElementBoundaryLocation  = SpatialElementBoundaryLocation.CoreCenter
surfacesSpace = []
for space in zone.Spaces:
	ArrArrSegments = space.GetBoundarySegments(optSpace)
	for segments in ArrArrSegments:
		proto_segments = [x.GetCurve().ToProtoType() for x in segments]
		polyCurve = DS.PolyCurve.ByJoinedCurves(proto_segments)
		surfacesSpace.append(polyCurve.Patch())

groupSurface = DS.Surface.ByUnion(surfacesSpace)
allcurves = groupCurves(list(groupSurface.PerimeterCurves()))

OUT = allcurves
3 Likes

@daniel82KGE I guess what you are looking for is a Generic Zone element boundary (GetBoundaries() Method):

import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS


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


from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)


clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

zone = UnwrapElement(IN[0])

cLoop = zone.GetBoundaries()
		
OUT = [[revitLine.ToProtoType() for revitLine in loop] for loop in cLoop]

Hi Tradeli,
I get this error :
Avertissement:IronPythonEvaluator.EvaluateIronPythonScript l’opération a échoué.
Traceback (most recent call last):
File “”, line 31, in
AttributeError: ‘List[object]’ object has no attribute ‘GetBoundaries’

Daniel OLIVES

@daniel82KGE your input is one zone or a list of zones?

Hi,
My answer was not correct
My problem was i have use select all elements of category and not select model
I have a list of list if the script is correct
Thank’s for your help
Daniel OLIVÈS

1 Like

Hi,Tradelie
If i run the script a second time list is empty ?
Daniel OLIVÈS
Anse-Lyon

@daniel82KGE try to close Dynamo then re-run the script/ Use Dynamo Player/ Use Transaction.End

Hi tradelie,
When i close only Dynamo, same thing, when i close Revit and Dynamo
on 3 GenericZone only 1 have Line ??
I add before out
TransactionManager.Instance.TransactionTaskDone()

Daniel OLIVÈS

@daniel82KGE can you share a Revit sample file?

Hi,
a simple file with nothing in, else 3 GenericZones
Zones-System
Revit 2022 and Dynamo 2.12
Daniel

@daniel82KGE you are right, after a while it will return an empty list, Revit did crash while testing it, I do not know if something is wrong with the GetBoundaries method for generic zone, it worked perfectly with Filled Regions, the thing I noticed is that within the Revit Lookup, the boundaries list is inaccessible for generic zone while it is for filled region, @jacob.small any hints?
Anyways, accessing the sketch to get the boundary is not a bad idea, saved by the Springs package :slight_smile:

I am not sure how to build such a thing in Revit… can someone post an RVT with the failing and passing geometry?

Hi Jacob,
You just need a rvt empty with 2 or 3 GenericZone create with Zone system.
And try to get Geometry with Python or Dynamo.
Electrical need some zone like Zone-HVAC for many reason. But the are not implemeant in Revit at this time. So we try to do something with element existing now in Revit.
Zone HVAC are useful also for electrical.
But my job for teaching how to give a better use of Revit is to search any thing that can by use by everyone.
Daniel OLIVÈS
Anse-Rhône

Hi Elie,
Thank’s that is the solution for me.
Daniel OLIVÈS
Anse-Rhône

1 Like

@jacob.small if you select the Zone element it will return an empty list, if you create a new zone it will return a list of lines, then it will get back to an empty list if you re-select it.
System-Zone.dyn (4.4 KB)
System-Zone.rvt (1.7 MB)

1 Like