Message 1 of 5
Not applicable
01-06-2014
03:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all I am trying to draw a simple square 10x10x10 from point 0,0 and am getting an error saying not a valid argument in .polarpoint. I am fairly familiar with excel VBA but am new to autocad. Below is my code.
Option Explicit
Sub drect()
Dim pi As Double
Dim pt1(0 To 2) As Variant
Dim pt2 As Variant
Dim pt3 As Variant
Dim pt4 As Variant
pi = 3.14159265358979
pt1(0) = 0#: pt1(1) = 0#: pt1(2) = 0#
With ThisDrawing.Utility
pt2 = .PolarPoint(pt1, 0, 10)
pt3 = .PolarPoint(pt2, pi / 2, 10)
pt4 = .PolarPoint(pt3, pi / 2, 10)
End With
With ThisDrawing.ModelSpace
.AddLine pt1, pt2
.AddLine pt2, pt3
.AddLine pt3, pt4
.AddLine pt4, pt1
End With
End SubThanks for any help.
Solved! Go to Solution.