这是因为工程被保护了,把代码贴在下面,自己看吧,仅供学习。
Sub Composite()
'
' Composite analysis Macro
'
Rem PROC CDINP:
Rem
Rem VERSION 1.4.4 (30th OCTOBER 1997)
'
Dim I, J, K, TL, CK, LN, LN2, FLG
Dim DATAG, NPLY
Dim MATL(1000), THETA(1000), THK(1000)
Dim E1, E2, C12, C22, C11, C33
Dim G12, V12, V21, K1, KK, ANG, L, N
Dim L2, N2, L3, N3, L4, N4, G(1000), z(1000), QT(500)
Dim EM1(5), EM2(5), GM12(5), MM12(5), FG(1000), MP(1000), TP(1000), DIX(40)
Dim V, V1, V2, AIX, BIX
Dim temp, QUOT, JP1, DIXM(100), HINVS(100)
'
Dim SXA(100), SYA(100), SSA(100), E(6), S(6), KA(6), S1(6)
Dim SA(6), SB(6), S2(6), PLY
Dim TX(9), CX, SX
Dim ST1, ST2, ST3, ST4, ST5, ST6, LD1(3), LD2(3)
'
Dim F1, F2, F12, F11, F22, F33
Dim A, B, RF, M, XT(19), XC(19), YT(19), YC(19), SH(19)
'
'---------------- CLEAR STRESS AND STRAIN RESULT TABLES --------------------
'
Range("O8:W205").Select
Selection.ClearContents
Range("A1").Select
'
'---------------------------------------------------------------------------
'
NPLY = Cells(2, 2) ' NUMBER OF PLIES
DATAG = Cells(3, 2) ' DATUM ANGLE
'
For I = 1 To NPLY
MATL(I) = Cells((2 + I), 4)
THETA(I) = Cells((2 + I), 5)
THK(I) = Cells((2 + I), 6)
THETA(I) = THETA(I) + DATAG ' Rem DATUM ANGLE ADDED
Next
'
For I = 1 To 5
EM1(I) = Cells(13, (8 + I))
EM2(I) = Cells(14, (8 + I))
GM12(I) = Cells(15, (8 + I))
MM12(I) = Cells(16, (8 + I))
XT(I) = Cells(17, (8 + I))
XC(I) = Cells(18, (8 + I))
YT(I) = Cells(19, (8 + I))
YC(I) = Cells(20, (8 + I))
SH(I) = Cells(21, (8 + I))
Next
'
TL = 0
For I = 1 To NPLY
TL = TL + THK(I)
Next
Cells(5, 2) = TL
Cells(6, 2) = NPLY
'
' DATA SORT ROUTINE
'
I = 1
FG(I) = 1
CK = 1
FTOT = 1
STEP4:
MP(CK) = MATL(I)
TP(CK) = THETA(I)
STEP1:
CK = 1
I = I + 1
If I > NPLY Then GoTo STEP5
STEP2:
If MATL(I) <> MP(CK) Or THETA(I) <> TP(CK) Then GoTo STEP3
FG(I) = CK
GoTo STEP1
STEP3:
CK = CK + 1
If CK < FTOT Or CK = FTOT Then GoTo STEP2
FTOT = FTOT + 1
FG(I) = CK
GoTo STEP4
STEP5:
'
'---------------------------
|