Data Types and Structures


basic data types

/* object or file name (null-terminated text string) */
typedef char vxName[32];

/* complete file path (null-terminated text string) */
typedef char vxPath[256];

/* arithmetic expression (null-terminated text string) */
typedef char vxExp[256];

geometry/math data

/* limits */
typedef struct svxLimit
   {
   double min;
   double max;
   } svxLimit;

/* 3D bounding box */
typedef struct svxBndBox
   {
   svxLimit X;
   svxLimit Y;
   svxLimit Z;
   } svxBndBox;

/* 2D point */
typedef struct svxPoint2
   {
   double x;
   double y;
   } svxPoint2;

/* 3D point */
typedef struct svxPoint
   {
   double x;
   double y;
   double z;
   } svxPoint;

/* 2D vector */
typedef struct svxVector2
   {
   double x;
   double y;
   } svxVector2;

/* 3D vector */
typedef struct svxVector
   {
   double x;
   double y;
   double z;
   } svxVector;

/* 3D axis */
typedef struct svxAxis
   {
   svxPoint Pnt;      /* point */
   svxVector Dir;      /* direction */
   } svxAxis;

/* 3D transformation matrix or coordinate frame (local to world) */
typedef struct svxMatrix
   {
   char identity;            /* 1 if identity matrix, else 0 */
   double xx, yx, zx, xt;   /* cosines of X axis and origin X (xt) */
   double xy, yy, zy, yt;   /* cosines of Y axis and origin Y (yt) */
   double xz, yz, zz, zt;   /* cosines of Z axis and origin Z (zt) */
   } svxMatrix;

/* 3D triangle */
typedef struct svxTriangle
   {
   svxPoint Pnt[3];      /* triangle vertices */
   svxVector Normal;      /* outward-facing normal */
   } svxTriangle;

/* curve types */
typedef enum evxCurveType
   {
   VX_CRV_UNDEFINED=0,
   VX_CRV_LINE=1,
   VX_CRV_ARC=2,
   VX_CRV_CIRCLE=3,
   VX_CRV_NURB=4
   } evxCurveType;

