Visual CADD has been written with a completely open "architecture" --if you know how, you can customize it to do just about anything you wish. If you're new to programming languages, read this to get a sense of what you can accomplish. It'll get you excited --but before you run out and spend money on programming software, be sure and read the article, Which Programming language should I use? You can link to it below, after you've read this introductory page.



What can the Visual CADD API do for you?

Have you ever wanted to hide or display a layer by having a script assigned to a key, a two-letter alias command, or a button on your main speed bar? The trouble is that the ways to hide or display layers in Visual CADD, such as Hide Layer (YH), Display Layer (YD), and Layer Manager (MGL), require additional input which cannot be put into a script or the CMDEXT.DEF file, so you're forced to use the speedbars or dialog boxes.

Do you repeatedly design similar objects where only the size and a few specifics change? Maybe it is a window or entry door, a cross-section of a beam or post, or a cabinet door or drawer? Because it is different each time, do you have to draw most of it from scratch? Or catalog a lot of symbols that are only slightly different? Wouldn't it be nice if you were able to just enter the appropriate size, check off a few options, and have the object drawn automatically?

Do you spend a lot of time working on a design, then go back and add a bunch of dimensions? Aren't the placements of many of your dimensions standardized, such as linear dimensions placed below horizontal lines and to the right of vertical lines? Ever get tired of repetitive mouse moves and clicks to place all those dimensions? For instance, it takes a minimum of 4 mouse moves and clicks to start Linear Dimension (DL) from the toolbar, select the line to dimension, hit the OK on the dimension preview, and click to position the dimension. Wouldn't it be nice to select all the lines you wanted to dimension and click one button (or press one or two keys) to automatically dimension all the lines at once?

Have you ever done any repetitive task in Visual CADD and wished for a simpler way? Have you ever thought of a shortcut or a tool you wanted, but couldn't get it to work in a script?

If you answered YES to any of these questions, then the Visual CADD API can help you. And it is much easier than you probably think.

The real power of the Visual CADD API is in doing repetitive tasks which, for one reason or another, cannot be done in a script. Maybe the script cannot accept the required input in the way you need. Maybe a bit of systematic logic or some extra information is needed to complete the task. Maybe it just doesn't fit the mold of being a script. Maybe it's simply too big to be a script.

The Visual CADD API has a place in many one-time uses, too. In related articles, you will learn how to use the API to create useful solutions for your work in Visual CADD. You do not need to be an experienced programmer. In fact, some things are so easy in the Visual CADD API that a complete novice to programming can learn to produce truly useful tools on day-one with C++, Visual Basic, or Delphi. These How-To's will not be a cookbook approach to inserting Tab A into Slot B. Instead, you will learn the concepts, so that you can apply those concepts to solving your own problems.


What is the Visual CADD API?

API means Application Programming Interface. The Visual CADD API provides a way for you to program your applications to work, or interface, with Visual CADD. Your application might be one line of code to toggle a setting on and off, or a complex series of steps to create a new tool.

The Visual CADD API currently supports C++ (Microsoft and Borland), Visual Basic, and Delphi, with all the function declarations documented in the Visual CADD API Help file and also available for download. The function declarations tell your programming language how to call the Visual CADD API routines. Because there are over 1,200 routines, it is an advantage to be able to download the function declarations and not have to write them yourself.

The Visual CADD API can also be accessed from FORTRAN, PASCAL, CA-Realizer, etc., but you are responsible for writing your own function declarations, so they are not recommended for the novice programmer.

The Visual CADD API consists of four DLLs: VCMAIN32.DLL, VCTOOL32.DLL, VCDLG32.DLL, and VCTRAN32.DLL. These are the same DLLs used by Visual CADD every time you use a tool or change a setting in the program. They are located in the Visual CADD folder on your hard drive. When you use Visual CADD, you are seeing the Visual CADD API in action.

DLL means Dynamic-Link Library. DLLs are just a collection of functions and subroutines to which your program can link when needed (i.e., dynamically link). For brevity, the Visual CADD API functions and subroutines will be referred to as Visual CADD API routines. The four Visual CADD API DLLs contain over 1,200 different routines (not counting duplicates provided to accommodate differences between C++, Visual Basic, and Delphi).

All the names of the Visual CADD API routines begin with VC…, making it a bit easier to recognize them when you see them. You will also find that the names of the routines are fairly descriptive and give you a good clue about what they do.

The Visual CADD API and its routines are documented in the Visual CADD API Help file. The Visual CADD v2.0.4 API Help file is called VCAPI32.HLP, which can be downloaded from this website (Prior versions of the help file were called VCAPI.HLP, which can be downloaded from this website . However, it is recommended that you upgrade your version of Visual CADD to v2.0.4 to have access to the most up-to-date Visual CADD API.)
And now to load the new IMSI Visual Cadd API also if you are operating the VC v3.0 which is also downloadable in the file VCAPI3_0_1.ZIP

You will find the Visual CADD API Help file to be an indispensable reference when writing your Visual CADD API applications. It is recommended that you drop the API Help file onto your desktop, a taskbar, or other speedbar for easy access. Another good location is to put it on the start menu so it can be accessed no matter how much clutter you have on the screen.

Some of the Visual CADD API routines are just like commands from Visual CADD. For example, when you create a 2-point Rectangle (R2), Visual CADD runs the Visual CADD API routine VCRectangle2Pt. If you write a function using VCRectangle2Pt in your application, it works exactly like R2.

Other routines in the Visual CADD API do things more directly than Visual CADD. For example, in Visual CADD you can toggle the display of points by using System Tab (TBS), followed by P for Points (which does the toggle), and O for OK. In the Visual CADD API, the routine VCSetPointDisplay toggles the display of points directly in one step, without having to go through System Tab.

