Example 1 - DLL to Show, Hide, or Toggle Point Display


Purpose of Example


Overview of Example The fact that over half of all the Visual CADD API routines are of the VCGet…/VCSet… kind illustrates that the most basic operation of the Visual CADD API is to get and set various properties in Visual CADD. The VCGet…/VCSet… routines are essential to most Visual CADD API applications. They control drawing properties, such as the display of points, construction points, hatches, and layers. They control tool properties, such as toggling ortho mode, setting chamfer distances, and setting grid size. And, they control entity properties, such as text font, height, color, and italics.

Because of their essential nature, the VCGet…/VCSet… routines are a good place to start learning how to use the Visual CADD API. The following example will help you create a DLL with three routines which control the display of points.

Setting the display of points, which is a property of the drawing, has no native or alias command. The display of points can be toggled by using System Tab (TBS), followed by P for Points, and O for OK. Because these commands cannot be placed into a script or the CMDEXT.DEF file (because the script will not accept the P and O input), it is not possible to assign a key or two-letter alias command to control the display of points.

The Visual CADD API has two routines for getting and setting the display of points - VCGetPointDisplay and VCSetPointDisplay. We will write a simple DLL with three functions that allows you to create three commands with two-letter aliases which will:

Visual Basic Example 1 Code
Visual C++ Example 1 Code