Intersect ModelElements with Detailline to get points for SpotElevations

Hello Dynamo Friends :slight_smile:

I´m placing spot elevations at the intersecting point of ceilings and a detailline.

The section is exacly in the middle of the ceilings, this leads to the line also being exactly in the middle.

Intersecting gives me the points in the middle of the ceilings:

But this points can not be used to place spot elevations. For the Spot Elevations i have to get the front face of the ceiling, it wont work with any other point. In my little test setup i got this point by taking the minimum y value.

Now I´m looking for a method that will work in every setup.
I´m a little lost…maybe i have to make a coordinatesystem for every element and compare this with the view direction or something?

Happy about any input, thanks in advance :slight_smile:
kind regards

Best I can think of is to use Surface.ProjectInputOnto in order to project the intersection point onto the nearest face in the opposite direction of the view orientation.

1 Like

Thanks Nick i will try that out.

I made a mistake in my first post, just to be clear I´m not using model lines, i use a detail line just to give dynamo some input where the SpotElevations should be placed.

If there would be any other method, like just klicking on a spot in revit and dynamo would get that point, that would be nicer than drawing this help line…

So i just figured out that, in my tiny test setup, i dont even have to intersect anything, the line is only there to get the x value.

Now I´m going to test whats happening when the ceilings have a slope, i think now it gets interresting :smiley:

And now it`s starting to get weird:

So a slope in the following direction is still ok:

BUT if the slope is in the other direction i get this weird result:

The Spot eleavtions are placed, even though the points are not correct.

And if i use the right points, the points of the intersection…i get no spot elevations :confused:

So I´m asking me the question, is there any way to get the coordinates of a spot elevation? so i could place one manually and check the coordinates?

So after troubles with the python code this is now working pretty well, but there is one thing left that bothers me.

Im using the “Surface.ProjectInputOnto” node. The problem is that it ignores the direction (reversed view direction) that i give as input. The node projects the point in both directions, onto both surfaces:

ezgif-5-8ebf88667b

And then i have to create a coordinate system and check which point is the right one:

So am I doing something wrong at projecting the points? And is there a better method to filter out the right surface?

Interesting. I believe there might be different projection methods, some of which use only the specified direction and some of which expand along the vector in both directions. It’s not a huge issue. Just filter like you are now. :+1:

1 Like

It works with Point.Project node :smiley:

Now thats a cleaned up graph i can work with :slight_smile:
Thanks for your help Nick!

Uff, trying that on a more comlex floor and its failing.

The projection of the bottom points works, but the projection of the top points fails…

Can´t find out whats going on here :frowning:


After more testing there are so many things unclear, but here some interesting results:

Projecting points to faces may give a lot of points, so faces must be filtered before or points must be filtered after. For some reason the view direction is wrong again…

By mistake i projected points onto the whole solid, and i was surprised because the spot elevations were placed correct. Only the single points i need were “projected”.

So i looked up those new point to find out it is the same point that i used for projecting

so it must work without all those proceting onto something thing…and in fact it does!

So what was the problem at my beginning? It was the python code that use the " ReferenceIntersector Class" to get the element references. This method somehow found the reference of the vertical faces and so i had to project them.

Now I´m inputting that top and bottom references myselfe i can now work with those intersection points on top and bottom face! :slight_smile:

So now it works by just using the points of intersection:

After testing in a few buildings, the graph works perfect :smiley: Just had to filter out all references of floors that are not intersecting.

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

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
view = UnwrapElement(IN[0])
refsTop = UnwrapElement(IN[1])
refsBottom = UnwrapElement(IN[2])
ptsTop = UnwrapElement(IN[3])
bendsTop = UnwrapElement(IN[4])
endsTop = UnwrapElement(IN[5])
refptsTop = UnwrapElement(IN[6])
ptsBottom = UnwrapElement(IN[7])
bendsBottom = UnwrapElement(IN[8])
endsBottom = UnwrapElement(IN[9])
refptsBottom = UnwrapElement(IN[10])
typeIdTop= UnwrapElement(IN[11])
typeIdBottom = UnwrapElement(IN[12])
leader = UnwrapElement(IN[13])
elementlistTop = []
elementlistBottom = []

TransactionManager.Instance.EnsureInTransaction(doc)

for refTop, ptTop, bendTop, endTop, refptTop in zip(refsTop, ptsTop, bendsTop, endsTop, refptsTop):
	
	ptTop = ptTop.ToXyz()
	elementlistTop.append(doc.Create.NewSpotElevation(view, refTop, ptTop, ptTop.Add(bendTop.AsPoint().ToXyz()), ptTop.Add(endTop.AsPoint().ToXyz()), refptTop.ToXyz(), leader))
	
for refBottom, ptBottom, bendBottom, endBottom, refptBottom in zip(refsBottom, ptsBottom, bendsBottom, endsBottom, refptsBottom):

	ptBottom = ptBottom.ToXyz()
	elementlistBottom.append(doc.Create.NewSpotElevation(view, refBottom, ptBottom, ptBottom.Add(bendBottom.AsPoint().ToXyz()), ptBottom.Add(endBottom.AsPoint().ToXyz()), refptBottom.ToXyz(), leader))
	

TransactionManager.Instance.TransactionTaskDone()

for elementTop in elementlistTop:

	elementTop.ChangeTypeId(ElementId(typeIdTop))
	
for elementBottom in elementlistBottom:

	elementBottom.ChangeTypeId(ElementId(typeIdBottom))

OUT = elementlistTop, elementlistBottom
2 Likes

And back with some troubles, sloped slabs will give me spot elevations with a little offset, that in some cases really doesn´t look good:

will try to find out why this happens…

Thanks Gerhard, I adapted your graph to work with Curtain Walls. very helpfull

1 Like

Hey Timhevel! :slight_smile:

You want to show us a gif/picture where you place the spotelevations? I find it so interresting how other people use dynamo and I´m trying to get our department of Architecture to hop on the dynamo train, maybe this is a useful thing for them.

Kind regards!

It is part of a bigger script that automatically creates elevations and places them on sheets with schedule and legend for all unique Curtain Walls the project based on the Type Mark.

1 Like