Тема: Как сделать повтор программы с параметрами прошлого запуска.
Уважаемые!
Есть код для формы:
Dim dimA, dimB, scaleHole, kmin As Double Dim pt1, pt2, pt3, pt As Variant Dim plineObj As AcadPolyline Dim points(0 To 11) As Double Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double Dim point3(0 To 2) As Double Dim point4(0 To 2) As Double Dim Layer1_06 As AcadLayer Dim Layer7_02 As AcadLayer Dim LayerPrevios As AcadLayer Dim solidObj As AcadSolid Private Sub cbCancel_Click() fDrawHoles.Hide End Sub Private Sub cbOk_Click() Set LayerPrevios = ThisDrawing.ActiveLayer Set Layer1_06 = ThisDrawing.Layers.Add("1-06") Layer1_06.Lineweight = acLnWt050 Set Layer7_02 = ThisDrawing.Layers.Add("7-02") Layer7_02.Lineweight = acLnWt020 ThisDrawing.ActiveLayer = Layer1_06 If obDimA100.Value = True Then dimA = 100 If obDimA120.Value = True Then dimA = 120 If obDimA200.Value = True Then dimA = 200 If obDimA250.Value = True Then dimA = 250 If obDimA300.Value = True Then dimA = 300 If obDimB100.Value = True Then dimB = 100 If obDimB120.Value = True Then dimB = 120 If obDimB200.Value = True Then dimB = 200 If obDimB250.Value = True Then dimB = 250 If obDimB300.Value = True Then dimB = 300 If obScale1.Value = True Then scaleHole = 1 If obScale20.Value = True Then scaleHole = 20 If obScale25.Value = True Then scaleHole = 25 If obScale30.Value = True Then scaleHole = 30 If obScale40.Value = True Then scaleHole = 40 dimA = dimA / scaleHole dimB = dimB / scaleHole fDrawHoles.Hide pt = ThisDrawing.Utility.GetPoint(, "Enter a point: ") If obPoint1.Value = True Then pt(0) = pt(0) - dimA / 2 pt(1) = pt(1) - dimB / 2 End If If obPoint3.Value = True Then pt(0) = pt(0) - dimA End If points(0) = pt(0): points(1) = pt(1): points(2) = 0 points(3) = pt(0) + dimA: points(4) = pt(1): points(5) = 0 points(6) = pt(0) + dimA: points(7) = pt(1) + dimB: points(8) = 0 points(9) = pt(0): points(10) = pt(1) + dimB: points(11) = 0 Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points) plineObj.Closed = True plineObj.Lineweight = acLnWtByLayer ThisDrawing.ActiveLayer = Layer7_02 If dimA < dimB Then kmin = dimA / 5 Else kmin = dimB / 5 point1(0) = pt(0): point1(1) = pt(1): point1(2) = 0 point2(0) = pt(0): point2(1) = pt(1) + dimB: point2(2) = 0 point3(0) = pt(0) + kmin: point3(1) = pt(1) + dimB - kmin: point3(2) = 0 point4(0) = pt(0) + dimA: point4(1) = pt(1) + dimB: point4(2) = 0 Set solidObj = ThisDrawing.ModelSpace.AddSolid(point1, point2, point3, point4) ThisDrawing.ActiveLayer = LayerPrevios fDrawHoles.Show End Sub Private Sub UserForm_Activate() obDimA250.Value = True obDimB250.Value = True obScale30.Value = True obPoint1.Value = True End Sub
Как сделать чтобы при повторном запуске в одном чертеже установки с прошлого выполнения программы запоминалсь и устанавливались?