ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magicsld/Debug_form.vb
Revision: 40
Committed: Mon Aug 20 21:30:28 2007 UTC (17 years, 8 months ago) by bournival
File size: 27502 byte(s)
Log Message:
Projet de these de Sylvain Bournival. Attention projet VB.

File Contents

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