Esempio n. 1
0
        public virtual bool TryGet(string name, out IXFeature ent)
        {
            IFeature feat;

            switch (Document.Model)
            {
            case IPartDoc part:
                feat = part.FeatureByName(name) as IFeature;
                break;

            case IAssemblyDoc assm:
                feat = assm.FeatureByName(name) as IFeature;
                break;

            case IDrawingDoc drw:
                feat = drw.FeatureByName(name) as IFeature;
                break;

            default:
                throw new NotSupportedException();
            }

            if (feat != null)
            {
                ent = SwObject.FromDispatch <SwFeature>(feat, Document);
                return(true);
            }
            else
            {
                ent = null;
                return(false);
            }
        }
Esempio n. 2
0
        protected override Version GetVersion(IXFeature featData, string name)
        {
            Version dimsVersion;
            string  versVal;

            ((SwMacroFeature)featData).FeatureData.GetStringByName(name, out versVal);

            if (!Version.TryParse(versVal, out dimsVersion))
            {
                dimsVersion = new Version();
            }

            return(dimsVersion);
        }
Esempio n. 3
0
        public override bool TryGet(string name, out IXFeature ent)
        {
            var feat = Component.Component.FeatureByName(name);

            if (feat != null)
            {
                ent = m_Assm.CreateObjectFromDispatch <SwFeature>(feat);
                return(true);
            }
            else
            {
                ent = null;
                return(false);
            }
        }
Esempio n. 4
0
 private Version GetDimensionsVersion(IXFeature featData)
 {
     return(GetVersion(featData, VERSION_DIMENSIONS_NAME));
 }
Esempio n. 5
0
 protected abstract Version GetVersion(IXFeature featData, string name);