1 |
Imports SldWorks
|
2 |
Imports SWPublished
|
3 |
imports SwConst
|
4 |
|
5 |
Namespace Enregistrement
|
6 |
Public Class EnregistrementPageHandler
|
7 |
Implements PropertyManagerPage2Handler2
|
8 |
|
9 |
Dim iSwApp As SldWorks.SldWorks
|
10 |
Dim userAddin As MAGIC.Magic
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
Function Init(ByVal sw As SldWorks.SldWorks, ByVal addin As MAGIC.Magic) As Integer
|
16 |
' on vient ici lorsque l'on choisit le complément MAGIC
|
17 |
iSwApp = sw
|
18 |
userAddin = addin
|
19 |
|
20 |
End Function
|
21 |
|
22 |
Sub AfterClose() Implements PropertyManagerPage2Handler2.AfterClose
|
23 |
|
24 |
' un fois que la fenêtre des propriétés est fermée on vient ici.
|
25 |
' mais je crois que c'est mieux de mettre le code dans OnClose...
|
26 |
|
27 |
Dim IndentSize As Integer
|
28 |
IndentSize = System.Diagnostics.Debug.IndentSize
|
29 |
System.Diagnostics.Debug.WriteLine(IndentSize)
|
30 |
|
31 |
|
32 |
EnregistrementCode.OK()
|
33 |
|
34 |
End Sub
|
35 |
|
36 |
Sub OnCheckboxCheck(ByVal id As Integer, ByVal status As Boolean) Implements PropertyManagerPage2Handler2.OnCheckboxCheck
|
37 |
' status est true si c'est cliqué, false si on enlève le signe
|
38 |
' ID = 2 pour les topologies sous-jacentes
|
39 |
' ID = 3 pour les conditions sur une seule annotation
|
40 |
|
41 |
|
42 |
End Sub
|
43 |
|
44 |
Sub OnClose(ByVal reason As Integer) Implements PropertyManagerPage2Handler2.OnClose
|
45 |
|
46 |
'Err.Raise(1)
|
47 |
|
48 |
'If Gilles1.Checked Then
|
49 |
' EnregistrementCode.bGilles1 = True
|
50 |
' If Gilles2.Checked Then EnregistrementCode.bGilles2 = True Else EnregistrementCode.bGilles2 = False
|
51 |
'Else
|
52 |
' EnregistrementCode.bGilles1 = False
|
53 |
' EnregistrementCode.bGilles2 = False
|
54 |
'End If
|
55 |
|
56 |
|
57 |
|
58 |
If reason = 1 Then
|
59 |
EnregistrementCode.MemoriserValeurs() ' la fenêtre sera détruite ainsi que ses valeurs. Il faut les mémoriser...
|
60 |
EnregistrementCode.sauvegarder = True
|
61 |
Else
|
62 |
EnregistrementCode.decoupe = False
|
63 |
POG = False
|
64 |
EnregistrementCode.cancel()
|
65 |
EnregistrementCode.sauvegarder = False
|
66 |
End If
|
67 |
|
68 |
End Sub
|
69 |
|
70 |
Sub OnComboboxEditChanged(ByVal id As Integer, ByVal text As String) Implements PropertyManagerPage2Handler2.OnComboboxEditChanged
|
71 |
|
72 |
End Sub
|
73 |
|
74 |
Function OnActiveXControlCreated(ByVal id As Integer, ByVal status As Boolean) As Integer Implements PropertyManagerPage2Handler2.OnActiveXControlCreated
|
75 |
OnActiveXControlCreated = -1
|
76 |
End Function
|
77 |
|
78 |
Sub OnButtonPress(ByVal id As Integer) Implements PropertyManagerPage2Handler2.OnButtonPress
|
79 |
'MsgBox(id)
|
80 |
End Sub
|
81 |
|
82 |
Sub OnComboboxSelectionChanged(ByVal id As Integer, ByVal item As Integer) Implements PropertyManagerPage2Handler2.OnComboboxSelectionChanged
|
83 |
' ici quand la sélection du combo est changée
|
84 |
|
85 |
End Sub
|
86 |
|
87 |
Sub OnGroupCheck(ByVal id As Integer, ByVal status As Boolean) Implements PropertyManagerPage2Handler2.OnGroupCheck
|
88 |
Dim volume As Double
|
89 |
Dim surface As Double
|
90 |
Dim eng As Double
|
91 |
Dim swMprop As SldWorks.MassProperty
|
92 |
swMprop = swModel.Extension.CreateMassProperty
|
93 |
volume = swMprop.Volume
|
94 |
surface = swMprop.SurfaceArea
|
95 |
eng = (volume / surface) / 6
|
96 |
|
97 |
EnregistrementCode.NumberENG.Value = eng
|
98 |
|
99 |
End Sub
|
100 |
|
101 |
Sub OnGroupExpand(ByVal id As Integer, ByVal status As Boolean) Implements PropertyManagerPage2Handler2.OnGroupExpand
|
102 |
|
103 |
End Sub
|
104 |
|
105 |
Function OnHelp() As Boolean Implements PropertyManagerPage2Handler2.OnHelp
|
106 |
OnHelp = True
|
107 |
MsgBox("On vient de cliquer sur l'aide")
|
108 |
End Function
|
109 |
|
110 |
Sub OnListboxSelectionChanged(ByVal id As Integer, ByVal item As Integer) Implements PropertyManagerPage2Handler2.OnListboxSelectionChanged
|
111 |
|
112 |
End Sub
|
113 |
|
114 |
Function OnNextPage() As Boolean Implements PropertyManagerPage2Handler2.OnNextPage
|
115 |
OnNextPage = True
|
116 |
|
117 |
End Function
|
118 |
|
119 |
Sub OnNumberboxChanged(ByVal id As Integer, ByVal val As Double) Implements PropertyManagerPage2Handler2.OnNumberboxChanged
|
120 |
'MsgBox(" Valeur de l'arrondi: " & EnregistrementCode.NumberArrondi.Value())
|
121 |
End Sub
|
122 |
|
123 |
Sub OnOptionCheck(ByVal id As Integer) Implements PropertyManagerPage2Handler2.OnOptionCheck
|
124 |
|
125 |
End Sub
|
126 |
|
127 |
Function OnPreviousPage() As Boolean Implements PropertyManagerPage2Handler2.OnPreviousPage
|
128 |
OnPreviousPage = True
|
129 |
End Function
|
130 |
|
131 |
Sub OnSelectionboxCalloutCreated(ByVal id As Integer) Implements PropertyManagerPage2Handler2.OnSelectionboxCalloutCreated
|
132 |
|
133 |
End Sub
|
134 |
|
135 |
Sub OnSelectionboxCalloutDestroyed(ByVal id As Integer) Implements PropertyManagerPage2Handler2.OnSelectionboxCalloutDestroyed
|
136 |
|
137 |
End Sub
|
138 |
|
139 |
Sub OnSelectionboxFocusChanged(ByVal Id As Integer) Implements PropertyManagerPage2Handler2.OnSelectionboxFocusChanged
|
140 |
|
141 |
End Sub
|
142 |
|
143 |
Sub OnSelectionboxListChanged(ByVal id As Integer, ByVal item As Integer) Implements PropertyManagerPage2Handler2.OnSelectionboxListChanged
|
144 |
|
145 |
End Sub
|
146 |
|
147 |
Sub OnTextboxChanged(ByVal id As Integer, ByVal text As String) Implements PropertyManagerPage2Handler2.OnTextboxChanged
|
148 |
|
149 |
End Sub
|
150 |
End Class
|
151 |
End Namespace |