ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magicsld/CLProp.vb
Revision: 205
Committed: Thu Jul 23 20:53:57 2009 UTC (15 years, 9 months ago) by bournival
File size: 7555 byte(s)
Log Message:
Commit de MAGiC_SLD pendant que j'y pense.  Les modifications ne devraient pas concerner personne d'autre que moi.   -- Sylvain

File Contents

# User Rev Content
1 bournival 48 Imports SolidWorks.Interop
2     Imports SolidWorks.Interop.swconst
3     Imports SolidWorks.Interop.swpublished
4 bournival 40
5     ' la classe des propriétés
6    
7     Namespace ConditionsAuxLimites
8     Public Class ConditionLimitePage
9     Dim iSwApp As SldWorks.SldWorks
10     Dim userAddin As MAGIC.Magic
11     Dim handler As CLPageHandler
12 bournival 48 Dim ppage As sldworks.PropertyManagerPage2
13 bournival 40
14     #Region "Property Manager Page Controls"
15     'Groupes
16 bournival 48 Dim group1 As sldworks.PropertyManagerPageGroup
17 bournival 40 'Dim group2 As PropertyManagerPageGroup
18    
19     ''Controles
20     'Dim checkbox1 As PropertyManagerPageCheckbox
21 bournival 48 Dim BoutonSousJascent As sldworks.PropertyManagerPageButton
22     Dim checkbox2 As sldworks.PropertyManagerPageCheckbox
23     Dim selection1 As sldworks.PropertyManagerPageSelectionbox
24     Dim combo1 As sldworks.PropertyManagerPageCombobox
25     Dim Numberbox1 As sldworks.PropertyManagerPageNumberbox
26     Dim DessinerCheck As sldworks.PropertyManagerPageCheckbox
27 bournival 40
28    
29     #End Region
30    
31     Function Init(ByVal sw As SldWorks.SldWorks, ByVal addin As MAGIC.Magic) As Object
32     iSwApp = sw
33     userAddin = addin
34     CreatePage()
35     AddControls()
36     Return Nothing
37     End Function
38    
39     Sub Show()
40     ppage.Show()
41     End Sub
42    
43     Sub CreatePage()
44     handler = New CLPageHandler
45     handler.Init(iSwApp, userAddin)
46     Dim options As Integer
47     Dim errors As Integer
48     options = swPropertyManagerPageOptions_e.swPropertyManagerOptions_OkayButton + swPropertyManagerPageOptions_e.swPropertyManagerOptions_CancelButton
49     ppage = iSwApp.CreatePropertyManagerPage("Condition limite", options, handler, errors)
50     End Sub
51    
52     Sub AddControls()
53     Dim options As Integer
54     Dim leftAlign As Integer
55     Dim controlType As Integer
56    
57     ppage.SetMessage("La sélection de l'option «Inclure les topologies sous-jacentes» n'affichera pas les entités dans la liste mais les sélectionne sur le modèle (et les prend en compte)", swPropertyManagerPageMessageVisibility.swMessageBoxVisible)
58     ' premier (et théoriquement seul) groupe
59     options = swAddGroupBoxOptions_e.swGroupBoxOptions_Expanded + swAddGroupBoxOptions_e.swGroupBoxOptions_Visible
60     group1 = ppage.AddGroupBox(0, "Condition de frontière", options)
61    
62    
63     'Selection1, qui contiendra les entités sélectionnées
64     controlType = swPropertyManagerPageControlType_e.swControlType_Selectionbox
65     leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
66     options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
67     selection1 = group1.AddControl(1, controlType, "Topologies sélectionnées", leftAlign, options, "Montre les entités qui ont été sélectionnées")
68     If Not selection1 Is Nothing Then
69     Dim filter() As Integer = New Integer() {swSelectType_e.swSelVERTICES, swSelectType_e.swSelEDGES, swSelectType_e.swSelFACES, swSelectType_e.swSelPOINTREFS} ' pour sélectionner juste les faces, aretes et sommets
70     selection1.Height = 50
71     selection1.SetSelectionFilters(filter)
72     End If
73     CLCode.selection1 = selection1 ' pour accéder à ses méthodes à partir du module CLCode...
74    
75    
76     'Bouton1, qui demande si on doit inclure les topologies sous-jacentes
77     controlType = swPropertyManagerPageControlType_e.swControlType_Button
78     leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
79     options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
80     BoutonSousJascent = group1.AddControl(2, controlType, "Ajouter les topologies sous-jacentes", leftAlign, options, "Une face sélectionnée ajoute les arêtes et sommets, une arete sélectionnée ajoute ses sommets")
81     BoutonSousJascent.Caption = "Sélectionner topologies sous-jacentes"
82     'CLCode.SousJacent = False
83     'CLCode.checkbox1 = checkbox1
84    
85     'Checkbox2, qui demande si l'on doit utiliser une seule annotation pour toutes les entités
86     'controlType = swPropertyManagerPageControlType_e.swControlType_Checkbox
87     'leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
88     'options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
89     'checkbox2 = group1.AddControl(3, controlType, "Utiliser une seule annotation", leftAlign, options, "Utiliser une seule annotation pour désigner toutes les conditions aux limites de ce type")
90     'checkbox2.Checked = True
91     'CLCode.checkbox2 = checkbox2
92     'CLCode.AnnoSeul = True
93    
94     'Combo1, les types de conditions aux limites
95     controlType = swPropertyManagerPageControlType_e.swControlType_Combobox
96     leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
97     options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
98     combo1 = group1.AddControl(4, controlType, "Type de conditions", leftAlign, options, " Choix du type de condition à appliquer à (aux) entité(s) sélectionnée(s)")
99     If Not combo1 Is Nothing Then
100     combo1.Height = 600
101 bournival 205 Dim items() As String = New String() {"Da, Fixer tout", "Dx, Bloquer les translations en X", "Dy, Bloquer les translations en Y", "Dz, Bloquer les translations en Z", "Fx, Force en X", "Fy, Force en Y", "Fz, Force en Z", "Px, Pression en X", "Py, Pression en Y", "Pz, Pression en Z", "Pn, Pression normale", "Rx, Rotation en X", "Ry, Rotation en Y", "Rz, Rotation en Z", "RA, Rotation dans tous les axes", "Mx, Moment en X", "My, Moment en Y", "Mz, Moment en Z"}
102 bournival 40 combo1.Style = swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditableText
103     combo1.AddItems(items)
104     End If
105     CLCode.combo1 = combo1
106    
107     'Numberbox1, là où on entre les valeurs
108     controlType = swPropertyManagerPageControlType_e.swControlType_Numberbox
109     leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
110     options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
111     Numberbox1 = group1.AddControl(5, controlType, "Valeur", leftAlign, options, "Entrez la valeur de la condition")
112     Numberbox1.Value = 0
113     Numberbox1.SetRange(SwConst.swNumberboxUnitType_e.swNumberBox_UnitlessDouble, -1.0E+20, 1.0E+20, 1, True)
114     CLCode.Numberbox1 = Numberbox1
115    
116     ' checkbox où on dit que l'on veut dessiner
117     controlType = swPropertyManagerPageControlType_e.swControlType_Checkbox
118     leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge
119     options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible
120     DessinerCheck = group1.AddControl(8, controlType, "Dessiner les conditions", leftAlign, options, "Place des repères pour illustrer les conditions")
121     CLCode.DessinerCL = DessinerCheck
122    
123     End Sub
124     End Class
125    
126    
127    
128    
129     End Namespace