Add elevation spot to an element in a locked 3D view

Hey everyone!
I’m trying to add a Spot Elevation tag to the element at an active locked 3D view. But I have some issues to get appropriate bend and end points for a spot elevation tag.
After doing some thinking I decided to place spot elevation manually and see its position in a 3D space:

After rotating unlocked 3D view I noticed that spot elevation is placed on a plane that is parallel to a viewport position at the moment when I added it manually:
image

Then I tried to find appropriate points according to same logic as I placed it manually:

  • created a local coordinate system that represented a position of an appropriate view direction
  • placed points of the bend and end position of spot elevation’s tag
  • then transformed points into a global coordinate system by Geometry.Transform node. So they became locating at the necessary plane
  • feeded that points to a GeniusLoci python script node “SpotElevation ByReference” that modified by myself.
    As a result I caught an error:

Also I caught the same error when I designed a different script. I got a reference point by FindNearest() method and did almost the same as a previous one with some differences (inspired by Clockwork node “SpotElevation.ByFloorPlanAndPoint”).

Please anyone explain me what I did wrong? What is the correct way to place spot elevations in a 3D view?
Here are my raw DYN files to check:
Spot elevation (bend and end poins as points).dyn (76.7 KB)
Spot elevation (reference by FindNearest() method).dyn (88.6 KB)

did you re-lock the 3D view before running the script? Revit won’t allow placing of tags in 3D unless view is locked. I’m guessing that’s where it get’s the view plane from.

1 Like

Yeah, I tried to re-lock the 3D view, and it didn’t help me.
Also, I noticed that when I change the unlocked 3D view position and select any placed spot elevation, its bend and end positions are being recalculated immediately, so it begins to lie on the plane that is parallel to the current view plane. My script does almost the same - it calculates the bend and end positions in the same way, but it doesn’t want to place any spot elevation anyway…