VectorWorks SDK provides predefined types for types. A plug-in must use those types to ensure correct communications with the SDK functions.
Note: There are other types defined in the SDK, but the ones described in this article should be used since the others are declared obsolete.
| Type Name | Description |
|---|---|
size_t |
A type suitable for representing the amount of memory. This is an unsigned type. |
bool |
Boolean value type. |
float |
Real 32-bit number. |
double |
Real 64-bit number. |
| Type Name | Description |
|---|---|
Uint8 |
Unsigned 8-bit number |
Sint8 |
Signed 8-bit number |
Uint16 |
Unsigned 16-bit number |
Sint16 |
Signed 16-bit number |
Uint32 |
Unsigned 32-bit number |
Sint32 |
Signed 32-bit number |
Uint64 |
Unsigned 64-bit number |
Sint64 |
Signed 64-bit number |
Real32 |
Real 32-bit number |
Real64 |
Real 64-bit number |
| Constant Name | Constant Value |
|---|---|
kGSMaxUint8 |
255 |
kGSMaxUint16 |
65535 |
kGSMaxUint32 |
4294967295UL |
kGSMaxUint64 |
18446744073709551615ULL |
kGSMaxSint8 |
127 |
kGSMaxSint16 |
32767 |
kGSMaxSint32 |
2147483647L |
kGSMaxSint64 |
9223372036854775807LL |
kGSMinUint8 |
0 |
kGSMinUint16 |
0 |
kGSMinUint32 |
0UL |
kGSMinUint64 |
0ULL |
kGSMinSint8 |
-128 |
kGSMinSint16 |
-32768 |
kGSMinSint32 |
-2147483648 |
kGSMinSint64 |
-9223372036854775808LL |
There is only one string class TXString.
TXStringArray defines an array of strings.
| Type Name | Description |
|---|---|
MCObjectHandle |
Identifier of a VectorWorks object. Used to recognize object instances. |
OSType |
A 32-bit identifier encoded as a Four Character Code (e.g., 'ApfT'). |
InternalIndex |
Represents an index to an object. This index is document-dependent. |
InternalName |
Represents the name of an object. This name is document-dependent. |
ColorRef |
Color reference. Identifier of a color in the active color palette. |
OpacityRef |
Opacity reference. Identifier of opacity. |
WorldCoord |
Real number representing world coordinates in a VectorWorks document. WorldCoords are always in units—millimeters. |
WorldArea |
Represents world coordinate area in a VectorWorks document. (WorldCoord * WorldCoord) |
WorldVolume |
Represents world coordinate volume in a VectorWorks document. (WorldCoord * WorldCoord * WorldCoord) |
WorldPt |
2D point in the world coordinate system of the document. Defined by (x, y) WorldCoord values. |
WorldPt3 |
3D point in the world coordinate system of the document. Defined by (x, y, z) WorldCoord values. |
TransformMatrix |
Defines a world coordinate transformation in the document. |
This is an obsolete type. It represents a VectorWorks callback pointer used with obsolete functions Obsolete Function.
The new callback mechanism involves VCOM (VectorWorks Component Object Model) with the interface ISDK.
All WorldCoord comparisons must use these functions.
These WorldCoord comparison functions are necessary because most floating-point numbers that are not whole numbers cannot be represented exactly (they have floating-point approximations).
Double-precision floating-point numbers (double) are accurate to 15 digits, but we'll consider WorldCoords equal if they are the same up to the 13th significant digit (to allow for drift).
Note that these functions do and must take the magnitude of the values into account. For example:
100,000,000,000,000must be considered equal to100,000,000,000,001.1.00000000000000must be considered equal to1.00000000000001.
Boolean WorldCoordsAreNearlyEqual(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoordIsNearlyZero(WorldCoord n);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoordsAreNotNearlyEqual(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoord1_GE_WorldCoord2(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoord1_GT_WorldCoord2(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoord1_LE_WorldCoord2(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoord1_LT_WorldCoord2(WorldCoord n1, WorldCoord n2);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
WorldCoord WorldCoordBumpedHigher(WorldCoord n);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
WorldCoord WorldCoordBumpedLower(WorldCoord n);Using epsilon (kNearlyEqualEpsilonForWorldCoords = 1e-13) for comparison.
Boolean WorldCoordsAreRelativelyClose(WorldCoord n1, WorldCoord n2, double ratio = 1e-7);