Place Spot Elevation in SectionView and change Type

Good idea, will try it with edge references!

But hey, looking at the needed parameter, this has to be possible without using this whole referenceintersector thing. I’m sure we can make that work :slight_smile:

So it was almost too easy, wasn´t it? :smiley:
This is now working in any project :slight_smile:

doc = DocumentManager.Instance.CurrentDBDocument
view = UnwrapElement(IN[0])
ref = UnwrapElement(IN[1])
pt = UnwrapElement(IN[2])
bend = UnwrapElement(IN[3])
end = UnwrapElement(IN[4])
refpt = UnwrapElement(IN[5])
leader = UnwrapElement(IN[6])
elementlist = []


TransactionManager.Instance.EnsureInTransaction(doc)

elementlist.append(doc.Create.NewSpotElevation(view, ref, pt.ToXyz(), bend.ToXyz(), end.ToXyz(), refpt.ToXyz(), leader))

TransactionManager.Instance.TransactionTaskDone()

OUT = elementlist

Will set up some code that works for lists in the next days.
Then we have to find a good way to filter the edge references. I think we can use the lines for that.
I think i will add inputs for different spotelevationtypes to the code.

For columns i will comine the codes for getting edge references and placing elevetions to one code.

And because you sayd @daniel1 that your spotelevations were placed on the wrong elements, we should just forget this whole ReferenceIntersector thing.

1 Like

Awesome @gerhard.p !
My guess is that it worked a lot faster than the original node too. I’m excited to use the updated script in my workfows. Thanks for your help.

1 Like

Too good to be true, with the new node from @Alban_de_Chasteigner we are getting there :slight_smile:

Edit:
And now with inputs for two different SpotElevationTypes :smiley:

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):

	elementlistTop.append(doc.Create.NewSpotElevation(view, refTop, ptTop.ToXyz(), bendTop.ToXyz(), endTop.ToXyz(), refptTop.ToXyz(), leader))
	
for refBottom, ptBottom, bendBottom, endBottom, refptBottom in zip(refsBottom, ptsBottom, bendsBottom, endsBottom, refptsBottom):

	elementlistBottom.append(doc.Create.NewSpotElevation(view, refBottom, ptBottom.ToXyz(), bendBottom.ToXyz(), endBottom.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
1 Like

Leaders are making some troubles cause it seems that i can´t adjust the text position :confused:

still not shure whats the difference between points and referencepoints…

Added vector input for leaders:

Edit:

This is possible…not good but when i can´t move the text i have to live with that. Would be perfect if the arrow was flipped…maybe i have to make an own family type for that? but i think thats a system family that can´t be changed.

Controling leaders with the vectors works pretty good, the text is still a problem.

Current result and code:

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(typeIdTop))

OUT = elementlistTop, elementlistBottom
1 Like

Success!
My version is below:

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])
refs = UnwrapElement(IN[1])
origins = UnwrapElement(IN[2])
bends = UnwrapElement(IN[3])
ends = UnwrapElement(IN[4])
refpts = UnwrapElement(IN[5])
typeId= UnwrapElement(IN[6])
leader = UnwrapElement(IN[7])
elementlist = []

TransactionManager.Instance.EnsureInTransaction(doc)

for ref, pt, bend, end, refpt in zip(refs, origins, bends, ends, refpts):

	elementlist.append(doc.Create.NewSpotElevation(view, ref, pt.ToXyz(), bend.ToXyz(), end.ToXyz(), refpt.ToXyz(), leader))
	

TransactionManager.Instance.TransactionTaskDone()

for element in elementlist:

	element.ChangeTypeId(ElementId(typeId))
	

OUT = elementlist

More flexibility.

Just looking back on a previous post, it seems like there is no difference between the origin and the refPt when placing a spot elevation in a section view. I attempted to change the elevation value with a lower reference point while keeping the same origin. The result was the same; the origin value was used instead. The refPt probably makes more sense in plan views. If the reference is a whole element, like say a floor, its is possible to get a top or bottom value from the same spot elevation. Maybe more light can be shed on this subject.

1 Like

And here is the Custom Node:

CreateSpotElevations.dyf (21.5 KB)
Happy Dimensioning!

2 Likes

Good work @daniel1 :slight_smile: :+1:

Hi, how is this problem so far now?
Just FYI, it took me a half of a day to find out the problem as you were in. Then i realize i need to uncheck the Section Box in Default 3D view to make the node work.

Hello @Nicolas.B

There is no real problem left, is it?
I use the code to place spotelevations on columns and on elements that intersect with a line:

you said in some your revit projects, placing spot elevation by Clockwork.SpotElevation.ByPoint does not work so i think just because of the Section Box option in Default 3DView. By checking that Section Box option in Default 3DView leading to the node does not work, unchecking may help, at least in FloorPlanView.

Hey Nicolas,

In this thread we showed that the referenceintersector class is not necessary for placing spot elevations. We don´t need the clockwork node.

If the node works for you I´m glad. I made about 100 tests, most of them with no section box activated, because the 3d view was created in the same dynamo graph that placed the spot elevations. So for me it did definitely not work with the clockwork node.

1 Like

@daniel1 Hi, can you show me an image as an example of the inputs to this node? I don’t know what are the differences among these 3 inputs.

@daniel1 The python script notified this warning but I don’t know what’s wrong. Please help me with this problem. Thank you.

The code only works with list inputs.
Make a list out of your point.

@gerhard.p I’m sorry, it’s sill not working. Please help me check.

Hey @Luffy11
A python node only works if you feed all the inputs, you can not leave them empty.
And there is also another Point you use as an input that is not in a list.
You can use the list.create node to mak a list out of an element.

hi @gerhard.p , yes about feeding all the inputs, I will. Pardon me, can you explain more about the list create that you suggest? I’m not good at programming language. I know “list.create” node but still don’t get your point.