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); } }
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); }
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); } }
private Version GetDimensionsVersion(IXFeature featData) { return(GetVersion(featData, VERSION_DIMENSIONS_NAME)); }
protected abstract Version GetVersion(IXFeature featData, string name);