设置窗体形状

Option Explicit
Public Declare Function CreateEllipticRgn Lib “GDI32” (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function SetWindowRgn Lib “user32” (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Public Declare Function CreatePolygonRgn Lib “GDI32” (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long

Public Type POINTAPI
X As Long
Y As Long
End Type

Public Sub RoundForm()
Dim hRgn As Long, lRes As Long
‘圆形窗体
hRgn = CreateEllipticRgn(30, 24, 456, 450)
lRes = SetWindowRgn(Me.hWnd, hRgn, True)
End Sub
Public Sub CrossForm()
Dim hRgn As Long, lRes As Long
Dim pNode() As POINTAPI
ReDim pNode(11) As POINTAPI
‘十字窗体
pNode(0).X = 156
pNode(0).Y = 42
pNode(1).X = 329
pNode(1).Y = 42
pNode(2).X = 329
pNode(2).Y = 154
pNode(3).X = 439
pNode(3).Y = 154
pNode(4).X = 439
pNode(4).Y = 317
pNode(5).X = 329
pNode(5).Y = 317
pNode(6).X = 329
pNode(6).Y = 429
pNode(7).X = 156
pNode(7).Y = 429
pNode(8).X = 156
pNode(8).Y = 317
pNode(9).X = 46
pNode(9).Y = 317
pNode(10).X = 46
pNode(10).Y = 154
pNode(11).X = 156
pNode(11).Y = 154
hRgn = CreatePolygonRgn(pNode(0), 12, 2)
lRes = SetWindowRgn(Me.hWnd, hRgn, True)
End Sub

文件的 Hash 算法

‘计算 MD2、MD3、MD4、MD5、SHA1 等散列值。

Option Explicit
Private Declare Function CryptAcquireContext Lib “advapi32.dll” Alias “CryptAcquireContextA” (ByRef phProv As Long, ByVal pszContainer As String, ByVal pszProvider As String, ByVal dwProvType As Long, ByVal dwFlags As Long) As Long
Private Declare Function CryptReleaseContext Lib “advapi32.dll” (ByVal hProv As Long, ByVal dwFlags As Long) As Long
Private Declare Function CryptCreateHash Lib “advapi32.dll” (ByVal hProv As Long, ByVal Algid As Long, ByVal hKey As Long, ByVal dwFlags As Long, ByRef phHash As Long) As Long
Private Declare Function CryptDestroyHash Lib “advapi32.dll” (ByVal hHash As Long) As Long
Private Declare Function CryptHashData Lib “advapi32.dll” (ByVal hHash As Long, pbData As Any, ByVal dwDataLen As Long, ByVal dwFlags As Long) As Long
Private Declare Function CryptGetHashParam Lib “advapi32.dll” (ByVal hHash As Long, ByVal dwParam As Long, pbData As Any, pdwDataLen As Long, ByVal dwFlags As Long) As Long
Private Const PROV_RSA_FULL = 1
Private Const CRYPT_NEWKEYSET = &H8
Private Const ALG_CLASS_HASH = 32768
Private Const ALG_TYPE_ANY = 0
Private Const ALG_SID_MD2 = 1
Private Const ALG_SID_MD4 = 2
Private Const ALG_SID_MD5 = 3
Private Const ALG_SID_SHA1 = 4
Enum HashAlgorithm
MD2 = ALG_CLASS_HASH Or ALG_TYPE_ANY Or ALG_SID_MD2
MD4 = ALG_CLASS_HASH Or ALG_TYPE_ANY Or ALG_SID_MD4
MD5 = ALG_CLASS_HASH Or ALG_TYPE_ANY Or ALG_SID_MD5
SHA1 = ALG_CLASS_HASH Or ALG_TYPE_ANY Or ALG_SID_SHA1
End Enum
Private Const HP_HASHVAL = 2
Private Const HP_HASHSIZE = 4

Function HashFile(ByVal FileName As String, Optional ByVal Algorithm As HashAlgorithm = MD5) As String
Dim hCtx As Long
Dim hHash As Long
Dim lFile As Long
Dim lRes As Long
Dim lLen As Long
Dim lIdx As Long
Dim abHash() As Byte
If Len(Dir$(FileName)) = 0 Then Err.Raise 53
lRes = CryptAcquireContext(hCtx, vbNullString, vbNullString, PROV_RSA_FULL, 0)
If lRes = 0 And Err.LastDllError = &H80090016 Then
lRes = CryptAcquireContext(hCtx, vbNullString, vbNullString, PROV_RSA_FULL, CRYPT_NEWKEYSET)
End If
If lRes <> 0 Then
lRes = CryptCreateHash(hCtx, Algorithm, 0, 0, hHash)
If lRes <> 0 Then
lFile = FreeFile
Open FileName For Binary As lFile
If Err.Number = 0 Then
Const BLOCK_SIZE As Long = 32 * 1024& ‘ 32K
ReDim abBlock(1 To BLOCK_SIZE) As Byte
Dim lCount As Long
Dim lBlocks As Long
Dim lLastBlock As Long
lBlocks = LOF(lFile) \ BLOCK_SIZE
lLastBlock = LOF(lFile) – lBlocks * BLOCK_SIZE
For lCount = 1 To lBlocks
Get lFile, , abBlock
lRes = CryptHashData(hHash, abBlock(1), BLOCK_SIZE, 0)
If lRes = 0 Then Exit For
Next
If lLastBlock > 0 And lRes <> 0 Then
ReDim abBlock(1 To lLastBlock) As Byte
Get lFile, , abBlock
lRes = CryptHashData(hHash, abBlock(1), lLastBlock, 0)
End If
Close lFile
End If
If lRes <> 0 Then
lRes = CryptGetHashParam(hHash, HP_HASHSIZE, lLen, 4, 0)
If lRes <> 0 Then
ReDim abHash(0 To lLen – 1)
lRes = CryptGetHashParam(hHash, HP_HASHVAL, abHash(0), lLen, 0)
If lRes <> 0 Then
For lIdx = 0 To UBound(abHash)
HashFile = HashFile & _
Right$(“0” & Hex$(abHash(lIdx)), 2)
Next
End If
End If
End If
CryptDestroyHash hHash
End If
End If
CryptReleaseContext hCtx, 0
If lRes = 0 Then Err.Raise Err.LastDllError
End Function

AutoCAD 函数系列之二

Private Function GetAngle(ByRef APoint() As Double, ByRef BPoint() As Double) As Double ‘X – Y 坐标系内 ① ② 两点连线的角度
Dim XDiff, YDiff As Double
XDiff = BPoint(0) – APoint(0)
YDiff = BPoint(1) – APoint(1)
Dim dTemp As Double
‘①––––②
If XDiff > 0 And YDiff = 0 Then ‘X 轴右段
GetAngle = 0 ‘弧度
End If
‘––––②
‘–––/
‘––/
‘–/
‘①
If XDiff > 0 And YDiff > 0 Then ‘第一象限
dTemp = YDiff / XDiff
GetAngle = Atn(dTemp) ‘弧度
End If
‘②
‘|
‘|
‘|
‘①
If XDiff = 0 And YDiff > 0 Then ‘Y 轴上段
GetAngle = 0.5 * PI ‘弧度
End If
‘②
‘–\
‘––\
‘–––\
‘––––①
If XDiff < 0 And YDiff > 0 Then ‘第二象限
dTemp = Abs(XDiff) / YDiff
GetAngle = 0.5 * PI + Atn(dTemp) ‘弧度
End If
‘②––––①
If XDiff < 0 And YDiff = 0 Then ‘X 轴左段 GetAngle = 1 * PI ‘弧度 End If ‘––––① ‘–––/ ‘––/ ‘–/ ‘② If XDiff < 0 And YDiff < 0 Then ‘第三象限 dTemp = Abs(YDiff) / Abs(XDiff) GetAngle = 1 * PI + Atn(dTemp) ‘弧度 End If ‘① ‘| ‘| ‘| ‘② If XDiff = 0 And YDiff < 0 Then ‘Y 轴下段 GetAngle = 1.5 * PI ‘弧度 End If ‘① ‘–\ ‘––\ ‘–––\ ‘––––② If XDiff > 0 And YDiff < 0 Then ‘第四象限
dTemp = XDiff / Abs(YDiff)
GetAngle = 1.5 * PI + Atn(dTemp) ‘弧度
End If
‘①×②
If XDiff = 0 And YDiff = 0 Then ‘原点
GetAngle = 0 ‘弧度
End If
End Function

Private Function GetDistance(ByRef APoint() As Double, ByRef BPoint() As Double) As Double ‘数组做参数, 两点的矢量距离
‘获得从 APoint 至 BPoint 的有方向距离,从西到东的扇形面积内为正(边界定义如下,正北到正南为负,正南到正北为正)
GetDistance = (BPoint(0) – APoint(0)) ^ 2 + (BPoint(1) – APoint(1)) ^ 2 ‘图形单位
GetDistance = Sqr(GetDistance) ‘图形单位
Dim iSign As Integer
If GetAngle(APoint, BPoint) > 0.5 * PI And GetAngle(APoint, BPoint) <= 1.5 * PI Then
iSign = -1
Else
iSign = 1
End If
GetDistance = iSign * GetDistance
End Function

Private Function GetSide(ByRef APoint() As Double, ByRef BPoint() As Double, ByRef CPoint() As Double) As String ‘数组做参数
‘判断点 CPoint 在从点 APoint 至点 BPoint 形成的有方向直线的哪一侧
Dim Vector01X As Double
Dim Vector01Y As Double
Vector01X = BPoint(0) – APoint(0)
Vector01Y = BPoint(1) – APoint(1)

Dim Vector02X As Double
Dim Vector02Y As Double
Vector02X = CPoint(0) – APoint(0)
Vector02Y = CPoint(1) – APoint(1)
Select Case Vector01X * Vector02Y – Vector02X * Vector01Y
Case 0
GetSide = “ABOVE”
Case Is > 0
GetSide = “LEFT”
Case Is < 0
GetSide = “RIGHT”
End Select
End Function

Private Function GetPosition(ByRef APoint() As Double, ByRef BPoint() As Double, ByRef CPoint() As Double) As String ‘数组做参数
‘判断点 CPoint 在从点 APoint 至点 BPoint 形成的有方向直线的哪一段,三点不共线 返回 -1
GetPosition = “-1”
If Not GetSide(APoint, BPoint, CPoint) = “ABOVE” Then Exit Function
If GetDistance(APoint, BPoint) >= 0 And GetDistance(APoint, CPoint) >= 0 Then
If GetDistance(APoint, BPoint) >= GetDistance(APoint, CPoint) Then
GetPosition = “INSIDE”
Else
GetPosition = “FRONT”
End If
End If
If GetDistance(APoint, BPoint) < 0 And GetDistance(APoint, CPoint) < 0 Then If GetDistance(APoint, BPoint) < GetDistance(APoint, CPoint) Then GetPosition = “INSIDE” Else GetPosition = “FRONT” End If End If If GetDistance(APoint, BPoint) >= 0 And GetDistance(APoint, CPoint) < 0 Then GetPosition = “REAR” End If If GetDistance(APoint, BPoint) < 0 And GetDistance(APoint, CPoint) >= 0 Then
GetPosition = “REAR”
End If
End Function

拖动窗体

Option Explicit
Private Declare Function GetCursorPos Lib “user32” (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim bMoveForm As Boolean, LastPoint As POINTAPI

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim POINT As POINTAPI
GetCursorPos POINT
LastPoint.X = POINT.X
LastPoint.Y = POINT.Y
bMoveForm = True
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim iDX As Long, iDY As Long
Dim iTPPX As Long, iTPPY As Long
iTPPX& = Screen.TwipsPerPixelX
iTPPY& = Screen.TwipsPerPixelY
Dim POINT As POINTAPI
If Not bMoveForm Then Exit Sub
GetCursorPos POINT
iDX& = (POINT.X – LastPoint.X) * iTPPX&
iDY& = (POINT.Y – LastPoint.Y) * iTPPY&
LastPoint.X = POINT.X
LastPoint.Y = POINT.Y
Me.Move Me.Left + iDX&, Me.Top + iDY&
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
bMoveForm = False
End Sub

AutoCAD 常量

General Constants

        acTrue = 1;

        acFalse = 0;

        acOn = 1;

        acOff = 0;

        ac3dFace = 1;

        ac3dPolyline = 2;

        ac3dSolid = 3;

        acArc = 4;

        acAttribute = 5;

        acAttributeReference = 6;

        acBlockReference = 7;

        acCircle = 8;

        acDimAligned = 9;

        acDimAngular = 10;

        acDimDiametric = 12;

        acDimOrdinate = 13;

        acDimRadial = 14;

        acDimRotated = 15;

        acEllipse = 16;

        acHatch = 17;

        acLeader = 18;

        acLine = 19;

        acMtext = 21;

        acPoint = 22;

        acPolyline = 23;

        acPolylineLight = 24;

        acPolymesh = 25;

        acRaster = 26;

        acRay = 27;

        acRegion = 28;

        acShape = 29;

        acSolid = 30;

        acSpline = 31;

        acText = 32;

        acTolerance = 33;

        acTrace = 34;

        acPViewport = 35;

        acXline = 36;

        acGroup = 37;

        acModelSpace = 1;

        acPaperSpace = 0;

        acPreferenceClassic = 0;

        acPreferenceCustom = 1;

        acPlotOrientationPortrait = 0;

        acPlotOrientationLandscape = 1;

        acByBlock = 0;

        acRed = 1;

        acYellow = 2;

        acGreen = 3;

        acCyan = 4;

        acBlue = 5;

        acMagenta = 6;

        acWhite = 7;

        acByLayer = 256;

        acAttachmentPointTopLeft = 1;

        acAttachmentPointTopCenter = 2;

        acAttachmentPointTopRight = 3;

        acAttachmentPointMiddleLeft = 4;

        acAttachmentPointMiddleCenter = 5;

        acAttachmentPointMiddleRight = 6;

        acAttachmentPointBottomLeft = 7;

        acAttachmentPointBottomCenter = 8;

        acAttachmentPointBottomRight = 9;

        acLeftToRight = 1;

        acRightToLeft = 2;

        acTopToBottom = 3;

        acBottomToTop = 4;

        acLineNoArrow = 0;

        acSplineNoArrow = 1;

        acLineWithArrow = 2;

        acSplineWithArrow = 3;

        acAttributeModeInvisible = 1;

        acAttributeModeConstant = 2;

        acAttributeModeVerify = 4;

        acAttributeModePreset = 8;

        acHorizontalAlignmentLeft = 0;

        acHorizontalAlignmentCenter = 1;

        acHorizontalAlignmentRight = 2;

        acHorizontalAlignmentAligned = 3;

        acHorizontalAlignmentMiddle = 4;

        acHorizontalAlignmentFit = 5;

        acVerticalAlignmentBaseline = 0;

        acVerticalAlignmentBottom = 1;

        acVerticalAlignmentMiddle = 2;

        acVerticalAlignmentTop = 3;

        acTextFlagBackward = 2;

        acTextFlagUpsideDown = 4;

        acSelectionSetWindow = 0;

        acSelectionSetCrossing = 1;

        acSelectionSetFence = 2;

        acSelectionSetPrevious = 3;

        acSelectionSetLast = 4;

        acSelectionSetAll = 5;

        acSelectionSetWindowPolygon = 6;

        acSelectionSetCrossingPolygon = 7;

        acHatchPatternTypeUserDefined = 0;

        acHatchPatternTypePreDefined = 1;

        acHatchPatternTypeCustomDefined = 2;

        acHatchLoopTypeDefault = 0;

        acHatchLoopTypeExternal = 1;

        acHatchLoopTypePolyline = 2;

        acHatchLoopTypeDerived = 4;

        acHatchLoopTypeTextbox = 8;

        acHatchStyleNormal = 0;

        acHatchStyleOuter = 1;

        acHatchStyleIgnore = 2;

        acOsnapEnd = 1;

        acOsnapMid = 2;

        acOsnapCenter = 3;

        acOsnapNode = 4;

        acOsnapQuadrant = 5;

        acOsnapInsert = 6;

        acOsnapPerpendicular = 7;

        acOsnapTangent = 8;

        acOsnapNear = 9;

        acSimplePoly = 0;

        acFitCurvePoly = 1;

        acQuadSplinePoly = 2;

        acCubicSplinePoly = 3;

        acViewport2Horizontal = 0;

        acViewport2Vertical = 1;

        acViewport3Left = 2;

        acViewport3Right = 3;

        acViewport3Horizontal = 4;

        acViewport3Vertical = 5;

        acViewport3Above = 6;

        acViewport3Below = 7;

        acViewport4 = 8;

        acActiveViewport = 0;

        acAllViewports = 1;

        acAmericanEnglish = “enu”;

        acAustralianEnglish = “ena”;

        acBritishEnglishIse = “ens”;

        acBritishEnglishIze = “enz”;

        acCatalan = “ca”;

        acCzech = “cs”;

        acDanish = “da”;

        acDutchPrim = “nl”;

        acDutchSec = “nls”;

        acFinnish = “fi”;

        acFrenchUnaccentCap = “fr”;

        acFrenchAccentCap = “fra”;

        acGermanScharfesS = “de”;

        acGermanDoppleS = “ded”;

        acItalian = “it”;

        acNorwegianBokmal = “no”;

        acNorwegianNynorsk = “non”;

        acPortugueseIberian = “pt”;

        acPortugueseBrazilian = “ptb”;

        acRussianInfrequentIo = “ru”;

        acRussianFrequentIo = “rui”;

        acSpanishUnaccentCap = “es”;

        acSpanishAccentCap = “esa”;

        acSwedish = “sv”;

        acUnion = 0;

        acIntersection = 1;

        acSubtraction = 2;

        acExtendNone = 0;

        acExtendThisEntity = 1;

        acExtendOtherEntity = 2;

        acExtendBoth = 3;

        acDegrees = 0;

        acDegreeMinuteSeconds = 1;

        acGrads = 2;

        acRadians = 3;

        acSurveyorUnits = 4;

        acScientific = 1;

        acDecimal = 2;

        acEngineering = 3;

        acArchitectural = 4;

        acFractional = 5;

        acWorld = 0;

        acUCS = 1;

        acDisplayDCS = 2;

        acPaperSpaceDCS = 3;

        acEnglish = 0;

        acMetric = 1;

        acDemandLoadDisabled = 0;

        acDemandLoadEnabled = 1;

        acDemandLoadEnabledWithCopy = 2;

        acPartialPreview = 0;

        acFullPreview = 1;

        acSimpleMesh = 0;

        acQuadSurfaceMesh = 5;

        acCubicSurfaceMesh = 6;

        acBezierSurfaceMesh = 8;

        acZoomScaledAbsolute = 0;

        acZoomScaledRelative = 1;

        acZoomScaledRelativePSpace = 2;

        acDragDoNotDisplay = 0;

        acDragDisplayOnRequest = 1;

        acDragDisplayAutomatically = 2;

        acDemanLoadDisable = 0;

        acDemandLoadOnObjectDetect = 1;

        acDemandLoadCmdInvoke = 2;

        acFontRegular = 0;

        acFontItalic = 1;

        acFontBold = 2;

        acFontBoldItalic = 3;

        acProxyNotShow = 0;

        acProxyShow = 1;

        acProxyBoundingBox = 2;

        acKeyboardRunningObjSnap = 0;

        acKeyboardEntry = 1;

        acKeyboardProxyNoScripts = 2;

Enums

AcBoolean

        acFalse = 0

        acTrue = 1

AcOnOff

        acOff = 0

        acOn = 1

AcEntityName

        ac3dFace = 1

        ac3dPolyline = 2

        ac3dSolid = 3

        acArc = 4

        acAttribute = 5

        acAttributeReference = 6

        acBlockReference = 7

        acCircle = 8

        acDimAligned = 9

        acDimAngular = 10

        acDimDiametric = 12

        acDimOrdinate = 13

        acDimRadial = 14

        acDimRotated = 15

        acEllipse = 16

        acHatch = 17

        acLeader = 18

        acLine = 19

        acMtext = 21

        acPoint = 22

        acPolyline = 23

        acPolylineLight = 24

        acPolymesh = 25

        acRaster = 26

        acRay = 27

        acRegion = 28

        acShape = 29

        acSolid = 30

        acSpline = 31

        acText = 32

        acTolerance = 33

        acTrace = 34

        acPViewport = 35

        acXline = 36

        acGroup = 37

        acMInsertBlock = 38

        acPolyfaceMesh = 39

        acMLine = 40

        acDim3PointAngular = 41

        acExternalReference = 42

AcActiveSpace

        acPaperSpace = 0

        acModelSpace = 1

AcKeyboardAccelerator

        acPreferenceClassic = 0

        acPreferenceCustom = 1

AcPlotOrientation

        acPlotOrientationPortrait = 0

        acPlotOrientationLandscape = 1

AcColor

        acByBlock = 0

        acRed = 1

        acYellow = 2

        acGreen = 3

        acCyan = 4

        acBlue = 5

        acMagenta = 6

        acWhite = 7

        acByLayer = 256

AcAttachmentPoint

        acAttachmentPointTopLeft = 1

        acAttachmentPointTopCenter = 2

        acAttachmentPointTopRight = 3

        acAttachmentPointMiddleLeft = 4

        acAttachmentPointMiddleCenter = 5

        acAttachmentPointMiddleRight = 6

        acAttachmentPointBottomLeft = 7

        acAttachmentPointBottomCenter = 8

        acAttachmentPointBottomRight = 9

AcDrawingDirection

        acLeftToRight = 1

        acRightToLeft = 2

        acTopToBottom = 3

        acBottomToTop = 4

        acByStyle = 5

AcLeaderType

        acLineNoArrow = 0

        acSplineNoArrow = 1

        acLineWithArrow = 2

        acSplineWithArrow = 3

AcAttributeMode

        acAttributeModeNormal = 0

        acAttributeModeInvisible = 1

        acAttributeModeConstant = 2

        acAttributeModeVerify = 4

        acAttributeModePreset = 8

AcHorizontalAlignment

        acHorizontalAlignmentLeft = 0

        acHorizontalAlignmentCenter = 1

        acHorizontalAlignmentRight = 2

        acHorizontalAlignmentAligned = 3

        acHorizontalAlignmentMiddle = 4

        acHorizontalAlignmentFit = 5

AcVerticalAlignment

        acVerticalAlignmentBaseline = 0

        acVerticalAlignmentBottom = 1

        acVerticalAlignmentMiddle = 2

        acVerticalAlignmentTop = 3

AcTextGenerationFlag

        acTextFlagBackward = 2

        acTextFlagUpsideDown = 4

AcSelect

        acSelectionSetWindow = 0

        acSelectionSetCrossing = 1

        acSelectionSetFence = 2

        acSelectionSetPrevious = 3

        acSelectionSetLast = 4

        acSelectionSetAll = 5

        acSelectionSetWindowPolygon = 6

        acSelectionSetCrossingPolygon = 7

AcPatternType

        acHatchPatternTypeUserDefined = 0

        acHatchPatternTypePreDefined = 1

        acHatchPatternTypeCustomDefined = 2

AcLoopType

        acHatchLoopTypeDefault = 0

        acHatchLoopTypeExternal = 1

        acHatchLoopTypePolyline = 2

        acHatchLoopTypeDerived = 4

        acHatchLoopTypeTextbox = 8

AcHatchStyle

        acHatchStyleNormal = 0

        acHatchStyleOuter = 1

        acHatchStyleIgnore = 2

AcPolylineType

        acSimplePoly = 0

        acFitCurvePoly = 1

        acQuadSplinePoly = 2

        acCubicSplinePoly = 3

Ac3DPolylineType

        acSimple3DPoly = 0

        acQuadSpline3DPoly = 1

        acCubicSpline3DPoly = 2

AcViewportSplitType

        acViewport2Horizontal = 0

        acViewport2Vertical = 1

        acViewport3Left = 2

        acViewport3Right = 3

        acViewport3Horizontal = 4

        acViewport3Vertical = 5

        acViewport3Above = 6

        acViewport3Below = 7

        acViewport4 = 8

AcRegenType

        acActiveViewport = 0

        acAllViewports = 1

AcBooleanType

        acUnion = 0

        acIntersection = 1

        acSubtraction = 2

AcExtendOption

        acExtendNone = 0

        acExtendThisEntity = 1

        acExtendOtherEntity = 2

        acExtendBoth = 3

AcAngleUnits

        acDegrees = 0

        acDegreeMinuteSeconds = 1

        acGrads = 2

        acRadians = 3

AcUnits

        acDefaultUnits = 0xffffffff

        acScientific = 1

        acDecimal = 2

        acEngineering = 3

        acArchitectural = 4

        acFractional = 5

AcCoordinateSystem

        acWorld = 0

        acUCS = 1

        acDisplayDCS = 2

        acPaperSpaceDCS = 3

        acOCS = 4

AcMeasurementUnits

        acEnglish = 0

        acMetric = 1

AcXRefDemandLoad

        acDemandLoadDisabled = 0

        acDemandLoadEnabled = 1

        acDemandLoadEnabledWithCopy = 2

AcPreviewMode

        acPartialPreview = 0

        acFullPreview = 1

AcPolymeshType

        acSimpleMesh = 0

        acQuadSurfaceMesh = 5

        acCubicSurfaceMesh = 6

        acBezierSurfaceMesh = 8

AcZoomScaleType

        acZoomScaledAbsolute = 0

        acZoomScaledRelative = 1

        acZoomScaledRelativePSpace = 2

AcDragDisplayMode

        acDragDoNotDisplay = 0

        acDragDisplayOnRequest = 1

        acDragDisplayAutomatically = 2

AcARXDemandLoad

        acDemanLoadDisable = 0

        acDemandLoadOnObjectDetect = 1

        acDemandLoadCmdInvoke = 2

AcTextFontStyle

        acFontRegular = 0

        acFontItalic = 1

        acFontBold = 2

        acFontBoldItalic = 3

AcProxyImage

        acProxyNotShow = 0

        acProxyShow = 1

        acProxyBoundingBox = 2

AcKeyboardPriority

        acKeyboardRunningObjSnap = 0

        acKeyboardEntry = 1

        acKeyboardEntryExceptScripts = 2

AcMenuGroupType

        acBaseMenuGroup = 0

        acPartialMenuGroup = 1

AcMenuFileType

        acMenuFileCompiled = 0

        acMenuFileSource = 1

AcMenuItemType

        acMenuItem = 0

        acMenuSeparator = 1

        acMenuSubMenu = 2

AcToolbarItemType

        acToolbarButton = 0

        acToolbarSeparator = 1

        acToolbarControl = 2

        acToolbarFlyout = 3

AcToolbarDockStatus

        acToolbarDockTop = 0

        acToolbarDockBottom = 1

        acToolbarDockLeft = 2

        acToolbarDockRight = 3

        acToolbarFloating = 4

AcLineWeight

        acLnWt000 = 0

        acLnWt005 = 5

        acLnWt009 = 9

        acLnWt013 = 13

        acLnWt015 = 15

        acLnWt018 = 18

        acLnWt020 = 20

        acLnWt025 = 25

        acLnWt030 = 30

        acLnWt035 = 35

        acLnWt040 = 40

        acLnWt050 = 50

        acLnWt053 = 53

        acLnWt060 = 60

        acLnWt070 = 70

        acLnWt080 = 80

        acLnWt090 = 90

        acLnWt100 = 100

        acLnWt106 = 106

        acLnWt120 = 120

        acLnWt140 = 140

        acLnWt158 = 158

        acLnWt200 = 200

        acLnWt211 = 211

        acLnWtByLayer = 0xffffffff

        acLnWtByBlock = 0xfffffffe

        acLnWtByLwDefault = 0xfffffffd

AcWindowState

        acNorm = 1

        acMin = 2

        acMax = 3

AcPlotPaperUnits

        acInches = 0

        acMillimeters = 1

        acPixels = 2

AcPlotRotation

        ac0degrees = 0

        ac90degrees = 1

        ac180degrees = 2

        ac270degrees = 3

AcPlotType

        acDisplay = 0

        acExtents = 1

        acLimits = 2

        acView = 3

        acWindow = 4

        acLayout = 5

AcPlotScale

        acScaleToFit = 0

        ac1_128in_1ft = 1

        ac1_64in_1ft = 2

        ac1_32in_1ft = 3

        ac1_16in_1ft = 4

        ac3_32in_1ft = 5

        ac1_8in_1ft = 6

        ac3_16in_1ft = 7

        ac1_4in_1ft = 8

        ac3_8in_1ft = 9

        ac1_2in_1ft = 10

        ac3_4in_1ft = 11

        ac1in_1ft = 12

        ac3in_1ft = 13

        ac6in_1ft = 14

        ac1ft_1ft = 15

        ac1_1 = 16

        ac1_2 = 17

        ac1_4 = 18

        ac1_8 = 19

        ac1_10 = 20

        ac1_16 = 21

        ac1_20 = 22

        ac1_30 = 23

        ac1_40 = 24

        ac1_50 = 25

        ac1_100 = 26

        ac2_1 = 27

        ac4_1 = 28

        ac8_1 = 29

        ac10_1 = 30

        ac100_1 = 31

AcAlignment

        acAlignmentLeft = 0

        acAlignmentCenter = 1

        acAlignmentRight = 2

        acAlignmentAligned = 3

        acAlignmentMiddle = 4

        acAlignmentFit = 5

        acAlignmentTopLeft = 6

        acAlignmentTopCenter = 7

        acAlignmentTopRight = 8

        acAlignmentMiddleLeft = 9

        acAlignmentMiddleCenter = 10

        acAlignmentMiddleRight = 11

        acAlignmentBottomLeft = 12

        acAlignmentBottomCenter = 13

        acAlignmentBottomRight = 14

ACAD_COLOR

ACAD_LAYER

ACAD_LTYPE

ACAD_NULL

ACAD_DISTANCE

ACAD_ANGLE

ACAD_LWEIGHT

ACAD_NOUNITS

ACAD_POINT

AcLineSpacingStyle

        acLineSpacingStyleAtLeast = 1

        acLineSpacingStyleExactly = 2

AcDimPrecision

        acDimPrecisionZero = 0

        acDimPrecisionOne = 1

        acDimPrecisionTwo = 2

        acDimPrecisionThree = 3

        acDimPrecisionFour = 4

        acDimPrecisionFive = 5

        acDimPrecisionSix = 6

        acDimPrecisionSeven = 7

        acDimPrecisionEight = 8

AcDimUnits

        acDimScientific = 1

        acDimDecimal = 2

        acDimEngineering = 3

        acDimArchitecturalStacked = 4

        acDimFractionalStacked = 5

        acDimArchitectural = 6

        acDimFractional = 7

        acDimWindowsDesktop = 8

AcDimLUnits

        acDimLScientific = 1

        acDimLDecimal = 2

        acDimLEngineering = 3

        acDimLArchitectural = 4

        acDimLFractional = 5

        acDimLWindowsDesktop = 6

AcDimArrowheadType

        acArrowDefault = 0

        acArrowClosedBlank = 1

        acArrowClosed = 2

        acArrowDot = 3

        acArrowArchTick = 4

        acArrowOblique = 5

        acArrowOpen = 6

        acArrowOrigin = 7

        acArrowOrigin2 = 8

        acArrowOpen90 = 9

        acArrowOpen30 = 10

        acArrowDotSmall = 11

        acArrowDotBlank = 12

        acArrowSmall = 13

        acArrowBoxBlank = 14

        acArrowBoxFilled = 15

        acArrowDatumBlank = 16

        acArrowDatumFilled = 17

        acArrowIntegral = 18

        acArrowNone = 19

        acArrowUserDefined = 20

AcDimCenterType

        acCenterMark = 0

        acCenterLine = 1

        acCenterNone = 2

AcDimFit

        acTextAndArrows = 0

        acArrowsOnly = 1

        acTextOnly = 2

        acBestFit = 3

AcDimFractionType

        acHorizontal = 0

        acDiagonal = 1

        acNotStacked = 2

AcDimHorizontalJustification

        acHorzCentered = 0

        acFirstExtensionLine = 1

        acSecondExtensionLine = 2

        acOverFirstExtension = 3

        acOverSecondExtension = 4

AcDimVerticalJustification

        acVertCentered = 0

        acAbove = 1

        acOutside = 2

        acJIS = 3

AcDimTextMovement

        acDimLineWithText = 0

        acMoveTextAddLeader = 1

        acMoveTextNoLeader = 2

AcDimToleranceMethod

        acTolNone = 0

        acTolSymmetrical = 1

        acTolDeviation = 2

        acTolLimits = 3

        acTolBasic = 4

AcDimToleranceJustify

        acTolBottom = 0

        acTolMiddle = 1

        acTolTop = 2

AcViewportScale

        acVpScaleToFit = 0

        acVpCustomScale = 1

        acVp1_1 = 2

        acVp1_2 = 3

        acVp1_4 = 4

        acVp1_8 = 5

        acVp1_10 = 6

        acVp1_16 = 7

        acVp1_20 = 8

        acVp1_30 = 9

        acVp1_40 = 10

        acVp1_50 = 11

        acVp1_100 = 12

        acVp2_1 = 13

        acVp4_1 = 14

        acVp8_1 = 15

        acVp10_1 = 16

        acVp100_1 = 17

        acVp1_128in_1ft = 18

        acVp1_64in_1ft = 19

        acVp1_32in_1ft = 20

        acVp1_16in_1ft = 21

        acVp3_32in_1ft = 22

        acVp1_8in_1ft = 23

        acVp3_16in_1ft = 24

        acVp1_4in_1ft = 25

        acVp3_8in_1ft = 26

        acVp1_2in_1ft = 27

        acVp3_4in_1ft = 28

        acVp1in_1ft = 29

        acVp3in_1ft = 30

        acVp6in_1ft = 31

        acVp1ft_1ft = 32

AcISOPenWidth

        acPenWidth013 = 13

        acPenWidth018 = 18

        acPenWidth025 = 25

        acPenWidth035 = 35

        acPenWidth050 = 50

        acPenWidth070 = 70

        acPenWidth100 = 100

        acPenWidth140 = 140

        acPenWidth200 = 200

        acPenWidthUnk = 0xffffffff

AcSaveAsType

        acUnknown = 0xffffffff

        acR12_dxf = 1

        acR13_dwg = 4

        acR13_dxf = 5

        acR14_dwg = 8

        acR14_dxf = 9

        acR15_dwg = 12

        acR15_dxf = 13

        acR15_Template = 14

        acNative = 12

AcPrinterSpoolAlert

        acPrinterAlwaysAlert = 0

        acPrinterAlertOnce = 1

        acPrinterNeverAlertLogOnce = 2

        acPrinterNeverAlert = 3

AcPlotPolicyForNewDwgs

        acPolicyNewDefault = 0

        acPolicyNewLegacy = 1

AcPlotPolicyForLegacyDwgs

        acPolicyLegacyDefault = 0

        acPolicyLegacyQuery = 1

        acPolicyLegacyLegacy = 2

AcOleQuality

        acOQLineArt = 0

        acOQText = 1

        acOQGraphics = 2

        acOQPhoto = 3

        acOQHighPhoto = 4

AcLoadPalette

        acPaletteByDrawing = 0

        acPaletteBySession = 1

AcInsertUnits

        acInsertUnitsUnitless = 0

        acInsertUnitsInches = 1

        acInsertUnitsFeet = 2

        acInsertUnitsMiles = 3

        acInsertUnitsMillimeters = 4

        acInsertUnitsCentimeters = 5

        acInsertUnitsMeters = 6

        acInsertUnitsKilometers = 7

        acInsertUnitsMicroinches = 8

        acInsertUnitsMils = 9

        acInsertUnitsYards = 10

        acInsertUnitsAngstroms = 11

        acInsertUnitsNanometers = 12

        acInsertUnitsMicrons = 13

        acInsertUnitsDecimeters = 14

        acInsertUnitsDecameters = 15

        acInsertUnitsHectometers = 16

        acInsertUnitsGigameters = 17

        acInsertUnitsAstronomicalUnits = 18

        acInsertUnitsLightYears = 19

        acInsertUnitsParsecs = 20

AcAlignmentPointAcquisition

        acAlignPntAcquisitionAutomatic = 0

        acAlignPntAcquisitionShiftToAcquire = 1

AcInsertUnitsAction

        acInsertUnitsPrompt = 0

        acInsertUnitsAutoAssign = 1

AcPlotPolicy

        acPolicyNamed = 0

        acPolicyLegacy = 1

AcDrawingAreaShortCutMenu

        acNoDrawingAreaShortCutMenu = 0

        acUseDefaultDrawingAreaShortCutMenu = 1

AcDrawingAreaSCMDefault

        acRepeatLastCommand = 0

        acSCM = 1

AcDrawingAreaSCMEdit

        acEdRepeatLastCommand = 0

        acEdSCM = 1

AcDrawingAreaSCMCommand

        acEnter = 0

        acEnableSCMOptions = 1

        acEnableSCM = 2