60 |
|
Private vcheckboxOriginal As Boolean |
61 |
|
Private vcheckboxModifie As Boolean |
62 |
|
|
63 |
+ |
Public checkboxMiniSurCoque As sldworks.PropertyManagerPageCheckbox |
64 |
+ |
Public checkboxMultidecoupage As sldworks.PropertyManagerPageCheckbox |
65 |
+ |
|
66 |
|
Public decoupe As Boolean ' pas le choix, si je met la variable dans le page handler, il plante à la fermeture. |
67 |
|
Public POGManuel As Boolean |
68 |
|
Public PogAutomatique As Boolean |
79 |
|
Dim nomFichier As String |
80 |
|
Dim nomfichier2 As String |
81 |
|
Dim NomFichierPog As String = Nothing |
82 |
+ |
Dim temps As Integer = My.Computer.Clock.TickCount |
83 |
+ |
Dim tempsTraitement As Integer |
84 |
+ |
Dim tempsFusion As Integer |
85 |
|
'Dim NomAppli As String |
86 |
|
|
87 |
+ |
Commun.NomFichierPog = Nothing ' remettre la valeur à 0... |
88 |
|
If Not sauvegarder Then Return |
89 |
< |
|
89 |
> |
Commun.ÉcartNodal = vNumberENG |
90 |
|
If POGManuel Then |
91 |
< |
NomFichierPog = PoGCode.DebutManuel(vNumberENG, Int(vNumberbox1), vcheckArrondi, vNumberArrondi, vcheckRentrant, vNumberRentrant, vcheckMatiere, vNumberMatiere, vcheckEntites, selectionpog, vNumberentités, vCheckEnt) |
91 |
> |
Commun.NomFichierPog = PoGCode.DebutManuel(vNumberENG, Int(vNumberbox1), vcheckArrondi, vNumberArrondi, vcheckRentrant, vNumberRentrant, vcheckMatiere, vNumberMatiere, vcheckEntites, selectionpog, vNumberentités, vCheckEnt) |
92 |
|
ElseIf PogAutomatique Then |
93 |
< |
NomFichierPog = PoGCode.DebutAutomatique(ValeurSliderRemi, limiteur.Value) |
93 |
> |
Commun.NomFichierPog = PoGCode.DebutAutomatique(ValeurSliderRemi, limiteur.Value) |
94 |
|
End If |
95 |
|
|
96 |
|
|
97 |
|
swModel.Save3(SwConst.swSaveAsOptions_e.swSaveAsOptions_AvoidRebuildOnSave, errors, warnings) |
98 |
|
|
99 |
|
|
93 |
– |
|
100 |
|
' on vient de cliquer sur le bouton ok pour enregistrer |
101 |
|
nomFichier = swModel.GetPathName() |
102 |
|
nomfichier2 = Left(nomFichier, Len(nomFichier) - 7) |
127 |
|
Try |
128 |
|
Intersections.Debuter(nomfichier2, nomFichier, checkboxOriginal.Checked, checkboxModifie.Checked) |
129 |
|
Catch |
130 |
< |
MsgBox("Debuter n'a pas fonctionner") |
130 |
> |
If MsgBox("Debuter n'a pas fonctionner" & vbCr & "Quitter?", MsgBoxStyle.YesNo, "Quitter le calcul") = MsgBoxResult.Yes Then Exit Sub |
131 |
|
End Try |
132 |
|
End If |
133 |
|
|
134 |
+ |
'If MsgBox("Continuer", MsgBoxStyle.YesNo) = MsgBoxResult.No Then Exit Sub |
135 |
+ |
|
136 |
|
Commun.videliste() |
137 |
|
Commun.GenererListes() |
138 |
+ |
tempsTraitement = My.Computer.Clock.TickCount - temps |
139 |
+ |
temps = My.Computer.Clock.TickCount |
140 |
+ |
Try |
141 |
+ |
If decoupe Then Intersections.FairePreCarte() |
142 |
+ |
Catch |
143 |
+ |
MsgBox("Faire pré-carte n'a pas fonctionner") |
144 |
+ |
End Try |
145 |
+ |
|
146 |
|
Commun.MettreNoms() ' place les noms des SlyClasses sur les entités. |
147 |
|
If decoupe Then Fusion() ' met un attribut sur les sommets et arètes doubles (pour que MAGiC ne les maille pas 2 fois. |
148 |
< |
|
133 |
< |
|
134 |
< |
swModel.Save3(SwConst.swSaveAsOptions_e.swSaveAsOptions_AvoidRebuildOnSave, errors, warnings) |
148 |
> |
swModel.Save3(swconst.swSaveAsOptions_e.swSaveAsOptions_AvoidRebuildOnSave, errors, warnings) |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
If vcheckboxOriginal And vcheckboxModifie Then |
153 |
|
' on veut garder le modèle modifié et faire apparaitre le modèle original |
154 |
< |
swApp.OpenDoc6(nomFichier, SwConst.swDocumentTypes_e.swDocPART, 0, 0, errors, warnings) |
154 |
> |
swApp.OpenDoc6(nomFichier, swconst.swDocumentTypes_e.swDocPART, 0, 0, errors, warnings) |
155 |
|
|
156 |
|
ElseIf vcheckboxOriginal And Not vcheckboxModifie Then |
157 |
|
' on veut recharger le modèle original et cacher le model modifié |
166 |
|
swApp.CloseDoc(nomfichier2) |
167 |
|
End If |
168 |
|
|
169 |
< |
|
170 |
< |
|
171 |
< |
|
172 |
< |
MsgBox("Enregistrement terminé!", MsgBoxStyle.Exclamation) |
169 |
> |
PogAutomatique = False |
170 |
> |
POGManuel = False |
171 |
> |
decoupe = False |
172 |
> |
tempsFusion = My.Computer.Clock.TickCount - temps |
173 |
> |
MsgBox("Enregistrement terminé!" & vbCr & vbCr & "Dans un temps de traitement de " & tempsTraitement & " Millisecondes" & vbCr & " Et un temps de fusion de " & tempsFusion & " Millisecondes", MsgBoxStyle.Exclamation) |
174 |
|
|
175 |
|
End Sub |
176 |
|
|
218 |
|
|
219 |
|
vcheckboxOriginal = checkboxOriginal.Checked |
220 |
|
vcheckboxModifie = checkboxModifie.Checked |
221 |
+ |
ValeurSliderRemi = curseur.Position |
222 |
|
|
223 |
+ |
Intersections.MettreMiniPoutresSurFaceInternes = EnregistrementCode.checkboxMiniSurCoque.Checked |
224 |
+ |
Intersections.MultiDecoupageCoques = EnregistrementCode.checkboxMultidecoupage.Checked |
225 |
|
|
226 |
|
End Sub |
227 |
|
|
264 |
|
|
265 |
|
Dim num As Integer |
266 |
|
' maintenant les arètes doublons entre les coques et les volumes |
267 |
< |
For Each sAreteCoque As SlyAreteCoque In Commun.lst_AreteCoque |
267 |
> |
For Each sAreteCoque3 As SlyAreteCoque In Commun.lst_AreteCoque |
268 |
|
For Each sAreteVol As SlyAreteVol In Commun.lst_AreteVolume |
269 |
< |
If sAreteCoque.Comparer((sAreteVol)) Then ' arêtes doivent être fusionnées |
270 |
< |
sAreteCoque.MettreAttributDoublon(num, False, sAreteVol.nom) |
269 |
> |
If sAreteCoque3.comparer((sAreteVol)) Then ' arêtes doivent être fusionnées |
270 |
> |
sAreteCoque3.MettreAttributDoublon(num, False, sAreteVol.nom) |
271 |
|
'sAreteCoque.Colorer(2, 1, 1, 0) |
272 |
|
num += 1 |
273 |
|
End If |
275 |
|
Next |
276 |
|
|
277 |
|
|
278 |
< |
' on parcourt la liste des features et on mémorise les DoublonsA |
279 |
< |
'Dim feat As SldWorks.Feature, featMaitre As SldWorks.Feature, featEsclave As SldWorks.Feature |
262 |
< |
'Dim vSupprime As Object |
263 |
< |
'Dim bsupprime As Boolean |
264 |
< |
'Dim NomFeat As String |
265 |
< |
'Dim lst_Maitre As New Collections.Generic.Dictionary(Of Integer, SldWorks.Edge) |
266 |
< |
'Dim lst_esclave As New Collections.Generic.Dictionary(Of Integer, SldWorks.Edge) |
267 |
< |
|
268 |
< |
'Dim attrM As SldWorks.Attribute = Nothing, attrE As SldWorks.Attribute = Nothing |
269 |
< |
'Dim swEnt As SldWorks.Entity |
270 |
< |
'Dim swAreteMaitre As SldWorks.Edge |
271 |
< |
'Dim swAreteEsclave As SldWorks.Edge |
272 |
< |
'Dim EncapM As SuperArete |
273 |
< |
'Dim EncapE As SuperArete |
274 |
< |
|
275 |
< |
'feat = swPart.FirstFeature |
278 |
> |
'Pour les arètes de coques entre elles... |
279 |
> |
Dim sAreteCoque, sAreteCoque2 As SlyAreteCoque |
280 |
|
|
277 |
– |
'Do While Not feat Is Nothing |
281 |
|
|
282 |
< |
' vSupprime = feat.IsSuppressed |
283 |
< |
' bSupprime = CBool(vSupprime) |
284 |
< |
' If Not bSupprime Then ' on vérifie que l'entité est pas supprimée |
285 |
< |
|
283 |
< |
' NomFeat = feat.Name ' retourne le nom du feature |
284 |
< |
' If Left(NomFeat, 8) = "DoublonA" Then |
285 |
< |
|
286 |
< |
' If InStr(NomFeat, "Maitre") <> 0 Then |
287 |
< |
' attrM = feat.GetSpecificFeature2() : swEnt = attrM.GetEntity() : swAreteMaitre = attrM.GetEntity2() |
288 |
< |
' If Not swAreteMaitre Is Nothing Then lst_Maitre.Add(CInt(Mid(NomFeat, 10, 3)), swAreteMaitre) Else MsgBox("Problème à trouver l'arète maitre") |
289 |
< |
|
290 |
< |
' ElseIf InStr(NomFeat, "Esclave") <> 0 Then |
291 |
< |
' attrE = feat.GetSpecificFeature2() : swEnt = attrE.GetEntity() : swAreteEsclave = attrE.GetEntity2() |
292 |
< |
' If Not swAreteEsclave Is Nothing Then lst_esclave.Add(CInt(Mid(NomFeat, 10, 3)), swAreteEsclave) Else MsgBox("Problème à trouver l'arète esclave") |
293 |
< |
|
294 |
< |
' End If |
295 |
< |
|
296 |
< |
' End If |
297 |
< |
' End If |
298 |
< |
' feat = feat.GetNextFeature |
299 |
< |
'Loop |
282 |
> |
For i As Integer = 0 To Commun.lst_AreteCoque.Count - 2 |
283 |
> |
For j As Integer = i + 1 To Commun.lst_AreteCoque.Count - 1 |
284 |
> |
sAreteCoque = Commun.lst_AreteCoque.Item(i) |
285 |
> |
sAreteCoque2 = Commun.lst_AreteCoque.Item(j) |
286 |
|
|
287 |
+ |
Debug.Print("On essai maintenant " & vbCr & sAreteCoque.nom & vbCr & sAreteCoque2.nom) |
288 |
|
|
289 |
+ |
If sAreteCoque.comparer(sAreteCoque2.swArete) Then |
290 |
+ |
sAreteCoque.MettreAttributDoublon(num, False, sAreteCoque2.nom) |
291 |
+ |
num += 1 |
292 |
|
|
293 |
< |
'On a 2 listes avec des index identiques pour les entrées ... |
304 |
< |
'Dim nomMaitre As String |
305 |
< |
'swModel.EditRebuild3() |
293 |
> |
' on devrait vérifier si les normales des faces sont dans la même direction... |
294 |
|
|
295 |
< |
'For Each numero As Integer In lst_Maitre.Keys |
295 |
> |
End If |
296 |
|
|
297 |
< |
' swAreteMaitre = lst_Maitre.Item(numero) |
298 |
< |
' swAreteEsclave = lst_esclave.Item(numero) |
297 |
> |
Next |
298 |
> |
Next |
299 |
|
|
300 |
< |
' EncapM = New SuperArete(swAreteMaitre, True) : nomMaitre = EncapM.getNom() |
301 |
< |
' EncapE = New SuperArete(swAreteEsclave, True) : Dim effacer As String = EncapE.getNom |
300 |
> |
' maintenant les sommets de coque entre eux. |
301 |
> |
Dim sSommetCoque, sSommetCoque2 As SlySommetCoque |
302 |
|
|
303 |
< |
' EncapE.MettreAttributDoublon(CInt(numero), False, nomMaitre) |
304 |
< |
' EncapM.EffacerAttributDoublon() |
305 |
< |
'Next |
303 |
> |
For i As Integer = 0 To Commun.lst_SommetCoque.Count - 2 |
304 |
> |
For j As Integer = i + 1 To Commun.lst_SommetCoque.Count - 1 |
305 |
> |
sSommetCoque = Commun.lst_SommetCoque.Item(i) |
306 |
> |
sSommetCoque2 = Commun.lst_SommetCoque.Item(j) |
307 |
> |
If sSommetCoque.Comparer(sSommetCoque2.swSommet) Then |
308 |
> |
sSommetCoque.MettreAttributDoublonSommet(sSommetCoque2.nom, sSommetCoque2.swSommet) |
309 |
> |
End If |
310 |
> |
Next |
311 |
> |
Next |
312 |
|
|
313 |
|
|
314 |
|
End Sub |