获取AutoCad环境变量
看过以前关于此话题的帖子,两种方式解决1、引用Com
2、读取注册表
这里提供第三种方法,:)
调用方式 //获取autocad支持目录
string s = TlsCad.Preferences.Files.SupportPath;
//设置autocad支持目录
TlsCad.Preferences.Files.SupportPath = s + ";c:\\";
//or
TlsCad.Preferences.Files.SupportPath += ";d:\\";
为了方便调用,做成静态类直接调用
其中的一些枚举没有做太多测试,太多了,大家帮忙测试下吧:)
1、Preferences
using System;
using System.Reflection;
using Autodesk.AutoCAD.ApplicationServices;
namespace TlsCad
{
namespace Preferences
{
static class Preferences
{
static Type AcadPreferences = Type.GetTypeFromHandle(Type.GetTypeHandle(Application.Preferences));
public static object GetProperties(string ProjectName, string PropertyName)
{
try
{
object obj = AcadPreferences.InvokeMember(ProjectName, BindingFlags.GetProperty, null, Application.Preferences, new object);
Type AcadPreferencesUnknown = Type.GetTypeFromHandle(Type.GetTypeHandle(obj));
return (object)AcadPreferencesUnknown.InvokeMember(PropertyName, BindingFlags.GetProperty, null, obj, new object);
}
catch
{
return null;
}
}
public static bool SetProperties(string ProjectName, string PropertyName, object Value)
{
try
{
object obj = AcadPreferences.InvokeMember(ProjectName, BindingFlags.GetProperty, null, Application.Preferences, new object);
Type AcadPreferencesUnknown = Type.GetTypeFromHandle(Type.GetTypeHandle(obj));
AcadPreferencesUnknown.InvokeMember(PropertyName, BindingFlags.SetProperty, null, obj, new object { Value });
return true;
}
catch
{
return false;
}
}
}
}
}
2、Files
namespace TlsCad
{
namespace Preferences
{
public static class Files
{
public static string ActiveProfile
{
get { return (string)Preferences.GetProperties("Profiles", "ActiveProfile"); }
set { Preferences.SetProperties("Profiles", "ActiveProfile", value); }
}
public static string AltFontFile
{
get { return (string)Preferences.GetProperties("Files", "AltFontFile"); }
set { Preferences.SetProperties("Files", "AltFontFile", value); return; }
}
public static string AltTabletMenuFile
{
get { return (string)Preferences.GetProperties("Files", "AltTabletMenuFile"); }
set { Preferences.SetProperties("Files", "AltTabletMenuFile", value); return; }
}
public static string AutoSavePath
{
get { return (string)Preferences.GetProperties("Files", "AutoSavePath"); }
set { Preferences.SetProperties("Files", "AutoSavePath", value); return; }
}
public static string ColorBookPath
{
get { return (string)Preferences.GetProperties("Files", "ColorBookPath"); }
set { Preferences.SetProperties("Files", "ColorBookPath", value); return; }
}
public static string ConfigFile
{
get { return (string)Preferences.GetProperties("Files", "ConfigFile"); }
}
public static string CustomDictionary
{
get { return (string)Preferences.GetProperties("Files", "CustomDictionary"); }
set { Preferences.SetProperties("Files", "CustomDictionary", value); return; }
}
public static string DefaultInternetURL
{
get { return (string)Preferences.GetProperties("Files", "DefaultInternetURL"); }
set { Preferences.SetProperties("Files", "DefaultInternetURL", value); return; }
}
public static string DriversPath
{
get { return (string)Preferences.GetProperties("Files", "DriversPath"); }
set { Preferences.SetProperties("Files", "DriversPath", value); return; }
}
public static string FontFileMap
{
get { return (string)Preferences.GetProperties("Files", "FontFileMap"); }
set { Preferences.SetProperties("Files", "FontFileMap", value); return; }
}
public static string HelpFilePath
{
get { return (string)Preferences.GetProperties("Files", "HelpFilePath"); }
set { Preferences.SetProperties("Files", "HelpFilePath", value); return; }
}
public static string LogFilePath
{
get { return (string)Preferences.GetProperties("Files", "LogFilePath"); }
set { Preferences.SetProperties("Files", "LogFilePath", value); return; }
}
public static string MainDictionary
{
get { return (string)Preferences.GetProperties("Files", "MainDictionary"); }
set { Preferences.SetProperties("Files", "MainDictionary", value); return; }
}
public static string MenuFile
{
get { return (string)Preferences.GetProperties("Files", "MenuFile"); }
set { Preferences.SetProperties("Files", "MenuFile", value); return; }
}
public static string PageSetupOverridesTemplateFile
{
get { return (string)Preferences.GetProperties("Files", "ageSetupOverridesTemplateFile"); }
set { Preferences.SetProperties("Files", "ageSetupOverridesTemplateFile", value); return; }
}
public static string PlotLogFilePath
{
get { return (string)Preferences.GetProperties("Files", "lotLogFilePath"); }
set { Preferences.SetProperties("Files", "lotLogFilePath", value); return; }
}
public static string PostScriptPrologFile
{
get { return (string)Preferences.GetProperties("Files", "ostScriptPrologFile"); }
set { Preferences.SetProperties("Files", "ostScriptPrologFile", value); return; }
}
public static string PrinterConfigPath
{
get { return (string)Preferences.GetProperties("Files", "rinterConfigPath"); }
set { Preferences.SetProperties("Files", "rinterConfigPath", value); return; }
}
public static string PrinterDescPath
{
get { return (string)Preferences.GetProperties("Files", "rinterDescPath"); }
set { Preferences.SetProperties("Files", "rinterDescPath", value); return; }
}
public static string PrinterStyleSheetPath
{
get { return (string)Preferences.GetProperties("Files", "rinterStyleSheetPath"); }
set { Preferences.SetProperties("Files", "rinterStyleSheetPath", value); return; }
}
public static string PrintFile
{
get { return (string)Preferences.GetProperties("Files", "rintFile"); }
set { Preferences.SetProperties("Files", "rintFile", value); return; }
}
public static string PrintSpoolerPath
{
get { return (string)Preferences.GetProperties("Files", "rintSpoolerPath"); }
set { Preferences.SetProperties("Files", "rintSpoolerPath", value); return; }
}
public static string PrintSpoolExecutable
{
get { return (string)Preferences.GetProperties("Files", "rintSpoolExecutable"); }
set { Preferences.SetProperties("Files", "rintSpoolExecutable", value); return; }
}
public static string QNewTemplateFile
{
get { return (string)Preferences.GetProperties("Files", "QNewTemplateFile"); }
set { Preferences.SetProperties("Files", "QNewTemplateFile", value); return; }
}
public static string SupportPath
{
get { return (string)Preferences.GetProperties("Files", "SupportPath"); }
set { Preferences.SetProperties("Files", "SupportPath", value); return; }
}
public static string TempFilePath
{
get { return (string)Preferences.GetProperties("Files", "TempFilePath"); }
set { Preferences.SetProperties("Files", "TempFilePath", value); return; }
}
public static string TemplateDWGPath
{
get { return (string)Preferences.GetProperties("Files", "TemplateDWGPath"); }
set { Preferences.SetProperties("Files", "TemplateDWGPath", value); return; }
}
public static string TempXRefPath
{
get { return (string)Preferences.GetProperties("Files", "TempXRefPath"); }
set { Preferences.SetProperties("Files", "TempXRefPath", value); return; }
}
public static string TextEditor
{
get { return (string)Preferences.GetProperties("Files", "TextEditor"); }
set { Preferences.SetProperties("Files", "TextEditor", value); return; }
}
public static string TextureMapPath
{
get { return (string)Preferences.GetProperties("Files", "TextureMapPath"); }
set { Preferences.SetProperties("Files", "TextureMapPath", value); return; }
}
public static string ToolPalettePath
{
get { return (string)Preferences.GetProperties("Files", "ToolPalettePath"); }
set { Preferences.SetProperties("Files", "ToolPalettePath", value); return; }
}
public static string WorkspacePath
{
get { return (string)Preferences.GetProperties("Files", "WorkspacePath"); }
set { Preferences.SetProperties("Files", "WorkspacePath", value); return; }
}
}
}
}
3、Display
namespace TlsCad
{
namespace Preferences
{
public enum Color
{
Black,
Red,
Yellow,
Green,
Cyan,
Blue,
Magenta,
White,
}
public enum acTextFontStyle
{
acFontRegular,
acFontItalic,
acFontBold,
acFontBoldItalic
}
public static class Display
{
public static Color AutoTrackingVecColor
{
get { return (Color)Preferences.GetProperties("Display", "AutoTrackingVecColor"); }
set { Preferences.SetProperties("Display", "AutoTrackingVecColor", value); }
}
public static int CursorSize
{
get { return (int)Preferences.GetProperties("Display", "CursorSize"); }
set { Preferences.SetProperties("Display", "CursorSize", value); }
}
public static bool DisplayLayoutTabs
{
get { return (bool)Preferences.GetProperties("Display", "DisplayLayoutTabs"); }
set { Preferences.SetProperties("Display", "DisplayLayoutTabs", value); }
}
public static bool DisplayScreenMenu
{
get { return (bool)Preferences.GetProperties("Display", "DisplayScreenMenu"); }
set { Preferences.SetProperties("Display", "DisplayScreenMenu", value); }
}
public static bool DisplayScrollBars
{
get { return (bool)Preferences.GetProperties("Display", "DisplayScrollBars"); }
set { Preferences.SetProperties("Display", "DisplayScrollBars", value); }
}
public static int DockedVisibleLines
{
get { return (int)Preferences.GetProperties("Display", "DockedVisibleLines"); }
set { Preferences.SetProperties("Display", "DockedVisibleLines", value); }
}
public static Color GraphicsWinLayoutBackgrndColor
{
get { return (Color)Preferences.GetProperties("Display", "GraphicsWinLayoutBackgrndColor"); }
set { Preferences.SetProperties("Display", "GraphicsWinLayoutBackgrndColor", value); }
}
public static Color GraphicsWinModelBackgrndColor
{
get { return (Color)Preferences.GetProperties("Display", "GraphicsWinModelBackgrndColor"); }
set { Preferences.SetProperties("Display", "GraphicsWinModelBackgrndColor", value); }
}
public static int HistoryLines
{
get { return (int)Preferences.GetProperties("Display", "HistoryLines"); }
set { Preferences.SetProperties("Display", "HistoryLines", value); }
}
public static bool ImageFrameHighlight
{
get { return (bool)Preferences.GetProperties("Display", "ImageFrameHighlight"); }
set { Preferences.SetProperties("Display", "ImageFrameHighlight", value); }
}
public static bool LayoutCreateViewport
{
get { return (bool)Preferences.GetProperties("Display", "LayoutCreateViewport"); }
set { Preferences.SetProperties("Display", "LayoutCreateViewport", value); }
}
public static Color LayoutCrosshairColor
{
get { return (Color)Preferences.GetProperties("Display", "LayoutCrosshairColor"); }
set { Preferences.SetProperties("Display", "LayoutCrosshairColor", value); }
}
public static bool LayoutDisplayMargins
{
get { return (bool)Preferences.GetProperties("Display", "LayoutDisplayMargins"); }
set { Preferences.SetProperties("Display", "LayoutDisplayMargins", value); }
}
public static bool LayoutDisplayPaper
{
get { return (bool)Preferences.GetProperties("Display", "LayoutDisplayPaper"); }
set { Preferences.SetProperties("Display", "LayoutDisplayPaper", value); }
}
public static bool LayoutDisplayPaperShadow
{
get { return (bool)Preferences.GetProperties("Display", "LayoutDisplayPaperShadow"); }
set { Preferences.SetProperties("Display", "LayoutDisplayPaperShadow", value); }
}
public static bool LayoutShowPlotSetup
{
get { return (bool)Preferences.GetProperties("Display", "LayoutShowPlotSetup"); }
set { Preferences.SetProperties("Display", "LayoutShowPlotSetup", value); }
}
public static bool MaxAutoCADWindow
{
get { return (bool)Preferences.GetProperties("Display", "MaxAutoCADWindow"); }
set { Preferences.SetProperties("Display", "MaxAutoCADWindow", value); }
}
public static Color ModelCrosshairColor
{
get { return (Color)Preferences.GetProperties("Display", "ModelCrosshairColor"); }
set { Preferences.SetProperties("Display", "ModelCrosshairColor", value); }
}
public static bool ShowRasterImage
{
get { return (bool)Preferences.GetProperties("Display", "ShowRasterImage"); }
set { Preferences.SetProperties("Display", "ShowRasterImage", value); }
}
public static int TextFontSize
{
get { return (int)Preferences.GetProperties("Display", "TextFontSize"); }
set { Preferences.SetProperties("Display", "TextFontSize", value); }
}
public static string TextFont
{
get { return (string)Preferences.GetProperties("Display", "TextFont"); }
set { Preferences.SetProperties("Display", "TextFont", value); }
}
public static acTextFontStyle TextFontStyle
{
get { return (acTextFontStyle)Preferences.GetProperties("Display", "TextFontStyle"); }
set { Preferences.SetProperties("Display", "TextFontStyle", value); }
}
public static Color TextWinBackgrndColor
{
get { return (Color)Preferences.GetProperties("Display", "TextWinBackgrndColor"); }
set { Preferences.SetProperties("Display", "TextWinBackgrndColor", value); }
}
public static Color TextWinTextColor
{
get { return (Color)Preferences.GetProperties("Display", "TextWinTextColor"); }
set { Preferences.SetProperties("Display", "TextWinTextColor", value); }
}
public static bool TrueColorImages
{
get { return (bool)Preferences.GetProperties("Display", "TrueColorImages"); }
set { Preferences.SetProperties("Display", "TrueColorImages", value); }
}
public static int XRefFadeIntensity
{
get { return (int)Preferences.GetProperties("Display", "XRefFadeIntensity"); }
set { Preferences.SetProperties("Display", "XRefFadeIntensity", value); }
}
}
}
}
4、Drafting
namespace TlsCad
{
namespace Preferences
{
public enum acAlignmentPointAcquisition
{
acAlignPntAcquisitionAutomatic,
acAlignPntAcquisitionShiftToAcquire
}
public enum acColor
{
acRed,
acYellow,
acGreen,
acCyan,
acBlue,
acMagenta,
acWhite
}
public static class Drafting
{
public static acAlignmentPointAcquisition AlignmentPointAcquisition
{
get { return (acAlignmentPointAcquisition)Preferences.GetProperties("Drafting", "AlignmentPointAcquisition"); }
set { Preferences.SetProperties("Drafting", "AlignmentPointAcquisition", value); return; }
}
public static bool AutoSnapAperture
{
get { return (bool)Preferences.GetProperties("Drafting", "AutoSnapAperture"); }
set { Preferences.SetProperties("Drafting", "AutoSnapAperture", value); return; }
}
public static int AutoSnapApertureSize
{
get { return (int)Preferences.GetProperties("Drafting", "AutoSnapApertureSize"); }
set { Preferences.SetProperties("Drafting", "AutoSnapApertureSize", value); return; }
}
public static bool AutoSnapMagnet
{
get { return (bool)Preferences.GetProperties("Drafting", "AutoSnapMagnet"); }
set { Preferences.SetProperties("Drafting", "AutoSnapMagnet", value); return; }
}
public static bool AutoSnapMarker
{
get { return (bool)Preferences.GetProperties("Drafting", "AutoSnapMarker"); }
set { Preferences.SetProperties("Drafting", "AutoSnapMarker", value); return; }
}
public static acColor AutoSnapMarkerColor
{
get { return (acColor)Preferences.GetProperties("Drafting", "AutoSnapMarkerColor"); }
set { Preferences.SetProperties("Drafting", "AutoSnapMarkerColor", value); return; }
}
public static int AutoSnapMarkerSize
{
get { return (int)Preferences.GetProperties("Drafting", "AutoSnapMarkerSize"); }
set { Preferences.SetProperties("Drafting", "AutoSnapMarkerSize", value); return; }
}
public static bool AutoSnapToolTip
{
get { return (bool)Preferences.GetProperties("Drafting", "AutoSnapToolTip"); }
set { Preferences.SetProperties("Drafting", "AutoSnapToolTip", value); return; }
}
public static bool AutoTrackTooltip
{
get { return (bool)Preferences.GetProperties("Drafting", "AutoTrackTooltip"); }
set { Preferences.SetProperties("Drafting", "AutoTrackTooltip", value); return; }
}
public static bool FullScreenTrackingVector
{
get { return (bool)Preferences.GetProperties("Drafting", "FullScreenTrackingVector"); }
set { Preferences.SetProperties("Drafting", "FullScreenTrackingVector", value); return; }
}
public static bool PolarTrackingVector
{
get { return (bool)Preferences.GetProperties("Drafting", "PolarTrackingVector"); }
set { Preferences.SetProperties("Drafting", "PolarTrackingVector", value); return; }
}
}
}
}
5、OpenSave
namespace TlsCad
{
namespace Preferences
{
public enum acARXDemandLoad
{
acDemandLoadDisabled,
acDemandLoadOnObjectDetect,
acDemandLoadCmdInvoke
}
public enum acXRefDemandLoad
{
acDemandLoadDisabled,
acDemandLoadEnabled,
acDemandLoadEnabledWithCopy
}
public enum acProxyImage
{
acProxyNotShow,
acProxyShow,
acProxyBoundingBox
}
public enum acSaveAsType
{
acR14_dwg = 8,
ac2000_dwg = 12,
ac2000_dxf = 13,
ac2000_Template = 14,
ac2004_dwg = 24,
ac2004_dxf = 25,
ac2004_Template = 26,
ac2007_dwg = 36,
ac2007_dxf = 37,
ac2007_Template = 38,
ac2010_dwg = 48,
ac2010_dxf,
ac2010_Template,
acNative = 36,
acUnknown = -1,
}
public static class OpenSave
{
public static bool AutoAudit
{
get { return (bool)Preferences.GetProperties("OpenSave", "AutoAudit"); }
set { Preferences.SetProperties("OpenSave", "AutoAudit", value); }
}
public static int AutoSaveInterval
{
get { return (int)Preferences.GetProperties("OpenSave", "AutoSaveInterval"); }
set { Preferences.SetProperties("OpenSave", "AutoSaveInterval", value); }
}
public static bool CreateBackup
{
get { return (bool)Preferences.GetProperties("OpenSave", "CreateBackup"); }
set { Preferences.SetProperties("OpenSave", "CreateBackup", value); }
}
public static acARXDemandLoad DemandLoadARXApp
{
get { return (acARXDemandLoad)Preferences.GetProperties("OpenSave", "DemandLoadARXApp"); }
set { Preferences.SetProperties("OpenSave", "DemandLoadARXApp", value); }
}
public static bool FullCRCValidation
{
get { return (bool)Preferences.GetProperties("OpenSave", "FullCRCValidation"); }
set { Preferences.SetProperties("OpenSave", "FullCRCValidation", value); }
}
public static int IncrementalSavePercent
{
get { return (int)Preferences.GetProperties("OpenSave", "IncrementalSavePercent"); }
set { Preferences.SetProperties("OpenSave", "IncrementalSavePercent", value); }
}
public static bool LogFileOn
{
get { return (bool)Preferences.GetProperties("OpenSave", "LogFileOn"); }
set { Preferences.SetProperties("OpenSave", "LogFileOn", value); }
}
public static int MRUNumber
{
get { return (int)Preferences.GetProperties("OpenSave", "MRUNumber"); }
set { Preferences.SetProperties("OpenSave", "MRUNumber", value); }
}
public static acProxyImage ProxyImage
{
get { return (acProxyImage)Preferences.GetProperties("OpenSave", "ProxyImage"); }
set { Preferences.SetProperties("OpenSave", "ProxyImage", value); }
}
public static acSaveAsType SaveAsType
{
get { return (acSaveAsType)Preferences.GetProperties("OpenSave", "SaveAsType"); }
set { Preferences.SetProperties("OpenSave", "SaveAsType", value); }
}
public static bool SavePreviewThumbnail
{
get { return (bool)Preferences.GetProperties("OpenSave", "SavePreviewThumbnail"); }
set { Preferences.SetProperties("OpenSave", "SavePreviewThumbnail", value); }
}
public static bool ShowProxyDialogBox
{
get { return (bool)Preferences.GetProperties("OpenSave", "ShowProxyDialogBox"); }
set { Preferences.SetProperties("OpenSave", "ShowProxyDialogBox", value); }
}
public static string TempFileExtension
{
get { return (string)Preferences.GetProperties("OpenSave", "TempFileExtension"); }
set { Preferences.SetProperties("OpenSave", "TempFileExtension", value); }
}
public static acXRefDemandLoad XRefDemandLoad
{
get { return (acXRefDemandLoad)Preferences.GetProperties("OpenSave", "XRefDemandLoad"); }
set { Preferences.SetProperties("OpenSave", "XRefDemandLoad", value); }
}
}
}
}
6、Output
namespace TlsCad
{
namespace Preferences
{
public enum acOleQuality
{
acOQLineArt,
acOQText,
acOQGraphics,
acOQPhoto,
acOQHighPhoto
}
public enum acPlotPolicy
{
acPolicyLegacy,
acPolicyNamed
}
public enum acPrinterSpoolAlert
{
acPrinterAlwaysAlert,
acPrinterAlertOnce,
acPrinterNeverAlertLogOnce,
acPrinterNeverAlert
}
public static class Output
{
public static bool AutomaticPlotLog
{
get { return (bool)Preferences.GetProperties("Output", "AutomaticPlotLog"); }
set { Preferences.SetProperties("Output", "AutomaticPlotLog", value); }
}
public static bool ContinuousPlotLog
{
get { return (bool)Preferences.GetProperties("Output", "ContinuousPlotLog"); }
set { Preferences.SetProperties("Output", "ContinuousPlotLog", value); }
}
public static string DefaultOutputDevice
{
get { return (string)Preferences.GetProperties("Output", "DefaultOutputDevice"); }
set { Preferences.SetProperties("Output", "DefaultOutputDevice", value); }
}
public static string DefaultPlotToFilePath
{
get { return (string)Preferences.GetProperties("Output", "DefaultPlotToFilePath"); }
set { Preferences.SetProperties("Output", "DefaultPlotToFilePath", value); }
}
public static string DefaultPlotStyleForLayer
{
get { return (string)Preferences.GetProperties("Output", "DefaultPlotStyleForLayer"); }
set { Preferences.SetProperties("Output", "DefaultPlotStyleForLayer", value); }
}
public static string DefaultPlotStyleForObjects
{
get { return (string)Preferences.GetProperties("Output", "DefaultPlotStyleForObjects"); }
set { Preferences.SetProperties("Output", "DefaultPlotStyleForObjects", value); }
}
public static acOleQuality OLEQuality
{
get { return (acOleQuality)Preferences.GetProperties("Output", "OLEQuality"); }
set { Preferences.SetProperties("Output", "OLEQuality", value); }
}
public static bool PlotLegacy
{
get { return (bool)Preferences.GetProperties("Output", "PlotLegacy"); }
set { Preferences.SetProperties("Output", "PlotLegacy", value); }
}
public static acPlotPolicy PlotPolicy
{
get { return (acPlotPolicy)Preferences.GetProperties("Output", "PlotPolicy"); }
set { Preferences.SetProperties("Output", "PlotPolicy", value); }
}
public static bool PrinterPaperSizeAlert
{
get { return (bool)Preferences.GetProperties("Output", "PrinterPaperSizeAlert"); }
set { Preferences.SetProperties("Output", "PrinterPaperSizeAlert", value); }
}
public static acPrinterSpoolAlert PrinterSpoolAlert
{
get { return (acPrinterSpoolAlert)Preferences.GetProperties("Output", "PrinterSpoolAlert"); }
set { Preferences.SetProperties("Output", "PrinterSpoolAlert", value); }
}
public static bool UseLastPlotSettings
{
get { return (bool)Preferences.GetProperties("Output", "UseLastPlotSettings"); }
set { Preferences.SetProperties("Output", "UseLastPlotSettings", value); }
}
}
}
}
7、Selection
namespace TlsCad
{
namespace Preferences
{
public static class Selection
{
public static bool DisplayGrips
{
get { return (bool)Preferences.GetProperties("Selection", "DisplayGrips"); }
set { Preferences.SetProperties("Selection", "DisplayGrips", value); }
}
public static bool DisplayGripsWithinBlocks
{
get { return (bool)Preferences.GetProperties("Selection", "DisplayGripsWithinBlocks"); }
set { Preferences.SetProperties("Selection", "DisplayGripsWithinBlocks", value); }
}
public static acColor GripColorSelected
{
get { return (acColor)Preferences.GetProperties("Selection", "GripColorSelected"); }
set { Preferences.SetProperties("Selection", "GripColorSelected", value); }
}
public static acColor GripColorUnselected
{
get { return (acColor)Preferences.GetProperties("Selection", "GripColorUnselected"); }
set { Preferences.SetProperties("Selection", "GripColorUnselected", value); }
}
public static int GripSize
{
get { return (int)Preferences.GetProperties("Selection", "GripSize"); }
set { Preferences.SetProperties("Selection", "GripSize", value); }
}
public static bool PickAdd
{
get { return (bool)Preferences.GetProperties("Selection", "PickAdd"); }
set { Preferences.SetProperties("Selection", "PickAdd", value); }
}
public static bool PickAuto
{
get { return (bool)Preferences.GetProperties("Selection", "PickAuto"); }
set { Preferences.SetProperties("Selection", "PickAuto", value); }
}
public static int PickBoxSize
{
get { return (int)Preferences.GetProperties("Selection", "PickBoxSize"); }
set { Preferences.SetProperties("Selection", "PickBoxSize", value); }
}
public static bool PickDrag
{
get { return (bool)Preferences.GetProperties("Selection", "PickDrag"); }
set { Preferences.SetProperties("Selection", "PickDrag", value); }
}
public static bool PickFirst
{
get { return (bool)Preferences.GetProperties("Selection", "PickFirst"); }
set { Preferences.SetProperties("Selection", "PickFirst", value); }
}
public static bool PickGroup
{
get { return (bool)Preferences.GetProperties("Selection", "PickGroup"); }
set { Preferences.SetProperties("Selection", "PickGroup", value); }
}
}
}
}
8、System
namespace TlsCad
{
namespace Preferences
{
public static class System
{
public static bool BeepOnError
{
get { return (bool)Preferences.GetProperties("System", "BeepOnError"); }
set { Preferences.SetProperties("System", "BeepOnError", value); }
}
public static bool DisplayOLEScale
{
get { return (bool)Preferences.GetProperties("System", "DisplayOLEScale"); }
set { Preferences.SetProperties("System", "DisplayOLEScale", value); }
}
public static bool EnableStartupDialog
{
get { return (bool)Preferences.GetProperties("System", "EnableStartupDialog"); }
set { Preferences.SetProperties("System", "EnableStartupDialog", value); }
}
public static bool LoadAcadLspInAllDocuments
{
get { return (bool)Preferences.GetProperties("System", "LoadAcadLspInAllDocuments"); }
set { Preferences.SetProperties("System", "LoadAcadLspInAllDocuments", value); }
}
public static bool ShowWarningMessages
{
get { return (bool)Preferences.GetProperties("System", "ShowWarningMessages"); }
set { Preferences.SetProperties("System", "ShowWarningMessages", value); }
}
public static bool StoreSQLIndex
{
get { return (bool)Preferences.GetProperties("System", "StoreSQLIndex"); }
set { Preferences.SetProperties("System", "StoreSQLIndex", value); }
}
public static bool TablesReadOnly
{
get { return (bool)Preferences.GetProperties("System", "TablesReadOnly"); }
set { Preferences.SetProperties("System", "TablesReadOnly", value); }
}
}
}
}
9、User
namespace TlsCad
{
namespace Preferences
{
public enum AcInsertUnits
{
acInsertUnitsUnitless,
acInsertUnitsInches,
acInsertUnitsFeet,
acInsertUnitsMiles,
acInsertUnitsMillimeters,
acInsertUnitsCentimeters,
acInsertUnitsMeters,
acInsertUnitsKilometers,
acInsertUnitsMicroinches,
acInsertUnitsMils,
acInsertUnitsYards,
acInsertUnitsAngstroms,
acInsertUnitsNanometers,
acInsertUnitsMicrons,
acInsertUnitsDecimeters,
acInsertUnitsDecameters,
acInsertUnitsHectometers,
acInsertUnitsGigameters,
acInsertUnitsAstronomicalUnits,
acInsertUnitsLightYears,
acInsertUnitsParsecs
}
public enum acKeyboardAccelerator
{
acPreferenceClassic,
acPreferenceCustom
}
public enum acKeyboardPriority
{
acKeyboardRunningObjSnap,
acKeyboardEntry,
acKeyboardEntryExceptScripts
}
public enum AcDrawingAreaSCMCommand
{
acEnter,
acEnableSCM,
acEnableSCMOptions
}
public enum AcDrawingAreaSCMDefault
{
acRepeatLastCommand,
acSCM
}
public enum AcDrawingAreaSCMEdit
{
acEdRepeatLastCommand,
acEdSCM
}
public static class User
{
public static AcInsertUnits ADCInsertUnitsDefaultSource
{
get { return (AcInsertUnits)Preferences.GetProperties("User", "ADCInsertUnitsDefaultSource"); }
set { Preferences.SetProperties("User", "ADCInsertUnitsDefaultSource", value); }
}
public static AcInsertUnits ADCInsertUnitsDefaultTarget
{
get { return (AcInsertUnits)Preferences.GetProperties("User", "ADCInsertUnitsDefaultTarget"); }
set { Preferences.SetProperties("User", "ADCInsertUnitsDefaultTarget", value); }
}
public static bool HyperlinkDisplayCursor
{
get { return (bool)Preferences.GetProperties("User", "HyperlinkDisplayCursor"); }
set { Preferences.SetProperties("User", "HyperlinkDisplayCursor", value); }
}
public static bool HyperlinkDisplayTooltip
{
get { return (bool)Preferences.GetProperties("User", "HyperlinkDisplayTooltip"); }
set { Preferences.SetProperties("User", "HyperlinkDisplayTooltip", value); }
}
public static acKeyboardAccelerator KeyboardAccelerator
{
get { return (acKeyboardAccelerator)Preferences.GetProperties("User", "KeyboardAccelerator"); }
set { Preferences.SetProperties("User", "KeyboardAccelerator", value); }
}
public static acKeyboardPriority KeyboardPriority
{
get { return (acKeyboardPriority)Preferences.GetProperties("User", "KeyboardPriority"); }
set { Preferences.SetProperties("User", "KeyboardPriority", value); }
}
public static AcDrawingAreaSCMCommand SCMCommandMode
{
get { return (AcDrawingAreaSCMCommand)Preferences.GetProperties("User", "SCMCommandMode"); }
set { Preferences.SetProperties("User", "SCMCommandMode", value); }
}
public static AcDrawingAreaSCMDefault SCMDefaultMode
{
get { return (AcDrawingAreaSCMDefault)Preferences.GetProperties("User", "SCMDefaultMode"); }
set { Preferences.SetProperties("User", "SCMDefaultMode", value); }
}
public static AcDrawingAreaSCMEdit SCMEditMode
{
get { return (AcDrawingAreaSCMEdit)Preferences.GetProperties("User", "SCMEditMode"); }
set { Preferences.SetProperties("User", "SCMEditMode", value); }
}
public static bool SCMTimeMode
{
get { return (bool)Preferences.GetProperties("User", "SCMTimeMode"); }
set { Preferences.SetProperties("User", "SCMTimeMode", value); }
}
public static int SCMTimeValue
{
get { return (int)Preferences.GetProperties("User", "SCMTimeValue"); }
set { Preferences.SetProperties("User", "SCMTimeValue", value); }
}
public static bool ShortCutMenuDisplay
{
get { return (bool)Preferences.GetProperties("User", "ShortCutMenuDisplay"); }
set { Preferences.SetProperties("User", "ShortCutMenuDisplay", value); }
}
}
}
}
页:
[1]
2