Surface Slope Arrow Analysis

Surface Slope Arrow Analysis

ted7LJ5P
Contributor Contributor
1,084 Views
2 Replies
Message 1 of 3

Surface Slope Arrow Analysis

ted7LJ5P
Contributor
Contributor

I do land development work and do detailed grading, including making sure the site is ADA compliant, etc.  I have found using the Surface Properties>Analysis>Slope Arrows>Range Details and setting a custom range (0-1.25%, 1.25-2.0%, 2.0%-5.0%,5%-8.33%, etc etc) is incredibly helpful. However, I have to create this range and color scheme in each and every drawing I do. 

THE TASK: How do I save this range so that it is easily imported into new drawings or even when the surface is data referenced into a different drawing? I have been able to create a custom table in the legend drop down, but this doesn't set the Range Details. I have tried saving the Surface Style and then import it into a new drawing, but it doesn't retain the range details.  Any help?

Thanks so much - This community is amazingly helpful and supportive!

Thanks,

Ted

PS - Hey Autodesk, it would be great if this web page did not erase the message here (Details) if the poster decides to change the "product/category" and "board" when posting.

0 Likes
1,085 Views
2 Replies
Replies (2)
Message 2 of 3

cwr-pae
Mentor
Mentor

Save the surface (call it 'slope analysis') with your desired settings but no data in your template. When you want perform the analysis paste the surface to be analyzed in to the 'slope analysis' surface and abracadabra, you have your ranges in the surface.

0 Likes
Message 3 of 3

hippe013
Advisor
Advisor

Here is quick example of how to set the slope arrow analysis data via code. Hope that this helps get you started.

 

   <CommandMethod("SetSurfaceAnalysisSlopeArrows")>
    Public Sub CmdSetSurfaceAnalysisSlopeArrows()

        'Gets the adoc, ed, & db variables
        GetCurrent()


        Dim opt As New PromptEntityOptions(vbCrLf + "Select Surface: ")
        opt.SetRejectMessage(vbCrLf + "Selected object must be a surface: ")
        opt.AddAllowedClass(GetType(TinSurface), True)

        Dim res As PromptEntityResult = ed.GetEntity(opt)

        If res.Status <> PromptStatus.OK Then
            ed.WriteMessage(vbCrLf + "User Cancelled")
            Exit Sub
        End If

        BuildSlopeArrowSurfaceAnalysis(res.ObjectId)

    End Sub

    Private Sub BuildSlopeArrowSurfaceAnalysis(SurfaceObjectId As ObjectId)

        Using tr As Transaction = db.TransactionManager.StartTransaction
            Dim surface As TinSurface = tr.GetObject(SurfaceObjectId, OpenMode.ForWrite)

            Dim analysis As SurfaceAnalysis = surface.Analysis

            Dim color1 As Color = Color.FromColorIndex(ColorMethod.ByAci, 1)
            Dim color2 As Color = Color.FromColorIndex(ColorMethod.ByAci, 2)
            Dim color3 As Color = Color.FromColorIndex(ColorMethod.ByAci, 3)
            Dim color4 As Color = Color.FromColorIndex(ColorMethod.ByAci, 4)


            Dim data As New List(Of SurfaceAnalysisSlopeArrowData)

            data.Add(New SurfaceAnalysisSlopeArrowData With {.MinimumSlope = 0.0, .MaximumSlope = 0.0125, .Scheme = color1})
            data.Add(New SurfaceAnalysisSlopeArrowData With {.MinimumSlope = 0.0125, .MaximumSlope = 0.02, .Scheme = color2})
            data.Add(New SurfaceAnalysisSlopeArrowData With {.MinimumSlope = 0.02, .MaximumSlope = 0.05, .Scheme = color3})
            data.Add(New SurfaceAnalysisSlopeArrowData With {.MinimumSlope = 0.05, .MaximumSlope = 0.0833, .Scheme = color4})

            analysis.SetSlopeArrowData(data.ToArray)

            tr.Commit()
        End Using
    End Sub
0 Likes