diff --git a/Base/Attributes/IconAttribute.cs b/Base/Attributes/IconAttribute.cs new file mode 100644 index 0000000..892bfa8 --- /dev/null +++ b/Base/Attributes/IconAttribute.cs @@ -0,0 +1,79 @@ +//********************** +//SwEx.MacroFeature - framework for developing macro features in SOLIDWORKS +//Copyright(C) 2018 www.codestack.net +//License: https://github.com/codestack-net-dev/swex-macrofeature/blob/master/LICENSE +//Product URL: https://www.codestack.net/labs/solidworks/swex/macro-feature +//********************** + +using CodeStack.SwEx.Common.Reflection; +using CodeStack.SwEx.MacroFeature.Icons; +using System; +using System.Drawing; + +namespace CodeStack.SwEx.MacroFeature.Attributes +{ + /// + /// Specifies the icon for macro feature to be displayed in the Feature Manager Tree + /// + [AttributeUsage(AttributeTargets.Class)] + public class IconAttribute : Attribute + { + internal MacroFeatureIcon Regular { get; private set; } + internal MacroFeatureIcon Suppressed { get; private set; } + internal MacroFeatureIcon Highlighted { get; private set; } + + internal string IconFolderName { get; private set; } + + /// + /// Specifies the master icon for all macro feature states + /// + /// Resource type + /// Name of the resource representing the icon + /// Folder name to store the icons. + /// This folder will be created in the Program Data. + /// If empty value is specified icon will be created at the default location + public IconAttribute(Type resType, string resName, string iconFolderName = "") + { + Regular = CreateIcon(resType, resName, MacroFeatureIconInfo.RegularName); + Suppressed = CreateIcon(resType, resName, MacroFeatureIconInfo.SuppressedName); + Highlighted = CreateIcon(resType, resName, MacroFeatureIconInfo.HighlightedName); + + IconFolderName = iconFolderName; + } + + /// + /// Name of the resource representing the small size icon + /// Name of the resource representing the medium size icon + /// Name of the resource representing the large size icon + public IconAttribute(Type resType, string smallResName, string mediumResName, + string largeResName, string iconFolderName = "") + { + Regular = CreateIcon(resType, smallResName, mediumResName, largeResName, MacroFeatureIconInfo.RegularName); + Suppressed = CreateIcon(resType, smallResName, mediumResName, largeResName, MacroFeatureIconInfo.SuppressedName); + Highlighted = CreateIcon(resType, smallResName, mediumResName, largeResName, MacroFeatureIconInfo.HighlightedName); + + IconFolderName = iconFolderName; + } + + //TODO: add another 2 constructors for specifying suppressed and highlighted + + private MasterIcon CreateIcon(Type resType, string regName, string baseName) + { + return new MasterIcon(baseName) + { + Icon = ResourceHelper.GetResource(resType, regName) + }; + } + + private HighResIcon CreateIcon(Type resType, string smallResName, string mediumResName, + string largeResName, string baseName) + { + return new HighResIcon(baseName) + { + Small = ResourceHelper.GetResource(resType, smallResName), + Medium = ResourceHelper.GetResource(resType, mediumResName), + Large = ResourceHelper.GetResource(resType, largeResName) + }; + } + } +} diff --git a/Base/MacroFeatureEx.cs b/Base/MacroFeatureEx.cs new file mode 100644 index 0000000..c356102 --- /dev/null +++ b/Base/MacroFeatureEx.cs @@ -0,0 +1,374 @@ +//********************** +//SwEx - development tools for SOLIDWORKS +//Copyright(C) 2018 www.codestack.net +//License: https://github.com/codestack-net-dev/swex-macrofeature/blob/master/LICENSE +//Product URL: https://www.codestack.net/labs/solidworks/swex/macro-feature +//********************** + +using CodeStack.SwEx.Common.Icons; +using CodeStack.SwEx.Common.Reflection; +using CodeStack.SwEx.MacroFeature.Attributes; +using CodeStack.SwEx.MacroFeature.Base; +using CodeStack.SwEx.MacroFeature.Helpers; +using CodeStack.SwEx.MacroFeature.Icons; +using SolidWorks.Interop.sldworks; +using SolidWorks.Interop.swconst; +using SolidWorks.Interop.swpublished; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace CodeStack.SwEx.MacroFeature +{ + public abstract class MacroFeatureEx : ISwComFeature + { + #region Initiation + + public MacroFeatureEx() + { + TryCreateIcons(); + } + + private void TryCreateIcons() + { + var iconsConverter = new IconsConverter( + MacroFeatureIconInfo.GetLocation(this.GetType()), false); + + IIcon regIcon = null; + IIcon highIcon = null; + IIcon suppIcon = null; + + this.GetType().TryGetAttribute(a => + { + regIcon = a.Regular; + highIcon = a.Highlighted; + suppIcon = a.Suppressed; + }); + + if (regIcon == null) + { + //TODO: load default + } + + if (highIcon == null) + { + highIcon = regIcon; + } + + if (suppIcon == null) + { + suppIcon = regIcon; + } + + //Creation of icons may fail if user doesn't have write permissions or icon is locked + try + { + iconsConverter.ConvertIcon(regIcon, true); + iconsConverter.ConvertIcon(suppIcon, true); + iconsConverter.ConvertIcon(highIcon, true); + iconsConverter.ConvertIcon(regIcon, false); + iconsConverter.ConvertIcon(suppIcon, false); + iconsConverter.ConvertIcon(highIcon, false); + } + catch + { + } + } + + //this method crashes SOLIDWORKS - need to research + private void UpdateIconsIfRequired(ISldWorks app, IModelDoc2 model, IFeature feat) + { + var data = (feat as IFeature).GetDefinition() as IMacroFeatureData; + data.AccessSelections(model, null); + var icons = data.IconFiles as string[]; + + if (icons != null) + { + if (icons.Any(i => + { + string iconPath = ""; + + if (Path.IsPathRooted(i)) + { + iconPath = i; + } + else + { + iconPath = Path.Combine( + Path.GetDirectoryName(this.GetType().Assembly.Location), i); + } + + return !File.Exists(iconPath); + })) + { + data.IconFiles = MacroFeatureIconInfo.GetIcons(this.GetType(), app.SupportsHighResIcons()); + feat.ModifyDefinition(data, model, null); + } + } + } + + #endregion + + #region Overrides + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public object Edit(object app, object modelDoc, object feature) + { + return OnEditDefinition(app as ISldWorks, modelDoc as IModelDoc2, feature as IFeature); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public object Regenerate(object app, object modelDoc, object feature) + { + var res = OnRebuild(app as ISldWorks, modelDoc as IModelDoc2, feature as IFeature); + + if (res != null) + { + return res.GetResult(); + } + else + { + return null; + } + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public object Security(object app, object modelDoc, object feature) + { + return OnUpdateState(app as ISldWorks, modelDoc as IModelDoc2, feature as IFeature); + } + + #endregion + + protected virtual bool OnEditDefinition(ISldWorks app, IModelDoc2 model, IFeature feature) + { + return true; + } + + protected virtual MacroFeatureRebuildResult OnRebuild(ISldWorks app, IModelDoc2 model, IFeature feature) + { + return null; + } + + protected virtual swMacroFeatureSecurityOptions_e OnUpdateState(ISldWorks app, IModelDoc2 model, IFeature feature) + { + return swMacroFeatureSecurityOptions_e.swMacroFeatureSecurityByDefault; + } + } + + public abstract class MacroFeatureEx : MacroFeatureEx + where TParams : class, new() + { + protected class DimensionData : IDisposable + { + public IDisplayDimension DisplayDimension { get; private set; } + public IDimension Dimension { get; private set; } + + internal DimensionData(IDisplayDimension dispDim) + { + DisplayDimension = dispDim; + Dimension = dispDim.GetDimension2(0); + } + + public void Dispose() + { + if (Marshal.IsComObject(Dimension)) + { + Marshal.ReleaseComObject(Dimension); + } + + if (Marshal.IsComObject(DisplayDimension)) + { + Marshal.ReleaseComObject(DisplayDimension); + } + + Dimension = null; + DisplayDimension = null; + } + } + + protected class DimensionDataCollection : ReadOnlyCollection, IDisposable + { + internal DimensionDataCollection(IDisplayDimension[] dispDims) + : base(new List()) + { + if (dispDims != null) + { + for (int i = 0; i < dispDims.Length; i++) + { + this.Items.Add(new DimensionData(dispDims[i] as IDisplayDimension)); + } + } + } + + public void Dispose() + { + if (Count > 0) + { + foreach (var item in this.Items) + { + item.Dispose(); + } + + GC.Collect(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + } + } + + private readonly MacroFeatureParametersParser m_ParamsParser; + + public MacroFeatureEx() + { + m_ParamsParser = new MacroFeatureParametersParser(this.GetType()); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + protected sealed override MacroFeatureRebuildResult OnRebuild(ISldWorks app, IModelDoc2 model, IFeature feature) + { + var featDef = feature.GetDefinition() as IMacroFeatureData; + + IDisplayDimension[] dispDims; + var parameters = GetParameters(feature, featDef, model, out dispDims); + + var res = OnRebuild(app, model, feature, parameters); + + UpdateDimensions(app, model, feature, dispDims, parameters); + + if (dispDims != null) + { + for (int i = 0; i < dispDims.Length; i++) + { + dispDims[i] = null; + } + } + + return res; + } + + protected virtual MacroFeatureRebuildResult OnRebuild(ISldWorks app, IModelDoc2 model, IFeature feature, TParams parameters) + { + return null; + } + + private void UpdateDimensions(ISldWorks app, IModelDoc2 model, IFeature feature, + IDisplayDimension[] dispDims, TParams parameters) + { + using (var dimsColl = new DimensionDataCollection(dispDims)) + { + if (dimsColl.Any()) + { + OnSetDimensions(app, model, feature, dimsColl, parameters); + } + } + } + + protected virtual void OnSetDimensions(ISldWorks app, IModelDoc2 model, IFeature feature, + DimensionDataCollection dims, TParams parameters) + { + } + + protected TParams GetParameters(IFeature feat, IMacroFeatureData featData, IModelDoc2 model) + { + IDisplayDimension[] dispDims; + var parameters = GetParameters(feat, featData, model, out dispDims); + + if (dispDims != null) + { + for (int i = 0; i < dispDims.Length; i++) + { + + } + } + + return parameters; + } + + protected void SetParameters(IModelDoc2 model, IFeature feat, IMacroFeatureData featData, TParams parameters) + { + MacroFeatureOutdateState_e state; + SetParameters(model, feat, featData, parameters, out state); + } + + /// + /// + /// + /// + /// + /// + /// Indicates that parameters version is outdated and feature needs to be replaced + protected void SetParameters(IModelDoc2 model, IFeature feat, IMacroFeatureData featData, TParams parameters, out MacroFeatureOutdateState_e state) + { + m_ParamsParser.SetParameters(model, feat, featData, parameters, out state); + } + + private TParams GetParameters(IFeature feat, IMacroFeatureData featData, IModelDoc2 model, out IDisplayDimension[] dispDims) + { + MacroFeatureOutdateState_e state; + return GetParameters(feat, featData, model, out dispDims, out state); + } + + private TParams GetParameters(IFeature feat, IMacroFeatureData featData, IModelDoc2 model, out IDisplayDimension[] dispDims, out MacroFeatureOutdateState_e state) + { + return m_ParamsParser.GetParameters(feat, featData, model, out dispDims, out state); + } + } + + public abstract class MacroFeatureEx : MacroFeatureEx + where THandler : class, IMacroFeatureHandler, new() + where TParams : class, new() + { + private MacroFeatureRegister m_Register; + + public MacroFeatureEx() : base() + { + m_Register = new MacroFeatureRegister(MacroFeatureInfo.GetBaseName(this.GetType())); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + protected override sealed bool OnEditDefinition(ISldWorks app, IModelDoc2 model, IFeature feature) + { + return OnEditDefinition(GetHandler(app, model, feature)); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + protected override sealed swMacroFeatureSecurityOptions_e OnUpdateState(ISldWorks app, IModelDoc2 model, IFeature feature) + { + return OnUpdateState(GetHandler(app, model, feature)); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + protected override sealed MacroFeatureRebuildResult OnRebuild(ISldWorks app, IModelDoc2 model, IFeature feature, TParams parameters) + { + return OnRebuild(GetHandler(app, model, feature), parameters); + } + + protected virtual swMacroFeatureSecurityOptions_e OnUpdateState(THandler handler) + { + return swMacroFeatureSecurityOptions_e.swMacroFeatureSecurityByDefault; + } + + protected virtual MacroFeatureRebuildResult OnRebuild(THandler handler, TParams parameters) + { + return null; + } + + protected virtual bool OnEditDefinition(THandler handler) + { + return true; + } + + private THandler GetHandler(ISldWorks app, IModelDoc2 model, IFeature feature) + { + bool isNew = true; + var handler = m_Register.EnsureFeatureRegistered(app, model, feature, out isNew); + return handler; + } + } +} diff --git a/Base/Mocks/DimensionEmpty.cs b/Base/Mocks/DimensionEmpty.cs new file mode 100644 index 0000000..2b0627f --- /dev/null +++ b/Base/Mocks/DimensionEmpty.cs @@ -0,0 +1,68 @@ +//********************** +//SwEx - development tools for SOLIDWORKS +//Copyright(C) 2018 www.codestack.net +//License: https://github.com/codestack-net-dev/swex-macrofeature/blob/master/LICENSE +//Product URL: https://www.codestack.net/labs/solidworks/swex/macro-feature +//********************** + +using SolidWorks.Interop.sldworks; + +namespace CodeStack.SwEx.MacroFeature.Mocks +{ + public class DimensionEmpty : Dimension + { + public MathVector DimensionLineDirection { get; set; } + public int DrivenState { get; set; } + public MathVector ExtensionLineDirection { get; set; } + public string FullName { get; } + public string Name { get; set; } + public bool ReadOnly { get; set; } + public object ReferencePoints { get; set; } + public double SystemValue { get; set; } + public DimensionTolerance Tolerance { get; } + public double Value { get; set; } + + public int GetArcEndCondition(int Index) { return -1; } + public Feature GetFeatureOwner() { return null; } + public string GetNameForSelection() { return ""; } + public int GetReferencePointsCount() { return -1; } + public bool GetSystemChamferValues(ref double Length, ref double Angle) { return false; } + public double GetSystemValue2(string ConfigName) { return -1; } + public object GetSystemValue3(int WhichConfigurations, object Config_names) { return new double[] { 0 }; } + public string GetToleranceFitValues() { return ""; } + public object GetToleranceFontInfo() { return -1; } + public int GetToleranceType() { return -1; } + public object GetToleranceValues() { return -1; } + public int GetType() { return -1; } + public double GetUserValueIn(object Doc) { return -1; } + public double GetValue2(string ConfigName) { return -1; } + public object GetValue3(int WhichConfigurations, object Config_names) { return -1; } + public MathPoint IGetReferencePoints(int PointsCount) { return null; } + public double IGetSystemValue3(int WhichConfigurations, int Config_count, ref string Config_names) { return -1; } + public double IGetToleranceFontInfo() { return -1; } + public double IGetToleranceValues() { return -1; } + public double IGetUserValueIn(ModelDoc Doc) { return -1; } + public double IGetUserValueIn2(ModelDoc2 Doc) { return -1; } + public double IGetValue3(int WhichConfigurations, int Config_count, ref string Config_names) { return -1; } + public bool IsAppliedToAllConfigurations() { return false; } + public bool IsDesignTableDimension() { return false; } + public void ISetReferencePoints(int PointsCount, ref MathPoint RefPoints) { } + public int ISetSystemValue3(double NewValue, int WhichConfigurations, int Config_count, ref string Config_names) { return -1; } + public void ISetUserValueIn(ModelDoc Doc, double NewValue) { } + public int ISetUserValueIn2(ModelDoc Doc, double NewValue, int WhichConfigurations) { return -1; } + public int ISetUserValueIn3(ModelDoc2 Doc, double NewValue, int WhichConfigurations) { return -1; } + public int ISetValue3(double NewValue, int WhichConfigurations, int Config_count, ref string Config_names) { return -1; } + public bool IsReference() { return false; } + public int SetArcEndCondition(int Index, int Condition) { return -1; } + public int SetSystemValue2(double NewValue, int WhichConfigurations) { return -1; } + public int SetSystemValue3(double NewValue, int WhichConfigurations, object Config_names) { return -1; } + public bool SetToleranceFitValues(string NewLValue, string NewUValue) { return false; } + public bool SetToleranceFontInfo(int UseFontScale, double TolScale, double TolHeight) { return false; } + public bool SetToleranceType(int NewType) { return false; } + public bool SetToleranceValues(double TolMin, double TolMax) { return false; } + public void SetUserValueIn(object Doc, double NewValue) { } + public int SetUserValueIn2(object Doc, double NewValue, int WhichConfigurations) { return -1; } + public int SetValue2(double NewValue, int WhichConfigurations) { return -1; } + public int SetValue3(double NewValue, int WhichConfigurations, object Config_names) { return -1; } + } +} diff --git a/Base/Mocks/DisplayDimensionEmpty.cs b/Base/Mocks/DisplayDimensionEmpty.cs new file mode 100644 index 0000000..9774fb0 --- /dev/null +++ b/Base/Mocks/DisplayDimensionEmpty.cs @@ -0,0 +1,155 @@ +//********************** +//SwEx - development tools for SOLIDWORKS +//Copyright(C) 2018 www.codestack.net +//License: https://github.com/codestack-net-dev/swex-macrofeature/blob/master/LICENSE +//Product URL: https://www.codestack.net/labs/solidworks/swex/macro-feature +//********************** + +using SolidWorks.Interop.sldworks; + +namespace CodeStack.SwEx.MacroFeature.Mocks +{ + public class DisplayDimensionEmpty : DisplayDimension + { + public bool ArcExtensionLineOrOppositeSide { get; set; } + public int ArrowSide { get; set; } + public bool BrokenLeader { get; set; } + public bool CenterText { get; set; } + public int ChamferTextStyle { get; set; } + public bool Diametric { get; set; } + public bool DimensionToInside { get; set; } + public bool DisplayAsChain { get; set; } + public bool DisplayAsLinear { get; set; } + public bool Elevation { get; set; } + public int EndSymbol { get; set; } + public bool ExtensionLineExtendsFromCenterOfSet { get; set; } + public bool ExtensionLineSameAsLeaderStyle { get; set; } + public bool ExtensionLineUseDocumentDisplay { get; set; } + public bool Foreshortened { get; set; } + public bool GridBubble { get; set; } + public int HorizontalJustification { get; set; } + public bool Inspection { get; set; } + public bool IsLinked { get; } + public bool Jogged { get; set; } + public int LeaderVisibility { get; set; } + public bool LowerInspection { get; set; } + public bool MarkedForDrawing { get; set; } + public double MaxWitnessLineLength { get; set; } + public bool OffsetText { get; set; } + public bool RunBidirectionally { get; set; } + public double Scale2 { get; set; } + public bool ShortenedRadius { get; set; } + public bool ShowDimensionValue { get; set; } + public bool ShowLowerParenthesis { get; set; } + public bool ShowParenthesis { get; set; } + public bool ShowTolParenthesis { get; set; } + public bool SmartWitness { get; set; } + public bool SolidLeader { get; set; } + public bool Split { get; set; } + public int Type2 { get; } + public int VerticalJustification { get; set; } + public int WitnessVisibility { get; set; } + public bool AddDisplayEnt(int Type, object Data) { return false; } + public bool AddDisplayText(string Text, object Position, object Format, int Attachment, double WidthFactor) { return false; } + public bool AutoJogOrdinate() { return false; } + public bool ExplementaryAngle() { return false; } + public int GetAlternatePrecision() { return -1; } + public int GetAlternatePrecision2() { return -1; } + public int GetAlternateTolPrecision() { return -1; } + public int GetAlternateTolPrecision2() { return -1; } + public object GetAnnotation() { return false; } + public int GetArcLengthLeader() { return -1; } + public int GetArrowHeadStyle() { return -1; } + public bool GetArrowHeadStyle2(ref int Style1, ref int Style2) { return false; } + public bool GetAutoArcLengthLeader() { return false; } + public double GetBentLeaderLength() { return 0; } + public int GetBrokenLeader2() { return -1; } + public bool GetChamferUnits(out int LengthUnit, out int AngularUnit) { LengthUnit = -1; AngularUnit = -1; return false; } + public MathTransform GetDefinitionTransform() { return null; } + public object GetDimension() { return new DimensionEmpty(); } + public Dimension GetDimension2(int Index) { return new DimensionEmpty(); } + public object GetDisplayData() { return false; } + public bool GetExtensionLineAsCenterline(short ExtIndex, ref bool Centerline) { return false; } + public int GetFractionBase() { return -1; } + public int GetFractionValue() { return -1; } + public object GetHoleCalloutVariables() { return false; } + public bool GetJogParameters(short WitnessIndex, ref bool Jogged, ref double Offset1, ref double Offset2, ref double Offset1to2) { return false; } + public string GetLinkedText() { return ""; } + public string GetLowerText() { return ""; } + public string GetNameForSelection() { return ""; } + public object GetNext() { return false; } + public object GetNext2() { return false; } + public object GetNext3() { return false; } + public DisplayDimension GetNext4() { return null; } + public DisplayDimension GetNext5() { return null; } + public void GetOrdinateDimensionArrowSize(out bool UseDoc, out double ArrowSize) { UseDoc = false; ArrowSize = 0; } + public bool GetOverride() { return false; } + public double GetOverrideValue() { return 0; } + public int GetPrimaryPrecision() { return -1; } + public int GetPrimaryPrecision2() { return -1; } + public int GetPrimaryTolPrecision() { return -1; } + public int GetPrimaryTolPrecision2() { return -1; } + public bool GetRoundToFraction() { return false; } + public bool GetSecondArrow() { return false; } + public bool GetSupportsGenericText() { return false; } + public string GetText(int WhichText) { return ""; } + public object GetTextFormat() { return false; } + public int GetTextFormatItems(int WhichText, out object TokensDefinition, out object TokensEvaluated) { WhichText = -1; TokensDefinition = null; TokensEvaluated = null; return -1; } + public int GetType() { return -1; } + public int GetUnits() { return -1; } + public bool GetUseDocArrowHeadStyle() { return false; } + public bool GetUseDocBentLeaderLength() { return false; } + public bool GetUseDocBrokenLeader() { return false; } + public bool GetUseDocDual() { return false; } + public bool GetUseDocPrecision() { return false; } + public bool GetUseDocSecondArrow() { return false; } + public bool GetUseDocTextFormat() { return false; } + public bool GetUseDocUnits() { return false; } + public bool GetWitnessLineGap(short WitnessIndex, ref bool UseDoc, ref double Gap) { return false; } + public int get_ChamferPrecision(int Index) { return -1; } + public bool IAddDisplayEnt(int Type, ref double Data) { return false; } + public bool IAddDisplayText(string Text, ref double Position, TextFormat Format, int Attachment, double WidthFactor) { return false; } + public Annotation IGetAnnotation() { return null; } + public Dimension IGetDimension() { return new DimensionEmpty(); } + public DisplayData IGetDisplayData() { return null; } + public DisplayDimension IGetNext() { return null; } + public DisplayDimension IGetNext2() { return null; } + public DisplayDimension IGetNext3() { return null; } + public TextFormat IGetTextFormat() { return null; } + public bool IsDimXpert() { return false; } + public bool ISetTextFormat(int TextFormatType, TextFormat TextFormat) { return false; } + public bool IsHoleCallout() { return false; } + public bool IsReferenceDim() { return false; } + public bool ResetExtensionLineStyle(short ExtIndex) { return false; } + public int SetArcLengthLeader(bool AutoLeader, int LeaderType) { return -1; } + public void SetArrowHeadStyle(bool UseDoc, int ArrowHeadStyle) { } + public bool SetArrowHeadStyle2(bool UseDoc, int Style1, int Style2) { return false; } + public bool SetBentLeaderLength(bool UseDoc, double Length) { return false; } + public int SetBrokenLeader2(bool UseDoc, int Broken) { return -1; } + public void SetDual(bool UseDoc) { } + public void SetDual2(bool UseDoc, bool InwardRounding) { } + public bool SetExtensionLineAsCenterline(short ExtIndex, bool Centerline) { return false; } + public bool SetJogParameters(short WitnessIndex, bool Jogged, double Offset1, double Offset2, double Offset1to2) { return false; } + public bool SetLineFontDimensionStyle(bool UseDoc, int Style) { return false; } + public bool SetLineFontDimensionThickness(bool UseDoc, int Style) { return false; } + public bool SetLineFontExtensionStyle(bool UseDoc, int Style) { return false; } + public bool SetLineFontExtensionThickness(bool UseDoc, int Style) { return false; } + public int SetLinkedText(string BstrLinkedText) { return -1; } + public void SetLowerText(string Text) { } + public void SetOrdinateDimensionArrowSize(bool UseDoc, double ArrowSize) { } + public bool SetOverride(bool Override, double Value) { return false; } + public int SetPrecision(bool UseDoc, int Primary, int Alternate, int PrimaryTol, int AlternateTol) { return -1; } + public int SetPrecision2(int Primary, int Dual, int PrimaryTol, int DualTol) { return -1; } + public int SetPrecision3(int Primary, int Dual, int PrimaryTol, int DualTol) { return -1; } + public void SetSecondArrow(bool UseDoc, bool SecondArrow) { } + public void SetText(int WhichText, string Text) { } + public bool SetTextFormat(int TextFormatType, object TextFormat) { return false; } + public int SetUnits(bool UseDoc, int UType, int FractBase, int FractDenom, bool RoundToFraction) { return -1; } + public int SetUnits2(bool UseDoc, int UType, int FractBase, int FractDenom, bool RoundToFraction, int DecimalRounding) { return -1; } + public bool SetWitnessLineGap(short WitnessIndex, bool UseDoc, double Gap) { return false; } + public void set_ChamferPrecision(int Index, int Precision) { } + public bool SupplementaryAngle() { return false; } + public int Unlink() { return -1; } + public bool VerticallyOppositeAngle() { return false; } + } +}