procedure too large

procedure too large

Anonymous
Not applicable
495 Views
3 Replies
Message 1 of 4

procedure too large

Anonymous
Not applicable

Hi I wrote that program

Public Sub podciag1()

With ThisDrawing.Utility

Dim k0Deg As Double

'every 1degree till 355

Dim k355Deg As Double

k0Deg = .AngleToReal("0d", acDegrees)
k355Deg = .AngleToReal("355d", acDegrees)

Const od0p As Integer = 0

'every 1 till 1000

Const od10000p As Integer = 10000

Dim layerObj As AcadLayer
Dim tekststyl As AcadTextStyle

Set layerObj = ThisDrawing.Layers.Item("defpoints")
Set wymiarstyl = ThisDrawing.DimStyles.Item("aL")
Set tekststyl = ThisDrawing.TextStyles.Item("Arial")
Dim bż As Integer
Dim hż As Integer
Dim bpd As Integer
Dim hpd As Integer
 'and many moro variables

'  2.1 from here there is main program, wchich draws
 

isoA1hp1w = .PolarPoint(isoA1hp1pos, k90Deg, od140p)

End Sub

' There are about 3000 lines, When I compile it shows
' procedure too large
' ??  How to split this procedure  

0 Likes
496 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

I've reviewed several of your recent posts ... seems like you need to start reading how to program VB here's a very helpful site, for more than just the VB language ...

 

http://www.dummies.com/how-to/computers-software/programming/visual-basic.html

 

832iE7A667E9F87D63AA

0 Likes
Message 3 of 4

Anonymous
Not applicable

Yes You are right. I have read a book about vba for autocad, 50 days ago and started programming. There are too many knowledge to find out within these 50 days so I ask on forum. This wasn't in a book. Thank You for help, it is difficult to find aprioprate information about basic knowledge. 

 I hope someone help me to split this procedure in to two separate.

0 Likes
Message 4 of 4

Anonymous
Not applicable

PIck sections of the primary Subroutine and then create smaller subs or functions then you can make your calls to them from the main sub.

 

I think the forum managers would agree with me here ... these forums are for asking questions in relation to how to program against the AutoCAD API ... not teaching programming fundamentals or for people asking for someone else to do their job for them.  Other forums exist for those types of questions

 

 

Public Sub  podciag1()
	Call Sub#1
	Call Function#1
	Call Sub#2
	.
	.
	.
	etc
End Sub 

Private Sub#1()
End Sub

Private Sub#2()
End Sub

Private Sub#3()
End Sub

Private Function#1()
End Sub

Private Function#2()
End Sub

 

 

 

 

0 Likes