Still other Visual CADD API routines do things which are more elementary than certain Visual CADD commands. For example, with text selected, the Text Editor (TE) opens a dialog box containing the a wealth of properties for changing text, such as its font, height, color, etc. Visual CADD gets this information about the selected text by using Visual CADD API routines such as VCGetTextFontName, VCGetTextHeight, and VCGetTextColor. If you change any of these properties, Visual CADD sets the new, revised text properties with Visual CADD API routines such as VCSetTextFontName, VCSetTextHeight, and VCSetTextColor (among several other things Visual CADD must do to complete your change). Suppose you routinely change only a few text properties? Your program can use these elementary Visual CADD API routines to change either one or several, in any combination, in a single step, without having to open the Text Editor.

The Visual CADD API routines may be classified into several different categories, according to what they do.

Environment Settings and Query Routines The Visual CADD API VCGet…/VCSet… routines described above are examples of environment routines. These routines are used to get information about, and set, various properties of your drawing, such as the text height for text, font for dimensions, display colors, fillet radius, ortho mode toggle, etc. They allow you to control how objects get created and how Visual CADD behaves.

Of the over 1,200 Visual CADD API routines, well over half are of the VCGet…/VCSet… variety. There are slightly more of the VCGet… kind than the VCSet… kind. This is because you can get information about some things that you cannot change, or set, directly from Visual CADD or the Visual CADD API. For example, VCGetCommandAlias will tell you the two-letter alias for a command, but you can only change that two-letter alias by editing the ALIAS.CMD file with a text-editor. VCGetCurrentEntityArea will give you the area of an entity, but you cannot change the area directly. Instead, you change the entity itself, which, in turn, changes the area.

Entity Creation and Editing Routines All the objects which can be created by Visual CADD have Visual CADD API routines which create the objects directly, without user intervention. For example, if you want to place a circle of given radius at a given center, then you would use VCAddCircleEntity. Note that these routines are read as VC-Add, not V-CADD. There are about 30 other VCAdd… routines to add other entity types.

Most editing of existing objects using the Visual CADD API consists of matching the existing properties of the object with VCMatchCurrentEntity, setting the revised (edited) properties using the VCSet… routines as described above, creating a new object with those properties with VCDuplicate, and then deleting the original object. For changing certain basic properties, such as color or line type, a couple other simpler ways are available, such as VCApplySettingsToCurrentEntity and VCChangeSelected, after also setting the revised properties.

Tool Routines All the tools you use in Visual CADD have a counterpart in the Visual CADD API. For example, 2-Point Circle (C2) creates the circle and prompts the user to place the points to define the center and radius. In the Visual CADD API, VCCircle2Pt does the same thing, including prompting the user for point placements. You don't have to write any additional code to tell the mouse when and how to place the points.

Note that this is in contrast to VCAddCircleEntity described above, which also creates a 2-point circle. VCAddCircleEntity gets the point placements from the program, which may be hard-coded, calculated, or obtained from user prompts controlled by the program. Thus, the Visual CADD API gives you full control over how you place the entities you create. If the user will place all the points for the circle, then VCCircle2Pt is easiest (although VCAddCircleEntity can still be used, with additional code for the user prompts to place the points). If your program will calculate or hard-code the points, then VCAddCircleEntity is required.

Parsing Routines The entities (or objects) created by Visual CADD and the Visual CADD API are held in a database, or list. When the application needs to access certain entities to edit or get information about them, the program must have a systematic way to look through the database to find the entity it needs. This systematic look through the database is called parsing.

The Visual CADD API provides a variety of ways to parse the database, including looking through all entities, those that are selected or on the screen, those that are part of a symbol or make up boundaries of a hatch or fill, or those meeting filter criteria. These parsing methods involve starting at the first entity, then proceeding one at a time to the next entity, until reaching the last entity. As you go from entity to entity, your program can process each entity as needed.

Dialog Routines All the dialogs and ribalogs (speedbars) used in Visual CADD have a counterpart in the Visual CADD API. These dialogs may be used to get input from the user for certain operations. For standalone applications which do not use the Visual CADD interface, it is possible to develop a custom interface which uses the standard Visual CADD dialogs.

Calculation Routines The Visual CADD API provides various routines to perform certain CAD-related calculations. For example, VCComputeIntersection finds the intersection point of two entities.

User Data Routines User data is data which may be attached to entities for other purposes within the application. For example, the application may allow the user to attach a third dimension to the entities, which would allow the application to find volumes for estimating materials requirements, or to attach other engineering data or specifications. The Visual CADD API provides routines for attaching data to, or retrieving data from, entities or the drawing header.

3D Routines The Visual CADD API provides a limited number of routines for some simple 3D objects and 3D perspective views, such as VCAddPolygon3D and VCSetProjection3D.

Summary Learning over 1,200 Visual CADD API routines may sound onerous, but it is not. As mentioned above, over half are VCGet…/VCSet… routines. Once you learn a few of these, you basically know how to use them all. And if you are ever uncertain of which one you need to perform some new task, the Visual CADD API Help file offers a keyword search which makes quick work of looking for the necessary routines. Likewise, learning all the VCAdd… routines requires understanding just a few.

There are probably 10-20 other routines that will be used regularly for most simple applications. The best way to learn these is to jump right in and start writing fully operational programs in C++, Visual Basic, or Delphi. We've included a few examples here on the website to help you get off to a very fast start.


Programming Index | Which Language? | VB and VC++ Setup
 
There are probably 10-20 other routines that will be used regularly for most simple applications. The best way to learn these is to jump right in and start writing fully operational programs in C++, Visual Basic, or Delphi. We've included a few examples here on the website to help you get off to a very fast start.

Programming Index | Which Language? | VB and VC++ Setup