AutoCAD .NET开发,Autodesk.AutoCAD.Runtime.Exception异常类的使用说明!
(2017-01-26 22:12:36)
System.Exception类及其派生类拥有多个属性,其中最重要的属性是Message和Source。Message属性包含当前异常原因的错误信息,Source属性表示导致错误的应用程序或对象的名称。TargetSite属性表示引发当前异常的方法。
Autodesk.AutoCAD.Runtime.Exception
类除了System.Exception类的属性外,另外还提供了ErrorStatus属性,用来表示与当前异常关联的错误状态代码,它属于Autodesk.AutoCAD.Runtime.ErrorStatus枚举。
= 0x4e53, AlreadyActive
= 0x4e54, AlreadyInactive
= 0x1a, AlreadyInDB
AlreadyInGroup = 260,
AmbiguousInput = 4,
AmbiguousOutput = 5,
AnonymousEntry = 0x26,
AtMaxReaders = 90,
BackgroundPlotInProgress = 0x20f,
BadColor = 0xd0,
BadColorIndex = 0xca,
BadDwgHeader = 0x13a,
BadDxfFile = 0x170,
BadDxfSequence = 0x34,
BadLayerName = 200,
BadLinetypeName = 0xcb,
BadLinetypeScale = 0xcc,
BadLineWeightValue = 0xcf,
BadlyNestedAppData = 0x17a,
BadPaperspaceView = 0xa9,
BadPlotStyleName = 0x180,
BadPlotStyleNameHandle = 0x183,
BadPlotStyleType = 0x182,
BadUcs = 0xa8,
BadVisibilityValue = 0xcd,
BinaryDataSizeExceeded = 0x187,
BlockDefInEntitySection = 0x17d,
BrokenHandle = 12,
BufferTooSmall = 7,
CannotBeErasedByCaller = 0x69,
CannotBeResurrected = 0x6a,
CannotChangeActiveViewpo rt = 140,
CannotChangeColumnType = 0x1b9,
CannotExplodeEntity = 0x9f,
CannotNestBlockDefinitio ns = 0x3b,
CannotPlotToFile = 0x20c,
CannotRestoreFromAcisFil e = 300,
CannotScaleNonUniformly = 0x88,
CantOpenFile = 0x16c,
CloseFailObjectDamaged = 0x68,
CloseModifyAborted = 0x66,
ClosePartialFailure = 0x67,
CloseWasNotifying = 0x65,
CommandWasInProgress = 0x8e,
ContainerNotEmpty = 0x12,
CopyDoesNotExist = 0x162,
CopyFailed = 0x164,
CopyInvalidName = 0x165,
CopyIsModelSpace = 0x163,
CopyNameExists = 0x166,
CreateFailed = 0x151,
CreateInvalidName = 0x152,
CustomSizeNotPossible = 0x202,
DatabaseObjectsOpen = 0x142,
DataLinkAdapterNotFound = 650,
DataLinkBadConnectionStr ing = 0x28d,
DataLinkConnectionFailed = 0x290,
DataLinkInvalidAdapterId = 0x28b,
DataLinkNotFound = 0x28c,
DataLinkNotUpdatedYet = 0x28e,
DataLinkOtherError = 660,
DataLinkSourceIsWritePro tected = 0x292,
DataLinkSourceNotFound = 0x28f,
DegenerateGeometry = 0x99,
DelDoesNotExist = 0x156,
DeletedEntry = 0x1c,
DeleteEntity = 0xbf,
DelIsModelSpace = 0x157,
DelLastLayout = 0x158,
DelUnableToFind = 0x15a,
DelUnableToSetCurrent = 0x159,
DeviceNotFound = 0x1f8,
DocumentSwitchDisabled = 0x14e,
DuplicateBlockDefinition = 0x185,
DuplicateBlockName = 0x181,
DuplicateDxfField = 0x31,
DuplicateIndex = 0x19,
DuplicateKey = 0x17,
DuplicateLayerName = 0x17f,
DuplicateRecordName = 0x5f,
DwgCrcDoesNotMatch = 0x41,
DwgNeedsAFullSave = 0x45,
DwgNeedsRecovery = 190,
DwgNotRecoverable = 0x3d,
DwgObjectImproperlyRead = 0x43,
DwgRecoveredOK = 60,
DwgSentinelDoesNotMatch = 0x42,
DwgShareDemandLoad = 500,
DwgShareReadAccess = 0x1f5,
DwgShareWriteAccess = 0x1f6,
DwkLockFileFound = 0x4d,
DxbPartiallyRead = 0x40,
DxbReadAborted = 70,
DxfPartiallyRead = 0x3e,
DxfReadAborted = 0x3f,
EndOfFile = 0x29,
EndOfObject = 40,
EntityInInactiveLayout = 9,
ExcessiveItemCount = 0xa6,
ExplodeBeforeTransform = 0x87,
ExternalDataSizeExceeded = 0x7d,
FileAccessErr = 0x48,
FileExists = 0x16a,
FileInternalErr = 0x4a,
FileLockedByAutoCAD = 0x47,
FileMissingSections = 0x1b4,
FileNotFound = 0x4c,
FilerError = 0x35,
FileSharingViolation = 0x1b1,
FileSystemErr = 0x49,
FileTooManyOpen = 0x4b,
FiniteStateMachineError = 0xc1,
FixedAllErrors = 120,
GeneralModelingFailure = 150,
GraphicsNotGenerated = 0x20b,
GuidNoAddress = 0x18a,
HadMultipleReaders = 0x5e,
HandleExists = 10,
HandleInUse = 14,
HatchTooDense = 420,
IgnoredLinetypeRedefinit ion = 0xa7,
IllegalEntityType = 0x15,
IllegalReplacement = 0x27,
IncompatiblePlotSettings = 0x1fc,
IncompleteBlockDefinitio n = 0x17b,
IncompleteComplexObject = 380,
InProcessOfCommitting = 0xfd,
InsertAfter = 110,
InternetBadPath = 0x4e23,
InternetBase = 0x4e20,
InternetCreateInternetSe ssionFailed = 0x4e33,
InternetDirectoryFull = 0x4e27,
InternetDiskFull = 0x4e2a,
InternetFileAccessDenied = 0x4e25,
InternetFileGenericError = 0x4e2b,
InternetFileNotFound = 0x4e22,
InternetFileOpenFailed = 0x4e37,
InternetGenericException = 0x4e51,
InternetHardwareError = 0x4e28,
InternetHttpAccessDenied = 0x4e3b,
InternetHttpBadGateway = 0x4e4c,
InternetHttpBadMethod = 0x4e3f,
InternetHttpBadRequest = 0x4e3a,
InternetHttpConflict = 0x4e43,
InternetHttpGatewayTimeo ut = 0x4e4e,
InternetHttpLengthRequir ed = 0x4e45,
InternetHttpNoAcceptable Response = 0x4e40,
InternetHttpNotSupported = 0x4e4b,
InternetHttpObjectNotFou nd = 0x4e3e,
InternetHttpOpenRequestF ailed = 0x4e38,
InternetHttpPaymentRequi red = 0x4e3c,
InternetHttpPrecondition Failure = 0x4e46,
InternetHttpProxyAuthori zationRequired = 0x4e41,
InternetHttpRequestForbi dden = 0x4e3d,
InternetHttpRequestTooLa rge = 0x4e47,
InternetHttpResourceGone = 0x4e44,
InternetHttpServerError = 0x4e4a,
InternetHttpServiceUnava ilable = 0x4e4d,
InternetHttpTimedOut = 0x4e42,
InternetHttpUnsupportedM edia = 0x4e49,
InternetHttpUriTooLong = 0x4e48,
InternetHttpVersionNotSu pported = 0x4e4f,
InternetInCache = 0x4e21,
InternetInternetError = 0x4e50,
InternetInternetSessionC onnectFailed = 0x4e34,
InternetInternetSessionO penFailed = 0x4e35,
InternetInvalidAccessTyp e = 0x4e36,
InternetInvalidFileHandl e = 0x4e26,
InternetNoInternetSuppor t = 0x4e30,
InternetNotAnUrl = 0x4e2d,
InternetNotImplemented = 0x4e31,
InternetNoWinInternet = 0x4e2e,
InternetOK = 0x4e20,
InternetOldWinInternet = 0x4e2f,
InternetProtocolNotSuppo rted = 0x4e32,
InternetSharingViolation = 0x4e29,
InternetTooManyOpenFiles = 0x4e24,
InternetUnknownError = 0x4e52,
InternetUserCancelledTra nsfer = 0x4e39,
InternetValidUrl = 0x4e2c,
InvalidAdsName = 0x1f,
InvalidAxis = 0x9a,
InvalidBlockName = 0x2f,
InvalidContext = 0x14f,
InvalidDimStyle = 0xac,
InvalidDwgVersion = 0x25,
InvalidDxf2dPoint = 0x177
,
InvalidDxf3dPoint = 0x178,
InvalidDxfCode = 50,
InvalidDxfSectionName = 0x173,
InvalidEngineState = 0x205,
InvalidExtents = 30,
InvalidFaceVertexIndex = 0x37,
InvalidFileExtension = 360,
InvalidFix = 0xc0,
InvalidIdMap = 220,
InvalidIndex = 0x18,
InvalidInput = 3,
InvalidInterfaceId = 290,
InvalidKey = 0x21,
InvalidLayer = 0xad,
InvalidMeshVertexIndex = 0x38,
InvalidNormal = 0x123,
InvalidObjectId = 600,
InvalidOffset = 0x9d,
InvalidOpenState = 8,
InvalidOwnerObject = 0xdd,
InvalidPlotArea = 0x201,
InvalidPlotInfo = 520,
InvalidProfileName = 0x169,
InvalidResultBuffer = 0x33,
InvalidStyle = 0x124,
InvalidSymbolTableName = 0x20,
InvalidSymTableFlag = 0xa1,
InvalidTextStyle = 0xa3,
InvalidView = 0x1ff,
InvalidWindowArea = 0x200,
InvalidXrefObjectId = 0x259,
IsAnEntity = 0x8b,
IsReading = 0x2a,
IsWriteProtected = 0x5b,
IsWriting = 0x2b,
IsXRefObject = 0x5c,
IteratorDone = 0x81,
KeyNotFound = 0x16,
LayerGroupCodeMissing = 0xc9,
LayoutNotCurrent = 0x20a,
LeftErrorsUnfixed = 0x7a,
LispActive = 0x14c,
LoadFailed = 0x1f7,
LockChangeInProgress = 0x143,
LockConflict = 0x141,
LockViolation = 320,
LongTransReferenceError = 0xff,
MakeMeProxy = 0x12d,
MakeMeProxyAndResurrect = 0x1b0,
MaxLayouts = 0x198,
MissingBlockName = 390,
MissingDxfField = 0x30,
MissingDxfSection = 370,
MissingSymbolTable = 0x62,
MissingSymbolTableRecord = 0x63,
MustBe0to2 = 0x18b,
MustBe0to3 = 0x18c,
MustBe0to4 = 0x18d,
MustBe0to5 = 0x18e,
MustBe0to8 = 0x18f,
MustBe1to15 = 0x191,
MustBe1to6 = 0x195,
MustBe1to8 = 400,
MustBeNonNegative = 0x193,
MustBeNonZero = 0x194,
MustBePositive = 0x192,
MustFirstAddBlockToDB = 0x3a,
MustOpenThruOwner = 0x58,
MustPlotToFile = 0x20d,
NegativeValueNotAllowed = 0x1d,
NlsFileNotAvailable = 0x12e,
NoActiveTransactions = 250,
NoBlockBegin = 0x17e,
NoClassId = 0x199,
NoCurrentConfig = 0x1f9,
NoDatabase = 0x7c,
NoDocument = 330,
NoErrorHandler = 0x207,
NoFileName = 0x16d,
NoInputFiler = 0x44,
NoInternalSpace = 0xab,
NoLabelBlock = 0x25b,
NoLayout = 0x1fb,
NoMatchingMedia = 510,
NonCoplanarGeometry = 0x98,
NonePlotDevice = 0x1fd,
NonPlanarEntity = 0x9e,
NoPlotStyleTranslationTa ble = 0x196,
NotAllowedForThisProxy = 0x12f,
NotAnEntity = 0x5d,
NotApplicable = 2,
NotCurrentDatabase = 0x8a,
NotDxfHeaderGroupCode = 0x174,
NotFromThisDocument = 0x14b,
NotHandled = 0x1af,
NoThumbnailBitmap = 0x189,
NotImplementedYet = 1,
NotInBlock = 0x83,
NotInDatabase = 0x89,
NotInGroup = 0x105,
NotInitializedYet = 0x176,
NotInPaperspace = 0x8d,
NotMultiPageCapable = 0x20e,
NotNewlyCreated = 0xfe,
NotOpenForRead = 0x2c,
NotOpenForWrite = 0x2d,
NotSupportedInDwgApi = 310,
NotThatKindOfClass = 0x2e,
NotTopTransaction = 0xfb,
NoViewAssociation = 0x25a,
NoWorkSet = 0x100,
NullBlockName = 0x11,
NullEntityPointer = 20,
NullExtents = 0x138,
NullHandle = 11,
NullIterator = 130,
NullObjectId = 0x10,
NullObjectPointer = 15,
NullPtr = 0x1fa,
= 0x209, NumberOfCopiesNotSupport ed
ObjectIsReferenced = 0x188,
ObjectToBeDeleted = 0x24,
ObsoleteFileFormat = 0x1b3,
OK = 0,
OnLockedLayer = 0x57,
OpenFileCancelled = 430,
OtherObjectsBusy = 0x39,
OutOfDisk = 0x1b,
OutOfMemory = 6,
OutOfPagerMemory = 0xd3,
OutOfRange = 0x97,
OwnerNotInDatabase = 0x84,
OwnerNotOpenForRead = 0x85,
OwnerNotOpenForWrite = 0x86,
OwnerNotSet = 0xde,
PageCancelled = 0x203,
PagerError = 210,
PagerWriteError = 0xd4,
PermanentlyErased = 0x51,
PlotAlreadyStarted = 0x206,
PlotCancelled = 0x204,
PlotStyleInColorDependen tMode = 0x197,
PointNotOnEntity = 0x9b,
PolyWidthLost = 0x137,
ProfileDoesNotExist = 0x167,
ProfileIsInUse = 0x16b,
ProperClassSeparatorExpe cted = 0xce,
RecordNotInTable = 0x80,
RegisteredApplicationIdN otFound = 0x7e,
RegistryAccessError = 0x16e,
RegistryCreateError = 0x16f,
RenameDoesNotExist = 0x15c,
RenameInvalidLayoutName = 350,
RenameInvalidName = 0x160,
RenameIsModelSpace = 0x15d,
RenameLayoutAlreadyExist s = 0x15f,
RepeatedDwgRead = 0x1b5,
RepeatEntity = 0x7f,
RowsMustMatchColumns = 0x1ba,
SecErrorCipherNotSupport ed = 0x4b2,
SecErrorComputingSignatu re = 0x44f,
SecErrorDecryptingData = 0x4b3,
SecErrorEncryptingData = 0x4b1,
SecErrorGeneratingTimest amp = 0x44e,
SecErrorReadingFile = 0x3ea,
SecErrorWritingFile = 0x3eb,
SecErrorWritingSignature = 0x450,
SecInitializationFailure = 0x3e9,
SecInvalidDigitalId = 0x44d,
SelfReference = 0x61,
SetFailed = 340,
SingularPoint = 0x9c,
SomeInputDataLeftUnread = 170,
StringTooLong = 160,
SubentitiesStillOpen = 0x59,
SubSelectionSetEmpty = 550,
TargetDocNotQuiescent = 0x14d,
TooFewLineTypeElements = 0xa4,
TooFewVertices = 0xe8,
TooManyLineTypeElements = 0xa5,
TooManyVertices = 0xe7,
TransactionOpenWhileComm andEnded = 0xfc,
UnableToGetLabelBlock = 0x25f,
UnableToGetViewAssociati on = 0x25d,
UnableToRemoveAssociatio n = 0x260,
UnableToSetLabelBlock = 0x25e,
UnableToSetViewAssociati on = 0x25c,
UnableToSyncModelView = 0x261,
UndefinedDxfGroupCode = 0x175,
UndefinedLineType = 0xa2,
UndefineShapeName = 0x184,
UndoNoGroupBegin = 0x19b,
UndoOperationNotAvailabl e = 410,
UnknownDxfFileFormat = 0x171,
UnknownHandle = 13,
UnrecoverableErrors = 0x7b,
UnsupportedFileFormat = 0x1b2,
UserBreak = 180,
VertexAfterFace = 0x36,
Vetoed = 0x145,
WasErased = 80,
WasNotErased = 0x6b,
WasNotForwarding = 0xd5,
WasNotifying = 0x55,
WasNotOpenForWrite = 100,
WasOpenForNotify = 0x56,
WasOpenForRead = 0x52,
WasOpenForUndo = 0x54,
WasOpenForWrite = 0x53,
WrongCellType = 440,
WrongDatabase = 0x23,
WrongObjectType = 0x22,
WrongSubentityType = 230,
XRefDependent = 0x60