1 |
+ |
Imports SolidWorks.Interop |
2 |
+ |
Imports SolidWorks.Interop.swconst |
3 |
+ |
Imports SolidWorks.Interop.swpublished |
4 |
+ |
|
5 |
|
Namespace ConditionsAuxLimites |
6 |
|
Module CLCode |
7 |
|
|
28 |
|
|
29 |
|
Dim Note As SldWorks.Note |
30 |
|
Dim Annotation As SldWorks.Annotation |
31 |
< |
Dim TextFormat As Object = nothing |
31 |
> |
Dim TextFormat As Object = Nothing |
32 |
|
Note = swPart.InsertNote(TypeCl & "," & valeur) |
33 |
|
If Not Note Is Nothing Then |
34 |
|
Note.Angle = 0 |
185 |
|
selMgr = swModel.SelectionManager |
186 |
|
|
187 |
|
For i = 1 To selMgr.GetSelectedObjectCount |
188 |
< |
If selMgr.GetSelectedObjectType2(i) = SwConst.swSelectType_e.swSelPOINTREFS Then |
188 |
> |
If selMgr.GetSelectedObjectType2(i) = swconst.swSelectType_e.swSelPOINTREFS Then |
189 |
|
' transformer la sélection d'un pointref en une sélection de vertex |
190 |
|
Dim coords(2) As Double |
191 |
|
Dim vretval As Object |
208 |
|
If Not swModel.AndSelectByID(Nothing, "VERTEX", lstpoints(j + 0), lstpoints(j + 1), lstpoints(j + 2)) Then MsgBox("Échec") |
209 |
|
Dim swsommet As SldWorks.Vertex |
210 |
|
|
211 |
< |
swModel.SelectAt(SwConst.swSelectType_e.swSelVERTICES, lstpoints(j + 0), lstpoints(j + 1), lstpoints(j + 2)) |
211 |
> |
swModel.SelectAt(swconst.swSelectType_e.swSelVERTICES, lstpoints(j + 0), lstpoints(j + 1), lstpoints(j + 2)) |
212 |
|
swEnt = selMgr.GetSelectedObject5(1) |
213 |
|
swsommet = swEnt |
214 |
|
|
222 |
|
|
223 |
|
For Each swEnt In listeentite |
224 |
|
If swEnt IsNot Nothing Then |
225 |
+ |
retour: |
226 |
|
Select Case swEnt.GetType |
227 |
< |
Case SwConst.swSelectType_e.swSelVERTICES |
227 |
> |
Case swconst.swSelectType_e.swSelVERTICES |
228 |
|
Dim swSommet As SldWorks.Vertex |
229 |
|
swSommet = swEnt |
230 |
|
CL = New EncapCL(swSommet) |
231 |
|
|
232 |
< |
Case SwConst.swSelectType_e.swSelEDGES |
232 |
> |
Case swconst.swSelectType_e.swSelEDGES |
233 |
|
Dim swArete As SldWorks.Edge |
234 |
|
swArete = swEnt |
235 |
|
CL = New EncapCL(swArete) |
236 |
|
|
237 |
< |
Case SwConst.swSelectType_e.swSelFACES |
237 |
> |
Case swconst.swSelectType_e.swSelFACES |
238 |
|
Dim swFace As SldWorks.Face2 |
239 |
|
swFace = swEnt |
240 |
|
CL = New EncapCL(swFace) |
241 |
< |
|
241 |
> |
Case swconst.swSelectType_e.swSelATTRIBUTES |
242 |
> |
Dim attr As SldWorks.Attribute = swEnt |
243 |
> |
swEnt = attr.GetEntity2() |
244 |
> |
GoTo retour |
245 |
|
Case Else |
246 |
|
'MsgBox("Une entité sélectionnée ne peut avoir de condition aux limites -->" & selMgr.GetSelectedObjectType2(i)) |
247 |
|
|
252 |
|
Next swEnt |
253 |
|
End Sub |
254 |
|
|
255 |
< |
End Module |
255 |
> |
End Module |
256 |
|
End Namespace |