63 |
|
If path Is Nothing Or path = "" Then MsgBox("Aucun fichier sélectionné, sortie du programme!", MsgBoxStyle.Critical, "Erreur!") : Return "" |
64 |
|
|
65 |
|
'MsgBox("Début de la routine de pré-optimisation" & vbCr & vbCr & "l'écart nodal global est de : " & Eng & vbCr & "La zone de transition : " & NbCouches & vbCr & "Les arrondis sont à : " & Arrondis & vbCr & "Arretes rentrantes: " & rentrant & vbCr & "Les retraits matière: " & matiere & vbCr & vbCr & "Arrondi = " & ArrondiBool & vbCr & "Rentrant = " & rentrantBool & vbCr & "Matiere = " & matiereBool) |
66 |
< |
vBodies = swPart.GetBodies2(SwConst.swBodyType_e.swAllBodies, True) |
66 |
> |
vBodies = swPart.GetBodies2(swconst.swBodyType_e.swAllBodies, True) |
67 |
> |
|
68 |
> |
Erase TabPoints ' Sylvain : modifs si on veut plus d'un corps |
69 |
> |
Erase Tabface |
70 |
> |
Erase TabFaceDouble |
71 |
> |
Erase TabEdge |
72 |
> |
Erase TabEdgeDouble |
73 |
> |
cpt = 0 |
74 |
> |
BoiteEnglobante() ' Sylvain: Ajouté car je veut la boite totale, et non la boite de chaque volume |
75 |
> |
|
76 |
|
For Each vbody In vBodies |
77 |
< |
cpt = 0 |
78 |
< |
Erase TabPoints |
79 |
< |
Erase Tabface |
80 |
< |
Erase TabFaceDouble |
81 |
< |
Erase TabEdge |
82 |
< |
Erase TabEdgeDouble |
77 |
> |
'cpt = 0 |
78 |
> |
'Erase TabPoints |
79 |
> |
'Erase Tabface |
80 |
> |
'Erase TabFaceDouble |
81 |
> |
'Erase TabEdge |
82 |
> |
'Erase TabEdgeDouble |
83 |
|
|
84 |
|
swbody = vbody |
85 |
< |
BoiteEnglobante() |
85 |
> |
'BoiteEnglobante() ' Sylvain: Retiré car je veut la boite totale, et non la boite de chaque volume |
86 |
|
initialisation() |
87 |
|
|
88 |
|
'initialistation de la grille |
129 |
|
fichiertxt(Eng, path) |
130 |
|
swModel.ClearSelection2(True) |
131 |
|
testPog(False, False, False, True, False) |
132 |
< |
Return path |
132 |
> |
'Return path |
133 |
|
Next vbody |
134 |
< |
|
134 |
> |
Return path ' Sylvain : je crois que ça va à l'extérieur de la boucle... |
135 |
|
End Function |
136 |
|
|
137 |
|
''' <summary> |
163 |
|
path = Txtpath(path) |
164 |
|
If path Is Nothing Or path = "" Then MsgBox("Aucun fichier sélectionné, sortie du programme!", MsgBoxStyle.Critical, "Erreur!") : Return "" |
165 |
|
|
166 |
< |
vBodies = swPart.GetBodies2(SwConst.swBodyType_e.swAllBodies, True) |
166 |
> |
vBodies = swPart.GetBodies2(swconst.swBodyType_e.swAllBodies, True) |
167 |
> |
|
168 |
> |
cpt = 0 ' Sylvain: Ajouté pour traiter plus d'un corps |
169 |
> |
Erase TabPoints |
170 |
> |
Erase Tabface |
171 |
> |
Erase TabFaceDouble |
172 |
> |
Erase TabEdge |
173 |
> |
Erase TabEdgeDouble |
174 |
> |
|
175 |
> |
BoiteEnglobante() ' Sylvain: Ajouté car je veut la boite totale, et non la boite de chaque volume |
176 |
|
For Each vbody In vBodies |
177 |
< |
cpt = 0 |
178 |
< |
Erase TabPoints |
179 |
< |
Erase Tabface |
180 |
< |
Erase TabFaceDouble |
181 |
< |
Erase TabEdge |
182 |
< |
Erase TabEdgeDouble |
177 |
> |
'cpt = 0 |
178 |
> |
'Erase TabPoints |
179 |
> |
'Erase Tabface |
180 |
> |
'Erase TabFaceDouble |
181 |
> |
'Erase TabEdge |
182 |
> |
'Erase TabEdgeDouble |
183 |
|
|
184 |
|
swbody = vbody |
185 |
< |
BoiteEnglobante() |
185 |
> |
'BoiteEnglobante() ' Sylvain: Retiré car je veut la boite totale, et non la boite de chaque volume |
186 |
|
initialisation() |
187 |
|
|
188 |
|
'Calul de Eng |
212 |
|
fichiertxt(Eng, path) |
213 |
|
swModel.ClearSelection2(True) |
214 |
|
testPog(False, False, False, True, False) |
215 |
< |
Return path |
215 |
> |
'Return path |
216 |
|
Next vbody |
217 |
+ |
Return path ' sylvain : Je crios aussi que ça vient à l'extérieur de la boucle |
218 |
|
End Function |
219 |
|
|
220 |
|
Sub entitéselection(ByRef coeff As Double, ByRef Ind As Boolean) |
1405 |
|
End If |
1406 |
|
Return path |
1407 |
|
End Function |
1408 |
+ |
|
1409 |
+ |
|
1410 |
|
Sub BoiteEnglobante() |
1411 |
|
' Ecrit la boite englobante dans le tableau de points |
1412 |
< |
Dim BodyBox() As Double |
1413 |
< |
Dim cpt1 As Integer |
1412 |
> |
Dim vBox As Object = swPart.GetPartBox(True) |
1413 |
> |
Dim box() As Double = vBox |
1414 |
|
|
1415 |
< |
BodyBox = swbody.GetBodyBox |
1416 |
< |
ReDim Preserve TabPoints(8, cpt) |
1415 |
> |
Dim centre(2) As Double ' le centre de la boite englobante |
1416 |
> |
Dim longueurs(2) As Double |
1417 |
|
|
1418 |
< |
For cpt1 = 0 To 5 |
1419 |
< |
TabPoints(cpt1, 0) = BodyBox(cpt1) |
1420 |
< |
Next cpt1 |
1418 |
> |
centre(0) = (box(3) + box(0)) / 2 |
1419 |
> |
centre(1) = (box(4) + box(1)) / 2 |
1420 |
> |
centre(2) = (box(5) + box(2)) / 2 |
1421 |
> |
|
1422 |
> |
longueurs(0) = (box(3) - box(0)) * 1.25 |
1423 |
> |
longueurs(1) = (box(4) - box(1)) * 1.25 |
1424 |
> |
longueurs(2) = (box(5) - box(2)) * 1.25 |
1425 |
> |
|
1426 |
> |
ReDim Preserve TabPoints(8, cpt) |
1427 |
> |
TabPoints(0, 0) = centre(0) - longueurs(0) / 2 |
1428 |
> |
TabPoints(1, 0) = centre(1) - longueurs(1) / 2 |
1429 |
> |
TabPoints(2, 0) = centre(2) - longueurs(2) / 2 |
1430 |
> |
TabPoints(3, 0) = centre(0) + longueurs(0) / 2 |
1431 |
> |
TabPoints(4, 0) = centre(1) + longueurs(1) / 2 |
1432 |
> |
TabPoints(5, 0) = centre(2) + longueurs(2) / 2 |
1433 |
> |
|
1434 |
> |
'Dim BodyBox() As Double |
1435 |
> |
'Dim cpt1 As Integer |
1436 |
> |
'BodyBox = swbody.GetBodyBox |
1437 |
> |
'ReDim Preserve TabPoints(8, cpt) |
1438 |
> |
|
1439 |
> |
'For cpt1 = 0 To 5 |
1440 |
> |
' TabPoints(cpt1, 0) = BodyBox(cpt1) |
1441 |
> |
'Next cpt1 |
1442 |
|
|
1443 |
|
End Sub |
1444 |
|
Sub initialisation() |