Jump to content

Recommended Posts

Posted

Hello,

I am new to autocad and i need help in using acad with vbe

here is unfinished program:

 

 

Private Sub CommandButton1_Click()

Me.hide

a = 50

Dim apskr, apskr2 As AcadCircle

Dim linija, linija2, linija3, linija4 As AcadLine

Dim t1 As Variant

Dim t2(0 To 2) As Double

Dim t3(0 To 2) As Double

Dim t4(0 To 2) As Double

Dim t5(0 To 2) As Double

Dim t6(0 To 2) As Double

Dim t7(0 To 2) As Double

Dim t8(0 To 2) As Double

Dim t9(0 To 2) As Double

Dim t10(0 To 2) As Double

 

t1 = ThisDrawing.Utility.GetPoint

t2(0) = t1(0)

t2(1) = t1(1) + a

t3(0) = t1(o)

t3(1) = t1(1) + 99

t4(0) = t1(o)

t4(1) = t1(1) - 99

t5(0) = t1(o) - 99

t5(1) = t1(1)

t6(0) = t1(o) + 99

t6(1) = t1(1)

t7(0) = t1(0) - a / 6

t7(1) = t1(1)

t8(1) = t1(1)

t8(0) = t1(0) + a / 6

t9(0) = t7(0)

t10(0) = t8(0)

t9(1) = t7(1) + a

t10(1) = t8(1) + a

Set linija = ThisDrawing.ModelSpace.AddLine(t4, t3)

Set linija = ThisDrawing.ModelSpace.AddLine(t5, t6)

Set linija2 = ThisDrawing.ModelSpace.AddLine(t7, t9)

Set linija3 = ThisDrawing.ModelSpace.AddLine(t8, t10)

Set apskr = ThisDrawing.ModelSpace.AddCircle(t1, a)

Set apskr = ThisDrawing.ModelSpace.AddCircle(t1, 2 * a / 3)

Set apskr2 = ThisDrawing.ModelSpace.AddCircle(t2, a / 6)

Set linija4 = linija2.ArrayPolar(7, 3.14 * 360 / 180, t1)

Set linija4 = linija3.ArrayPolar(7, 3.14 * 360 / 180, t1)

Set linija = linija2.Delete.circle(t1, a)

Set apskr2 = apskr2.ArrayPolar(7, 3.14 * 360 / 180, t1)

Set asd = t

apskr.Update

linija2.Update

Me.hide

End Sub

 

On every "arraypolar" command i get 424 (object required) error. anyone knows knows how should i edit it to be correct?

Thank you in advance :}

Posted

A variant is the value returned from the array method.

 

 

Dim var1, var2, var3 As Variant

. . . . .

var1 = linija2.ArrayPolar(7, 3.14 * 360 / 180, t1)
var2 = linija3.ArrayPolar(7, 3.14 * 360 / 180, t1)
[color="SeaGreen"]'Set linija = linija2.Delete.circle(t1, a)[/color] [color="DarkRed"]‘What is the objective here?[/color]
var3 = apskr2.ArrayPolar(7, 3.14 * 360 / 180, t1)
[color="seagreen"]'Set asd = t [/color][color="darkred"]‘What is the objective here?[/color]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...