<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: TopographySurface as reference in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10605057#M24195</link>
    <description>&lt;P&gt;No it doesn't have to be hosted on another topo surface or pre-existing. It can be created on something that has a surface reference but not a datum element such as level. The below creates a randomised topo and places spot elevations on it. The spot elevations are copied from a single spot elevation hosted on a direct shape which is created for the purpose and deleted at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function Obj_210906a(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result

        Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
        If UIDoc Is Nothing Then Return Result.Cancelled Else
        Dim IntDoc As Document = UIDoc.Document

        Dim V As View = UIDoc.ActiveGraphicalView

        Dim SpotEl As Element = Nothing
        Dim DS As DirectShape = Nothing
        Dim Topo As Element = Nothing

        Dim Pts As New List(Of XYZ)
        Dim Nnum As Integer = 60
        Dim Mnum As Integer = 40
        Dim RND As New Random


        Dim Range As Integer() = New Integer() {Nnum / 3, Mnum / 3}
        Dim HeightLimits As Double() = New Double(1) {2 / 0.3048, 1 / 0.3048}
        For X = 0 To Range(0) - 1
            For Y = 0 To Range(1) - 1
                Dim H As Double = HeightLimits(0) + (RND.NextDouble() * (HeightLimits(1) - HeightLimits(0)))
                Dim Pt As New XYZ((X * 3) / 0.3048, (Y * 3) / 0.3048, H)

                Pts.Add(Pt)
            Next
        Next

        Using TR0 As New Transaction(IntDoc, "Create random topo")
            If TR0.Start = TransactionStatus.Started Then
                Topo = TopographySurface.Create(IntDoc, Pts)

                V.SetCategoryHidden(New ElementId(BuiltInCategory.OST_Topography), False)

                TR0.Commit()
            End If
        End Using

        Using Tg As New TransactionGroup(IntDoc, "Add topo spot elevation")
            If Tg.Start = TransactionStatus.Started Then

                'Create direct shape to host spot elevation
                Using TR0 As New Transaction(IntDoc, "Spot elev")
                    If TR0.Start = TransactionStatus.Started Then

                        Dim PL As Plane = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, XYZ.Zero)
                        Dim SKP As SketchPlane = SketchPlane.Create(IntDoc, PL)

                        DS = DirectShape.CreateElement(IntDoc, New ElementId(BuiltInCategory.OST_GenericModel))
                        Dim A0 As Arc = Arc.Create(PL, 1, 0, Math.PI)
                        Dim A1 As Arc = Arc.Create(PL, 1, Math.PI, 2 * Math.PI)

                        Dim CL As New CurveLoop
                        CL.Append(A0)
                        CL.Append(A1)

                        Dim S As Solid = GeometryCreationUtilities.CreateExtrusionGeometry({CL}.ToList, -XYZ.BasisZ, 0.25)
                        DS.SetShape(New GeometryObject() {S}.ToList)

                        TR0.Commit()
                    End If
                End Using

                'Add spot elevation to top face of newly created direct shape.
                Using TR1 As New Transaction(IntDoc, "Spot elev")
                    If TR1.Start = TransactionStatus.Started Then

                        Dim GeomEl As GeometryElement = DS.Geometry(New Options With {.DetailLevel = ViewDetailLevel.Fine, .ComputeReferences = True})
                        Dim S0 As Solid = GeomEl.Where(Function(x) x.GetType = GetType(Solid)).Cast(Of Solid).Where(Function(x) x.Volume &amp;gt; 0).FirstOrDefault
                        Dim TF As Face = Nothing
                        For i = 0 To S0.Faces.Size - 1
                            Dim F As PlanarFace = TryCast(S0.Faces.Item(i), PlanarFace)
                            If F Is Nothing Then Continue For Else
                            If F.FaceNormal.IsAlmostEqualTo(XYZ.BasisZ) Then
                                TF = F
                            End If
                        Next

                        Dim P As XYZ = XYZ.Zero
                        SpotEl = IntDoc.Create.NewSpotElevation(V, TF.Reference, P, P, P, P, False)

                        TR1.Commit()
                    End If
                End Using

                'Copy onto topo
                Using TR2 As New Transaction(IntDoc, "Spot elev")
                    If TR2.Start = TransactionStatus.Started Then

                        For Each GP As XYZ In Pts
                            Dim Els As List(Of ElementId) = ElementTransformUtils.CopyElement(IntDoc, SpotEl.Id, GP)
                        Next

                        IntDoc.Delete(New ElementId() {DS.Id, SpotEl.Id}.ToList)

                        TR2.Commit()
                    End If
                End Using

                Tg.Assimilate()
            End If
        End Using

        Return Result.Succeeded
    End Function&lt;/LI-CODE&gt;&lt;P&gt;In a new empty project you should then end up with something like the below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="210907.PNG" style="width: 870px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/962137i46B2CB94BF7D6FC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="210907.PNG" alt="210907.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 10:38:56 GMT</pubDate>
    <dc:creator>RPTHOMAS108</dc:creator>
    <dc:date>2021-09-07T10:38:56Z</dc:date>
    <item>
      <title>TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10569512#M24185</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create SpotElevation automatically on a TopographySurface but i can't find a way to convert the TopographySurface to a Reference (I'm using this method : doc.Create.NewSpotElevation()).&lt;/P&gt;&lt;P&gt;Is there a way to get the surface as a reference ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks,&lt;/P&gt;&lt;P&gt;Virone Lorenzo&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:17:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10569512#M24185</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-08-24T13:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10570055#M24186</link>
      <description>&lt;P&gt;the "TopographySurface" class inherits from the Element class so I think you can use the Reference class constructor to get the "TopographySurface" object as a Reference object:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="identifier"&gt;Reference&lt;/SPAN&gt;(&lt;A href="https://www.revitapidocs.com/2015/eb16114f-69ea-f4de-0d0d-f7388b105a16.htm" target="_blank" rel="noopener"&gt;Element&lt;/A&gt; &lt;SPAN class="parameter"&gt;element&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 16:08:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10570055#M24186</guid>
      <dc:creator>Omar_Amen</dc:creator>
      <dc:date>2021-08-24T16:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10570247#M24187</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks for your suggestion, but i've tried this and it seems to ignore the reference and not create the SpotElevation :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Reference d = new Reference(ts);
SpotDimension e = doc.Create.NewSpotElevation(current_view, d, p, p, p, p, true);&lt;/LI-CODE&gt;&lt;P&gt;ts = TopographySurface&lt;/P&gt;&lt;P&gt;p = XYZ point&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 17:30:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10570247#M24187</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-08-24T17:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10571464#M24188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After further tests, it seems like the constructor for reference works, but I can't create the SpotElevation (see pic).&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/956873i41DD317D13E6C17F/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The Reference object is the same as if I had created the SpotElevation manually in Revit but an error occurs while trying to create the SpotElevation using code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/956874i715FDAC5A5D2B18E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Maybe it is the XYZ object in the SpotElevation creation method ? I'm sure the XY is on the Topography, but i put zero to the Z value ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;TopographySurface ts = doc.GetElement(id) as TopographySurface;
XYZ p = new XYZ(x, y, 0);  //x and y are calculated
Reference r = new Reference(ts);

try
{
    SpotDimension e = doc.Create.NewSpotElevation(current_view, r, p, p, p, p, false);
}
catch (Exception e) { TaskDialog.Show("s", 
      "Reference ID: " + r.ElementId.ToString() + "\n" 
      + "Reference Type: " + r.ElementReferenceType + "\n\n\n" 
      + e.ToString()); }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 05:35:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10571464#M24188</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-08-25T05:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10572571#M24189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9528713"&gt;@l.virone&lt;/a&gt;!&amp;nbsp;&lt;BR /&gt;may you call NewSpotElevation() func outside the TryCatch ? to get the original Revit exception error it may help for the error tracing!&lt;BR /&gt;I've searched about your problem and I think you have a problem in the point with Z=0 so u have to get the actual Z value on the surface!&lt;BR /&gt;I found that question on the forum with almost the same problem, so check this out I hope it will help:&lt;BR /&gt;"&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-create-spot-elevation-on-the-topographysurface/m-p/10003458" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/how-to-create-spot-elevation-on-the-topographysurface/m-p/10003458&lt;/A&gt;"&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-create-spot-elevation-on-the-topographysurface/m-p/10003458" target="_blank"&gt;How to create spot elevation on the TopographySurface? - Autodesk Community - Revit Products&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 13:17:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10572571#M24189</guid>
      <dc:creator>Omar_Amen</dc:creator>
      <dc:date>2021-08-25T13:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602173#M24190</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8594778"&gt;@Omar_Amen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tested a very simple method alone and outside a try-catch and it didn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;XYZ ps = new XYZ(0, 0, 0);
SpotDimension es = doc.Create.NewSpotElevation(current_view, new Reference(topography), ps, ps, ps, ps, false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lvirone_0-1630912405974.png" style="width: 395px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/961677i37C66AA890303957/image-dimensions/395x312?v=v2" width="395" height="312" role="button" title="lvirone_0-1630912405974.png" alt="lvirone_0-1630912405974.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Tks for the link but I had already found this topic and their conclusion was to use an existing SpotElevation and copy/paste it where we need it. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;It works BUT not if there are subregions (because ID is different, it's another topographysurface), which is the case with all my projects! &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;So basically I need an ElevationSpot on each possible Subregions to make it works, and that's not conceivable... &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I would like to find a better way to create these ElevationSpots automatically, but it seems very difficult... &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks again and &lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;sorry for the delay in response,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Virone Lorenzo&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 07:23:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602173#M24190</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-09-06T07:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602590#M24191</link>
      <description>&lt;P&gt;Sorry for the naive question, but just to make sure: can you create the desired spot elevation on the toposurface manually through the end user interface? If so, maybe you can analyse the result in RevitLookup to find out more about what elements, properties and parameters are involved and how they need to be set up. If not, the API will probably not support this either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 10:54:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602590#M24191</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-09-06T10:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602721#M24192</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mean create it manually in Revit ? Yes I can create it manually in all ViewTypes (2D plan, 2D section, 3D,...), in my test I'm using a basic ViewPlan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I've analyzed above in the discussion (using Revit LookUp) the parameters of the point created by hand and I tried to do the same thing using code, I've achieved to get the same objects which have the same IDs and are of the same types, but impossible to create the point...&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; (&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Below a new example) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;This is a point created in Revit manually :&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/961767iFB644BA2E9BD7C17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the reference property I get using code :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/961768i429893C880586704/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I must specify that&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; that, it work on objects of others types (with just a correct X-Y, no need to specify Z) but not on TopographySurface objects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Either the API does not support, or I missed something...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Tks,&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 11:51:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10602721#M24192</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-09-06T11:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10603668#M24193</link>
      <description>&lt;P&gt;This has come up before, you can't add a spot elevation to a topo but you can copy one onto it from another temporary location using ElementTransformUtils.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-create-spot-elevation-on-the-topographysurface/m-p/10210072/highlight/true#M54887" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/how-to-create-spot-elevation-on-the-topographysurface/m-p/10210072/highlight/true#M54887&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create a DirectShape at the model origin you can host the temporary spot elevation on the top face of this at 0,0,0 and then copy to the coordinates on the topo. To find such coords you can use ReferenceIntersector. Need to use a surface reference to host the temporary spot elevation.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 20:23:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10603668#M24193</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-09-06T20:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10604401#M24194</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solution is fine with me if it only needs one existing ElevationSpot, except when I perform the copy and the point is no longer on its original host (like a subregion), then the copy fails.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ElementTransformUtils.CopyElement(doc, existingSpot.Id, point);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may have misunderstood, but it seems that the copied ElevationSpot must already be on the TopographySurface host which we want to copy the point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 06:03:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10604401#M24194</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-09-07T06:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10605057#M24195</link>
      <description>&lt;P&gt;No it doesn't have to be hosted on another topo surface or pre-existing. It can be created on something that has a surface reference but not a datum element such as level. The below creates a randomised topo and places spot elevations on it. The spot elevations are copied from a single spot elevation hosted on a direct shape which is created for the purpose and deleted at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function Obj_210906a(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result

        Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
        If UIDoc Is Nothing Then Return Result.Cancelled Else
        Dim IntDoc As Document = UIDoc.Document

        Dim V As View = UIDoc.ActiveGraphicalView

        Dim SpotEl As Element = Nothing
        Dim DS As DirectShape = Nothing
        Dim Topo As Element = Nothing

        Dim Pts As New List(Of XYZ)
        Dim Nnum As Integer = 60
        Dim Mnum As Integer = 40
        Dim RND As New Random


        Dim Range As Integer() = New Integer() {Nnum / 3, Mnum / 3}
        Dim HeightLimits As Double() = New Double(1) {2 / 0.3048, 1 / 0.3048}
        For X = 0 To Range(0) - 1
            For Y = 0 To Range(1) - 1
                Dim H As Double = HeightLimits(0) + (RND.NextDouble() * (HeightLimits(1) - HeightLimits(0)))
                Dim Pt As New XYZ((X * 3) / 0.3048, (Y * 3) / 0.3048, H)

                Pts.Add(Pt)
            Next
        Next

        Using TR0 As New Transaction(IntDoc, "Create random topo")
            If TR0.Start = TransactionStatus.Started Then
                Topo = TopographySurface.Create(IntDoc, Pts)

                V.SetCategoryHidden(New ElementId(BuiltInCategory.OST_Topography), False)

                TR0.Commit()
            End If
        End Using

        Using Tg As New TransactionGroup(IntDoc, "Add topo spot elevation")
            If Tg.Start = TransactionStatus.Started Then

                'Create direct shape to host spot elevation
                Using TR0 As New Transaction(IntDoc, "Spot elev")
                    If TR0.Start = TransactionStatus.Started Then

                        Dim PL As Plane = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, XYZ.Zero)
                        Dim SKP As SketchPlane = SketchPlane.Create(IntDoc, PL)

                        DS = DirectShape.CreateElement(IntDoc, New ElementId(BuiltInCategory.OST_GenericModel))
                        Dim A0 As Arc = Arc.Create(PL, 1, 0, Math.PI)
                        Dim A1 As Arc = Arc.Create(PL, 1, Math.PI, 2 * Math.PI)

                        Dim CL As New CurveLoop
                        CL.Append(A0)
                        CL.Append(A1)

                        Dim S As Solid = GeometryCreationUtilities.CreateExtrusionGeometry({CL}.ToList, -XYZ.BasisZ, 0.25)
                        DS.SetShape(New GeometryObject() {S}.ToList)

                        TR0.Commit()
                    End If
                End Using

                'Add spot elevation to top face of newly created direct shape.
                Using TR1 As New Transaction(IntDoc, "Spot elev")
                    If TR1.Start = TransactionStatus.Started Then

                        Dim GeomEl As GeometryElement = DS.Geometry(New Options With {.DetailLevel = ViewDetailLevel.Fine, .ComputeReferences = True})
                        Dim S0 As Solid = GeomEl.Where(Function(x) x.GetType = GetType(Solid)).Cast(Of Solid).Where(Function(x) x.Volume &amp;gt; 0).FirstOrDefault
                        Dim TF As Face = Nothing
                        For i = 0 To S0.Faces.Size - 1
                            Dim F As PlanarFace = TryCast(S0.Faces.Item(i), PlanarFace)
                            If F Is Nothing Then Continue For Else
                            If F.FaceNormal.IsAlmostEqualTo(XYZ.BasisZ) Then
                                TF = F
                            End If
                        Next

                        Dim P As XYZ = XYZ.Zero
                        SpotEl = IntDoc.Create.NewSpotElevation(V, TF.Reference, P, P, P, P, False)

                        TR1.Commit()
                    End If
                End Using

                'Copy onto topo
                Using TR2 As New Transaction(IntDoc, "Spot elev")
                    If TR2.Start = TransactionStatus.Started Then

                        For Each GP As XYZ In Pts
                            Dim Els As List(Of ElementId) = ElementTransformUtils.CopyElement(IntDoc, SpotEl.Id, GP)
                        Next

                        IntDoc.Delete(New ElementId() {DS.Id, SpotEl.Id}.ToList)

                        TR2.Commit()
                    End If
                End Using

                Tg.Assimilate()
            End If
        End Using

        Return Result.Succeeded
    End Function&lt;/LI-CODE&gt;&lt;P&gt;In a new empty project you should then end up with something like the below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="210907.PNG" style="width: 870px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/962137i46B2CB94BF7D6FC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="210907.PNG" alt="210907.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 10:38:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10605057#M24195</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-09-07T10:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: TopographySurface as reference</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10607150#M24196</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks it works ! But only on the main topography surface and not on subcategories like subregions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems the problem is a Revit problem :&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;gt; Manually in Revit, try to copy an ElevationSpot from an element to a sub-region and it will fail, it doesn't matter if you use CTRL+V or if you keep CTRL down and move the element, it will fail because the copied element is not&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;on his host...&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I think Revit temporary copy the Spot on the main topographySurface, and after the copy process Revit realizes that the host is not right because a sub-regions has a different Id.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;This is why I would have liked to succeed in directly creating the points on a topographysurface.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;And this is why I had believed it wasn't possible to duplicate from another element, the problem isn't the topographySurface but the sub-regions.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;Someone know a way to bypass this problem ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;T&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;hanks for the previous answers! &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 05:03:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/topographysurface-as-reference/m-p/10607150#M24196</guid>
      <dc:creator>l.virone</dc:creator>
      <dc:date>2021-09-08T05:03:56Z</dc:date>
    </item>
  </channel>
</rss>