typedef struct svxParameters
   {
   int closed;          /* 1=closed curve, 0=open curve */
   int degree;          /* degree (order = deg + 1) */
   int num_knots;       /* number of knots */
   svxLimit bnd;        /* boundaries of parameter space */
   double *knots;       /* array of knot values */
   int free_mem;         /* 1 if memory referenced by "knots" should
                        ** be free'd by cvxCurveFree()
   } svxParameters;

typedef struct svxControlPoints
   {
   int rat;             /* 1=RATIONAL, 0=NONRATIONAL control points  */
   int dim;             /* number of coordinates per control point (1-4) */
   int plane;           /* cp hyper plane type: 1:pnt, 2:line, 3:plane  */
   int num_cp;          /* number of control points in list */
   svxBndBox box;       /* bounding box of control points */
   double *coord;         /* control point coordinates  (possibly weighted) */
                        /* if RATIONAL, points are of form (wx,wy,wz,w) */
   int free_mem;         /* 1 if memory referenced by "coord" should
                        ** be free'd by cvxCurveFree()
   } svxControlPoints;

/* 2D or 3D curvilinear geometry */
typedef struct svxCurve
   {
   evxCurveType Type;     /* curve type */
   svxMatrix Frame;        /* local frame */

   svxPoint P1, P2;      /* line start/end points or circle/arc center point */
   double A1, A2;           /* arc start/end angles (degrees) */
   double R;            /* circle/arc radius */

   svxParameters T;       /* NURB parameter space data */
   svxControlPoints P;  /* NURB control point data (mm) */

   } svxCurve;

/* surface types */
typedef enum evxSurfaceType
   {
   VX_SRF_PLANE,
   VX_SRF_SPHERE,
   VX_SRF_CONE,
   VX_SRF_GRID,
   VX_SRF_CYLINDER,
   VX_SRF_EXTRUDE,
   VX_SRF_REVOLVE,
   VX_SRF_SWEEP_NOT_USED,
   VX_SRF_GEN,
   VX_SRF_OFFSET,
   VX_SRF_MESH,
   VX_SRF_RULED,
   VX_SRF_HEMIS,
   VX_SRF_FRUSTRUM,
   VX_SRF_DRAFT,
   VX_SRF_DRAFT_NPLN,
   VX_SRF_DRAFT_NUV,
   VX_SRF_ELLIPSOID,
   VX_SRF_3PT_PLANE,
   VX_SRF_BILIN_CNVX,
   VX_SRF_EXTRUDE_DRFT,
   VX_SRF_REVOLVE_PLN,
   VX_SRF_TORUS,
   VX_SRF_SMD_THCK_FC,
   VX_SRF_BEND_GEN,
   VX_SRF_PLANE_STAT_FC,
   VX_SRF_GEN_STAT_FC,
   VX_SRF_CIR_OFF,
   VX_SRF_VAR_OFF,
   VX_SRF_THRD_THDFC,
   VX_SRF_THRD_NTHDFC,
   VX_SRF_THRD_CONFC
   } evxSurfaceType;

/* 3D NURB surface (untrimmed) */
typedef struct svxSurface
   {
   evxSurfaceType Type; /* surface type */

   int OutNormal;         /* 1 if the surface's natural normal points towards
                        ** the outside of the shape it is associated with;
                        ** 0 if the surface's natural normal points inward.

   svxParameters U;       /* NURB parameter space data in U direction */
   svxParameters V;       /* NURB parameter space data in V direction */
   svxControlPoints P;  /* NURB control point data (mm) */

   } svxSurface;

/* numeric variable */
typedef struct svxVariable
   {
   vxName Name;      /* variable name */
   double Value;      /* value ("millimeter" if distance; "degree" if angle) */
                     /* value is not required if Expression is defined */
   vxExp Expression;   /* optional expression (Expression[0]=0 if undefined) */
   int isDistance;   /* 1 if variable defines a distance, else 0 */
   int isAngle;      /* 1 if variable defines an angle, else 0 */
   } svxVariable;

/* system of linear units */
typedef enum evxUnitType
   {
   VX_UNIT_MICRON = 0,
   VX_UNIT_MILLIMETER = 1,
   VX_UNIT_CENTIMETER = 2,
   VX_UNIT_METER = 3,
   VX_UNIT_INCH = 4,
   VX_UNIT_FOOT = 5
   } evxUnitType;

/* face trim-curve option */
typedef enum evxFaceTrim
   {
   VX_TRIM_NONE = 0,      /* ignore all trim boundaries */
   VX_TRIM_ALL = 1,      /* use all face trim boundaries */
   VX_TRIM_OUTER = 2      /* use only the outer trim boundaries */
   } evxFaceTrim;

/* point location */
typedef enum evxPntLocation
   {
   VX_PNT_OUT = -1,      /* point lies outside the boundary */
   VX_PNT_ON = 0,         /* point lies on the boundary */
   VX_PNT_IN = 1,         /* point lies inside the boundary */
   VX_PNT_NULL = -2      /* unable to classify point location */
   } evxPntLocation;


gui/display data

/* standard colors */
typedef enum evxColor
   {
   VX_COLOR_NULL=0,
   VX_COLOR_GREEN=1,
   VX_COLOR_RED=2,
   VX_COLOR_BROWN=3,
   VX_COLOR_GOLDENROD=4,
   VX_COLOR_MED_BLUE=5,
   VX_COLOR_DARK_MAGENTA=6,
   VX_COLOR_DARK_GREY=7,
   VX_COLOR_DARK_BLUE=8,
   VX_COLOR_VIOLET=9,
   VX_COLOR_LIGHT_GREEN=10,
   VX_COLOR_LIGHT_BLUE=11,
   VX_COLOR_ROSE=12,
   VX_COLOR_LIGHT_MAGENTA=13,
   VX_COLOR_LIGHT_GREY=14,
   VX_COLOR_WHITE=15,
   VX_COLOR_BLACK=16,
   VX_COLOR_YELLOW=17,
   VX_COLOR_MED_GREY=18
   } evxColor;

/* RGB color */
typedef struct svxColor
   {
   unsigned char r;      /* red color component (0-255) */
   unsigned char g;      /* green color component (0-255) */
   unsigned char b;      /* blue color component (0-255) */
   } svxColor;

/* display mode */
typedef enum evxDispMode
   {
   VX_DISP_WIRE = 1,
   VX_DISP_SHADE = 2,
   VX_DISP_HIDD_APPROX = 3,
   VX_DISP_HIDD_EXACT = 4,
   VX_DISP_EDGE = 5
   } evxDispMode;

/* display (i.e. GUI) item */
typedef enum evxDispItem
   {
   VX_DISP_SCREEN = 0,
   VX_DISP_PREVIEW = 1,
   VX_DISP_FORMS = 2,
   VX_DISP_ALL = 3
   } evxDispItem;

/* display attribute types */
typedef enum evxDispAttrib
   {
   VX_DISP_POINT=0,
   VX_DISP_LINE=1,
   VX_DISP_FACE=2
   } evxDispAttrib;

/* standard 3D view orientations */
typedef enum evxViewStd
   {
   VX_VIEW_FRONT = 0,
   VX_VIEW_BACK = 1,
   VX_VIEW_TOP = 2,
   VX_VIEW_BOTTOM = 3,
   VX_VIEW_RIGHT = 4,
   VX_VIEW_LEFT = 5,
   VX_VIEW_ISO = 6,
   VX_VIEW_AUX = 7,
   VX_VIEW_PLANE = 8
   } evxViewStd;

/* cursor display type */
typedef enum evxCursorType
   {
   VX_CURSOR_STD = 0,            /* standard arrow cursor */
   VX_CURSOR_MOUSE = 1,           /* mouse shaped cursor */
   VX_CURSOR_BUSY = 2,            /* cursor used to indicate system is busy */
   VX_CURSOR_WRENCH = 3,          /* wrench shaped cursor */
   VX_CURSOR_PLIERS = 4,          /* cursor shaped like pliers */
   VX_CURSOR_SCREW_DRIVER = 5,    /* screw driver shaped cursor */
   VX_CURSOR_HAMMER = 6,          /* cursor shaped like a hammer */
   VX_CURSOR_TOGGLE = 7,          /* cursor with two semi-circular arrows */
   VX_CURSOR_HAND = 8,            /* cursor shaped like a hand */
   VX_CURSOR_WRENCH_PLUS = 9      /* wrench shaped cursor with plus */
   } evxCursorType;

/* root object preview mode */
typedef enum evxPreviewMode
   {
   VX_PREVIEW_OFF = 0,
   VX_PREVIEW_GEOM = 1,
   VX_PREVIEW_ATTRIB = 2
   } evxPreviewMode;

/* point input options */
typedef enum evxPntInpOpt
   {
   VX_INP_PNT_GENERAL=0,
   VX_INP_PNT_ON_ENTITY=1,
   VX_INP_PNT_ON_CURVE=2,
   VX_INP_PNT_ON_EDGE=3,
   VX_INP_PNT_ON_CURVE_OR_EDGE=4,
   VX_INP_PNT_ON_ANY_FACE=5,
   VX_INP_PNT_ON_FIELD_1_FACE=6,
   VX_INP_PNT_END=7,
   VX_INP_PNT_ASSEMBLY=8,
   VX_INP_PNT_DIRECTION=9,
   VX_INP_PNT_ON_CRV_OR_PROF=10
   } evxPntInpOpt;

/* entity input options */
typedef enum evxEntInpOpt
   {
   VX_INP_UNDEFINED=0,
   VX_INP_GENERAL_3D=1,
   VX_INP_GENERAL_2D=2,
   VX_INP_SHAPE=3,
   VX_INP_FACE=4,
   VX_INP_SHAPE_OR_FACE=5,
   VX_INP_EDGE=6,
   VX_INP_CURVE=7,
   VX_INP_EDGE_OR_CURVE=8,
   VX_INP_CURVE_LIST=9,
   VX_INP_PARTING_CURVE=10,
   VX_INP_POINT=11,
   VX_INP_FEATURE=12,
   VX_INP_SKETCH=13,
   VX_INP_DATUM_PLANE=14,
   VX_INP_REF_PLANE=15,
   VX_INP_3D_BLOCK=16,
   VX_INP_LIGHT=17,
   VX_INP_LAYER=18,
   VX_INP_REF_GEOM=19,
   VX_INP_WIREFRAME=20,
   VX_INP_MOVE=21,
   VX_INP_BLANK=22,
   VX_INP_ERASE=23,
   VX_INP_INQUIRE=24,
   VX_INP_3D_GEOM=25,
   VX_INP_TEXT=26,
   VX_INP_PROF=27,
   VX_INP_COMP=28
   } evxEntInpOpt;

/* response to user prompt */
typedef enum evxResponse
   {
   VX_CANCEL = -1,
   VX_NO = 0,
   VX_YES = 1,
   VX_YES_ALL = 2
   } evxResponse;

/* light source type */
typedef enum evxLightType
   {
   V_LIGHT_NULL=0,      /* undefined */
   V_LIGHT_AMB=1,       /* ambient light source */
   V_LIGHT_DIR=2,       /* directional light source */
   V_LIGHT_POS=3,       /* positional light source */
   V_LIGHT_SPOT=4,      /* spot light source */
   V_LIGHT_EYE=5        /* light source located at view position */
   } evxLightType;

/* light source */
typedef struct svxLight
   {
   vxName name;         /* light source name */
   evxLightType type;   /* light source type */
   svxPoint pos;        /* light position in definition space */
   svxPoint dir;        /* light direction in definition space */
   svxPoint target_pnt; /* target point for spot light */
   float intensity;     /* light intensity (0.0-1.0) */
   float angle_1;        /* spotlight cutoff angle (0-180 deg) */
   float angle_2;       /* spotlight constant intensity angle (0-180 deg) */
   float exp;           /* spotlight exponent (0-128)*/
   float c1,c2,c3;      /* attenuation coefficients */
   svxColor color;      /* light color (rgb) */
   char off;            /* 1-light is OFF, else ON */
   char shadow;         /* 1-cast shadows, else 0 */
   } svxLight;

/* face display attributes */
typedef struct svxFaceAt
   {
   unsigned char reflectance; /* reflectance */
   unsigned char refraction;  /* refraction */
   unsigned char exp;         /* specular reflection exponent (0-128) */
   unsigned char trans;       /* transparency setting (0-100) */
   unsigned char ambient;     /* ambient reflection coeff. (0-100) */
   unsigned char diffuse;     /* diffuse reflection coeff. (0-100) */
   unsigned char specular;    /* specular reflection coeff. (0-100) */
   unsigned char emission;    /* emission coeff. (0-100) */
   svxColor front_color;        /* color of frontside */
   svxColor back_color;         /* color of backside */
   svxColor spec_color;         /* specular color */

   } svxFaceAt;

/* texture map option */
typedef enum evxTextureOpt
   {
   V_TEXTURE_NULL=0,
   V_TEXTURE_BLEND=1,
   V_TEXTURE_DECAL=2,
   V_TEXTURE_MODULATE=3,
   V_TEXTURE_REPLACE=4
   } evxTextureOpt;

/* texture attribute */
typedef struct svxTextureAt
   {
   evxTextureOpt opt;      /* texture option (zero if undefined) */
   vxPath file;            /* texture path/file name (blank if undefined) */
   unsigned char dimen;      /* texture dimension (1-3) */
   unsigned char repeat;   /* 1 to repeat texture, else 0 */
   float trans;            /* texture transparency (0 to 1.0) */
   double height;            /* texture height (mm) */
   double width;            /* texture width (mm) */
   double angle;            /* texture angle (deg) */
   svxPoint origin;         /* texture origin */
   
   } svxTextureAt;


/* shader attribute */
typedef struct svxShaderAt
   {
   vxName name;         /* shader name (blank if undefined) */
   vxPath file;         /* shader path/file name (blank if undefined) */
   svxColor color[4];   /* shader colors */
   double param[10];      /* shader parameters */
   
   } svxShaderAt;


database entity data

/* entity types */
typedef enum evxEntType
   {
   VX_ENT_BREP = -4,      /* any brep entity (i.e. shape,face,loop,edge,vertex) */
   VX_ENT_OP = -3,      /* any history operation */
   VX_ENT_POINT = -2,   /* any point entity (2D or 3D) */
   VX_ENT_WIRE = -1,      /* any wireframe entity (line, arc, curve) */
   VX_ENT_ALL = 0,      /* any entity type */
   VX_ENT_SHAPE = 42,   /* b-rep shape (i.e. faceset) */
   VX_ENT_FACE = 43,      /* b-rep face */
   VX_ENT_EDGE = 46,      /* b-rep edge */
   VX_ENT_FTR = 48,      /* feature operation */
   VX_ENT_NRB_CRV = 54,   /* NURBS curve */
   VX_ENT_LINE3 = 56,   /* 3D line */
   VX_ENT_LINE2 = 58,   /* 2D line */
   VX_ENT_CIRCLE3 = 60,   /* 3D circle */
   VX_ENT_CIRCLE2 = 61,   /* 2D circle */
   VX_ENT_ARC3 = 62,      /* 3D arc */
   VX_ENT_ARC2 = 63,      /* 2D arc */
   VX_ENT_POINT3 = 64,   /* 3D point */
   VX_ENT_POINT2 = 65,   /* 2D point */
   VX_ENT_LAYER = 67,   /* layer */
   VX_ENT_SKETCH = 70,   /* sketch */
   VX_ENT_REF_GEOM = 72,/* reference geometry */
   VX_ENT_TEXT = 76,      /* text */
   VX_ENT_DIMEN = 77,   /* dimension */
   VX_ENT_ANNO = 83,      /* annotation text */
   VX_ENT_BLOCK = 86,   /* block */
   VX_ENT_DWG_VIEW = 87,/* drawing view */
   VX_ENT_COMP = 88,      /* assembly component */
   VX_ENT_PART = 89,      /* part */
   VX_ENT_SHEET = 90,   /* drawing sheet */
   VX_ENT_PACKET = 91,   /* drawing packet */
   VX_ENT_DATUM = 95,   /* datum plane */
   VX_ENT_CRV_LIST = 102,   /* curve list */
   VX_ENT_PART_LINE = 106,   /* parting line */
   VX_ENT_HATCH = 111,   /* cross-hatch */
   VX_ENT_LIGHT = 118,   /* light source */
   VX_ENT_INT_CRV = 119,/* interpolated curve */
   VX_ENT_VAR = 120,      /* variable */
   VX_ENT_EQN_SET = 121,/* equation set */
   VX_ENT_SYMBOL = 123,   /* 2D symbol */
   VX_ENT_TRACE = 133   /* sketch trace */
   } evxEntType;

/* entity search types */
typedef enum evxEntFind
   {
   VX_FIND_POINT = 1,      /* point */
   VX_FIND_CURVE = 2,      /* cuve */
   VX_FIND_EDGE = 3,         /* edge */
   VX_FIND_FACE = 5,         /* face */
   VX_FIND_SKETCH = 6,      /* sketch */
   VX_FIND_CRV_LIST = 7,   /* 3D curve list */
   VX_FIND_3D_BLOCK = 14   /* 3D point or STL block */
   } evxEntFind;

/* root object type */
typedef enum evxRootType
   {
   VX_ROOT_NULL = 0,
   VX_ROOT_PART = 89,
   VX_ROOT_SHEET = 90,
   VX_ROOT_DRAWING = 91,
   VX_ROOT_SKETCH = 70,
   VX_ROOT_EQUATION_SET = 121,
   VX_ROOT_CAM_PLAN = 200
   } evxRootType;

/* entity pick path */
typedef struct svxEntPath
   {
   int Count;     /* number of id's in the path */
   int Id[50];      /* list of id's that define the path to an entity */
                  /* Id[0] = -1; path begins with active root object */
                  /* Id[0] = -2; path begins with active root file */
                  /* Id[1] = id of first parent entity in path */
                  /* Id[N] = id of child entity to act upon */

   } svxEntPath;


command or gui form template data

/* command types */
typedef enum evxCmdType
   {
   VX_STANDARD_COMMAND=-1,    /* non-history command */
   VX_HIST_GENERAL=0,         /* general-purpose history operation */
   VX_HIST_SOLID_CREATE=11,   /* "solid create" history operation */
   VX_HIST_SOLID_EDIT=12,     /* "solid edit" history operation */
   VX_HIST_SURF_CREATE=13,    /* "surface create" history operation */
   VX_HIST_SURF_EDIT=14,      /* "surface edit" history operation */
   VX_HIST_CRV_CREATE=15,     /* "curve create" history operation */
   VX_HIST_CRV_EDIT=16,       /* "curve edit" history operation */
   VX_HIST_COMP=17,           /* "component" history operation */
   VX_HIST_SKETCH=18,         /* "sketch" history operation */
   VX_HIST_DATUM=19,          /* "datum" history operation */
   VX_HIST_FILLET=20,         /* "fillet/chamfer" history operation */
   VX_HIST_SHELL=21,          /* "shell" history operation */
   VX_HIST_SHT_METAL=22,      /* "sheet metal" history operation */
   VX_HIST_HOLE=23,           /* "hole" history operation */
   VX_HIST_CRV_LIST=24,       /* "curve list" history operation */
   VX_HIST_IMPORT=25,         /* "import" history operation */
   VX_HIST_REF_GEOM=26,       /* "reference geometry" history operation */
   VX_HIST_EQN=27,            /* "equation" history operation */
   VX_HIST_HEAL=28,           /* "heal" history operation */
   VX_HIST_ERASE=29,          /* "erase" history operation */
   VX_HIST_BLANK=30,          /* "blank/unblank" history operation */
   VX_HIST_ATTRIBUTE=33,      /* "attributes" history operation */
   VX_HIST_RENDER=34,         /* "rendering" history operation */
   VX_HIST_ANALYZE=35,        /* "analyze" history operation */
   VX_HIST_MOVE=37,           /* "copy/move/pattern" history operation */
   VX_HIST_TEXT=38,           /* "text" history operation */
   VX_HIST_POINT=39,          /* "point" history operation */
   VX_HIST_DRAFT=40,          /* "draft" history operation */
   VX_HIST_ASSEMBLY=41,       /* "assembly" history operation */
   VX_HIST_TAG=42,            /* "tag" history operation */
   VX_HIST_MOLD=43            /* "mold design" history operation */
   } evxCmdType;

/* numeric input field type */
typedef enum evxFldNumType
   {
   VX_INP_DOUBLE=0,
   VX_INP_INTEGER=1,
   VX_INP_DISTANCE=2,
   VX_INP_ANGLE=3
   } evxFldNumType;

/* gui form template field (i.e. widget) classes */
typedef enum evxFormFldClass
   {
   VX_FORM_FLD_NULL=-1,      /* null */
   VX_FORM_FLD_NUM=0,        /* numeric input */
   VX_FORM_FLD_SLIDER=1,     /* bounded numeric input (slider bar) */
   VX_FORM_FLD_TXT_IN=2,     /* text input */
   VX_FORM_FLD_TXT_OUT=3,    /* text output */
   VX_FORM_FLD_TXT_BTN=4,    /* text input with an extra button */
   VX_FORM_FLD_TXT_LBL=5,    /* toggle+label+text */
   VX_FORM_FLD_DATA=6,       /* data input for handling a template */
   VX_FORM_FLD_LIST=7,       /* scrolling list */
   VX_FORM_FLD_OPT=8,        /* exclusive/non-exclusive group of options */
   VX_FORM_FLD_BTNS=9,       /* menu button group */
   VX_FORM_FLD_GROUP=10,     /* widget grouping entity */
   VX_FORM_FLD_LABEL=11,     /* label only */
   VX_FORM_FLD_SEPARATOR=12, /* seperator */
   VX_FORM_FLD_COLOR=13,     /* color widget */
   VX_FORM_FLD_TREE=14,      /* tree widget */
   VX_FORM_FLD_COMBO=15,     /* combo widget */
   VX_FORM_FLD_TAB=16,       /* tab widget */
   VX_FORM_FLD_PROGRESS=17,  /* progress control widget */
   VX_FORM_FLD_TABLE=18      /* table widget */
   } evxFormFldClass;

/* command template field classes */
typedef enum evxCmdFldClass
   {
   VX_CMD_FLD_NULL=0,      /* null */
   VX_CMD_FLD_TEXT=1,      /* text string */
   VX_CMD_FLD_NUM=2,         /* number */
   VX_CMD_FLD_DIST=3,      /* distance */
   VX_CMD_FLD_ANGLE=4,      /* angle */
   VX_CMD_FLD_POINT=5,      /* point */
   VX_CMD_FLD_ENTITY=6,      /* entity */
   VX_CMD_FLD_OPTION=7,      /* option */
   VX_CMD_FLD_CONT=8,      /* continue */
   VX_CMD_FLD_FORM=9,      /* gui form */
   VX_CMD_FLD_WIN=10       /* pick window */
   } evxCmdFldClass;

/* template field data */
typedef struct svxTplFld
   {
   char Name[65];      /* field name (i.e. label) */
   int Id;            /* command field or gui widget id */
   int Class;          /* see evxFormFldClass or evxCmdFldClass */
   void *Callback;   /* pointer to field's callback function */
   } svxTplFld;

/* gui form action (see cvxFormFunc()) */
typedef enum evxFormAction
   {
   VX_FORM_INIT=-4,   /* initialize form */
   VX_FORM_CANCEL=-3, /* take down the form */
   VX_FORM_RESET=-2,  /* reset form values */
   VX_FORM_APPLY=-1,  /* apply form values and leave form up */
   VX_FORM_OKAY=0,    /* accept form values and take form down */
   VX_FORM_DEFAULT=1  /* default form values */
   } evxFormAction;


command input data

/* command license codes */
#define VX_CODE_GENERAL 0.0
#define VX_CODE_ADV_RENDERING 1.0
#define VX_CODE_ASSEMBLY 2.0
#define VX_CODE_ADV_ASSEMBLY 17179869184.0
#define VX_CODE_DRAFTING 4.0
#define VX_CODE_WIREFRAME 8589934592.0
#define VX_CODE_MODELING 512.0
#define VX_CODE_ADV_MODELING 34359738368.0
#define VX_CODE_ADV_SURF 256.0
#define VX_CODE_MOLD_DESIGN 1024.0
#define VX_CODE_HEALING 4294967296.0
#define VX_CODE_POST 2199023255552.0

/* numeric input data types */
typedef enum evxNumType
   {
   VX_NUM_UNDEFINED=-1,     /* undefined */
   VX_NUM_NULL=0,           /* undefined */
   VX_NUM_TO_FACE=1,        /* distance/angle to face */
   VX_NUM_FACE_BND=2,       /* boundary face  */
   VX_NUM_TO_PNT=3,         /* distance/angle to point */
   VX_NUM_THRU_PLUS=4,      /* "through all" in positive direction */
   VX_NUM_THRU_MINUS=5,     /* "through all" in negative direction */
   VX_NUM_CURVE_BND=6       /* boundary curve */
   } evxNumType;

/* point input data types */
typedef enum evxPntType
   {
   VX_PNT3_ABS=0,     /* defined by absolute coord. in object space */
   VX_PNT3_ENT=1,     /* entity "critical" point (start, end, mid, center) */
   VX_PNT3_ON=2,      /* point on entity defined in entity parameter space */
   VX_PNT3_TO=3,      /* point on entity for "tangent to" or "extend to" */
   VX_PNT3_MID=4,     /* curve midpoint */
   VX_PNT3_NUM=5,     /* point object stores dimensionless numeric input */
   VX_PNT3_DST=6,     /* point object stores linear numeric input */
   VX_PNT3_ANG=7,     /* point object stores angular numeric input */
   VX_PNT3_TAN=8,     /* point on entity for "tangent to" */
   VX_PNT3_FRAC=9,    /* point on curve defined as fraction of curve length */
   VX_PNT3_REL=10,    /* point defined relative to previous point */
   VX_PNT3_DATA=11,   /* point defined by a VDATA object */
   VX_PNT3_ABS_COMP=12/* defined by abs coord in space of active component */
   } evxPntType;

/* command input data item */
typedef struct svxData
   {
   /* flags indicating the types of data defined by this structure */
   char isPoint;        /* 1 if "Pnt" is defined, else 0 */
   char isEntity;       /* 1 if "idEntity" is defined, else 0 */
   char isNumber;       /* 1 if "Num" is defined, else 0 */
   char isDirection;    /* 1 if "Dir" is defined, else 0 */
   char isText;          /* 1 if "Text" is defined, else 0 */
   char isPntOnCrv;      /* 1 if point on curve, else 0.
                        ** idEntity="curve id"; Pnt="point coordinates";
                        ** Param[0]="curve t param"; idParent is optional.
   char isEndPnt;         /* if "isPntOnCrv=1", set this flag to 1 if 
                        ** Param[0] is to be used to identify the closest
                        ** endpoint on the specified curve (idEntity).
   char isPntOnFace;      /* 1 if point on face, else 0.
                        ** idEntity="face id"; Pnt="point coordinates";
                        ** Param[0]="u parameter"; Param[1]="v parameter".
   /* various parameters that may be defined (see the flags above) */
   int idEntity;        /* entity/object id (0 if undefined) */
   int idParent;         /* id of parent entity (0 if undefined) */
   evxNumType NumType;  /* numeric input type (input and output) */
   double Num;          /* numeric value */
   evxPntType PntType;  /* point input type (output only) */
   svxPoint Pnt;        /* point coordinates */
   svxVector Dir;       /* unit direction vector */
   double Param[3];     /* pick parameters (i.e. t value or point id) */
   char Text[256];      /* text string (expression if "isNumber=1") */
   } svxData;


assembly data

/* component data */
typedef struct svxCompData
   {
   vxPath Dir;       /* pathname of directory that contains "File" */
                     /* set "Dir[0]=0" to search default pathnames */
   vxName File;      /* name of VX file that contains "Part" */
   vxName Part;      /* name of part to instance as a component */
   vxName Comp;      /* name to assign to new component in parent part */
                     /* set "Comp[0]=0" for default name */
   svxMatrix Frame;  /* insertion frame for new component */
   int Anchor;       /* 1 to anchor component, or 0 */
   int AutoRegen;    /* 1 to regen component when parent is regen'd, or 0 */
   int AutoDelete;   /* 1 to delete component when parent is deleted, or 0 */
   int Copy;         /* 1 to copy "Part" before instancing, or 0 */
   vxName CopyName;   /* name to assign to copied part when "Copy=1" */
                     /* if no name is given, the default name is output */
   int Overwrite;      /* 0 to automatically avoid overwriting existing part
                     ** 1 to prompt whether to overwrite existing part
                     ** -1 to automatically overwrite existing part 
   vxName DestFile;   /* name of destination file if copying part
                     ** If no name is given (DestFile[0]=0), the part
                     ** is copied to the file of the parent assembly.
   } svxCompData;

/* geometry export */
typedef struct svxGeomExport
   {
   int numEnts;      /* number of geometry entities to export */
   int *idEnts;      /* id's of geometry entities to export */
   vxName File;      /* destination file (set File[0]=0 to use active file) */
   vxName Part;      /* name of destination part (new or existing) */
   svxMatrix Frame;   /* local coordinate frame */
   int Option;         /* 0 - add import operation to destination part.
                     ** 1 - add import operation and then "encapsulate" history.
                     ** 2 - add import operation and then "backup" history.
                     ** (Option 1 is recommended)
   int AddComponent;   /* 1 to instance part as component; else 0 */
   int NoExportOp;   /* 1 to disable logging of "Export" operation; else 0 */
   } svxGeomExport;

hole feature data

/* hole types */
typedef enum evxHoleType
   {
   VX_HOLE_SIMPLE = 0,
   VX_HOLE_TAPERED = 1,
   VX_HOLE_COUNTER_BORE = 2,
   VX_HOLE_COUNTER_SUNK = 3,
   VX_HOLE_SPOT_FACE = 4
   } evxHoleType;

/* hole end conditions */
typedef enum evxEndCondition
   {
   VX_BLIND = 0,
   VX_UNTIL_FACE = 1,
   VX_THROUGH_ALL = 2
   } evxEndCondition;

/* hole thread types */
typedef enum evxThreadType
   {
   VX_THREAD_NONE = 1,
   VX_THREAD_CUSTOM = 2,
   VX_THREAD_M = 3,
   VX_THREAD_UNC = 4,
   VX_THREAD_UNF = 5,
   VX_THREAD_UNEF = 6
   } evxThreadType;

/* hole data */
typedef struct svxHoleData
   {
   /* Geometry */
   evxHoleType Type;    /* hole type */
   int idInsFace;       /* id of insertion face */
   int Count;           /* number of holes */
   svxPoint *Points;    /* list of "Count" hole insertion points */
                        /* (calling procedure must allocate/deallocate) */
   double Diameter1;    /* 1st diameter (mm) */
   double Depth1;       /* 1st depth (mm) */
   double Diameter2;    /* 2nd diameter (mm, countersunk holes) */
   double Depth2;       /* 2nd depth (mm, countersunk holes) */
   double TaperAngle;   /* taper angle (degrees) */
   double TipAngle;     /* tip angle (degrees) (0 is mapped to 180) */
   evxEndCondition End; /* hole end condition */
   int idUntilFace;     /* id of "until" face (0 if not required) */
   int UseDirection;      /* 1 to use "Direction" input; 0 for default */
   svxVector Direction; /* optional direction for hole centerline */

   /* Thread */
   evxThreadType ThreadType;      /* thread type */
   double ThreadDiameter;         /* thread diameter (mm) */
   double ThreadLength;            /* thread length (mm) */
   double ThreadsPerUnit;         /* threads per unit (0 if not used) */
   double ThreadPitch;            /* thread pitch (mm) (0 if not used) */

   /* Tolerance */
   int UseTol;           /* 1 to use tolerances; or 0 */
   double TolIn;        /* inner tolerance on Diameter 1 */
   double TolOut;        /* outer tolerance on Diameter 1 */

   /* Other */
   char Callout[128];   /* callout text string */
   int DoNotMachine;    /* 1 to ignore hole in CAM, or 0 */
   } svxHoleData;


shape feature data

/* boolean combination method */
typedef enum evxBoolType
   {
   VX_BOOL_NONE = 0,
   VX_BOOL_ADD = 1,
   VX_BOOL_REMOVE = 2,
   VX_BOOL_INTERSECT = 3
   } evxBoolType;


/* box */
typedef struct svxBoxData
   {
   evxBoolType Combine;   /* combination method */
   int idPlane;         /* optional datum plane, or 0 */
   svxPoint Center;      /* center of box volume */
   double X;            /* length along X */
   double Y;            /* length along Y */
   double Z;            /* length along Z */
   } svxBoxData;
   

/* cylinder */
typedef struct svxCylData
   {
   evxBoolType Combine;   /* combination method */
   int idPlane;         /* optional datum plane (0 to use XY plane) */
   svxPoint Center;      /* center of bottom face */
   double Radius;         /* radius (mm) in XY plane */
   double Length;         /* length (mm) along Z */
   } svxCylData;


/* extruded shape */
typedef struct svxExtrudeData
   {
   evxBoolType Combine;   /* combination method */
   int idProfile;         /* profile (sketch or curvelist) */
   double Start;         /* start distance (mm) */
   double End;            /* end distance (mm) */

   double Draft;         /* draft angle (deg) */
   int Blend;            /* corner blend option */
                        /* (0-variable, 1-constant, 2-round) */

   int UseDirection;      /* 1 to use optional extrusion direction, else 0 */   
   svxVector Direction;   /* optional extrusion direction */

   double Twist;         /* twist angle (deg) */
   svxPoint Pivot;      /* pivot point if twist is non-zero */

   double Offset;         /* profile offset (mm) (0 if undefined) */
   double Thickness;      /* wall thickness (mm) (0 if undefined) */
   } svxExtrudeData;


/* revolved shape */
typedef struct svxRevolveData
   {
   evxBoolType Combine;   /* combination method */
   int idProfile;         /* profile (sketch or curvelist) */
   double Start;         /* start angle (deg) */
   double End;            /* end angle (deg) */
   svxAxis Axis;         /* axis of revolution */

   double Offset;         /* profile offset (mm) (0 if undefined) */
   double Thickness;      /* wall thickness (mm) (0 if undefined) */
   } svxRevolveData;


/* sweep option */
typedef enum evxSweepOpt
   {
   VX_SWP_NATURAL=0,
   VX_SWP_AT_PROFILE=1,
   VX_SWP_AT_PATH=2,
   VX_SWP_FRAME=3
   } evxSweepOpt;


/* swept shape */
typedef struct svxSweepData
   {
   evxBoolType Combine;   /* combination method */
   int idProfile;         /* profile (sketch, curve, edge, curvelist) */
   int idPath;            /* id of curve that identifies the sweep path */
   svxPoint StartPnt;   /* point that identifies start of path curve */
                        /* (defined relative to curve's coordinate frame) */

   int idParent;         /* id of path curve's parent sketch or curvelist */
   int UseParent;         /* 1 to use curve's parent as the sweep path, else 0 */

   evxSweepOpt Option;   /* sweep option */

   int idFrame;         /* id of sweep frame if Option=VX_SWP_FRAME, else 0 */

   int idXaxis;         /* id of X-axis curve or plane (0 if undefined) */

   int idZaxis;         /* id of Z-axis curve or plane (0 if undefined) */

   double Offset;         /* profile offset (mm) (0 if undefined) */
   double Thickness;      /* wall thickness (mm) (0 if undefined) */

   } svxSweepData;


curve data

/* 3D interpolated curve */
typedef struct svxCrvIntData
   {
   /* required inputs */

   int isClosed;         /* 1 if curve is closed, 0 if open */
   int Degree;            /* curve degree (2 - 6) */
   int Count;            /* number of points to interpolate */
   svxPoint *Points;      /* pointer to list of points to interpolate */
                        /* (set Z coordinate to zero for 2D curves) */

   /* optional inputs */

   int UseStartTan;      /* 1 to use start tangent direction, else 0 */
   svxVector StartTan;   /* normalized start tangent direction vector */
   double StartScale;   /* start tangent scale factor (0.1 - 10.0) */

   int UseEndTan;         /* 1 to use start tangent direction, else 0 */
   svxVector EndTan;      /* normalized end tangent direction vector */
   double EndScale;      /* end tangent scale factor (0.1 - 10.0) */
   } svxCrvIntData;

general part data

/* global settings */
typedef enum evxGlobal
   {
   VX_TOLERANCE=1,   /* proximity tolerance (double) */
   VX_AUTO_MERGE=2    /* 1=auto-merge shells before boolean (int) */

   } evxGlobal;

/* standard attribute data */
typedef struct svxAttribute
   {
   char  label[64];      /* attribute label */
   char  data[128];      /* attribute data */
   } svxAttribute;

/* part attribute structure */
typedef struct svxPartAttribute
   {
   int Version;
   int UserAttributeCount;
   svxAttribute UserAttribute[64];
   svxAttribute Name;
   svxAttribute Number;
   svxAttribute Partclass;
   svxAttribute Designer;
   svxAttribute Cost;
   svxAttribute Supplier;
   svxAttribute Description;
   svxAttribute Keyword;
   svxAttribute Manager;
   svxAttribute Material;
   svxAttribute Startdate;
   svxAttribute Enddate;
   svxAttribute Derived;
   svxAttribute No_section;
   svxAttribute No_hatch;
   svxAttribute Dimen[20];
   svxAttribute No_bom;
   } svxPartAttribute;

/* part component/shape alignment */
typedef enum evxAlignType
   {
   VX_ALIGN_COINCIDENT=0,
   VX_ALIGN_TANGENT=1,
   VX_ALIGN_CONCENTRIC=2,
   VX_ALIGN_PARALLEL=3,
   VX_ALIGN_PERPENDICULAR=4,
   VX_ALIGN_ANGLE=5
   } evxAlignType;

typedef enum evxAlignInterference
   {
   VX_INTERFERENCE_NONE=0,
   VX_INTERFERENCE_HIGHLIGHT=1,
   VX_INTERFERENCE_STOP_AT=2,
   VX_INTERFERENCE_ADD_ALIGN=3
   } evxAlignInterference;

typedef struct svxAlign
   {
   svxData Entity1;      /* "isPntOnCrv" or "isPntOnFace" required */
   svxData Entity2;      /* "isPntOnCrv" or "isPntOnFace" required */
                        /* point must be defined in active part space */
                        /* (see cvxPntOnFace()) */
   evxAlignType Type;   /* alignment type */
   double Offset;         /* distance between alignment entities */
   double Angle;         /* angle between alignment entities */
   int isOpposite;      /* 1 to make entities opposite facing, else 0 */
   int ShowExistingAlign;
   evxAlignInterference Interference;
   } svxAlign;


typedef struct svxMassProp 
   {
   double Density;      /* Density (kg/mm^3) */
   double Area;         /* Area (mm^2) */
   double Volume;       /* Volume (mm^3) */
   double Mass;         /* Mass (kg) */
   svxPoint Center;      /* Centroid (i.e. Center of Gravity) */
   svxVector Axis[3];   /* Principal axes relative to global xyz frame */
   double Im[6];         /* Moments of inertia relative to xyz axes */
   double Ip[3];         /* Moments of inertia relative to principal axes */
   double Rad[3];         /* Radii of gyration relative to principal axes */

   } svxMassProp;


Custom Commands


custom command definition and execution

extern void cvxCmdCallback(vxName Name, void *Function);
extern int cvxCmdEval(vxName Name, int idData);
extern int cvxCmdExec(int idData);
extern void cvxCmdFunc(vxName Name, void *Function, double Code);
extern int cvxCmdInput(vxName Name, int idDataIn, int *idDataOut);
extern void cvxCmdInqActive(vxName Name);
extern int cvxCmdMacro(char *Input, char **Output);
extern void cvxCmdMarker(vxName Okay, vxName Cancel);
extern void cvxCmdSend(char *CommandString);
extern int cvxCmdTemplate(vxPath File);
extern void cvxCmdVariable(vxName Name, void *Variable);


command template definition

extern int cvxTplContAdd(int Id,int Opt,char*Name,char*Prompt);
extern int cvxTplEntAdd(int Id,int Opt,char*Name,char*Prompt,int isList);
extern int cvxTplEntOpt(int Id,evxEntInpOpt Option,char *Callback,int EmptyOk);
extern int cvxTplInit(evxCmdType Type,char *Name,char *Description);
extern int cvxTplInit2(char *ExecFunc,char *StartFunc,char *EndFunc,int Update);
extern int cvxTplInit3(int NoOptForm, int AutoRepeat, int MidClickRepeat);
extern int cvxTplInqFld(vxName Name, int *Count, svxTplFld **Fields);
extern int cvxTplInqFnCust(vxName Name, char *FnName);
extern int cvxTplInqFnEcho(vxName Name, char *FnName);
extern int cvxTplInqFnInit(vxName Name, char *FnName);
extern int cvxTplInqFnTerm(vxName Name, char *FnName);
extern int cvxTplNumAdd(int Id,int Opt,char*Name,char*Prompt,evxFldNumType);
extern int cvxTplNumOpt(int Id,char*Global,int Integer,double Step,double Min,double Max);
extern int cvxTplNumOpt2(int Id,char*Callback,int Slider,int EmptyOk);
extern int cvxTplOptAdd(int Id,int Opt,char*Name,char*Prompt);
extern int cvxTplOptItem(int Opt,char *Item);
extern int cvxTplOptOpt(int Id,char*Global,char*Callback,int CheckBox,int EmptyOk);
extern int cvxTplPntAdd(int Id,int Opt,char*Name,char*Prompt,int isList);
extern int cvxTplPntOpt(int Id,evxPntInpOpt Option,char*Callback,int EmptyOk);
extern int cvxTplStrAdd(int Id,int Opt,char*Name,char*Prompt);
extern int cvxTplStrOpt(int Id,char*Callback,int EmptyOk);
extern int cvxTplRegister(void);



input data management for custom commands

extern int cvxDataClear(int idData, int idField);
extern int cvxDataDel(int idData, int idField);
extern int cvxDataFree(int idData);
extern int cvxDataGet(int idData, int idField, svxData *Data);
extern int cvxDataGetEnt(int idData, int idField, int *idEnt, int *idParent);
extern int cvxDataGetEnts(int idData, int idField, int *Count, int **idEnts);
extern int cvxDataGetList(int idData, int idField, int *Count, svxData **Data);
extern int cvxDataGetNum(int idData, int idField, double *Number);
extern int cvxDataGetOpt(int idData, int idField);
extern int cvxDataGetPath(int idData, int idField, int *FirstEnt, svxEntPath*);
extern int cvxDataGetPnt(int idData, int idField, svxPoint*);
extern int cvxDataGetPnts(int idData, int idField, int *Count, svxPoint**);
extern int cvxDataGetPromote(int idData, int idField, int *Promote);
extern int cvxDataGetText(int idData, int idField, int NumBytes, char*);
extern int cvxDataInit(vxName Template, int *idData);
extern int cvxDataSet(int idData, int idField, svxData *Data);
extern int cvxDataSetPath(int idData, int idField, svxEntPath*);
extern int cvxDataSetPromote(int idData, int idField, int Promote);
extern int cvxDataSetPntOnFace(int idData, int idField, int idComp, int idFace);
extern void cvxDataZero(svxData *Data);


Custom GUI Forms


manage forms

extern void cvxFormCallback(vxName Name, void *Function);
extern int cvxFormCreate(char *Form, int Display);
extern void cvxFormFunc(vxName Name, void *Function, double Code);
extern void cvxFormKill(char *Form);
extern int cvxFormDataGet(char *Form, char **Data);
extern int cvxFormDataSet(char *Form, char *Data);
extern int cvxFormInqFld(vxName Name, int *Count, svxTplFld **Fields);
extern int cvxFormsPrecompiled(vxPath File);
extern void cvxFormRefresh(char *Form);
extern void cvxFormShow(char *Form);
extern int cvxFormState(char *Form);
extern int cvxFormTemplate(vxPath File);
extern void cvxFormTitleGet(char *Form, char **Title);
extern void cvxFormUpdate(int idField);
extern int cvxFormWait(char *Form);

manage fields within a form

extern void cvxFieldClear(char *Form, int idField);
extern void cvxFieldDisable(char *Form, int idField);
extern void cvxFieldEnable(char *Form, int idField);
extern void cvxFieldImageSet(char *Form, int idField, char *Image);
extern void cvxFieldNumItems(char *Form, int idField, int *NumItems);

manage items within a field of a form

extern void cvxItemAdd(char *Form, int idField, char *Text);
extern void cvxItemDel(char *Form, int idField, int idItem);
extern void cvxItemFind(char *Form, int idField, char *Text, int *idItem);
extern void cvxItemGet(char *Form, int idField, int idItem, char *Text);
extern void cvxItemSelect(char *Form, int idField, int idItem);
extern void cvxItemSelectText(char *Form, int idField, char *Text);
extern void cvxItemSelected(char *Form, int idField, int *idItem);
extern void cvxItemSet(char *Form, int idField, int idItem, char *Text);
extern void cvxItemStateGet(char *Form, int idField, int idItem, int *isOn);
extern void cvxItemStateSet(char *Form, int idField, int idItem, int isOn);

manage cells within a table on a form

extern void cvxCellColorBack(char *Form,int idField,int Row,int Col,svxColor);
extern void cvxCellColorFront(char *Form,int idField,int Row,int Col,svxColor);
extern void cvxCellCombo(char *Form,int idField,int Row,int Col,char *Labels);
extern void cvxCellFromItem(int idItem, int *Row, int *Col);
extern void cvxCellMode(char *Form,int idField,int Row,int Col,int Edit);
extern void cvxCellToItem(int Row, int Col, int *idItem);


GUI/Display Management


display management

extern void cvxDispColorGet(evxDispAttrib Type, evxColor *Color);
extern void cvxDispColorSet(evxDispAttrib Type, evxColor Color);
extern int cvxDispGetLights(int *Count, svxLight **Lights);
extern void cvxDispModeGet(evxDispMode *Mode);
extern void cvxDispModeSet(evxDispMode Mode);
extern void cvxDispRedraw(void);
extern void cvxDispSwitch(evxDispItem Item, int isOn);
extern void cvxDispZoomAll(int Redraw);


layer management (active part or sheet)

extern int cvxLayerActivate(vxName Name);
extern int cvxLayerAssign(vxName Name, int numEnt, int *idEnts);
extern int cvxLayerAdd(vxName Name);
extern int cvxLayerDel(vxName Name);
extern int cvxLayerExists(vxName Name);
extern void cvxLayerInqActive(vxName Name);
extern int cvxLayerList(int *Count, vxName **Names);
extern int cvxLayerName(int Number, vxName Name);
extern int cvxLayerNum(vxName Name, int *Number);
extern int cvxLayerShowAll(void);
extern int cvxLayerStateGet(vxName Name, int *isVisible, int *isFrozen);
extern int cvxLayerStateSet(vxName Name, int isVisible, int isFrozen);
extern int cvxLayerSync(void);


view management

extern void cvxViewExtent(double Extent);
extern void cvxViewGet(svxMatrix *Frame, double *Extent);
extern void cvxViewOrigin(svxPoint *Origin);
extern void cvxViewSet(svxMatrix *Frame, double Extent);
extern void cvxViewStd(evxViewStd Type, double NullExtent);


menu management

extern void cvxMenuItemState(vxName Menu, int Item, int State);


cursor management

extern void cvxCursorSet(evxCursorType Type);
extern void cvxCursorRestore(void);


error management

extern void cvxErrDisable(void);
extern void cvxErrEnable(void);

message management

extern void cvxMsgAreaClose(void);
extern void cvxMsgAreaOpen(void);
extern void cvxMsgAreaState(int);
extern void cvxMsgDisable(void);
extern void cvxMsgDisp(char *Text);
extern void cvxMsgEnable(void);
extern int cvxMsgFileLoad(vxPath File, int *idFile);
extern char *cvxMsgPtr(int idFile, int MessageNum);
extern void cvxPromptDisable(void);
extern void cvxPromptEnable(void);
extern void cvxTranStatusDisable(void);
extern void cvxTranStatusEnable(void);


user input

extern int cvxGetAngle(char *Prompt, double *Angle);
extern int cvxGetDistance(char *Prompt, double *Distance);
extern int cvxGetNumber(char *Prompt, double *Number);
extern int cvxGetEnt(char *Prompt,evxEntInpOpt,int EmptyOk,int*idEntity);
extern int cvxGetEnts(char*Prompt,evxEntInpOpt,int EmptyOk,int*Count,int**idEnts);
extern void cvxGetFile(int Open,char*Prompt,char*Default,char*Filter,char*Path);
extern int cvxGetPoint(char*Prompt,evxPntInpOpt,int EmptyOk,svxPoint*,int*idEnt);
extern int cvxGetPoints(char*Prompt,evxPntInpOpt,int EmptyOk,int*Count,svxPoint**Points);
extern int cvxGetResponse(int Option, char *Message);
extern int cvxGetString(char*Prompt,char*Default,int NumBytes,char*String);

escape checking

extern int cvxEscCheck(void);
extern void cvxEscDisable(int *EscapeState);
extern void cvxEscRestore(int EscapeState);
extern void cvxEscStart(void);
extern void cvxEscEnd(void);

miscellaneous

extern void cvxHistDisable(void);
extern void cvxHistEnable(void);



File Management


file management

extern int cvxFileActivate(vxName Name);
extern void cvxFileClose(void);
extern void cvxFileDirectory(vxPath Directory);
extern void cvxFileInqActive(vxName Name);
extern int cvxFileNew(vxName Name);
extern int cvxFileNew2(vxName Name, char *Description);
extern int cvxFileOpen(vxPath File);
extern int cvxFileSave(int Close);
extern int cvxFileSaveAs(vxPath File);
extern void cvxFileTypeGet(int *MultiObject);
extern void cvxFileTypeSet(int MultiObject);

session management

extern int cvxSessionClear(void);
extern int cvxSessionSave(void);


path management

extern int cvxPathAdd(vxPath SearchDirectory);
extern int cvxPathAddApiPath(vxName LibName, char *SubFolder);
extern int cvxPathApiLib(vxName LibName, vxPath LibDirectory);
extern int cvxPathCompose(vxPath Path, vxName Name);
extern void cvxPathDel(vxPath Path);
extern void cvxPathDelim(vxPath Path);
extern void cvxPathDir(vxPath FullPath, vxPath Directory);
extern void cvxPathFile(vxPath FullPath, vxName FileName);
extern void cvxPathFile2(char *FullPath, int MaxNameLen, char *FileName);
extern int cvxPathFind(vxName FileName, vxPath FullPath);
extern void cvxPathInstall(vxPath InstallDirectory);
extern void cvxPathSearchFirst(vxPath Directory);
extern void cvxPathTemp(vxPath Directory);

Root Object Management


extern int cvxRootActivate(vxName Name);
extern int cvxRootActivate2(vxName File, vxName Name);
extern int cvxRootAdd(evxRootType Type, vxName Name, vxName Template);
extern int cvxRootAdd2(evxRootType, vxName Name, vxName Template, char *Desc);
extern int cvxRootCopy(vxName,vxName,vxName,vxName,int Overwrite,int UpdateUid);
extern int cvxRootDel(vxName Name);
extern void cvxRootExit(void);
extern int cvxRootId(vxName Name, int *idRoot, evxRootType *Type);
extern void cvxRootInqActive(vxName Name);
extern int cvxRootList(vxPath File, int *Count, vxName **Names);
extern evxPreviewMode cvxRootPreviewGet(void);
extern void cvxRootPreviewSet(evxPreviewMode Mode, vxName File, vxName Object);
extern int cvxRootRename(vxName Name,vxName NewName,int Update);
extern int cvxRootRename2(vxName Name,vxName NewName,char *Descript,int Update);
extern void cvxRootTemplateFile(vxName File);
extern int cvxRootVarGet(vxName Name, svxVariable *Variable);
extern int cvxRootVarSet(vxName Name,int Count,svxVariable*Var,int Working);
extern void cvxRootVisibility(vxName Name, int Visible);

Active Part/Assembly


datum plane creation

extern int cvxPartDatum(svxMatrix *Frame, int *idDatum);
extern int cvxPartPlnCrv(int idCrv,svxPoint*Origin,svxPoint*Xaxis, int *idPln);
extern int cvxPartPlnSrf(int idFace, svxPoint*Origin, int *idPln);

wireframe creation

extern int cvxPartArc3pt(svxPoint*Start,svxPoint*End,svxPoint*Mid,int*idEnt);
extern int cvxPartArcRad(svxMatrix *Pln,double R,double S,double E,int *idEnt);
extern int cvxPartCir3pt(svxPoint *P1, svxPoint *P2, svxPoint *P3 ,int *idEnt);
extern int cvxPartCirRad(svxMatrix *Plane, double Radius, int *idEnt);
extern int cvxPartCrvInt(svxCrvIntData *Crv, int *idEnt);
extern int cvxPartCrvList(int Count, int *Curves, int *idEnt);
extern int cvxPartCurve(svxCurve *Crv, int *idEnt);
extern int cvxPartLine2pt(svxPoint *Start, svxPoint *End, int *idEnt);
extern int cvxPartPnt(svxPoint *Point, int *idEnt);
extern int cvxPartPnts(int Count, svxPoint *Points);

sketch creation

extern int cvxPartSkIns(vxName File,vxName Name,svxMatrix*Plane,int*idEnt);
extern int cvxPartSkNew(svxMatrix *Plane, int *idEnt);

shape creation

extern int cvxPartBool(evxBoolType,int idBase,int Count,int *Shapes,int Keep);
extern int cvxPartBox(svxBoxData *Box, int *idShape);
extern int cvxPartCyl(svxCylData *Cyl, int *idShape);
extern int cvxPartExtrude(svxExtrudeData *Ext, int *idShape);
extern int cvxPartFace(svxSurface*, int NumCurves, svxCurve *TrimCurves, int Code, int Sew, double Tol, int *idFace);
extern int cvxPartRevolve(svxRevolveData *Rev, int *idShape);
extern int cvxPartSweep(svxSweepData *Swp, void *Options, int *idShape);

feature creation

extern int cvxPartChamAng(int Cnt,int*Edges,int idFace,double Sb,double Angle);
extern int cvxPartChamAsym(int Cnt,int*Edges,int idFace,double Sb1,double Sb2);
extern int cvxPartChamConst(int Count, int *Edges, double Sb);
extern int cvxPartFillet(int Count, int *Edges, double Radius);
extern int cvxPartHole(svxHoleData *Data, int *idOp);

assembly component

extern int cvxCompExtract(int idShape,svxMatrix*,vxName,int NewFile,evxResponse,int*idComp);
extern int cvxCompEditPart(int idComp);
extern int cvxCompFind(evxFaceTrim,svxAxis*,double Dist,int SkipBlank,int*Count,int**Comps);
extern int cvxCompInqPart(int idComp, vxName File, vxName Part);
extern int cvxCompIns(svxCompData *Comp, int *idComp);
extern int cvxCompMerge(evxBoolType Combine,int idComp,int *idShape);
extern int cvxCompRegenSet(int idComp, int Regen);
extern int cvxCompShift(int idComp);

sub-part

extern int cvxSubPartIns(vxName Name, int AutoRegen, int MergeDimen);
extern int cvxSubPartFlag(vxName File, vxName Part, int isSubPart);

variables

extern int cvxPartVarAdd(svxVariable *Variable);
extern int cvxPartVarGet(svxVariable *Variable);
extern int cvxPartVarSet(int Count, svxVariable *Variables, int Working);

display

extern void cvxPartShowAll(void);
extern void cvxPartShowTarg(void);

edit

extern int cvxPartCopyPntToPnt(int idEntity,svxAxis*S,svxAxis*E,int*idCopy);
extern int cvxPartErase(int Count, int *idEnts);
extern int cvxPartMovePntToPnt(int idEntity,svxAxis*S,svxAxis*E);
extern int cvxPartNameLastOp(vxName NewName);
extern int cvxPartSew(double Tol, int *OpenEdges, double *MaxGap);
extern int cvxPartSewForce(double Tol);

query

extern int cvxPartInqComps(vxName File, vxName Part, int *Count, int **Comps);
extern int cvxPartInqCurve(int idEntity, int Nurb, svxCurve *Crv);
extern int cvxPartInqCurves(int *Count, int **Curves);
extern int cvxPartInqEdgeFaces(int idEdge,int *Count,int **Faces);
extern int cvxPartInqEdgeCrv(int idEdge, int idFace, svxCurve *Crv);
extern int cvxPartInqEntFtr(int idEntity, int *idFeature);
extern int cvxPartInqEntShape(int idEntity, int *idShape);
extern int cvxPartInqFaceAt(int idFace, svxFaceAt *At);
extern int cvxPartInqFaceSh(int idFace, svxShaderAt *Sh);
extern int cvxPartInqFaceTx(int idFace, svxTextureAt *Tx);
extern int cvxPartInqFaceBox(int idFace, svxBndBox *Box);
extern int cvxPartInqFaceCrvs(int idFace,int *Count,svxCurve **TrimCurves);
extern int cvxPartInqFaceEdges(int idFace,int *Count,int **Edges);
extern int cvxPartInqFaceFacets(int idFace, int *Count, svxTriangle **Facets);
extern int cvxPartInqFaceLoops(int idFace,int Inner, int *Count,int **Loops);
extern int cvxPartInqFaceSrf(int idFace, svxSurface *Srf);
extern int cvxPartInqFaceShape(int idFace, int *idShape);
extern int cvxPartInqFtrData(int idFeature, int iNoEval, int *idData);
extern int cvxPartInqFtrTemplate(int idFeature, vxName Template);
extern int cvxPartInqFtrVersion(int idFeature, int *Version);
extern int cvxPartInqLoopEdges(int idFace,int *Count,int **Edges);
extern int cvxPartInqHoles(vxName File, vxName Part, int *Count, svxHoleData**);
extern int cvxPartInqShapeBox(int idShape, svxMatrix *Mat, svxBndBox *Box);
extern int cvxPartInqShapeComp(int idShape, int *idComp);
extern int cvxPartInqShapeEdges(int idShape,int *Count,int **Edges);
extern int cvxPartInqShapeFaces(int idShape,int *Count,int **Faces);
extern int cvxPartInqShapeMass(int idShape, double Density, svxMassProp*);
extern int cvxPartInqShapes(vxName File, vxName Part, int *Count, int **Shapes);
extern int cvxPartInqVars(vxName File, vxName Part, int *Count, svxVariable**);

other

extern int cvxPartAlign(svxAlign *Align);
extern int cvxPartAnchor(int idEntity);
extern int cvxPartAtGet(vxName Name, svxPartAttribute *At);
extern int cvxPartAtSet(vxName Name, svxPartAttribute *At);
extern int cvxPartBackup(void);
extern int cvxPartEncapsulate(void);
extern void cvxPartExit(void);
extern void cvxPartFreeHoles(int Count, svxHoleData **Holes);
extern int cvxPartGeomExport(svxGeomExport *Data);
extern int cvxPartHistDel(int Count, int *Operations);
extern int cvxPartHistEnd(void);
extern int cvxPartHistGroup(int idFirst, int idLast, vxName Name, int Close);
extern int cvxPartHistRename(int idOp, vxName Name, char *Descript);
extern int cvxPartHistStart(vxName Name);
extern int cvxPartMassProp(void);


Active Sketch


extern int cvxSkArc3pt(svxPoint2*Start,svxPoint2*End,svxPoint2*Mid,int*idEnt);
extern int cvxSkArcRad(svxPoint2*Center,double R,double S,double E,int*idEnt);
extern int cvxSkCir3pt(svxPoint2 *P1,svxPoint2 *P2,svxPoint2 *P3,int *idEnt);
extern int cvxSkCirRad(svxPoint2 *Center,double Radius,int *idEnt);
extern int cvxSkCrvInt(svxCrvIntData *Crv, int *idEnt);
extern int cvxSkLine2pt(svxPoint2 *Start, svxPoint2 *End, int *idEnt);



General Entity Operations


extern int cvxEntBlank(int Show, int Count, int *idEnts);
extern int cvxEntByLabel(int *Label, int Exact, int *idEntity);
extern int cvxEntByName(vxName Name, int *idEntity);
extern void cvxEntClassName(int ClassNumber, char *ClassName);
extern int cvxEntClassNum(int idEntity);
extern int cvxEntColorGet(int idEntity, evxColor *Color);
extern int cvxEntColorSet(evxColor Color, int Count, int *idEnts);
extern int cvxEntComp(int idEntity, int *idComp, vxName File, vxName Parent);
extern int cvxEntEndPnt(int idEntity, svxPoint *Start, svxPoint *End);
extern int cvxEntErase(svxEntPath *Ent);
extern int cvxEntFind(evxEntFind,svxPoint*RefPnt,int*idEntity,svxPoint*Pnt,double *Dist);
extern void cvxEntHighlight(int idEntity);
extern int cvxEntIsBlanked(int idEntity);
extern int cvxEntIsCurve(int idEntity);
extern int cvxEntLabelGet(int idEntity, int **Label);
extern int cvxEntLabelSet(int idEntity, int *Label);
extern int cvxEntLayer(int idEntity, vxName Layer);
extern int cvxEntMatrix(int idEntity, svxMatrix *Matrix);
extern int cvxEntMatrix2(svxEntPath Entity, svxMatrix *Matrix);
extern int cvxEntTextInq(int idText, char **Text);
extern int cvxEntTextMod(int idText, char *Text);
extern int cvxEntPnt(int idEntity, svxPoint *Pnt);
extern int cvxEntName(int idEntity, vxName Name);
extern int cvxEntNameSet(int idEntity, vxName Name);
extern int cvxEntNew(int StartOp, evxEntType Type);
extern void cvxEntNewList(int StartOp,evxEntType Type,int *Count,int **idEnts);
extern int cvxEntRefEnt(int idRefEnt, int *idEnt);
extern int cvxEntRgbGet(int idEntity, svxColor *Color);
extern int cvxEntRgbSet(svxColor Color, int Count, int *idEnts);
extern void cvxEntUnhighlightAll(void);




General Application


extern void cvxAutoRegenGet(int *Status);
extern void cvxAutoRegenSet(int Status);
extern int cvxGlobalGet(evxGlobal, void *Data);
extern int cvxGlobalSet(evxGlobal, void *Data);
extern int cvxLabelMatch(int *Label1, int *Label2);
extern void cvxLangGet(vxName Language);
extern int cvxOpCount(void);
extern void cvxNewCommand(void);
extern int cvxNoteGet(char **Note);
extern int cvxNoteSet(char *Note);
extern void cvxHostId(double *idNetwork, double *idDongle);
extern void cvxShowDisp(int SlideNumber);
extern void cvxShowOpen(vxPath File);
extern int cvxUndoRedoTo(int Undo, vxName Name);
extern int cvxUndoRedoMarker(vxName Name);
extern void cvxUnitGet(evxUnitType *Type, vxName Name);
extern void cvxUnitSet(evxUnitType Type);
extern void cvxUnitToSys(double *Distance);
extern void cvxUnitToUser(double *Distance);
extern int cvxVersion(char *vxStatus);

Math and Geometry


transformation matrix

extern void cvxMatInit(svxMatrix *Mat);
extern void cvxMatInvert(svxMatrix *Mat, svxMatrix *InvMat);
extern void cvxMatMult(svxMatrix *Mat1, svxMatrix *Mat2, svxMatrix *Mat3);
extern void cvxMatPntVec(svxPoint *Origin, svxVector *zAxis, svxMatrix *Mat);
extern void cvxMatRotate(svxMatrix*,double Angle,svxAxis*Axis);
extern void cvxMatScale(svxMatrix*,svxPoint*,double sX, double sY, double sZ);
extern void cvxMatSetIdentity(svxMatrix *Mat);
extern void cvxMatTranslate(svxMatrix *Mat, double dX, double dY, double dZ);
extern void cvxMatView(svxMatrix *Mat, evxViewStd Type);

point

extern double cvxPntDist(svxPoint *Point1, svxPoint *Point2);
extern int cvxPntOnCrv(int idCurve, double Fraction, svxPoint *Point);
extern int cvxPntOnFace(int idComp, int idFace, double Param[2], svxPoint*);
extern int cvxPntProject(svxPoint *Pnt, int idEntity, svxPoint *ProjPnt);
extern void cvxPntTransform(svxMatrix *Mat, svxPoint *Point);
extern void cvxPntTransformList(svxMatrix *Mat, int Count, svxPoint *Points);
extern void cvxPntTranslate(svxPoint*, svxVector*, double Distance);

axis

extern void cvxAxisTransform(svxMatrix *Mat, svxAxis *Axis);

vector

extern void cvxVecCross(svxVector *V1, svxVector *V2, svxVector *Cross);
extern void cvxVecInit(svxPoint *Point1, svxPoint *Point2, svxVector *Vector);
extern void cvxVecNormalize(svxVector *Vector);
extern void cvxVecPerp(svxVector *Vector, svxVector *Perp);
extern void cvxVecReverse(svxVector *Vector);
extern void cvxVecTransform(svxMatrix *Mat, svxVector *Vector);

bounding box

extern void cvxBndBoxAdd(svxBndBox *Box, svxPoint *Pnt);
extern void cvxBndBoxInit(svxBndBox *Box);
extern void cvxBndBoxPnts(svxBndBox *Box, svxPoint *Pnts);
extern double cvxBndBoxSize(svxBndBox *Box);

curve

extern int cvxCrvEval(int idCurve,double T,svxPoint*Point,svxVector*Normal);
extern int cvxCrvParam(int idCurve, svxLimit *T);
extern int cvxCrvPntProj(int idCurve,svxPoint*Pnt,double *T,svxPoint*ProjPnt);

face

extern int cvxFaceEval(int idFace,double U,double V,svxPoint*,svxVector*Normal);
extern int cvxFaceEval2(int idFace,double U,double V,svxPoint*,svxVector*Normal,svxVector*Utan,svxVector*Vtan);
extern int cvxFaceParam(int idFace, svxLimit *U, svxLimit *V);
extern int cvxFacePntLoc(int idFace, double U, double V, evxPntLocation *);
extern int cvxFacePntProj(int idFace, svxPoint*, double *U, double *V);

intersection

extern int cvxIsectCrvCrv(int Crv1,int Crv2,int Tan,int*Count,svxPoint**Points);
extern int cvxIsectRayComp(int idComp,evxFaceTrim,svxAxis*,svxPoint*);
extern int cvxIsectRayFace(int idFace,evxFaceTrim,svxAxis*,svxPoint*,svxPoint2*);
extern int cvxIsectRayPart(evxFaceTrim,svxAxis*,svxPoint*,int*idFace);
extern int cvxIsectRayPartVis(evxFaceTrim,svxAxis*,svxPoint*,int*idFace);
extern int cvxIsectRayPlane(svxAxis*,svxMatrix*,svxPoint*);
extern int cvxIsectRayShape(int idShape,evxFaceTrim,svxAxis*,svxPoint*,int*);



Memory Management


extern void cvxCurveFree(svxCurve *Crv);
extern int cvxMemAlloc(int NumBytes, void **MemPointer);
extern void cvxMemFree(void **MemPointer);
extern int cvxMemResize(int NumBytes, void **MemPointer);
extern void cvxMemZero(void *MemPointer, int NumBytes);
extern void cvxSurfaceFree(svxSurface *Srf);