1 |
+ |
Imports SolidWorks.Interop |
2 |
+ |
Imports SolidWorks.Interop.swconst |
3 |
+ |
Imports SolidWorks.Interop.swpublished |
4 |
+ |
|
5 |
|
Public Class SuperSommet |
6 |
|
Inherits SuperEntite |
7 |
|
Public swSommet As SldWorks.Vertex |
136 |
|
Public Overrides Sub Selectionner(Optional ByVal Mark As Integer = 0, Optional ByRef Append As Boolean = True) |
137 |
|
Dim swent As SldWorks.Entity |
138 |
|
swent = swSommet |
139 |
< |
swent.Select2(append, Mark) |
139 |
> |
swent.Select2(Append, Mark) |
140 |
|
End Sub |
141 |
|
|
142 |
|
|
157 |
|
''' <returns></returns> |
158 |
|
''' <remarks></remarks> |
159 |
|
Public Function GetX() As Double |
160 |
< |
Return Me.x |
160 |
> |
Return Me.X |
161 |
|
End Function |
162 |
|
|
163 |
|
''' <summary> |
166 |
|
''' <returns></returns> |
167 |
|
''' <remarks></remarks> |
168 |
|
Public Function GetY() As Double |
169 |
< |
Return Me.y |
169 |
> |
Return Me.Y |
170 |
|
End Function |
171 |
|
|
172 |
|
''' <summary> |
175 |
|
''' <returns></returns> |
176 |
|
''' <remarks></remarks> |
177 |
|
Public Function GetZ() As Double |
178 |
< |
Return Me.z |
178 |
> |
Return Me.Z |
179 |
|
End Function |
180 |
|
|
181 |
|
|
214 |
|
nom = "Doublon" & CStr(no) |
215 |
|
attr = Intersections.DefAttrDoublon.CreateInstance5(swModel, Me.swSommet, nom, 0, 2) |
216 |
|
no += 1 |
217 |
+ |
If no > 1000 Then MsgBox("Incapable de mettre un attribut sur un sommet non sélectionnable!") : no -= 500 : Exit While |
218 |
|
End While |
219 |
|
|
220 |
|
ParamMaitre = attr.GetParameter("Maitre") |
221 |
|
ParamMaitre.SetStringValue2(NomMaitre, 2, "") ' swAllConfiguration = 2 |
222 |
|
|
223 |
< |
GererDossiers("Doublons", nom) |
223 |
> |
'GererDossiers("Doublons", nom) |
224 |
|
no += 1 |
225 |
|
Me.colorer() |
226 |
|
|
227 |
|
End Sub |
228 |
|
|
229 |
|
|
230 |
< |
|
230 |
> |
''' <summary> |
231 |
> |
''' Colore le sommet pour l'identifier plus facilement |
232 |
> |
''' </summary> |
233 |
> |
''' <param name="rouge">Valeur du rouge (entre 0 et 255)</param> |
234 |
> |
''' <param name="vert">Valeur du vert (entre 0 et 255)</param> |
235 |
> |
''' <param name="bleu">Valeur du bleu (entre 0 et 255)</param> |
236 |
> |
''' <param name="epaisseur">La grosseur du point</param> |
237 |
> |
''' <remarks></remarks> |
238 |
|
Public Sub colorer(Optional ByVal rouge As Integer = 255, Optional ByVal vert As Integer = 0, Optional ByVal bleu As Integer = 0, Optional ByVal epaisseur As Double = 1.5) |
239 |
|
Me.swSommet.display(swModel, RGB(rouge, vert, bleu), epaisseur, True) |
240 |
|
End Sub |
241 |
+ |
|
242 |
+ |
|
243 |
+ |
|
244 |
+ |
''' <summary> |
245 |
+ |
''' Sélectionne l'arète, mais s'assure de ne pas la désélectionner si elle est déjà sélectionnée |
246 |
+ |
''' </summary> |
247 |
+ |
''' <remarks>Pas très rapide...</remarks> |
248 |
+ |
Public Sub SelectionnerSafe() |
249 |
+ |
Dim swEnt As sldworks.Entity = Me.swSommet |
250 |
+ |
Dim selMgr As sldworks.SelectionMgr = swModel.SelectionManager |
251 |
+ |
|
252 |
+ |
For i As Integer = 1 To selMgr.GetSelectedObjectCount2(-1) |
253 |
+ |
If selMgr.GetSelectedObject6(i, -1) Is swEnt Then |
254 |
+ |
Exit Sub |
255 |
+ |
End If |
256 |
+ |
Next |
257 |
+ |
|
258 |
+ |
swEnt.Select4(True, Nothing) |
259 |
+ |
End Sub |
260 |
+ |
|
261 |
+ |
|
262 |
+ |
''' <summary> |
263 |
+ |
''' Retourne vrai si les 2 sommets sont identiques... |
264 |
+ |
''' </summary> |
265 |
+ |
''' <param name="swSommet"></param> |
266 |
+ |
''' <returns></returns> |
267 |
+ |
''' <remarks></remarks> |
268 |
+ |
Public Function Comparer(ByRef swSommet As sldworks.Vertex) As Boolean |
269 |
+ |
If Commun.Distance(Me.swSommet, swSommet) < Epsilon Then Return True |
270 |
+ |
End Function |
271 |
+ |
|
272 |
|
End Class |