コード例 #1
0
            public Boolean FiltreFonctionRepetition(Object SelBox, Object selection, int selType, String itemText)
            {
                EffacerContraintes();

                if (selType == (int)swSelectType_e.swSelBODYFEATURES)
                {
                    Feature f = selection as Feature;
                    if (f.GetTypeName2() == FeatureType.swTnCurvePattern)
                    {
                        SelectContraintes();
                        return(true);
                    }
                }
                else
                {
                    try
                    {
                        Face2      face = selection as Face2;
                        Body2      b    = face.GetBody();
                        Entity     e    = face as Entity;
                        Component2 c    = e.GetComponent();

                        String  cNomFonc = _pFonctionRepet.GetValeur <String>();
                        Feature F        = b.eChercherFonction(f => { return(Regex.IsMatch(f.Name, cNomFonc)); }, false);

                        if (F.IsNull())
                        {
                            F = b.eChercherFonction(f => { return(f.GetTypeName2() == FeatureType.swTnCurvePattern); }, false);
                        }

                        F = c.FeatureByName(F.Name);

                        SelectFonctionRepetition((CtrlSelectionBox)SelBox, F);
                    }
                    catch (Exception e)
                    { this.LogMethode(new Object[] { e }); }
                }

                return(false);
            }