- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am trying to execute a vba code in Civil 3D but it is giving a runtime error: Invalid use of property. The code follows below
Sub list_alignment_entyties()
Dim i As Integer
Dim oTangent As AeccAlignmentTangent
Dim oArc As AeccAlignmentArc
Dim oSpiral As AeccAlignmentSpiral
Dim oSCSGroup As AeccAlignmentSCSGroup
Debug.Print "Number of Entities: "; oAlignment.Entities.Count
For i = 0 To oAlignment.Entities.Count - 1
Select Case (oAlignment.Entities.Item(i).Type)
Case aeccTangent
Set oTangent = oAlignment.Entities.Item(i)
Debug.Print "Tangent length:" & oTangent.Length
Case aeccArc
Set oArc = oAlignment.Entities.Item(i)
Debug.Print "Arc radius:" & oArc.Radius
Case aeccSpiral
Set oSpiral = oAlignment.Entities.Item(i)
Debug.Print "Spiral A value:" & oSpiral.A
Case aeccSpiralCurveSpiralGroup
Set oSCSGroup = oAlignment.Entities.Item(i)
Debug.Print "Radius of curve in SCS group:" _
& oSCSGroup.Arc.Radius
' And so on for AeccAlignmentSTSGroup,
' AeccAlignmentSTGroup, AeccAlignmentTSGroup
' AeccAlignmentSCGroup, and AeccAlignmentCSGroup types.
End Select
Next i
End Sub
I can't identify why the error occurs as this code is in AutoCAD Civil 3D API Developers Guide
Solved! Go to Solution.