Exemple #1
0
        private string GetPropertyValue(ICustomPropertyManager prpMgr, string prpName)
        {
            string resVal;

            if (OwnerApplication.IsVersionNewerOrEqual(SwVersion_e.Sw2018))
            {
                prpMgr.Get6(prpName, false, out _, out resVal, out _, out _);
            }
            else if (OwnerApplication.IsVersionNewerOrEqual(SwVersion_e.Sw2014))
            {
                prpMgr.Get5(prpName, false, out _, out resVal, out _);
            }
            else
            {
                prpMgr.Get4(prpName, false, out _, out resVal);
            }

            return(resVal);
        }
            internal PropertiesList(ICustomPropertyManager prpsMgr, ISldWorks app) : base(StringComparer.CurrentCultureIgnoreCase)
            {
                var prpNames = prpsMgr.GetNames() as string[];

                if (prpNames != null)
                {
                    foreach (var prpName in prpNames)
                    {
                        string val;
                        string resVal;
                        if (app.IsVersionNewerOrEqual(SwVersion_e.Sw2014))
                        {
                            bool wasRes;
                            prpsMgr.Get5(prpName, true, out val, out resVal, out wasRes);
                        }
                        else
                        {
                            prpsMgr.Get4(prpName, true, out val, out resVal);
                        }
                        Add(prpName, val);
                    }
                }
            }