Room Elevations debugging

Hi All,

First of all I have had a look through the forum and I have found some things that have allowed me to get this far but it keeps crashing and I don’t why.

Also the other methods create one elevation marker for each wall. What I am trying to achieve is one elevation marker in the center of the room and then four elevations of each wall.

Can anyone see any problems with the code?

I have attached to Revit file to the Dropbox link below.

PS. It is late here in UK I will check this post again in morning.


creating room elevations - debugging #9 (TOPOST).dyn (78.8 KB)

creating room elevations - debugging #9 (TOPOST).dyn (78.8 KB)

#Copyright(c) 2016 www.Learndynamo.com 
#Please contact at jeremy@learndynamo.com

import clr
clr.AddReference('RevitAPI')
clr.AddReference("RevitServices")
clr.AddReference("RevitNodes")
import RevitServices
import Revit
import Autodesk
from Autodesk.Revit.DB import *
from math import *

clr.ImportExtensions(Revit.GeometryConversion)

from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# create varible for revit document
doc = DocumentManager.Instance.CurrentDBDocument
ponts = UnwrapElement(IN[0])
vertln = UnwrapElement(IN[1])
viewType = UnwrapElement(IN[2])
angl = UnwrapElement(IN[3])
vues = UnwrapElement(IN[4])
toggle = IN[5]
#pt = UnwrapElement(IN[3])

cenpos = []
lst = []
topponts = []


if toggle == True:
	# start transaction
	TransactionManager.Instance.EnsureInTransaction(doc)
	
	
	
	# code that modifies revit database goes here
	
	
	for pt, ang, vln, v, cen in zip(ponts, angl, vertln, vues, cenpos):
		elevationPT = pt.ToXyz()
		eleMarker = ElevationMarker.CreateElevationMarker(doc, viewType.Id, elevationPT, 100)
		#ele = eleMarker.CreateElevation(doc, v.Id , 0)
		#ele = eleMarker.CreateElevation(doc, v.Id , 1)
		#ele = eleMarker.CreateElevation(doc, v.Id , 2)
		#ele = eleMarker.CreateElevation(doc, v.Id , 3)
		lst.append(eleMarker)
		#Rotate elevation marker towars model line.
		#ElementTransformUtils.RotateElement(doc, eleMarker.Id, vln, ang)
	
	#end transaction
	TransactionManager.Instance.TransactionTaskDone()
	
else:
	lst.append("set to true")

OUT = lst

hi @simon_murphy1, try this node from Quasar package.

elevInRoom

For more info:

https://twentytwopaths.wordpress.com/2018/04/01/quasar-revit-dynamo-package/#more-56

Hi Jean,

Thanks I will try it but it looks like it will create one marker per wall which is not what I’m trying to achieve. Also I’d like to know what is wrong with my Python script.

Cheers, Si

For your info:

You need CurveLoop and GetCropRegionShapeManager.
Example:

eastShape = YourEastElevation.GetCropRegionShapeManager();
eastShape.SetCropShape(YourCurveLoop);