CTruax
Civil/Environmental
- May 21, 2001
- 82
I get a type mismatch error with the following code:
Dim noOfPoints As Integer: noOfPoints = 5
ReDim P(0 To noOfPoints * 2 - 1) As Double
P(0) = 0#: P(1) = 0#
P(2) = L: P(3) = 0#
P(4) = L: P(5) = Th
P(6) = 0#: P(7) = Th
P(8) = 0#: P(9) = 0# 'a closed polyline
Dim ObjectList(0 To 0) As Object 'in this case an array length of 1
Set ObjectList(0) = acadApp.ActiveDocument.ModelSpace.AddLightWeightPolyline(P)
Dim Regions As Variant
Regions = acadApp.ActiveDocument.ModelSpace.AddRegion(ObjectList)
Dim PointsArray(0 To 5) As Double
PointsArray(0) = 0: PointsArray(1) = 0: PointsArray(2) = 0
PointsArray(3) = 0: PointsArray(4) = 0: PointsArray(5) = 6
Dim anObj As Object
Set anObj = acadApp.ActiveDocument.ModelSpace.AddExtrudedSolidAlongPath(Regions, PointsArray)
I can perform the task from the ACAD R14 command line but why do I get a MisMatch error on the last statement?
Dim noOfPoints As Integer: noOfPoints = 5
ReDim P(0 To noOfPoints * 2 - 1) As Double
P(0) = 0#: P(1) = 0#
P(2) = L: P(3) = 0#
P(4) = L: P(5) = Th
P(6) = 0#: P(7) = Th
P(8) = 0#: P(9) = 0# 'a closed polyline
Dim ObjectList(0 To 0) As Object 'in this case an array length of 1
Set ObjectList(0) = acadApp.ActiveDocument.ModelSpace.AddLightWeightPolyline(P)
Dim Regions As Variant
Regions = acadApp.ActiveDocument.ModelSpace.AddRegion(ObjectList)
Dim PointsArray(0 To 5) As Double
PointsArray(0) = 0: PointsArray(1) = 0: PointsArray(2) = 0
PointsArray(3) = 0: PointsArray(4) = 0: PointsArray(5) = 6
Dim anObj As Object
Set anObj = acadApp.ActiveDocument.ModelSpace.AddExtrudedSolidAlongPath(Regions, PointsArray)
I can perform the task from the ACAD R14 command line but why do I get a MisMatch error on the last statement?