Ad

Monday, April 26, 2010

Structure Rim Manipulation

This post shows how you can modify a structure’s rim elevation and how to get an elevation at an X, Y location from a surface object.

Option Explicit

Sub AdjustStructureRim()

Dim vPt As Variant
Dim oAcadObj As AcadObject
On Error Resume Next
ThisDrawing.Utility.GetEntity oAcadObj, vPt, "Select surface: "

If (TypeOf oAcadObj Is AeccSurface) Then
Dim oSurface As AeccSurface
Set oSurface = oAcadObj
Else
ThisDrawing.Utility.Prompt "Select Only Surfaces" & vbCrLf
Exit Sub
End If

Do Until AdjustStructureRimWork(oSurface) = False

Loop

End Sub

Function AdjustStructureRimWork(oSurface As AeccSurface) As Boolean

Dim vPt As Variant
Dim oAcadObj As AcadObject
' On Error Resume Next
ThisDrawing.Utility.GetEntity oAcadObj, vPt, "Select structure: "

If (oAcadObj Is Nothing) Then
AdjustStructureRimWork = False
ElseIf (TypeOf oAcadObj Is AeccStructure) Then
Dim oStructure As AeccStructure
Set oStructure = oAcadObj

Dim dElev As Double
dElev = oSurface.FindElevationAtXY(oStructure.Position.X, oStructure.Position.Y)

oStructure.Position.Z = dElev
AdjustStructureRimWork = True

Else
ThisDrawing.Utility.Prompt "Select Only Polylines" & vbCrLf
AdjustStructureRimWork = False
End If



End Function

2 comments:

Mr. Justin said...

Was this suppose to help? That was the worst post i've ever seen!

Christopher Fugitt said...

Mr. Justin, what information were you looking for?

LinkWithin

Blog Widget by LinkWithin