211 |
|
swEnt = sketchCercle : swEnt.Select2(False, 1) |
212 |
|
swEnt = sketch : swEnt.Select2(True, 4) |
213 |
|
|
214 |
< |
feat = swFeatManager.InsertProtrusionSwept3(False, False, 0, False, False, 1, 1, False, 0, 0, 0, 0, merge, 1, 1, 0, 1) ' merge fait additionner le bnouveau corps... Pas certain du false qui suit. |
214 |
> |
feat = swFeatManager.InsertProtrusionSwept3(False, False, 0, False, False, swTangencyType_e.swTangencyNone, swTangencyType_e.swTangencyNone, False, 0, 0, 0, 0, 0, 1, 1, 0, 1) |
215 |
|
|
216 |
|
If feat Is Nothing Then |
217 |
|
swEnt = sketchCercle : swEnt.Select2(False, 1) |
218 |
|
swEnt = sketch : swEnt.Select2(True, 4) |
219 |
< |
feat = swFeatManager.InsertProtrusionSwept3(False, False, 0, False, False, 0, 0, False, 0, 0, 0, 0, 0, 1, 1, 0, 1) |
219 |
> |
feat = swFeatManager.InsertProtrusionSwept3(False, False, 0, False, False, swTangencyType_e.swTangencyNone, swTangencyType_e.swTangencyNone, False, 0, 0, 0, 0, 0, 1, 1, 0, 1) |
220 |
|
End If |
221 |
|
|
222 |
|
If feat Is Nothing Then |
227 |
|
End If |
228 |
|
|
229 |
|
Dim vfaces As Object = feat.GetFaces |
230 |
< |
Dim swface As SldWorks.Face2 = vfaces(0) |
230 |
> |
Dim swface As sldworks.Face2 = vfaces(0) |
231 |
|
Me.BodySweep = swface.GetBody |
232 |
|
|
233 |
|
|
403 |
|
featmanager = swModel.FeatureManager |
404 |
|
feat = Nothing |
405 |
|
sfaceVol = Me.sFaceVolume |
406 |
< |
faces = sfaceVol.GetFaces |
406 |
> |
'faces = sfaceVol.GetFaces |
407 |
|
Dim scoque As SlyFaceCoque = Me.sFaceCoque |
408 |
|
|
409 |
< |
For q As Integer = 0 To UBound(faces) |
410 |
< |
swfaceVol = faces(q) |
411 |
< |
' merde, on a 3 fois la même face??? vérifier que le for each marche bien et/ou que le .ToArray du faces est corect. |
412 |
< |
If swModel.ClosestDistance(swfaceVol, Me.BodySweep, Nothing, Nothing) < Epsilon Then |
413 |
< |
|
414 |
< |
swModel.ClearSelection2(True) |
415 |
< |
Do While swFaceSweep IsNot Nothing ' les faces coupantes (celles du sweep) ont un mark de 16 |
416 |
< |
swent = swFaceSweep : swent.Select2(True, 16) |
417 |
< |
swFaceSweep = swFaceSweep.GetNextFace |
418 |
< |
Loop |
419 |
< |
|
420 |
< |
' sélection de la bonne face de coque: |
421 |
< |
'swent = swfaceCoque : swent.Select2(True, 16) |
422 |
< |
Me.SelectionneBonneCoque(True, 16) |
423 |
< |
swent = swfaceVol : swent.Select2(True, 32) |
424 |
< |
feat = featmanager.InsertSplitLineIntersect(7) |
425 |
< |
If feat IsNot Nothing Then Exit For |
409 |
> |
'For q As Integer = 0 To UBound(faces) |
410 |
> |
'swfaceVol = faces(q) |
411 |
> |
' merde, on a 3 fois la même face??? vérifier que le for each marche bien et/ou que le .ToArray du faces est corect. |
412 |
> |
' If swModel.ClosestDistance(swfaceVol, Me.BodySweep, Nothing, Nothing) < Epsilon Then |
413 |
> |
|
414 |
> |
swModel.ClearSelection2(True) |
415 |
> |
Do While swFaceSweep IsNot Nothing ' les faces coupantes (celles du sweep) ont un mark de 16 |
416 |
> |
swent = swFaceSweep : swent.Select2(True, 16) |
417 |
> |
swFaceSweep = swFaceSweep.GetNextFace |
418 |
> |
Loop |
419 |
> |
|
420 |
> |
' sélection de la bonne face de coque: |
421 |
> |
'Me.SelectionneBonneCoque(True, 16) |
422 |
> |
Me.sFaceCoque.SelectionnerToutes(16, True) |
423 |
> |
|
424 |
> |
' sélection de tout le volume |
425 |
> |
Dim swBod As sldworks.Body2 = Me.sFaceVolume.SwFace.GetBody : swBod.Select(True, 32) |
426 |
> |
'swent = swfaceVol : swent.Select2(True, 32) |
427 |
|
|
428 |
< |
End If |
429 |
< |
Next |
428 |
> |
feat = featmanager.InsertSplitLineIntersect(7) |
429 |
> |
'If feat IsNot Nothing Then Exit For |
430 |
> |
|
431 |
> |
' End If |
432 |
> |
'Next |
433 |
|
|
434 |
|
If feat Is Nothing Then |
435 |
|
If swApp.SendMsgToUser2("Solidworks est incapable de découper la face du volume, entre " & Me.sFaceCoque.nom & " et " & Me.sFaceVolume.nom & vbCr & " La géométrie est trop compliquée pour solidworks!", swconst.swMessageBoxIcon_e.swMbWarning, swconst.swMessageBoxBtn_e.swMbRetryCancel) = swconst.swMessageBoxResult_e.swMbHitCancel Then Exit Sub |
443 |
|
|
444 |
|
For Each swfaceVol In vfaces ' sélectionne les faces découpées. |
445 |
|
If Not swfaceVol.GetBody Is Me.BodySweep Then |
446 |
+ |
If swfaceVol Is Nothing Then Exit For |
447 |
|
sfaceVol.AjouterFace(swfaceVol) |
448 |
< |
'là on a une conneraie, la face originale n'est pas dans la liste des faces de vFaces |
448 |
> |
'là on a une connerie, la face originale n'est pas dans la liste des faces de vFaces |
449 |
|
'et le pointeur original semble détruit |
450 |
|
' puisque ajouterface ne créé pas de doubles, on va chercher des faces que l'on mettra dans la liste |
451 |
|
' la grosse face en fera automatiquement partie. |
661 |
|
Next |
662 |
|
End If |
663 |
|
swFaces = lstfaces.ToArray |
664 |
< |
GoTo second_essai |
664 |
> |
'GoTo second_essai |
665 |
|
End If |
666 |
|
|
667 |
|
|