ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magicsld/Debug_form.vb
Revision: 48
Committed: Wed Aug 22 21:18:12 2007 UTC (18 years ago) by bournival
File size: 27608 byte(s)
Log Message:
On passe aux nouveaux .dll

File Contents

# Content
1 Imports SolidWorks.Interop
2 Imports SolidWorks.Interop.swconst
3 Imports SolidWorks.Interop.swpublished
4
5 Public Class Debug_form
6 Inherits System.Windows.Forms.Form
7
8 #Region " Code généré par le Concepteur Windows Form "
9
10 Public Sub New()
11 MyBase.New()
12
13 'Cet appel est requis par le Concepteur Windows Form.
14 InitializeComponent()
15
16 'Ajoutez une initialisation quelconque après l'appel InitializeComponent()
17
18 End Sub
19
20 'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
21 Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
22 If disposing Then
23 If Not (components Is Nothing) Then
24 components.Dispose()
25 End If
26 End If
27 MyBase.Dispose(disposing)
28 End Sub
29
30 'Requis par le Concepteur Windows Form
31 Private components As System.ComponentModel.IContainer
32
33 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
34 'Elle peut être modifiée en utilisant le Concepteur Windows Form.
35 'Ne la modifiez pas en utilisant l'éditeur de code.
36 Friend WithEvents Label1 As System.Windows.Forms.Label
37 Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
38 Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
39 Friend WithEvents Label2 As System.Windows.Forms.Label
40 Friend WithEvents Label3 As System.Windows.Forms.Label
41 Friend WithEvents Label4 As System.Windows.Forms.Label
42 Friend WithEvents Label5 As System.Windows.Forms.Label
43 Friend WithEvents Label6 As System.Windows.Forms.Label
44 Friend WithEvents Label7 As System.Windows.Forms.Label
45 Friend WithEvents Label8 As System.Windows.Forms.Label
46 Friend WithEvents Label9 As System.Windows.Forms.Label
47 Friend WithEvents Label10 As System.Windows.Forms.Label
48 Friend WithEvents Label11 As System.Windows.Forms.Label
49 Friend WithEvents Label12 As System.Windows.Forms.Label
50 Friend WithEvents Label13 As System.Windows.Forms.Label
51 Friend WithEvents Label14 As System.Windows.Forms.Label
52 Friend WithEvents Label15 As System.Windows.Forms.Label
53 Friend WithEvents Label16 As System.Windows.Forms.Label
54 Friend WithEvents Label17 As System.Windows.Forms.Label
55 Friend WithEvents Label18 As System.Windows.Forms.Label
56 Friend WithEvents Label19 As System.Windows.Forms.Label
57 Friend WithEvents Label20 As System.Windows.Forms.Label
58 Friend WithEvents Label21 As System.Windows.Forms.Label
59 Friend WithEvents Label22 As System.Windows.Forms.Label
60 Friend WithEvents Label23 As System.Windows.Forms.Label
61 Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
62 Friend WithEvents Label24 As System.Windows.Forms.Label
63 Friend WithEvents Label25 As System.Windows.Forms.Label
64 Friend WithEvents Label26 As System.Windows.Forms.Label
65 Friend WithEvents Label27 As System.Windows.Forms.Label
66 Friend WithEvents ListBox2 As System.Windows.Forms.ListBox
67 <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
68 Me.Label1 = New System.Windows.Forms.Label
69 Me.ListBox1 = New System.Windows.Forms.ListBox
70 Me.GroupBox1 = New System.Windows.Forms.GroupBox
71 Me.Label23 = New System.Windows.Forms.Label
72 Me.Label22 = New System.Windows.Forms.Label
73 Me.Label21 = New System.Windows.Forms.Label
74 Me.Label20 = New System.Windows.Forms.Label
75 Me.Label19 = New System.Windows.Forms.Label
76 Me.Label18 = New System.Windows.Forms.Label
77 Me.Label17 = New System.Windows.Forms.Label
78 Me.Label16 = New System.Windows.Forms.Label
79 Me.Label15 = New System.Windows.Forms.Label
80 Me.Label14 = New System.Windows.Forms.Label
81 Me.Label13 = New System.Windows.Forms.Label
82 Me.Label12 = New System.Windows.Forms.Label
83 Me.Label11 = New System.Windows.Forms.Label
84 Me.Label10 = New System.Windows.Forms.Label
85 Me.Label9 = New System.Windows.Forms.Label
86 Me.Label8 = New System.Windows.Forms.Label
87 Me.Label7 = New System.Windows.Forms.Label
88 Me.Label6 = New System.Windows.Forms.Label
89 Me.Label5 = New System.Windows.Forms.Label
90 Me.Label4 = New System.Windows.Forms.Label
91 Me.Label3 = New System.Windows.Forms.Label
92 Me.Label2 = New System.Windows.Forms.Label
93 Me.GroupBox2 = New System.Windows.Forms.GroupBox
94 Me.Label27 = New System.Windows.Forms.Label
95 Me.Label26 = New System.Windows.Forms.Label
96 Me.Label25 = New System.Windows.Forms.Label
97 Me.Label24 = New System.Windows.Forms.Label
98 Me.ListBox2 = New System.Windows.Forms.ListBox
99 Me.GroupBox1.SuspendLayout()
100 Me.GroupBox2.SuspendLayout()
101 Me.SuspendLayout()
102 '
103 'Label1
104 '
105 Me.Label1.Location = New System.Drawing.Point(8, 8)
106 Me.Label1.Name = "Label1"
107 Me.Label1.Size = New System.Drawing.Size(184, 16)
108 Me.Label1.TabIndex = 0
109 Me.Label1.Text = "Poutres et coques sélectionnées:"
110 '
111 'ListBox1
112 '
113 Me.ListBox1.Items.AddRange(New Object() {"gfdgd"})
114 Me.ListBox1.Location = New System.Drawing.Point(8, 24)
115 Me.ListBox1.Name = "ListBox1"
116 Me.ListBox1.Size = New System.Drawing.Size(200, 290)
117 Me.ListBox1.TabIndex = 1
118 '
119 'GroupBox1
120 '
121 Me.GroupBox1.Controls.Add(Me.Label23)
122 Me.GroupBox1.Controls.Add(Me.Label22)
123 Me.GroupBox1.Controls.Add(Me.Label21)
124 Me.GroupBox1.Controls.Add(Me.Label20)
125 Me.GroupBox1.Controls.Add(Me.Label19)
126 Me.GroupBox1.Controls.Add(Me.Label18)
127 Me.GroupBox1.Controls.Add(Me.Label17)
128 Me.GroupBox1.Controls.Add(Me.Label16)
129 Me.GroupBox1.Controls.Add(Me.Label15)
130 Me.GroupBox1.Controls.Add(Me.Label14)
131 Me.GroupBox1.Controls.Add(Me.Label13)
132 Me.GroupBox1.Controls.Add(Me.Label12)
133 Me.GroupBox1.Controls.Add(Me.Label11)
134 Me.GroupBox1.Controls.Add(Me.Label10)
135 Me.GroupBox1.Controls.Add(Me.Label9)
136 Me.GroupBox1.Controls.Add(Me.Label8)
137 Me.GroupBox1.Controls.Add(Me.Label7)
138 Me.GroupBox1.Controls.Add(Me.Label6)
139 Me.GroupBox1.Controls.Add(Me.Label5)
140 Me.GroupBox1.Controls.Add(Me.Label4)
141 Me.GroupBox1.Controls.Add(Me.Label3)
142 Me.GroupBox1.Controls.Add(Me.Label2)
143 Me.GroupBox1.Location = New System.Drawing.Point(216, 8)
144 Me.GroupBox1.Name = "GroupBox1"
145 Me.GroupBox1.Size = New System.Drawing.Size(336, 312)
146 Me.GroupBox1.TabIndex = 2
147 Me.GroupBox1.TabStop = False
148 Me.GroupBox1.Text = "Poutre"
149 '
150 'Label23
151 '
152 Me.Label23.Location = New System.Drawing.Point(120, 280)
153 Me.Label23.Name = "Label23"
154 Me.Label23.Size = New System.Drawing.Size(210, 24)
155 Me.Label23.TabIndex = 21
156 Me.Label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight
157 '
158 'Label22
159 '
160 Me.Label22.Location = New System.Drawing.Point(120, 256)
161 Me.Label22.Name = "Label22"
162 Me.Label22.Size = New System.Drawing.Size(210, 24)
163 Me.Label22.TabIndex = 20
164 Me.Label22.TextAlign = System.Drawing.ContentAlignment.MiddleRight
165 '
166 'Label21
167 '
168 Me.Label21.Location = New System.Drawing.Point(120, 232)
169 Me.Label21.Name = "Label21"
170 Me.Label21.Size = New System.Drawing.Size(210, 24)
171 Me.Label21.TabIndex = 19
172 Me.Label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight
173 '
174 'Label20
175 '
176 Me.Label20.Location = New System.Drawing.Point(120, 200)
177 Me.Label20.Name = "Label20"
178 Me.Label20.Size = New System.Drawing.Size(210, 15)
179 Me.Label20.TabIndex = 18
180 Me.Label20.TextAlign = System.Drawing.ContentAlignment.MiddleRight
181 '
182 'Label19
183 '
184 Me.Label19.Location = New System.Drawing.Point(120, 160)
185 Me.Label19.Name = "Label19"
186 Me.Label19.Size = New System.Drawing.Size(210, 16)
187 Me.Label19.TabIndex = 17
188 Me.Label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight
189 '
190 'Label18
191 '
192 Me.Label18.Location = New System.Drawing.Point(120, 136)
193 Me.Label18.Name = "Label18"
194 Me.Label18.Size = New System.Drawing.Size(210, 16)
195 Me.Label18.TabIndex = 16
196 Me.Label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight
197 '
198 'Label17
199 '
200 Me.Label17.Location = New System.Drawing.Point(120, 112)
201 Me.Label17.Name = "Label17"
202 Me.Label17.Size = New System.Drawing.Size(210, 16)
203 Me.Label17.TabIndex = 15
204 Me.Label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight
205 '
206 'Label16
207 '
208 Me.Label16.Location = New System.Drawing.Point(120, 88)
209 Me.Label16.Name = "Label16"
210 Me.Label16.Size = New System.Drawing.Size(210, 16)
211 Me.Label16.TabIndex = 14
212 Me.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight
213 '
214 'Label15
215 '
216 Me.Label15.Location = New System.Drawing.Point(120, 64)
217 Me.Label15.Name = "Label15"
218 Me.Label15.Size = New System.Drawing.Size(210, 16)
219 Me.Label15.TabIndex = 13
220 Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight
221 '
222 'Label14
223 '
224 Me.Label14.Location = New System.Drawing.Point(120, 40)
225 Me.Label14.Name = "Label14"
226 Me.Label14.Size = New System.Drawing.Size(210, 16)
227 Me.Label14.TabIndex = 12
228 Me.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight
229 '
230 'Label13
231 '
232 Me.Label13.Location = New System.Drawing.Point(120, 16)
233 Me.Label13.Name = "Label13"
234 Me.Label13.Size = New System.Drawing.Size(210, 16)
235 Me.Label13.TabIndex = 11
236 Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight
237 '
238 'Label12
239 '
240 Me.Label12.Location = New System.Drawing.Point(40, 288)
241 Me.Label12.Name = "Label12"
242 Me.Label12.Size = New System.Drawing.Size(64, 16)
243 Me.Label12.TabIndex = 10
244 Me.Label12.Text = "Z"
245 Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight
246 '
247 'Label11
248 '
249 Me.Label11.Location = New System.Drawing.Point(40, 264)
250 Me.Label11.Name = "Label11"
251 Me.Label11.Size = New System.Drawing.Size(64, 16)
252 Me.Label11.TabIndex = 9
253 Me.Label11.Text = "Y"
254 Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight
255 '
256 'Label10
257 '
258 Me.Label10.Location = New System.Drawing.Point(40, 240)
259 Me.Label10.Name = "Label10"
260 Me.Label10.Size = New System.Drawing.Size(64, 16)
261 Me.Label10.TabIndex = 8
262 Me.Label10.Text = "X"
263 Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight
264 '
265 'Label9
266 '
267 Me.Label9.Location = New System.Drawing.Point(8, 192)
268 Me.Label9.Name = "Label9"
269 Me.Label9.Size = New System.Drawing.Size(80, 40)
270 Me.Label9.TabIndex = 7
271 Me.Label9.Text = "Coordonnées du troisième point"
272 Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight
273 '
274 'Label8
275 '
276 Me.Label8.Location = New System.Drawing.Point(8, 40)
277 Me.Label8.Name = "Label8"
278 Me.Label8.Size = New System.Drawing.Size(96, 16)
279 Me.Label8.TabIndex = 6
280 Me.Label8.Text = "type de section"
281 Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight
282 '
283 'Label7
284 '
285 Me.Label7.Location = New System.Drawing.Point(8, 136)
286 Me.Label7.Name = "Label7"
287 Me.Label7.Size = New System.Drawing.Size(96, 16)
288 Me.Label7.TabIndex = 5
289 Me.Label7.Text = "Dim. secondaire"
290 Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight
291 '
292 'Label6
293 '
294 Me.Label6.Location = New System.Drawing.Point(8, 112)
295 Me.Label6.Name = "Label6"
296 Me.Label6.Size = New System.Drawing.Size(96, 16)
297 Me.Label6.TabIndex = 4
298 Me.Label6.Text = "Dim. principale"
299 Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
300 '
301 'Label5
302 '
303 Me.Label5.Location = New System.Drawing.Point(8, 88)
304 Me.Label5.Name = "Label5"
305 Me.Label5.Size = New System.Drawing.Size(96, 16)
306 Me.Label5.TabIndex = 3
307 Me.Label5.Text = "Inertie secondaire"
308 Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight
309 '
310 'Label4
311 '
312 Me.Label4.Location = New System.Drawing.Point(8, 64)
313 Me.Label4.Name = "Label4"
314 Me.Label4.Size = New System.Drawing.Size(96, 16)
315 Me.Label4.TabIndex = 2
316 Me.Label4.Text = "Inertie principale"
317 Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
318 '
319 'Label3
320 '
321 Me.Label3.Location = New System.Drawing.Point(56, 16)
322 Me.Label3.Name = "Label3"
323 Me.Label3.Size = New System.Drawing.Size(48, 16)
324 Me.Label3.TabIndex = 1
325 Me.Label3.Text = "Matériau"
326 Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
327 '
328 'Label2
329 '
330 Me.Label2.Location = New System.Drawing.Point(8, 160)
331 Me.Label2.Name = "Label2"
332 Me.Label2.Size = New System.Drawing.Size(96, 16)
333 Me.Label2.TabIndex = 0
334 Me.Label2.Text = "Aire de la section"
335 Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
336 '
337 'GroupBox2
338 '
339 Me.GroupBox2.Controls.Add(Me.Label27)
340 Me.GroupBox2.Controls.Add(Me.Label26)
341 Me.GroupBox2.Controls.Add(Me.Label25)
342 Me.GroupBox2.Controls.Add(Me.Label24)
343 Me.GroupBox2.Location = New System.Drawing.Point(216, 8)
344 Me.GroupBox2.Name = "GroupBox2"
345 Me.GroupBox2.Size = New System.Drawing.Size(272, 312)
346 Me.GroupBox2.TabIndex = 3
347 Me.GroupBox2.TabStop = False
348 Me.GroupBox2.Text = "Coques"
349 Me.GroupBox2.Visible = False
350 '
351 'Label27
352 '
353 Me.Label27.Location = New System.Drawing.Point(96, 56)
354 Me.Label27.Name = "Label27"
355 Me.Label27.Size = New System.Drawing.Size(112, 24)
356 Me.Label27.TabIndex = 3
357 Me.Label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight
358 '
359 'Label26
360 '
361 Me.Label26.Location = New System.Drawing.Point(96, 24)
362 Me.Label26.Name = "Label26"
363 Me.Label26.Size = New System.Drawing.Size(112, 24)
364 Me.Label26.TabIndex = 2
365 Me.Label26.TextAlign = System.Drawing.ContentAlignment.MiddleRight
366 '
367 'Label25
368 '
369 Me.Label25.Location = New System.Drawing.Point(16, 56)
370 Me.Label25.Name = "Label25"
371 Me.Label25.Size = New System.Drawing.Size(72, 24)
372 Me.Label25.TabIndex = 1
373 Me.Label25.Text = "Épaisseur"
374 Me.Label25.TextAlign = System.Drawing.ContentAlignment.MiddleRight
375 '
376 'Label24
377 '
378 Me.Label24.Location = New System.Drawing.Point(16, 24)
379 Me.Label24.Name = "Label24"
380 Me.Label24.Size = New System.Drawing.Size(72, 24)
381 Me.Label24.TabIndex = 0
382 Me.Label24.Text = "Matériau"
383 Me.Label24.TextAlign = System.Drawing.ContentAlignment.MiddleRight
384 '
385 'ListBox2
386 '
387 Me.ListBox2.Location = New System.Drawing.Point(558, 16)
388 Me.ListBox2.Name = "ListBox2"
389 Me.ListBox2.Size = New System.Drawing.Size(402, 446)
390 Me.ListBox2.TabIndex = 4
391 '
392 'Debug_form
393 '
394 Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
395 Me.ClientSize = New System.Drawing.Size(968, 486)
396 Me.Controls.Add(Me.ListBox2)
397 Me.Controls.Add(Me.ListBox1)
398 Me.Controls.Add(Me.Label1)
399 Me.Controls.Add(Me.GroupBox1)
400 Me.Controls.Add(Me.GroupBox2)
401 Me.Name = "Debug_form"
402 Me.Text = "Debug_form"
403 Me.GroupBox1.ResumeLayout(False)
404 Me.GroupBox2.ResumeLayout(False)
405 Me.ResumeLayout(False)
406
407 End Sub
408
409 #End Region
410
411
412 Private Structure info
413 Dim tipe As Byte
414 Dim M As String
415 Dim S As String
416 Dim I1 As Double
417 Dim I2 As Double
418 Dim D1 As Double
419 Dim D2 As Double
420 Dim A As Double
421 Dim N3 As String
422
423 Dim Ep As Double
424
425 Dim x3 As Double
426 Dim y3 As Double
427 Dim z3 As Double
428 Dim swent As SldWorks.Entity
429 End Structure
430
431 Private detail() As info
432
433
434 Private Sub Debug_form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
435 Dim selmgr As SldWorks.SelectionMgr
436 Dim i As Integer
437 Dim swEnt As SldWorks.Entity
438 Dim swFeat As SldWorks.Feature
439 Dim liste() As String
440 Dim attr As SldWorks.Attribute
441 ReDim liste(0)
442 ReDim detail(0)
443 Intersections.RegisterAttribut()
444 'swModel.EditRebuild3()
445 ' si on a sélectionné qqchose qui n'est pas une entité (sketch)
446 liste(0) = " "
447 selmgr = swModel.SelectionManager
448
449 For i = 1 To selmgr.GetSelectedObjectCount
450
451 swEnt = selmgr.GetSelectedObject5(i)
452
453
454 'If MsgBox("Register?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then RealConstant.RCCode.RegisterAttribut()
455
456
457 Select Case swEnt.GetType
458 Case swconst.swSelectType_e.swSelATTRIBUTES
459 swFeat = swEnt
460 attr = swFeat.GetSpecificFeature2()
461 If Not attr Is Nothing Then
462 populer(attr, swEnt)
463 ReDim Preserve liste(UBound(liste) + 1)
464 liste(UBound(liste)) = attr.GetName()
465 'MsgBox("Ambigu = " & attr.GetEntityState(SwConst.swAssociatedEntityStates_e.swIsEntityAmbiguous) & " Deleted = " & attr.GetEntityState(SwConst.swAssociatedEntityStates_e.swIsEntityDeleted) & " Invalid = " & attr.GetEntityState(SwConst.swAssociatedEntityStates_e.swIsEntityInvalid) & " Suppressed = " & attr.GetEntityState(SwConst.swAssociatedEntityStates_e.swIsEntitySuppressed))
466 End If
467
468
469 Case swconst.swSelectType_e.swSelEDGES
470 ' on essai pour la condition aux limites
471 attr = swEnt.FindAttribute(Intersections.DefAttrConditionLimite, 0)
472 If Not attr Is Nothing Then
473 populer(attr, swEnt)
474 ReDim Preserve liste(UBound(liste) + 1)
475 liste(UBound(liste)) = attr.GetName()
476 End If
477
478 ' puis on essai pour les realConstant
479 attr = swEnt.FindAttribute(Intersections.DefAttrRCP1, 0)
480 If Not attr Is Nothing Then
481 populer(attr, swEnt)
482 ReDim Preserve liste(UBound(liste) + 1)
483 liste(UBound(liste)) = attr.GetName()
484 End If
485
486 ' puis on essai pour les Ignorer
487 attr = swEnt.FindAttribute(Intersections.DefAttrIgnorer, 0)
488 If Not attr Is Nothing Then
489 populer(attr, swEnt)
490 ReDim Preserve liste(UBound(liste) + 1)
491 liste(UBound(liste)) = attr.GetName()
492 End If
493
494
495 Case swconst.swSelectType_e.swSelFACES
496 ' on essai pour la condition aux limites
497 attr = swEnt.FindAttribute(Intersections.DefAttrConditionLimite, 0)
498 If Not attr Is Nothing Then
499 populer(attr, swEnt)
500 ReDim Preserve liste(UBound(liste) + 1)
501 liste(UBound(liste)) = attr.GetName()
502 End If
503
504 Dim swface As SldWorks.Face2
505 swface = swEnt
506
507 attr = swEnt.FindAttribute(Intersections.DefAttrRCCoque, 0)
508 If Not attr Is Nothing Then
509 populer(attr, swEnt)
510 ReDim Preserve liste(UBound(liste) + 1)
511 liste(UBound(liste)) = attr.GetName()
512 End If
513
514
515 attr = swEnt.FindAttribute(Intersections.DefAttrFaceInterne, 0)
516 If Not attr Is Nothing Then
517 populer(attr, swEnt)
518 ReDim Preserve liste(UBound(liste) + 1)
519 liste(UBound(liste)) = attr.GetName()
520 End If
521
522
523
524 End Select
525 Next
526
527 ListBox1.DataSource = liste
528
529 End Sub
530
531 Private Sub populer(ByRef attr As SldWorks.Attribute, ByRef swent As SldWorks.Entity)
532
533 Dim i As Integer
534 Dim p As SldWorks.Parameter
535 i = UBound(detail) + 1
536
537 ReDim Preserve detail(i)
538
539
540 If Microsoft.VisualBasic.Left(attr.GetName, 2) = "CL" Then
541 p = attr.GetParameter("CL")
542 Try
543 detail(i).M = p.GetStringValue
544 Catch ex As Exception
545 Dim pos As Integer
546 pos = InStr(attr.GetName, "_")
547 detail(i).M = p.GetStringValue 'Microsoft.VisualBasic.Right(attr.GetName, Len(attr.GetName) - pos)
548 End Try
549
550 detail(i).swent = swent
551 detail(i).tipe = 1
552 Exit Sub
553 End If
554
555 If Microsoft.VisualBasic.Left(attr.GetName, 9) = "InterAPAP" Then
556 p = attr.GetParameter("X")
557 detail(i).x3 = p.GetDoubleValue
558
559 p = attr.GetParameter("Y")
560 detail(i).y3 = p.GetDoubleValue
561
562 p = attr.GetParameter("Z")
563 detail(i).z3 = p.GetDoubleValue
564
565 detail(i).swent = swent
566 detail(i).tipe = 1
567 Exit Sub
568 End If
569
570 If Microsoft.VisualBasic.Left(attr.GetName, 5) = "FaceI" Then
571 detail(i).M = "FaceInterne"
572
573 detail(i).swent = swent
574 detail(i).tipe = 5
575 Exit Sub
576 End If
577
578 If Microsoft.VisualBasic.Left(attr.GetName, 2) = "Ig" Then
579 detail(i).M = "Ignorer"
580
581 detail(i).swent = swent
582 detail(i).tipe = 6
583 Exit Sub
584 End If
585
586
587 Try
588 p = attr.GetParameter("S")
589 detail(i).S = p.GetStringValue()
590
591 p = attr.GetParameter("M")
592 detail(i).M = p.GetStringValue
593
594 p = attr.GetParameter("I1")
595 detail(i).I1 = p.GetDoubleValue()
596
597 p = attr.GetParameter("I2")
598 detail(i).I2 = p.GetDoubleValue()
599
600 p = attr.GetParameter("D1")
601 detail(i).D1 = p.GetDoubleValue()
602
603 p = attr.GetParameter("D2")
604 detail(i).D2 = p.GetDoubleValue()
605
606 p = attr.GetParameter("As")
607 detail(i).A = p.GetDoubleValue()
608
609 p = attr.GetParameter("N3")
610 detail(i).N3 = p.GetStringValue()
611
612 p = attr.GetParameter("X3")
613 detail(i).x3 = p.GetDoubleValue
614
615 p = attr.GetParameter("Y3")
616 detail(i).y3 = p.GetDoubleValue
617
618 p = attr.GetParameter("Z3")
619 detail(i).z3 = p.GetDoubleValue
620
621 '******************
622 'If Not Microsoft.VisualBasic.Left(attr.GetName, 4) = "Mini" Then
623
624 ' Dim swDocExt As SldWorks.ModelDocExtension
625 ' Dim swXform As SldWorks.MathTransform
626 ' Dim selMgr As SldWorks.SelectionMgr
627 ' Dim swFeat As SldWorks.Feature
628
629 ' swDocExt = swModel.Extension
630 ' selMgr = swModel.SelectionManager
631 ' 'swFeat = selMgr.GetSelectedObject5(1)
632
633 ' swXform = swDocExt.GetCoordinateSystemTransformByName(detail(i).N3)
634
635 ' detail(i).x3 = swXform.ArrayData(9) * 1000.0#
636 ' detail(i).y3 = swXform.ArrayData(10) * 1000.0#
637 ' detail(i).z3 = swXform.ArrayData(11) * 1000.0#
638 'End If
639 detail(i).tipe = 1
640 detail(i).swent = swent
641 '*********************
642 Catch
643 ' ben, on a pas une poutre, mais une coque
644 p = attr.GetParameter("M")
645 detail(i).M = p.GetStringValue
646
647 p = attr.GetParameter("Ep")
648 detail(i).Ep = p.GetDoubleValue()
649 detail(i).tipe = 2
650 detail(i).swent = swent
651 End Try
652
653 fin:
654 End Sub
655
656 Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
657
658 End Sub
659
660 Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
661 Dim i As Integer
662 i = ListBox1.SelectedIndex()
663 If i = 0 Then Exit Sub
664
665 If detail(i).tipe = 1 Then
666 ' on vient de sélectionner une poutre
667 GroupBox2.Visible = False
668 GroupBox1.Visible = True
669
670 Label13.Text = detail(i).M
671 Label14.Text = detail(i).S
672 Label15.Text = detail(i).I1
673 Label16.Text = detail(i).I2
674 Label17.Text = detail(i).D1
675 Label18.Text = detail(i).D2
676 Label19.Text = detail(i).A
677 Label20.Text = detail(i).N3
678 Label21.Text = detail(i).x3
679 Label22.Text = detail(i).y3
680 Label23.Text = detail(i).z3
681
682 ElseIf detail(i).tipe = 2 Then
683 ' on a sélectionné une coque
684 GroupBox1.Visible = False
685 GroupBox2.Visible = True
686
687 Label26.Text = detail(i).M
688 Label27.Text = detail(i).Ep
689 End If
690
691 On Error Resume Next
692 ' on peut sélectionner aussi les entités:
693 detail(i).swent.Select(False)
694 'swModel.SelectedFeatureProperties(255, 0.8, 0.5, 0.5, 1, 0, 1, False, False, 0)
695 ' si le entity est un
696 If detail(i).swent.GetType = swconst.swSelectType_e.swSelATTRIBUTES Then
697 Dim swfeat As SldWorks.Feature
698 Dim attr As SldWorks.Attribute
699 Dim ent As SldWorks.Entity
700 swfeat = detail(i).swent
701 attr = swfeat.GetSpecificFeature2()
702 ent = attr.GetEntity
703 ent.Select(True)
704 'swModel.SelectedFeatureProperties(255, 0.8, 0.5, 0.5, 1, 0, 1, False, False, 0)
705 End If
706
707 End Sub
708
709 Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter
710
711 End Sub
712
713 Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter
714
715 End Sub
716 End Class