Start Here !!

Welcome to Vdraft’s Developer’s On-Line Reference.

Creating custom extensions to Vdraft is easy. If you are already familiar with either Visual Basic or C++ then there is really not too much more that you need to know. Just run through these first few help pages to familiarize yourself with the basics, including how this help file is organized and then you will be on your way.

Using VB with Vdraft

Using C++ with Vdraft

API - List of Interfaces

Object Hierarchy

Symbols

Using This Help File

This help file has several sections to it and includes a lot of information. We have tried to make it easy to use. The major sections are these:

Start Here !!
This section. It’s a quick introduction to creating extensions for Vdraft, an overview of this document and how to use it and some basic definitions and concepts.
Overview
A detailed overview of the customizing Vdraft, what all the options are and some of the approaches one might take. It covers many of the important concepts needed for working with Vdraft. It also covers some nifty tips and techniques that you can apply in your work. This is an important section to look through.
API Reference
This is the nitty gritty core of it all. This section covers all the Vdraft objects, their interfaces and the methods and properties belonging to each interface. Many of these include short code fragments in either C++, VB or both.
Sample Code (for C++ and for VB)
This section includes some specific samples of VB and C++ code for accomplishing certain purposes. In addition to these code samples, there are code fragments scattered all about the API Reference section and there are also complete working applications included with Vdraft. You will find these samples in the directory \Vdraft\Programs\CPP, \Vdraft\Programs\VB and \Vdraft\Programs\Excel.


Contents

Vdraft Customization Guide

Virtual Drafter (Vdraft) is a CAD editor which works directly with AutoCAD drawing (i.e., DWG and DXF) files. It can be programmed from Visual Basic, C/C++, Excel or any other programming system that supports ActiveX Automation. You can customize keyboard shortcuts, menus or automate processes through the simple built-in script language. Vdraft also includes powerful Internet tools, thereby providing powerful capabilities for distributing your drawings to however large an audience you wish, be that only other people at your company or everyone on the planet.

Programming for Vdraft is Easy

This help file is primarily concerned with Vdraft’s interfaces and how to make Vdraft do what you want it to do. Application developers will find here the information they need to have to create their unique solutions. This help file also discusses creating custom drawing templates and custom popup mouse menus.

NOTE: All the code examples in this document are based around Microsoft C/C++ and Microsoft Visual Basic. Additionally, on the Vdraft discs ships a programming example that uses Microsoft Excel. Other programming environments that support ActiveX Automation under Windows should work as well, but have not been tested.

  • The Vdraft Web Site
  • Custom Scripts and Drawing Templates
  • Custom Popup (mouse) Menus
  • Add-Ons
  • Customizing Vdraft through ActiveX Automation
  • Vdraft PlugIns
  • The Vdraft OCX
  • Development Tools
  • AutoCAD Compatibility
  • AutoLisp and ADS versus VB and C/C++ with Vdraft
  • C/C++ vs. Visual Basic
  • Using ActiveX Automation in C/C++
  • Using ActiveX Automation in Visual Basic
  • DXF Code Reference
Code Samples
  • Visual Basic Code Samples
  • C/C++ Code Samples


The Vdraft Web Site

Vdraft has a web site at www.vdraft.com. In this web site you will find many useful items, such as a frequently asked questions document, a developers-only area and so. You will also find the lastest version of this help file.

www.vdraft.com
The latest version of this help file is available on the Vdraft Web Site. Be sure that you obtain the latest edition, as this help file is constantly being worked on and improved with more information, more code samples, etc.


Drawings Templates and Scripts

Drawing Templates and Scripts

When you being a new drawing in Vdraft, you can select from either templates or prototype files. A template is a special file that gives Vdraft any number of instructions about a variety of things. It may set up special command sequences or activate a special application – such as the drawing wizard as shown in the sample script below.

Wizard.vs: starts a new drawing and activates the Drawing Wizard.
    # Name
    ~Wizard

    # Description
    New Drawing Wizard

    # prototype drawing
    vdraft.dwg
    run.exe NewDwg

You will notice several parts to this script, simple though it is. The #Name field is the name of the script file. This is the name that will appear in the New Drawing dialog box, under Templates. The #Description entry is what will show up in the Description box of the New Drawing dialog box when templates are selected. The #prototype drawing entry is the name of the prototype drawing that the new drawing is to be created from. These are the DWG files that are in the \Vdraft\Template.

When this script is activated (by the user’s selecting it from the Templates listing in the new drawing dialog box) two things happen: a copy of the

vdraft.dwg drawing is made and loaded up as the new drawing, then the external application NewDwg.Exe is executed and control is transferred to that application.

There are other things that might be included in a script, should one desire. Keyboard command definitions are a very powerful option.

Example one:
    set.keys normal
    set.keys "fn"		document.new
    set.keys "fo"		document.open
    set.keys "fc"		document.close
    set.keys "eu"		undo
    set.keys "er"		redo
    set.keys "et"		cut
Example two:
    set.keys acad
    set.keys "new"		document.new
    set.keys "open"		document.open
    set.keys "fileopen"	document.open
    set.keys "u"		undo
    set.keys "undo"		undo
    set.keys "redo"		redo
    set.keys "cutclip"	cut

The first example sets up a few two-key command shortcuts. That is, once this script has been loaded, to start a new document one needs merely type “F” and then “N”. To delete (cut) a given entity, one would type “E” and then “T” again.

In the second example some keyboards are being setup to simulate to command set that AutoCAD uses. To start a new drawing, you would type in the full word “NEW” and then press either enter or space bar, as with AutoCAD. That is the “set.keys acad” command at the start of the example is telling Vdraft: to require a space bar or enter key before proceeding with the given command. In the first example, because “set.keys normal” has been used, the command will be executed immediately upon striking the second key.

Vdraft comes with a number of .VS files. Most of these are special VS files:
VDRAFT.VS – for Vdraft’s use only.
APPS.VS – for use by 3rd party software developers only
USER.VS – for use by the user, to add new macros, keys, etc.

Vdraft.Vs is maintained by Vdraft and should never be edited by the user or by any add-on applications for Vdraft. Add-ons can place any startup commands they may require in the APPS.VS file, where special keystrokes can be specified, files loaded up, drawings opened or whatever is appropriate for that application. Developers should keep in mind that this file may be used by other add-on packages at the same time, therefore precautions should be taken to ensure that any add-ons you produce remain “friendly” to other add-ons.

USER.VS is reserved for the user’s own needs. Here you can create your own keyboard shortcut commands, load up any drawings or templates you want to always have loaded, etc..

Other predefined VS files:
AacdKeys.vs – allows the AutoCAD command set to be used in Vdraft
QuickKeys.vs – a set of 2-key shortcut commands.


Custom Popup Menus

Custom Popup (Mouse) Menus

At any time that you are working in Vdraft, you can use the right mouse button to bring up various menus. The right mouse button by itself will bring up menus related to the currently selected object(s), if any.

Holding the CTRL key while clicking the right mouse button will bring up a menu of options related to the view, such as Zoom In, Zoom Out, Pan, Redraw, etc.

The SHIFT key used in concert with the right mouse button is reserved for a user-defined custom popup menu.

Shown here is the script file that produced the above custom popup menu. This simple example sets up a popup menu that can be accessed by holding the SHIFT key while clicking the right mouse button. The nine statements beginning with “set.popup” each create a tile on that popup menu.

    set.popup "New"		document.new
    set.popup "Close"	document.close
    set.popup "Open"	document.open
    set.popup "Zoomer"	run.exe Zoom
    set.popup "NotePad"	run.exe notepad
    set.popup "Doom"	run.exe doom
    set.popup "Hexen"	run.exe hexen
    set.popup "BossKey"	run.exe bosskey
    set.popup "WebSurf"	run.exe websurf

The last few lines of the script file will actually run external applications (for example, a sample application that ships with Vdraft – Zoomer – and the NotePad application from Microsoft Window). This illustrates how you can combine Vdraft commands along with external commands on one popup menu.

A script like this can be used by placing it in the templates subdirectory under Vdraft and then creating a new drawing from it, or by placing the “set.popup” lines in the User.Vs file.


Add-Ons Under Vdraft

See Also
Development Tools
Vdraft PlugIns

Vdraft allows for the creation of custom add-ons. That is, programs that can work in concert with Vdraft to accomplish some task, simple or complex, that Vdraft might not already do. Such add-ons, or extensions to Vdraft, can be constructed in several fashions (see Development Tools for more information on that).

Once an add-on has been created, how is it activated? That depends on the nature of the add-on. If it has been created as an executable file (that is, an .EXE) then it may be started as any other application is started. Or, it can be started via the Applications dialog box (under the Extensions menu in Vdraft), as shown here:

This dialog box’s appearance will vary depending on what executable add-ons Vdraft finds the Vdraft\Programs subdirectory.

Each of the icons this dialog box displays represents one application that Vdraft found in the Vdraft\Programs subdirectory. The dialog box automatically pulls an icon from each application and displays it for the user along with the application’s name.

So, one easy way to allow the user to activate an add-on is to create it as an EXE (under MSVC or VB, for example) and then to place that executable file in the Vdraft\Programs subdirectory.

If the add-on was created as a DLL or a VB OCX (using the “Make OLE DLL” option under the File Menu in VB), then you will also want place it in the Vdraft\Programs subdirectory, where Vdraft will load this file automatically when Vdraft starts up. What happens from that point is up the add-on. Usually the add-on will create a menu entry for itself under the Extensions menu in Vdraft, enabling the user to select this entry and thusly activate the add-on’s function(s). See Vdraft PlugIns for more information.


OLE Automation Reference

ActiveX Automation Reference

Further Reading

ActiveX Automation (a.k.a., OLE Automation) is a well defined method that allows one application to send requests, commands or data to another application, while knowing very little about that application. An application that supports ActiveX Automation publishes a set of Automation Interfaces that give outside applications access to its capabilities. There are many advantages to ActiveX Automation, ease of programming (for the add-on solution developer) being the primary one. See Vdraft PlugIns for information about performance issues under ActiveX.

You can take advantage of ActiveX Automation from a variety of programming languages, such as Visual Basic, C/C++, Excel or any other Windows-based programming tool that supports Automation. Even Microsoft Excel or Word offer this capability. That means that if you are already familiar with a Windows programming tool, you can probably use it to create your own custom add-ons for Virtual Drafter.

For example, the New Drawing Wizard that ships with Vdraft is an external application that was created using Visual Basic (the source code for the Wizard is included with Vdraft as sample code). Vdraft starts up this application when you select to start a new drawing from the “~Wizard” template. After making your selections and then pressing the “Apply” button, the wizard will place all those settings into your new drawing by passing various commands to Vdraft via ActiveX Automation calls.

Using Automation with Vdraft you can:

Read and write all information in DWG or DXF files, including block attributes, layers, dimensions, object properties and extended entity data.
Drive any command available through Vdraft’s user interface.
Use Vdraft’s tools for geometry calculations such as transformations, object snaps, intersections, trim and extend.
Work with multiple drawings simultaneously.
Do your processing in the background while the user works in the foreground.
You can even load and process drawings without displaying them.
Bundle entire batches of Vdraft commands together under one name and description in the undo list, making the undo list much more meaningful to the user. This is especially important when your application may be sending hundreds of separate Vdraft commands for what the user might regard as a single step.
A VERY USEFUL TIP:
From Visual Basic, after starting your application, you can use the pause button to gain an interactive access to Vdraft’s ActiveX Automation. That is, in the VB debug window, automation commands can be typed in directly and their effects (or lack of) can be observed at once. This is an excellent way of testing something out before committing it to code. [See Also]

Using ActiveX Automation, programming for Vdraft is simple. In Visual Basic, to being a session with Vdraft, the following code is all that is necessary:

    Dim Vdraft as Object
    Set Vdraft = CreateObject("Vdraft.Application")

Of course, for any real application that you would be creating, you would include error trapping and recovery code, which will not be shown in these examples.

Once the Vdraft object has been created, the whole of Vdraft is available to your application. For example, to get the name of the currently active document in Vdraft (assuming that “Vdraft” is already set to the Vdraft Application):

    str$ = Vdraft.ActiveDocument.Name  ' get the document’s name

Further Reading:

It is not necessary to know much about the internal workings of ActiveX Automation in order to make maximum use of the Vdraft Interfaces. However, if you are interested in further information about this topic there are several good sources for details about it. These include, but are not limited to:

Windows SDK documentation (from Microsoft), including Books Online,
The Microsoft Developer’s Network (MSDN),
Inside OLE, second edition, by Kraig Brockschmidt, from Microsoft Press,
Building OCXs, by Toohey and Toupin, QUE.
The Revolutionary Guide to MFC 4 Programming with Visual C++, 2nd Edition, by Mike Blaszczak, Microsoft Press,
Back issues of Microsoft Systems Journal, and Windows Developer’s Journal,
Experience and experimenting,
Other people’s code,


Development Tools

What do you need in order to develop add-ons for Virtual Drafter?

NOTE: All the code examples in this document are based around Microsoft C/C++ and Microsoft Visual Basic. Additionally, on the Vdraft disks ships a programming example that uses Microsoft Excel and Borland Delphi. Other programming environments that properly supports ActiveX Automation under Windows should work as well, but have not been tested.
There are two main things you need: a programming environment and the know-how to use it (or the gumption to dig in and learn while you go). Among available programming environments are several popular ones to choose from: things like Visual Basic and Microsoft Visual C/C++. Any programming environment that supports ActiveX Automation under Windows 95, NT 3.51 or NT 4.00 should do just fine.

If you are working in Visual Basic: the code sample we have provided assumes version 4.0 or later of Microsoft Visual Basic. Earlier versions of Visual Basic have never been tested, therefore, if you feel so inclined as to try version 3.0 or even earlier, we can’t guarantee results. Version 4.0 is much more automation aware than was 3.0; this is probably significant.

Visual Basic is largely a complete programming environment in itself. Add-ons and tools tend to be packages of pre-existing code, bundled up as OCX’s and what-not. Some of these add-ons might be useful to you in developing your Virtual Drafter applications.

If you are working in C/C++: there a wide variety of C/C++ compilers and environments available on the market, such as those from Microsoft, Borland and Watcom. Each of them come with their own flock of attendant accessories, tools, documentation and code samples. Vdraft and all of the C/C++ add-on samples have been created using Microsoft C/C++ with MFC. The provided Vdraft.Cpp and Vdraft.h files require MFC in order to function correctly. Since many current C++ compilers for Windows now ship with MFC, it is probable that these examples will work as shown with other compilers than MSVC, but this has not been tested.

Another tool that the C/C++ programmer will find extremely useful is Visual Basic. This is in part because of VB’s debug window, where in, when the VB app you are running is paused, you may type in Vdraft commands directly and have them executed immediately. This gives you an interactive, real-time window into Vdraft. It can really help you BUNCHES in figuring out how something works with Vdraft. For example, the following commands might be typed in directly:

When working in C/C++ there are other tools that you may want to consider, things that can speed up your productivity and reduce your coding errors. These include, among other things:
A good lint tool, e.g., PC-Lint, by Gimpel Software
A memory leak detector (e.g., Bounds Checker)
Sophisticated luck enhancers: (e.g., A dead chicken, an old Shaman)


Compatibility with AutoCAD

Virtual Drafter was designed to work directly with AutoCAD drawing files without translation. All your information is maintained including layers, textstyles, all entities, xdata, ARX objects, paperspace, etc. The following chart illustrates what this means in terms of the information stored in your drawings.

AutoCAD | Vdraft | AutoCAD Drawing Info
R14 | v2.0 | (Read, Write, Edit, Create and Display the following:)
 |  | line, arc, circle
 |  | ellipse
 |  | ray, construction line (xline)
 |  | hatching
 |  | image (bitmap)
 | 2 | multi-line (mline)
 |  | point display modes
 |  | solid
 | 1 | trace
 |  | 3d face
 |  | polylines
 |  | lightweight polylines
 |  | polylines w/ varying widths
 |  | polylines w/ arcs
 | 1 | polymesh
 | 1 | polyface
 |  | donut, polygon
 |  | polyline spline (quadratic and cubic)
 | 2 | spline (including NURBS)
 | 2 | leader
 |  | text (rotate, xscale, oblique, justify, upsidedown, backwards)
 | 2 | paragraph text (mtext) including formatting codes for height, color, etc.
 |  | text style (+ AutoCAD SHX fonts)
 |  | TrueType fonts
 | 2 | tolerance
 | 1 | shape
 | 2 | ACIS objects: region, body, 3d solid
 | 2 | OLE2 frame
 | 2 | proxy object created by an ARX application
 |  | entity handles
 |  | extended entity data (including changing the data when the entity changes)
 |  | thickness
 |  | all entities in 3d
 |  | linear dimensions (horizontal, vertical, aligned, rotated)
 |  | angular dimensions (3 point, 4 point)
 |  | radius, diameter dimensions
 |  | baseline, continuous dimensions
 |  | ordinate dimensions
 |  | leader
 |  | named dimension styles
 |  | blocks, inserts
 |  | minserts
 |  | block attributes (attribute definitions)
 |  | xrefs
 |  | bylayer, byblock, layer 0 (rules for determining color and linetype)
 |  | named layers (and associated color, linetype)
 |  | linetypes
 | 3 | UCS
 |  | named views
 | 4 | tiled viewports
 |  | paperspace
 |  | paperspace viewports

NOTES:
1: Creation only available through programming interface.
2: Read, write, edit, display, and some editing.
3: Limited support.
4: Support for existing tiled viewports.


C/C++ vs. Visual Basic

AutoLisp/ADS vs.

VB and C/C++ in Vdraft

Vdraft is built on the newest technology, incorporating true object-oriented design from its core on out. This gives the add-on developer many advantages, the chief of which is relatively simple code that is easy to understand – almost self-documenting.

The following code fragments show how you would take the last drawing entity created and change the layer it is on. A simple enough and routine enough chore. The first two examples show doing this in AutoCAD, first in AutoLisp then in ADS; the next two examples show this same process in Vdraft, first in Visual Basic then in C/C++.

AutoLisp for AutoCAD
    (setq entity (entget (entlast)))
    (setq entity (subst (cons 8 "LAYER") (assoc 8 entity) entity))
    (entmod entity)

ADS for AutoCAD
    struct resbuf *ent, *ptr;
    ads_name last;
    ads_entlast(last);	// name of last object
    ent = ads_entget(last);	// get last object
    ptr = ent;		// working pointer
    while (ptr != NULL)
    {
        if (ptr->restype == 8)	// found the layer
        {	//  assumes the string buffer is long enough
            strcpy(ptr->resval.rstring, "LAYER");
            break;
        }
        ptr = ptr->next;	// go to next resbuf
    }
    ads_entmod(ent);

Visual Basic for Vdraft
    Drawing.Entities.Last.Layer = Drawing.Layers("LAYER")
C/C++ for Vdraft
    // drawing already points to the document we are working with
    IEntities entities(drawing.GetEntities());
    IEntity	lastent(entities.GetLast());
    ILayers	layers(drawing.GetLayers());
    ILayer	layer(layers.GetItem(cVariant("LAYER")));
    lastent.SetLayer(layer);


Polishing Vdraft Add-ons

How to Add Polish to a Vdraft Add-on

Vdraft provides tools you can use to make your add-on behave like built-in Vdraft commands. For example, you can bundle all your commands together so they behave as one when the user undoes & redoes actions. Or you can use Vdraft's string conversion routines to display and parse strings so users can work in the same units they use in other areas of Vdraft.
  • Bundling Commands Together
  • Using the String to Units Conversions
  • Feedback While Picking

Bundling Commands Together

 When you give Vdraft a series of commands, each command will be a separate item on the undo list. This makes it inconvenient for the user to undo what is perceived as a single action. By using the document's ICommands interface, you can have a series of commands combined together in one command. This allows the user to undo all the actions at once. Furthermore, you can give the commands a useful description so when users examine the commands they have performed, they can identify your command more easily.

In Visual Basic:

    Dim Commands As Object
    Set Commands = doc.Commands
    Commands.Group "Acme.DrawRoom Living Room"
    ...	' insert blocks, draw lines, etc.
    Commands.EndGroup
In C++:
    ICommands commands(doc.GetCommands());
    commands.Group(CString("Acme.DrawRoom Living Room"));
    ...	// insert blocks, draw lines, etc.
    commands.EndGroup();
This code would cause all the commands executed between Group and EndGroup to be lumped together. The first piece of text, Acme.DrawRoom, is the command name. When you click the right button in Vdraft or display the Edit pulldown menu, Undo Acme.DrawRoom will be displayed. In this example, we've added the company name to the name of the command to differentiate it from somebody else's DrawRoom command. (Alternately, you could use the program's name or have no prefix at all.) The rest of the string is the description. It can be whatever information may be useful to the user when they examine the undo/redo list.

Using the String to Units Conversions

 Often you need to display distances, areas, volumes, points, or angles for the user and/or allow them to type these values in. The document's IUnits interface will convert strings such as 10' 2 1/2", 14' 2.1", 3.14r, or N 71 13' E into the appropriate distance, point, or angle. Additionally, IUnits will convert a distance, point, or angle into whatever units are in effect for the drawing - architectural, engineering, metric, scaled etc.

The following code snippets will convert the point string 10' 2 1/2", 12' 1.2, 5" and place 122.5, 145.2, 5 into MyVector.

In Visual Basic:

    Dim Units As Object, MyVector As Object
    Set Units = doc.Units
    ' 10' 2 1/2", 12' 1.2, 5"
    pointstring$ = "10' 2 1/2" + Chr$(34) + ", 12' 1.2, 5" + Chr$(34)
    Set MyVector = Units.StringToPoint(pointstring$)
In C++:
    IUnits units(doc.GetUnits());
    IVector MyVector( units.StringToPoint(CString( "10' 2 1/2\", 12' 1.2, 5\"" )) );
Users have the option of displaying distances and angles in several different formats. If they have chosen metric with a scaling factor, or architectural with feet and fractional inches, then they would probably prefer to see all output in that format. The following code will create strings using the drawing's current settings.

In Visual Basic:

    point$ = Units.PointToString (MyVector)
    length$ = Units.CoordinateToString (1.234)	' note: specified in drawing units
    angle$ = Units.AngleToString (3.1415)		' note: specified in radians
In C++:
    CString point( Units.PointToString(MyVector) );
    CString length( Units.CoordinateToString(1.234) );	// note: specified in drawing units
    CString angle( Units.AngleToString(3.1415) );		// note: specified in radians

Feedback While Picking

 Vdraft gives the user feedback and extra information through the status bar, text on the context sensitive popup menus, and cursor tips (the explanatory text which travels near the cursor). When your add-on uses IPickEvents or ISelectionEvents to ask the user for pick or selection information, generic defaults are used for the status bar, popup, and cursor tips. You can supplement these with text relevant to the action.

The following example prompts the user to pick a point. The popup menu will contain the text Cancel Center. On the status bar will be Pick the center of the object. The Visual Basic example uses the VdraftEvents Control. The C++ example derives cMyPickEvent from cPickEvent (defined in Vutil.hpp).

In Visual Basic:

    Dim pick As Object
    Set pick = doc.PickEvents
    pick.Name = "Center"
    pick.StatusBar = "Pick the center of the object"
    VdraftEvents1.RequestPick pick, 0
In C++:
    IPickEvents pick(doc.GetPickEvents());
    pick.SetName(CString("Center"));
    pick.SetStatusBar(CString("Pick the center of the object"));
    pick.RequestPick(id,cVariant(new cMyPickEvent(vdraft,id)));
The next example asks the user to select objects. The cursor tip will say select objects for manipulation. The popup will contain Cancel Manipulation. Once the user has selected as least one object, the popup will also say Start Manipulation. The status bar will display Select objects for manipulation. In the C++ example, cMySelectEvent is derived from cSelectEvent.

In Visual Basic:

    Dim selection As Object
    Set selection = doc.SelectionEvents
    selection.Name = "Manipulation"
    selection.StatusBar = "Select objects for manipulation"
    VdraftEvents1.RequestSelect selection, 0
In C++:
    ISelectionEvents selection(doc.GetSelectionEvents());
    selection.SetName(CString("Manipulation"));
    selection.SetStatusBar(CString("Select objects for manipulation"));
    selection.RequestSelect(id,cVariant(new cMySelectEvent(vdraft,id)));


C/C++ vs. Visual Basic

Creating ActiveX Automation applications in Visual Basic is well documented and very easy, and should become even easier as Visual Basic continues to evolve. Under Visual C/C++, the process is almost as easy, but is rather badly documented for the most part. Once you understand what you have to do, then it becomes quite straight forward.

We have provided several useful files that you will want to use in your C/C++ project: Vdraft.h, Venums.h, Vobjects.h, Vplugin.h, Vutil.h, Vwait.h, Vdraft.cpp, and Vutil.cpp.

  • Vdraft.h includes all the rest of the header files. This is usually the only file you need to include.
  • Venums.h contains enumerated types that some Vdraft functions work with.
  • Vobjects.h contains the definitions of all the interface classes described in this help system.
  • Vplugin.h has callbacks and enumerated types for creating Vdraft plug-ins.
  • Vutil.h contains classes for encapsulating VARIANT as well as event handling, vectors, etc.
  • Vwait.h can be used to simplify event handling if you wish to avoid event-driven programming.
  • Vdraft.cpp contains the implementation of the ActiveX Automation wrapper classes for accessing Vdraft. (These “wrapper” classes are what is actually documented in this help file.)
  • Vutil.cpp contains the implementation for class in Vutil.h.

The following is a comparative sample showing C/C++ versus Visual Basic. As you can see, the two code samples are closely related.

Comparative code sample: starting a session with Vdraft.

Visual Basic Code Sample:
    Dim Vdraft as Object
    Set Vdraft = CreateObject("Vdraft.Application")
C/C++ Code Sample:
    #include "Vdraft.h"
    IVdraft Vdraft;
    Vdraft.CreateDispatch ("Vdraft.Application", NULL);


The Vdraft OCX for VB

The Vdraft OCX

Vdraft\VEvents.OCX

Often a program needs to prompt the user for points to pick or entities to select. Or you may wish to add a command to Vdraft. To respond to actions performed in Vdraft, you can either use the VdraftEvents ActiveX Control (also known as an OLE Control or OCX) or build a PlugIn. The OCX is simple to use from a programming environment such as Visual Basic. It provides a set of functions you can call and events you can respond to. Alternately, a PlugIn can be created from a language such as C++ and provides similar functionality. Additionally, a PlugIn provides faster execution, is automatically loaded when Vdraft starts, and can add items to Vdraft's pull down menu.

To use the OCX from Visual Basic 4.0, choose the Tools / Custom Controls menu. Make sure Controls is checked on the dialog box, then select Vdraft Events Control. After you pick OK, the VdraftEvents icon should appear along with the other standard tools (buttons, radio buttons, etc.). Pick the icon, and drag out an area on your form just as you would a button.

Note that this control will not appear when you run your program. By default, Visual Basic will name this object VdraftEvents1.

Double click on the new Vdraft Events Control to display the code window. The “Proc” list will list the Vdraft events your program can respond to. You will usually first request events from the control, then respond to the events in these functions

From Microsoft Visual C++ it can be used via the component gallery. (The OCX is installed into the component gallery during installation.) The AppWizard will then generate a wrapper class (complete with CPP and H files) for you automatically.

A Visual Basic Example

As a simple VB example, we will create a program which prompts the user to draw a line. Our program will respond by turning the line into an X by adding another line. Add a button to the form with VdraftEvents1 and change the caption to 'Draw X'. Double click on the button to display the code attached to the button. Add the following code.

    Private Sub Command1_Click()
        Dim doc As Object

        If VdraftEvents1.Connect = False Then
            MsgBox "Could not Connect with Vdraft"
            Exit Sub
        End If

        Set doc = VdraftEvents1.Vdraft.ActiveDocument
        ' have the user draw a line
        doc.Entities.DrawLine
        ' we want to know when the user finishes
        VdraftEvents1.RequestDraw doc.PickEvents, 0
    End Sub

VdraftEvents1.Connect establishes communications with Vdraft. If successful, Vdraft will respond by calling Load in VdraftEvents1 and then Connect will return True. If communications have already been started, Load will not be called, but Connect will still return True. This way, this same function can be called multiple times. Note that you should use the Vdraft application object from the VdraftEvents object instead of using CreateObject("Vdraft.Application"). You can use either VdraftEvents.Vdraft or the Vdraft object pased back to you for further calls into Vdraft.

Next we put Vdraft in line drawing mode and request to be notified when the user draws a line. Notice that we ask the VdraftEvents control to send us events, not Vdraft.

Double click on the VdraftEvents object on the form to bring up the associated code. Choose DrawDone from the Proc list. Here we will get the line the user drew and create another line based on it.

    Private Sub VdraftEvents1_DrawDone(ByVal info As Long)
        Dim Entities, line1, line2 As Object
        Set Entities = VdraftEvents1.Vdraft.ActiveDocument.Entities
        ' get the line the user just drew
        Set line1 = Entities.Last
        ' create a new line
        Set line2 = Entities.AddLine
        ' set its endpoints so the lines form an X
        line2.Where1.Set line1.Where1.X, line1.Where2.Y
        line2.Where2.Set line1.Where2.X, line1.Where1.Y
    End Sub
The last number we passed to RequestDraw is the number passed to DrawDone. This is useful if you need more information on the pick event you received. Sometimes this is necessary if you wish to have your program be able to work in multiple documents at the same time.

If you put your executable in \Vdraft\Programs, it will be listed in Vdraft's Applications dialog box (extensions/applications menu selection). See the sample code in \Vdraft\Programs for further examples.


VdraftEvents Interface

VdraftEvents

See Also
cVdraftEvent
Plug-Ins

The purpose of the OCX is to provide a handy access to Vdraft generated events, such as mouse picks, menu picks and entity selections, among others. From C++ its use is optional as Vdraft events can be handled directly using C++ code. From Visual Basic, the OCX is essential if you wish to respond to events.

Typically you would start by calling Connect to establish communications with Vdraft. Access drawing information through the Vdraft property. You may get an object from IDocument which allows you to configure how you want Vdraft's user interface to behave. This object should then be passed to the appropriate method listed below. As the user interacts with Vdraft the appropriate events are called.

properties:
long | InstanceID | (read-only)
IVdraft | Vdraft | (read-only)
methods:
boolean | AddKeyboardCommand (long event, BSTR keystrokes)
boolean | RequestPick (IPickEvents pickevents, [long info])
boolean | RequestDraw (IPickEvents pickevents, [long info])
boolean | RequestSelect (ISelectionEvents selectevent, [long info])
boolean | RequestSingleSelect (ISelectionEvents selectevent, [long info])
boolean | Connect()
void | Disconnect()
void | AboutBox()
events:
void | Command(long event)
void | DrawDone(long info)
void | DrawCancel(long info)
void | DrawPick (IVector point, short picknumber, long info)
void | Help(long helptoken)
void | Load (IVdraft vdraft)
void | PickPoint (IVector point, long info)
void | PickCancel(long info)
void | PickDone(long info)
void | PickProperties(long info)
void | PickUndo(long info)
void | SelectDone(long info)
void | SelectCancel(long info)
void | Unload()
InstanceID
Visual Basic | long InstanceID (read-only)
C++ | long GetInstanceID()
A value that is unique for each instance of the OCX or plug-in Vdraft has loaded.
Vdraft
Visual Basic | IVdraft Vdraft (read-only)
C++ | IVdraft GetVdraft()
The main communication channel to Vdraft. This is created when Connect is called and destroyed when Disconnect is called
boolean AddKeyboardCommand (long event, BSTR keystrokes)
Register a keystroke command with Vdraft. When the user types in keystrokes, the value event will be sent to the Command event.
boolean RequestPick (IPickEvents pickevents, [long info])
Request to be notified of pick events. First get an IPickEvents object from IDocument . Set the appropriate settings and pass the object to this function. PickPoint, PickCancel, PickDone, PickProperties, and PickUndo may be called (if the events have been requested) when the user carries out various actions.
boolean RequestDraw (IPickEvents pickevents, [long info])
Request to be notified of pick events. First you will need to call the appropriate Draw function from IEntities . Then get an IPickEvents object from IDocument to pass to this function. info will be passed to DrawDone, DrawCancel, or DrawPick when these events occur.
boolean RequestSelect (ISelectionEvents selectevent, [long info])
Have the user select one or more objects and request to be notified of selection events. First get an ISelectionEvents object from IDocument . Set the appropriate settings and pass the object to this function. info will be passed to SelectDone or SelectCancel when these events occur.
boolean RequestSingleSelect (ISelectionEvents selectevent, [long info])
Have the user select a single object and request to be notified of selection events. First get an ISelectionEvents object from IDocument . Set the appropriate settings and pass the object to this function. info will be passed to SelectDone or SelectCancel when these events occur.
boolean Connect()
Establish initial communications with Vdraft. You can then access the IVdraft object through Vdraft.
void Disconnect()
Sever communications with Vdraft.
void AboutBox()
Display the About Box for the OCX.
void Command(long event)
Called when the user issues a command registered by this OCX. event is the value passed to AddKeyboardCommand.
void DrawDone(long info)
Called when the user chooses Done from the popup menu. Requested through RequestDraw.
void DrawCancel(long info)
Called when the user chooses Cancel from the popup menu, hits escape, etc. Requested through RequestDraw.
void DrawPick (IVector point, short picknumber, long info)
Called when the user picks a point while drawing an object. Requested through RequestDraw.
void Help(long helptoken)
Called when the user chooses help while performing an OCX initiated action.
void Load (IVdraft vdraft)
Called if Connect was successful.
void PickPoint (IVector point, long info)
Called when the user picks a point after a call to RequestPick.
void PickCancel(long info)
Called when the user picks Cancel after a call to RequestPick.
void PickDone(long info)
Called when the user picks Done after a call to RequestPick.
void PickProperties(long info)
Called when the user picks Properties after a call to RequestPick.
void PickUndo(long info)
Called when the user picks Undo after a call to RequestPick.
void SelectDone(long info)
Called when the user picks Done after a call to RequestSelect or RequestSingleSelect.
void SelectCancel(long info)
Called when the user picks Cancel after a call to RequestSelect or RequestSingleSelect.
void Unload()
Called if Disconnect was successful or if Vdraft goes away.


Sample Code - Visual Basic

Visual Basic Code Samples

See Also
C/C++ Sample Code
Defined Symbols for VB

There are fragments of sample code scattered all through this document. The following are some code fragments that offer more pith than the usual example. You may find these useful.

Of course, all the usual liability and “your mileage may vary” legal statements apply to these. (You know what they are; we don’t need to elaborate.) You are free to use these code samples any way you choose; but we don’t guarantee that they will work for your need.

The Vdraft package ships with sample applications with full source code. For Visual Basic, look under

\Vdraft\Programs\VB\

Attribs | blocks and block attributes
DrawX | line drawing example
Linetype | create line types
List | list entities in a selection set
NewDwg | new drawing wizard
Zoomer | drawing zoom applet
Aside from these complete examples, this document contains a number of code fragments scattered all about, as examples of the various individual APIs, plus the following examples:

Essentials of Working with Vdraft

Starting Vdraft

Listing All Active Drawings in Vdraft

Adding Polish


Using Automation in Visual Basic

See Also
VB Sample Code
C/C++ Sample Code

Using ActiveX Automation from Visual Basic is quite simple. This discussion and the samples shown here will clearly demonstrate this. Since all roads begin with the IVdraft class, let’s take a quick look at that first.

The group of functions that fall under IVdraft are as follows:

.
Visible | is Vdraft visible?
ActiveDocument | gains you access to the currently active document
Documents | gains you access to the collection of all documents
FullName | returns the full name (including path) of Vdraft
Name | returns “Vdraft”
Minimized | sets or gets the minimized status of Vdraft
Maximized | sets or gets the maximized status of Vdraft
Events | returns the IApplicationEvents interface into Vdraft
void Quit | causes Vdraft to shut down.
IVector NewVector | returns a new IVector object
IMatrix NewMatrix | returns a new IMatrix object

The first items are properties and all return information about some setting in or status of Vdraft. The last items are methods, which cause Vdraft to perform some action, such as quitting. These could be used from VB as follows:

    Dim Vdraft as Object
    Set Vdraft = CreateObject("Vdraft.Application")	' open up Vdraft communications

    Name$ = Vdraft.Name				' "Vdraft"
    FullName$ = Vdraft.FullName			' <path>\Vdraft.Exe

    If Vdraft.Visible Then				' if Vdraft is visible to user,
        ' do whatever you need here
    End If

    NumDocs% = Vdraft.Documents.Count		' get number of docs open in Vdraft
    ActDocName$ = Vdraft.ActiveDocument.FullName	' get full name (path) of active document

    ' continue processing

    Vdraft.Quit					' shut Vdraft down
    End						' done

The Documents group includes a Count property that returns the number of documents currently open in Vdraft. The IDocument group includes several properties and methods for handling individual documents. One of these properties is the document’s full name, including its path.

Visual Basic gives you some handy short cut techniques, such as illustrated in the following code:

    Vdraft = CreateObject(“Vdraft.Application”)
    NumOfEntities = Vdraft.ActiveDocument.Entities.Count

This allows you to avoid having to create a slew of intermediate objects, assigning each one specifically to a VB object variable.

The final source code example here starts by creating a new drawing document in Vdraft, then creating a circle and one line.

    Dim Vdraft, Entities As Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Entities = Vdraft.Documents.ActiveDoc.Entities

    '  draw a new circle in the document
    Dim mycircle As Object
    Set mycircle = Entities.AddCircle()	' create a new circle
    mycircle.Where.Set(14.0, 21.0)
    mycircle.Radius = 10.0

    '  draw a new line
    Dim myline As Object			' line and its points

    Set myline = Entities.AddLine()		' add the new line
    myline.Where1.Set(0.00, 0.00)		' start point of line
    myline.Where2.Set(10.0, 10.0)		' end point of line

In the code above, the Circle and Line will update on the document’s display as soon as the objects “mycircle” and “myline” go out of scope or they get set to “Nothing.”


Sample Code - C/C++

C/C++ Code Samples

See Also
VB Sample Code

Care has been taken all the code samples in this document to ensure that they reflect the true state of affairs in Vdraft – and that they will actually work. However, we can not guarantee that they are flawless or even appropriate for your own uses. You know, “your mileage may vary,” etc..

Further, all sample code has been constructed using only Microsoft Visual C/C++; other compilers may work, but we can make no guarantees about this. All compilers have their own idiosyncrasies. What is required is a package that is compatible with MSVC’s implementation of MFC and of ActiveX.

The Vdraft package ships with sample applications with full source code. For C/C++, look under

\Vdraft\Programs\CPP\
AngDim | angular dimension example
CurveLdr | curved leader example
DrawX | line drawing example

These are live samples that, aside from really working, illustrate many important principals about working with Vdraft in C/C++. This document also contains a number of code fragments scattered all about, as examples of the various individual interfaces; while not complete by any means, these fragments should still offer guidance for how to use the various interfaces.

Note that many of the entity interfaces have some sample code illustrating how you might use it.

Additionally, the following examples are available:

A general automation example

Creating a Vdraft PlugIn module

Interpreting XData.

PlugIn samples

Reading the IColors “table”

Retrieving header variables

Running through every entity in a drawing

Starting Vdraft and getting an active document.

Adding Polish


Using Automation in C/C++

Using Automation in C++

See Also
C/C++ Sample Code
VB Sample Code

The following is a code sample that illustrates a very basic procedure that simply gets a channel in to Vdraft, grabs interfaces to a few of the tables and then draws a couple lines. Nothing exciting, but this isn’t meant to be a practical example so much as an illustration of how to do some basic stuff.

void CNewAppDlg::OnGetVdraft()
{
    IVdraft Vdraft;					// grab vdraft.
    BOOL bSuccess = Vdraft.CreateDispatch("Vdraft.Application", NULL);
    CString AppName = Vdraft.GetName();		// should you want the app's name.

    IDocuments Dox(Vdraft.GetDocuments());		// the documents collection
    if (Dox.Count() == 0)				// is there an active document?
        Dox.Add(cVariant());			// add one if not

    IDocument Doc(Vdraft.GetActiveDocument());	// for currently active doc
    CString DocName = Doc.GetFullName();		// name of the currently active doc

    ILayers layers(Doc.GetLayers());		// pointer to layers table
    IEntities entities(Doc.GetEntities());		// the drawing entities

    ILine newline(entities.AddLine());		// create a new line
    IVector startpt(newline.StartPoint());		// start point of line
    startpt.Set2D(10, 10);				// set it

    IVector endpt(newline.EndPoint());		// end point of line
    endpt.Set2D(1.00, 1.00);			// set it
}

As soon as NewLine goes out of scope the object it is attached to, which is to say, the new line that was created, will update and display itself. Alternatively, you could have explicitly updated it by calling its Update() method.


Vdraft PlugIns

See Also
PlugIn Exports
OCX Events
cVdraftEvent
Performance with ActiveX
Loading a PlugIn
Shutting Down a PlugIn
Debugging a PlugIn

Vdraft PlugIns are special C/C++ DLL’s that are loaded up automatically by Vdraft at startup time. PlugIn’s have some advantages over other forms of Vdraft add-ons, such as performance, notifications and additional user interface capabilities.

Peroformance with ActiveX Automation

Although ActiveX Automation offers many advantages, there are some disadvantages. The main disadvantage is performance. ActiveX Automation can be very slow compared to other, more direct, programming solutions. This is because of the many layers of code that automation calls have to go through to “get from here to there.”

Worse than that, the easier methods of implementing ActiveX Automation are also the slower ones. Between VB and C/C++ the slowest to the fastest implementations rank this way:

Visual Basic EXE’s < Slowest
Visual C/C++ EXE’s
Visual Basic OLE DLL’s
Visual C/C++ DLL’s < Fastest

A PlugIn is a DLL which can be created with a language which can export functions, such as C++. When the DLL is placed in /Vdraft/Programs and exports a function called vfLoad, Vdraft will automatically load it when starting. vfLoad will be called when Vdraft loads the DLL, so this is a good place to perform initializations such as adding items to Vdraft's pull down menu.

To make a PlugIn, first create a new DLL. With a compiler such as Microsoft Visual C/C++, there is a wizard to walk you through the process of creating a new DLL. To call Vdraft's Automation functions, many programming environments offer a way to use a 'type library'. Vdraft's type library, Vdraft.tlb, is found in the Vdraft directory. It describes the functionality you can use to customize Vdraft. Provided with Vdraft are the files vdraft.cpp and vdraft.h which are a set of MFC (Microsoft Foundation Classes) based classes which simplify calling Vdraft. Add vdraft.cpp to your project. For more information on DLLs and using type libraries, see your compiler's documentation.

Code Samples

The following code adds a menu item when the DLL is first loaded. "My Menu Item" will appear on the menu. When the user highlights it, "A simple Vdraft add-on" will appear on the status bar.

    #include "vdraft.h"
    static IVdraft vdraft;
    #define MYMENUITEM	1

    veReturn vfLoad(vtAddOnID id)
    {
        if (!vdraft.CreateDispatch("Vdraft.Application", NULL))
            return veR_Unload;
        CString item("My Menu Item"), status("A simple Vdraft add-on");
        IApplicationEvents events(vdraft.GetEvents());
        events.AddToolsCommand(id,MYMENUITEM,item,status);
        return veR_OK;
    }
Remember to export vfLoad by listing it in the appropriate .def file. The file vplugin.h contains prototypes for the functions Vdraft calls to notify the PlugIn of events. Events are requested through the IApplicationEvents, IPickEvents, and ISelectionEvents interfaces. Vdraft passes an id to the PlugIn in all its event functions. The PlugIn should pass this id to Vdraft whenever it requests events so Vdraft knows who to respond to.

To perform an action when the user picks your menu item, define and export vfCommand. The following function responds to the item we added in vfLoad by prompting the user to draw a line. It then requests that Vdraft notify it when the user is done. The eventid parameter is the same value we passed to AddToolsCommand.

    #include "vdraft.h"
    veReturn vfCommand(vtAddOnID id, long eventid)
    {
        if (eventid != MYMENUITEM)
            return veR_OK;
        IDocument doc(vdraft.GetActiveDocument());

        // have them draw a line
        IEntities entities(doc.GetEntities());
        entities.DrawLine();

        // ask to be notified when they're done
        IPickEvents pick(doc.GetPickEvents());
        pick.RequestDraw(id,cVariant());
        return veR_OK;
    }
The cVariant class is defined in vutil.h. It provides a convenient way to pass values when a function expects a VARIANT (which simply means the parameter can take on different values). To pass 3 to RequestDraw, use pick.RequestDraw(id, cVariant(3)). As in the example discussing the VdraftEvents control, this value is passed back from Vdraft if extra information is needed to identify the specific drawing instance.

When the user finishes drawing the line, we will respond by drawing another line over it to make an X. vfDrawEvent is called when the user finishes, cancels, or picks a point. We will create the new line only if the user finishes drawing the first line.

    veReturn vfDrawEvent(vtAddOnID id, veDrawEvent event, double* point, short picknumber, long info)
    {
        if (event != veDE_Done)
            return veR_OK;
        IDocument doc(vdraft.GetActiveDocument());
        IEntities entities(doc.GetEntities());

        // get the line they just drew - it will be the last entity
        ILine line(entities.GetLast());
        // get the endpoints of the line
        IVector end1(line.GetWhere1()), end2(line.GetWhere2());

        // create a new line
        ILine newline(entities.AddLine());
        // get the endpoints of the new line
        IVector newend1(newline.GetWhere1()), newend2(newline.GetWhere2());

        // use the 1st line to position the 2nd line so we form an X
        newend1.Set2D(end1.GetX(), end2.GetY());
        newend2.Set2D(end2.GetX(), end1.GetY());
        return veR_OK;
    }
Additional code samples, including complete working examples, can be found on the Vdraft distribution disks and are installed under \Vdraft\Programs\Cpp.

Loading a PlugIn

To load the dll, execute the script command plugin.load <dll name>. Or, simply place the Dll in Vdraft\Programs subdirectory, which will cause the dll to be loaded automatically when Vdraft starts.

NOTE: Once Vdraft has been started up, new DLL’s placed in Vdraft\Programs won’t be loaded until the next time Vdraft starts.

Shutting Down a PlugIn

It can be unloaded either with the command plugin.unload <dll name> or by returning veR_Unload from VdraftEvents (otherwise return veR_OK).

If you wish to respond to shut down queries and notifications, then you will need to implement vfQueryUnload() or vfUnload() or both. These are optional, however and only need to be implemented if you wish to utilize them. vfQueryUnload() is called by Vdraft when Vdraft is considering shutting down; this gives you a chance to vote on the matter. This doesn’t mean that Vdraft will necessarily listen to your vote, however; it depends on why Vdraft is shutting down. When Vdraft is really shutting down, vfUnload() is called; this allows you to do your clean up and shutdown work.

Debugging a PlugIn

By default, Vdraft traps all unhandled exceptions that may occur in the plugin. The user is told which plugin had the problem, but the plugin still sticks around. So that the developer can have the debugger catch the errors & show them where the problem is, Vdraft's exception handling can be turned off by passing -debug on the command line.


PlugIn Exported Functions

See Also
OCX Events
cVdraftEvent

There are several functions that a PlugIn might need to export in order to make use of the various notification events. All except the vfLoad() function are optional. The last five of them are only called by Vdraft in response to event notifications that your request of it. Therefore, if you wish a particular type of notification, then you must include the appropriate exported function in your PlugIn. These functions are outlined here. The various C++ code samples contain examples of how to use these functions.

veReturn vfLoad( vtAddOnID id) < REQUIRED
vfLoad is the only function that is required to exist for the plugin to be loaded. It is called when the plugin is first loaded by Vdraft. This is a good time to add commands to Vdraft’s menu and/or keyboard (see AddKeyboardCommand())
veReturn vfQueryUnload(vtAddOnID id)
Vdraft is thinking about quitting. This is a query to all PlugIns, effectively asking whether it is OKay or not to shutdown. If the PlugIn has no objections, it should return veR_Unload if it isn't busy. This is only a request or query for shutdown; the PlugIn should not at this point do any closing down or cleanup. See vfUnload() for that.
veReturn vfUnload(vtAddOnID id)
Vdraft is actually quitting. This is where the PlugIn should do final cleanup.
veReturn vfCommand(vtAddOnID id, long eventid)
This function will be called by Vdraft in response to IApplicationEvents. The user has selected a plugin-defined command, such as from the Extensions menu or a keyboard command that was earlier defined by the PlugIn. The eventid will identify the command that was issued by the user; it’ll be the same id or long value you gave to Vdraft when the command was created.
veReturn vfPickEvent(vtAddOnID id, vePickEvent event, double* point, long info)
Called by Vdraft in response to IPickEvents::RequestPick. This is asking for the user to pick something and means that the user has picked a point or done something related to picking a point
veReturn vfDrawEvent(vtAddOnID id, veDrawEvent event, double* point, short picknumber, long info)
Called by Vdraft in response to IPickEvents::RequestDraw. This comes from a request for notification about great moments in the user’s drawing a particular entity and means that the user has generated an event related to drawing an object This might relate to the issuing of a Draw3PointArc() method, for example, when you are wanting to know when various points have been picked and to get data about those picks, etc.
veReturn vfSelectEvent(vtAddOnID id, veSelectEvent event, long info)
Called by Vdraft in response to ISelectionEvents::RequestSelect or ISelectionEvents::RequestSingleSelect. This has to do with asking the user to pick one or several entities in the drawing and means that the user has finished selecting objects.
veReturn vfHelpEvent(vtAddOnID id, long helptoken)
Called by Vdraft in response to a help request by the user. It means that the user has asked for help on something provided by the plugin. The help token is defined by the PlugIn.


ActiveX Interface Overview

The Virtual Drafter Interfaces

Listed here are all the interfaces for Virtual Drafter. Each class represents all the methods and properties related to a specific aspect of a drawing or the Vdraft application. For example, the IBlocks class holds all the methods and property access functions related to the Blocks table with in a given drawing.

I2DPolyline | A 2D polyline
I2DVertex | A 2D vertex point, for 2D polylines,
I2DVertices | A collection of 2D vertex points,
I3DPolyline | A 3D polyline
I3DSolid | An ACIS 3D solid
IAngleSnap | The angle snap object within the current drawing.
IApplicationEvents | Event notification.
IApplicationID | A registered name within the drawing document.
IApplicationIDs | For registering the name of your application for XData.
IArc | An arc object.
IAttdef | An attribute definition object.
IAttribute | An attribute object.
IBlock | A specific block within the blocks table.
IBlocks | The blocks table with in the current drawing.
IBody | An ACIS body.
ICircle | A circle object.
IColor | A specific color entry with in the color table.
IColors | The colors table for the current drawing.
ICommands | Commands interface into the document.
IDimension | A dimension object.
IDimStyle | A specific dimension style in the current drawing.
IDimStyles | The dimension styles table in the current drawing.
IDocument | Functions for a specific drawing document.
IDocuments | All current documents in Vdraft.
IEllipse | An ellipse.
IEntities | The collection of all entities in the current drawing.
IEntity | A generic class for all drawing entities.
IEntitySet | The set of entities in the drawing.
IEntitySnap | Snap settings in the given drawing.
IFace | A 3D face object.
IFaceVertex | A face in a polyface object.
IHatch | A hatch object.
IImage | An image object.
IInsert | A block insertion object.
IGridSnap | The grid snap object within the current drawing.
IHeader | Functions for accessing the drawing's settings.
ILayer | A specific layer within the layers table.
ILayers | The layers table within the drawing.
ILeader | A leader object.
ILine | A line object.
ILineType | A specific line type within the line types table.
ILineTypes | The line types table within the drawing.
IMatrix | for manipulating matrices
IMline | A multi-line object.
IMtext | Paragraph text.
INamedView | A specific named view in the current drawing.
INamedViews | The named views table in the current drawing.
IOle2Frame | An embedded object representing another program.
IOleFrame | An embedded object representing another program.
IPickEvents | For mouse pick event notifications.
IPoint | A point object.
IPolyface | A polyface object.
IPolymesh | A polymesh object.
IProxy | An ARX object.
IRay | A construction line infinite in one direction.
IRegion | An ACIS region object.
IShape | A shape object.
ISelection | The current selection set in the drawing.
ISelectionEvents | For entity selection event notifications.
ISolid | A solid object (a 2D solid-filled area).
ISpline | A spline object.
IText | A text object.
ITextStyle | A specific text style in the current drawing.
ITextStyles | The text styles table in the current drawing.
ITolerance | A tolerance object.
ITrace | A trace object (similar to a solid).
IUcs | A specific UCS in the current drawing.
IUcses | The UCSes table in the current drawing.
IUnits | Units settings for this drawing.
IVdraft | The Virtual Drafter application.
IVertex | A vertex object.
IVertices | A collection of vertex objects belonging to a polyline.
IVector | a vector, used for vector and for point information
IVectors | A collection of IVector objects
IView | A specific view or window in your drawing.
IViewport | A viewport object.
IViews | The views or windows for your drawing.
IXData | Extended entity data attached to a particular entity.
IXline | A construction line infinite in both directions.
cVariant | for easily dealing with VARIANT data type parameters


IVdraft Interface

IVdraft

This is the main application interface which is returned from a call to CreateObject or CreateDispatch. All information about the application and the drawings can be accessed through this object.

Visual Basic Code Sample

    Dim Vdraft as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Vdraft.Visible = True

C++ Code Sample

    IVdraft Vdraft;
    BOOL success = Vdraft.CreateDispatch("Vdraft.Application",NULL);
    Vdraft.SetVisible(TRUE);
properties:
IVdraft | Application | (read-only)
IVdraft | Parent | (read-only)
BSTR | FullName | (read-only)
BSTR | Name | (read-only) (default)
boolean | Visible
boolean | Minimized
boolean | Maximized
IDocument | ActiveDocument | (read-only)
IDocuments | Documents | (read-only)
IApplicationEvents | Events | (read-only)
long | WindowHandle | (read-only)
short | VersionMajor | (read-only) --ADDED FOR 1.5--
short | VersionMinor | (read-only) --ADDED FOR 1.5--
long | SerialNumber | (read-only) --ADDED FOR 1.5--
methods:
void | Quit()
IVector | NewVector([double x],[double y],[double z])
IMatrix NewMatrix()
void | Dialog() --ADDED FOR 1.5--
void | Finish() --ADDED FOR 2.11--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object. For IVdraft this is simply itself.
Parent
Visual Basic | IVdraft Parent (read-only)
C++ | IVdraft GetParent()
Returns the owner of this object. For IVdraft this is simply itself.
FullName
Visual Basic | BSTR FullName (read-only)
C++ | BSTR GetFullName()
The name of the Vdraft executable file.
Name
Visual Basic | BSTR Name (read-only) (default)
C++ | BSTR GetName()
The name of the Vdraft executable file.
Visible
Visual Basic | boolean Visible
C++ | boolean GetVisible()
C++ | void SetVisible(boolean)
The visibility of the Vdraft application window. If Vdraft is not running when communication is first established with it (through CreateObject or CreateDispatch), Vdraft will start up not visible to the user.
Minimized
Visual Basic | boolean Minimized
C++ | boolean GetMinimized()
C++ | void SetMinimized(boolean)
The minimized state of Vdraft. Minimizing Vdraft turns it into an icon on the task bar (or desktop for Windows NT 3.51 and earlier). Setting Minimized to FALSE returns it to its previous state.
Maximized
Visual Basic | boolean Maximized
C++ | boolean GetMaximized()
C++ | void SetMaximized(boolean)
The maximized state of Vdraft. Maximizing Vdraft causes the Vdraft window to grow to the size of the screen. Setting Maximized to FALSE returns it to its previous state.
ActiveDocument
Visual Basic | IDocument ActiveDocument (read-only)
C++ | IDocument GetActiveDocument()
Returns the currently active document (drawing). This object can then be used to access the elements in that document.
Documents
Visual Basic | IDocuments Documents (read-only)
C++ | IDocuments GetDocuments()
Returns an object which allows access to all the documents currently loaded in Vdraft.
Events
Visual Basic | IApplicationEvents Events (read-only)
C++ | IApplicationEvents GetEvents()
Returns an object which allows you to add items to the pulldown menu, add keyboard commands, etc.
WindowHandle
Visual Basic | long WindowHandle (read-only)
C++ | long GetWindowHandle()
Returns the HWND for Vdraft's main window.
VersionMajor
Visual Basic | short VersionMajor (read-only) --ADDED FOR 1.5--
C++ | short GetVersionMajor()
Returns the major version number for Vdraft. For example, Vdraft 1.51 returns 1.
VersionMinor
Visual Basic | short VersionMinor (read-only) --ADDED FOR 1.5--
C++ | short GetVersionMinor()
Returns the minor version number for Vdraft. For example, Vdraft 1.51 returns 510 in hexadecimal.
SerialNumber
Visual Basic | long SerialNumber (read-only) --ADDED FOR 1.5--
C++ | long GetSerialNumber()
Returns the serial number of this copy of Vdraft. The trial version of Vdraft has a serial number of 0. This allows third party add-ons to run in demo mode for trial copies of Vdraft.
void Quit()
Cause Vdraft to quit.
IVector NewVector([double x],[double y],[double z])
Return a new vector object.
IMatrix NewMatrix()
Return a new matrix object. It defaults to the identity matrix.
void Dialog() --ADDED FOR 1.5--
Display the About dialog.
void Finish() --ADDED FOR 2.11--
Force Vdraft to finish all queued actions. This also allows the user interface to be updated to reflect the current state of the active drawing. Starting with v2.11 of Vdraft this method is now invoked before returning from IDocument Close and IDocument CloseOut.


Vdraft Enumerated Constants Interface

Vdraft Enumerated Constants

Enumerated constants are integers used by various methods and properties. This helps clarify code that would otherwise pass non-obvious numbers.

Enumerated types used by Vdraft are prefaced with 've' which stands for Vdraft Enum. The items in the enum are prefaced with 've' and an acronym representing the name. This helps reduce the likelihood of name conflicts with other code and between enums.

Note: Unless otherwise specified, the following enumerated constants start at 0.

Venums.h

veLinearUnits

Used by IUnits.Linear
  • veLU_Scientific = 1
  • veLU_Decimal
  • veLU_Engineering
  • veLU_Architectural
  • veLU_Fractional

veAngularUnits

Used by IUnits.Angular
  • veAU_DecimalDegrees
  • veAU_DegMinSec
  • veAU_Grads
  • veAU_Radians
  • veAU_Surveyor

veDimStyleAlignment

Used by IDimStyle.Alignment
  • veDSA_Horizontal
  • veDSA_DimLine
  • veDSA_Inside
  • veDSA_Outside

veDimStyleVertical

Used by IDimStyle.Vertical
  • veDSV_Centered
  • veDSV_Above
  • veDSV_Relative

veDimStyleHorizontal

Used by IDimStyle.Horizontal
  • veDSH_Default
  • veDSH_TextIn
  • veDSH_TextArrowsIn

veDimStyleTolerance

Used by IDimStyle.Tolerance
  • veDST_None
  • veDST_Variance
  • veDST_Limits

veCommonArrowsType

Used by IDimStyle.ArrowsType
  • veCAT_Block
  • veCAT_Default
  • veCAT_Dot
  • veCAT_Tick

veSeparateArrowsType

Used by IDimStyle.Arrow1Type, IDimStyle.Arrow2Type
  • veSAT_Block
  • veSAT_Default
  • veSAT_Dot

veEntityType

Used by IEntity.Type
  • veET_Line
  • veET_Point
  • veET_Circle
  • veET_Shape
  • veET_Text
  • veET_Arc
  • veET_Trace
  • veET_Solid
  • veET_Insert
  • veET_Attdef
  • veET_Attrib
  • veET_2DPolyline
  • veET_3DPolyline
  • veET_Polymesh
  • veET_Polyface
  • veET_2DVertex
  • veET_Vertex
  • veET_FaceVertex
  • veET_3DFace
  • veET_HorizontalDim
  • veET_VerticalDim
  • veET_RotatedDim
  • veET_AlignedDim
  • veET_Angular4PointDim
  • veET_DiameterDim
  • veET_RadiusDim
  • veET_Angular3PointDim
  • veET_OrdinateXDim
  • veET_OrdinateYDim
  • veET_Viewport
  • veET_Ray --ADDED FOR 2.0--
  • veET_Xline --ADDED FOR 2.0--
  • veET_Ellipse --ADDED FOR 2.0--
  • veET_Mline --ADDED FOR 2.0--
  • veET_Mtext --ADDED FOR 2.0--
  • veET_Body --ADDED FOR 2.0--
  • veET_Leader --ADDED FOR 2.0--
  • veET_OleFrame --ADDED FOR 2.0--
  • veET_Region --ADDED FOR 2.0--
  • veET_Tolerance --ADDED FOR 2.0--
  • veET_3DSolid --ADDED FOR 2.0--
  • veET_Spline --ADDED FOR 2.0--
  • veET_Proxy --ADDED FOR 2.0--
  • veET_Hatch --ADDED FOR 2.0--
  • veET_Image --ADDED FOR 2.0--
  • veET_Ole2Frame --ADDED FOR 2.0--
  • veET_ArcAlignedText --ADDED FOR 2.1--
  • veET_Rtext --ADDED FOR 2.1--
  • veET_Wipeout --ADDED FOR 2.1--

veXDataType

Used by IXData.Type
  • veXDT_Invalid
  • veXDT_String
  • veXDT_Control
  • veXDT_Layer
  • veXDT_RawData
  • veXDT_Handle
  • veXDT_Vector
  • veXDT_Double
  • veXDT_Short
  • veXDT_Long

veXDataControl

Used by IXData.Control
  • veXDC_Start
  • veXDC_End

vePolylineCurve

Used by I2DPolyline.Curve, I3DPolyline.Curve, IPolymesh.ColumnCurve, IPolymesh.RowCurve
  • vePC_NoCurve
  • vePC_Curved
  • vePC_Cubic
  • vePC_Quadratic

veJustifyHorizontal

Used by bGeneralText.Horizontal, See also IText, IAttdef, IAttribute
  • veJH_Left
  • veJH_Center
  • veJH_Right
  • veJH_Align
  • veJH_Middle
  • veJH_Fit

veJustifyVertical

Used by bGeneralText.Vertical, See also IText, IAttdef, IAttribute
  • veJV_Baseline
  • veJV_Bottom
  • veJV_Middle
  • veJV_Top

veBlockDefinitionMethod

Used by IBlocks.Add
  • veBDM_EntitiesRemoved
  • veBDM_ReplacedByInsert
  • veBDM_EntitiesLeft

veCursorTipInfo

Used by IPickEvents.SetCursorTipInfo
  • veCTI_None
  • veCTI_Offset
  • veCTI_Scale
  • veCTI_Angle
  • veCTI_LengthAngle
  • veCTI_Height
  • veCTI_Width
  • veCTI_Radius
  • veCTI_Length
  • veCTI_Diameter

vePickPopup

Used by IPickEvents.TriggerPopup
  • vePP_Done
  • vePP_Cancel
  • vePP_Properties
  • vePP_Undo
  • vePP_Help
  • vePP_TypeCoordinates

veFilletChamfer

Used by ILine.Fillet, ILine.Chamfer, I2DPolyline.Fillet, I2DPolyline.Chamfer
  • veFC_Success
  • veFC_IllegalEntity
  • veFC_InInsert
  • veFC_DifferentSpace
  • veFC_NoIntersection
  • veFC_NotLongEnough
  • veFC_SameEntity
  • veFC_BadEntity
  • veFC_ZeroDistance

veScaleOptions

Used by IUnits.ScaleMethod
  • veSO_ScaleBy
  • veSO_UnitEquals
  • veSO_UnitIsInch

veMetricDistance

Used by IUnits.Units
  • veMD_mm
  • veMD_cm
  • veMD_m
  • veMD_km

veAddOnFunctionReturnStatus

Used by IApplicationEvents, IApplicationEvents.CallAddOnFunction
  • veAOFRS_FunctionNotFound = -2
  • veAOFRS_AddOnNotFound = -1

veMtextJustification

Used by IMtext.Justification
  • eMJ_TopLeft = 1
  • eMJ_TopCenter
  • eMJ_TopRight
  • eMJ_MiddleLeft
  • eMJ_MiddleCenter
  • eMJ_MiddleRight
  • eMJ_BottomLeft
  • eMJ_BottomCenter
  • eMJ_BottomRight

veMtextDirection

Used by IMtext.Direction
  • eMD_LeftToRight = 1
  • eMD_RightToLeft
  • eMD_TopToBottom
  • eMD_BottomToTop
  • eMD_ByStyle

veBitmapFormat

Used by IDocument.ExportBitmap
  • eBF_BMP = 1 -- Windows Bitmap (*.bmp)
  • eBF_RLE -- Windows Compressed Bitmap (*.bmp)
  • eBF_JPG -- JPEG - JFIF Compliant (*.jpg)
  • eBF_PCX -- ZSoft Paintbrush (*.pcx)
  • eBF_PCT -- Mac Pict (*.pct)
  • eBF_PNG -- Portable Network Graphics (*.png)
  • eBF_TGA -- Truevision Targa (*.tga)
  • eBF_TIF -- Tiff using JPEG (*.tif)
  • eBF_CALS -- A 1-bit FAX Format (*.cal)
  • eBF_OS2 -- OS/2 Bitmap v1.x (*.bmp)
  • eBF_OS2_2 -- OS/2 Bitmap v2.x (*.bmp)
  • eBF_PSD -- Abobe PhotoShop v3.0 (*.psd)
  • eBF_RAS -- Sun Raster Image (*.ras)

veBitsPerPixel

Used by IDocument.ExportBitmap
  • eBPP_1 = 1 -- Monochrome
  • eBPP_2 = 2 -- 4-Color
  • eBPP_4 = 4 -- 16-Color
  • eBPP_8 = 8 -- 256-Color
  • eBPP_16 = 16 -- HiColor
  • eBPP_24 = 24 -- TrueColor
  • eBPP_32 = 32 -- TrueColor

Vplugin.h

vePickEvent

Used by IPickEvents
  • vePE_Point
    A point has been picked.
  • vePE_Cancel
    Pick was aborted.
  • vePE_Done
    Done chosen from popup.
  • vePE_Properties
    Properties chosen from popup
  • vePE_Undo
    Undo chosen from popup.

veDrawEvent

Used by IPickEvents, vfDrawEvent
  • veDE_Done
    Drawing is completely done
  • veDE_Cancel
    Drawing has been aborted.
  • veDE_Pick
    Point has been picked.

veSelectEvent

Used by ISelectionEvents
  • veSE_Done
    The user is done selecting objects.
  • veSE_Cancel
    The user aborted the selection process.

veReturn

Return values for the plugin functions vfCommand, vfLoad, vfDrawEvent.
Used by IApplicationEvents, IPickEvents
  • veR_OK
    Return to continue.
  • veR_Unload
    Return if the plugin should be unloaded immediately.
  • veR_DontUnload = veR_OK


DXF Code Reference

The following is a brief reference guide to the DXF codes found in Vdraft drawings. They are identical to AutoCAD DXF codes. You may even find some AutoCAD-related documentation that will give more details about these codes and exactly how they are used for each entity type. The descriptions here are very generic and the exact usage of a given DXF code can be vary quite a lot depending on the actual entity involved.

This is according to the AutoCAD Release 12 DXF Spec; therefore, you will find an abundance of additional reference materials on DXF in the world, both AutoCAD’s own references as well as the many books that have been written about AutoCAD.

0 | Identifies the start of an entity, table entry, or file separator. The value following shows which.
1 | The primary text value for an entity
2 | A name; attribute tag, block name, etc.
3-4 | Other textual or name values
5 | Entity handle expressed as hex number
6 | Line type name
7 | Text style
8 | Layer name
9 | Variable name identifier – for header only
10 | Primary X Coordinate
11 - 18 | Other X Coordinates
20 | Primary Y Coordinate
21 - 28 | Other Y Coordinates
30 | Primary Z Coordinate
31 - 37 | Other Z Coordinates
38 | Entity’s elevation, if nonzero
39 | Entity’s thickness, if nonzero
40 - 48 | Floating point values (text height, etc)
49 | Repeated value
50 - 58 | Angles
62 | Color number
66 | “Entities Follow” flag
70 - 78 | integer values, such as repeat counts, etc
210, 220, 230 | X, Y, Z components of extrusion direction
999 | Comments
1000 | ASCII string up to 255 bytes long

See IXData for more information on the following codes and their use.

1001 | Registered Application name (string up to 31 bytes long – see ApplicationIDs)
1002 | XData Control String
1003 | XData Layer Name
1004 | Chunk of bytes (up to 127 bytes long)
1005 | XData Database handle
1010, 1020, 1030 | XData X, Y, Z coodinates.
1011, 1021, 1031 | XData X, Y, Z coordinates in 3D World space placement.
1012, 1022, 1032 | XData X, Y, Z components of 3D World space displacement.
1013, 1023, 1033 | XData X,Y, Z components of 3D World space direction.
1040 | XData floating point value
1041 | XData distance value
1042 | XData scale factor
1070 | XData 16-bit integer
1071 | XData 32-bit signed long.


cVariant

(Interface Overview)

C++ Class Constructors:
    cVariant();
    cVariant(BOOL val);
    cVariant(short val);
    cVariant(long val);
    cVariant(double val);
    cVariant(BSTR val);
    cVariant(CString& val);
    cVariant(LPDISPATCH val);
    cVariant(cVdraftEvent* ptr);

The cVariant object is a small class that has been created for the benefit of C++ programmers to make for simpler code where parameters must be passed in as VARIANTS, particularly optional parameters, which for C/C++ can not be optional under ActiveX Automation. Automation does not support default parameters.

This is only useful with C++; Visual Basic does not need and can not use this object. (Under Visual Basic, the VARIANT parameter needed by some function calls are equivalent to the VB Variant data type.)
The class has essentially only one member function, an inline reference operator. The inner VooDoo of C++ combined with this one operator allows you to send VARIANT parameters in an easy fashion.
inline operator VARIANT&()

C/C++ Code Samples:

This code fragment retrieves the layer called “MYLAYER”:

    // 'drawing' already points to the document we are working with
    IEntities entities(drawing.GetEntities());
    IEntity	lastent(entities.GetLast());
    ILayers	layers(drawing.GetLayers());
    ILayer	layer(layers.GetItem(cVariant(“MYLAYER”)));
    lastent.SetLayer(layer);
This code fragment adds a new document if there are no active documents present. The Add() method off of the Documents interface adds a new drawing only if there is no parameter passed in.
    IDocuments Dox(Vdraft.GetDocuments());		// the documents collection
    if (Dox.Count() == 0)				// is there an active document?
        Dox.Add(cVariant());			// add one
This last code fragment uses the cVariant to pass in the third parameter for initializing a Vector object.
    Vec2.Set(3.5, 5.0, cVariant());

There are many other examples of the use of cVariant’s scattered all through out this help file. (Click on the “cVariant Examples” button above to see a listing of some of them).


IAngleSnap Interface

IAngleSnap

Controls the angle snap settings for a viewport.
properties:
IVdraft | Application | (read-only)
IView | Parent | (read-only)
boolean | Snap | (default)
boolean | Ortho
double | Angle
double | BaseAngle
methods:
void Dialog()
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IView Parent (read-only)
C++ | IView GetParent()
Returns the owner of this object.
Snap
Visual Basic | boolean Snap (default)
C++ | boolean GetSnap()
C++ | void SetSnap(boolean)
If angle snap is on.
Ortho
Visual Basic | boolean Ortho
C++ | boolean GetOrtho()
C++ | void SetOrtho(boolean)
If ortho snap is on. This is the same as an angle snap of 90 degrees.
Angle
Visual Basic | double Angle
C++ | double GetAngle()
C++ | void SetAngle(double)
Controls the snap angle relative to the BaseAngle.
BaseAngle
Visual Basic | double BaseAngle
C++ | double GetBaseAngle()
C++ | void SetBaseAngle(double)
Controls the base angle snaps are relative to.
void Dialog()
Display the Angles tab of the Unit Settings dialog


ICommands Interface

ICommands

The collection of commands that have been executed since the last time the drawing was saved. Allows commands to be undone and redone. Also useful for grouping commands issued by a Vdraft add-on to make it easier for the user to undo the collection of commands the add-on may have issued.

Visual Basic Code Sample

    ' assume doc already points to an IDocument object
    Dim commands as Object
    Set commands = doc.Commands
    commands.Group ("mycommand (1,1)-(2,2)")	' text which appears in Undo/Redo list
    ' execute various commands - creating and modifying entities, etc.
    commands.EndGroup	' all the previous commands are lumped together and put in Undo/Redo list

C++ Code Sample

    // assume doc already points to an IDocument object
    ICommands commands( doc.GetCommands() );
    CString description("mycommand (1,1)-(2,2)");	// text which appears in Undo/Redo list
    commands.Group( description );
    // execute various commands - creating and modifying entities, etc.
    commands.EndGroup();	// all the previous commands are lumped together and put in Undo/Redo list
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
BSTR | Item(long index) | (read-only) (default)
methods:
boolean | Undo([long howmany])
boolean | Redo([long howmany])
boolean | Restart()
boolean | Do (BSTR command)
void | Group (BSTR description)
void | EndGroup()
void | KillUndoRedo() --ADDED FOR 1.5--
void | Dialog() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
Returns the number of top level commands in the undo list.
Item
Visual Basic | BSTR Item(long index) (read-only) (default)
C++ | BSTR GetItem()
Returns a description of command number index in the undo list.
boolean Undo([long howmany])
Undo the specified number of top level commands. Defaults to 1.
boolean Redo([long howmany])
Redo the specified number of top level commands. Defaults to 1.
boolean Restart()
Restart the last command.
boolean Do (BSTR command)
Execute a macro command. The macro syntax is exactly what appears in the undo/redo list.
void Group (BSTR description)
Begin the grouping of commands. Once EndGroup is called, the commands are placed on the undo list using the specified text as a description.
void EndGroup()
End the grouping of commands started with StartGroup.
void KillUndoRedo() --ADDED FOR 1.5--
Get rid of the current undo/redo lists.
void Dialog() --ADDED FOR 1.5--
Display the Undo/Redo List dialog.


IDocument Interface

IDocument

All information about a document (drawing) can be accessed and set through this object.
properties:
IVdraft | Application | (read-only)
IDocuments | Parent | (read-only)
BSTR | FullName | (read-only)
BSTR | Name | (read-only) (default)
BSTR | Path | (read-only)
boolean | Saved | (read-only)
IEntitySnap | EntitySnap | (read-only)
IUnits | Units | (read-only)
IEntities | Entities | (read-only)
IApplicationIDs | ApplicationIDs | (read-only)
ILayers | Layers | (read-only)
ILinetypes | Linetypes | (read-only)
IBlocks | Blocks | (read-only)
IDimStyles | DimStyles | (read-only)
ITextStyles | TextStyles | (read-only)
IUcses | Ucses | (read-only)
INamedViews | NamedViews | (read-only)
IViews | Views | (read-only)
ICommands | Commands | (read-only)
IColors | Colors | (read-only)
ISelection | Selection | (read-only)
BSTR StatusBar
IHeader | Header | (read-only)
IPickEvents | PickEvents | (read-only)
ISelectionEvents | SelectionEvents | (read-only)
boolean | Visible | --ADDED FOR 1.5--
boolean | Minimized | --ADDED FOR 1.5--
boolean | Maximized | --ADDED FOR 1.5--
long | WindowHandle | (read-only) --ADDED FOR 1.5--
methods:
void | Activate()
void | Print([short copies]) (VB alternate: PrintOut)
void | PrintSetup()
void | PrintPreview()
void | PrintPreviewClose()
void | Save()
void | SaveAs (BSTR filename)
void | Close ([boolean saveChanges], [BSTR fileName]) (VB alternate: CloseOut)
void | Redraw()
void | Regen()
IEntitySet | NewEntitySet() --ADDED FOR 1.01--
void | Dialog() --ADDED FOR 1.5--
void | SaveCopyAs (BSTR filename) --ADDED FOR 2.0--
void | SaveAsRelease (BSTR filename, short release) --ADDED FOR 2.0--
void | ExportBitmap (BSTR filename, veBitmapFormat bitmapformat, veBitsPerPixel bitsperpixel, short width, short height) --ADDED FOR 2.1--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocuments Parent (read-only)
C++ | IDocuments GetParent()
Returns the owner of this object.
FullName
Visual Basic | BSTR FullName (read-only)
C++ | BSTR GetFullName()
Returns the full name of the drawing, including the path. For example: "c:\drawings\MyDrawing.dwg".
Name
Visual Basic | BSTR Name (read-only) (default)
C++ | BSTR GetName()
Returns the name of the drawing without path or file extension. For example: "MyDrawing".
Path
Visual Basic | BSTR Path (read-only)
C++ | BSTR GetPath()
Returns the path of the drawing. For example: "c:\drawings\".
Saved
Visual Basic | boolean Saved (read-only)
C++ | boolean GetSaved()
Returns FALSE if the drawing has been modified since it was last saved. Use the Save method to save the document.
EntitySnap
Visual Basic | IEntitySnap EntitySnap (read-only)
C++ | IEntitySnap GetEntitySnap()
Returns an object which allows access to the entity snap settings.
Units
Visual Basic | IUnits Units (read-only)
C++ | IUnits GetUnits()
Returns an object which allows access to unit settings for output and measurement purposes.
Entities
Visual Basic | IEntities Entities (read-only)
C++ | IEntities GetEntities()
Returns the collection of all entities in the drawing.
ApplicationIDs
Visual Basic | IApplicationIDs ApplicationIDs (read-only)
C++ | IApplicationIDs GetApplicationIDs()
Returns the collection of registered applications for this drawing.
Layers
Visual Basic | ILayers Layers (read-only)
C++ | ILayers GetLayers()
Returns the collection of all layers in the drawing.
Linetypes
Visual Basic | ILinetypes Linetypes (read-only)
C++ | ILinetypes GetLinetypes()
Returns the collection of all linetypes in the drawing.
Blocks
Visual Basic | IBlocks Blocks (read-only)
C++ | IBlocks GetBlocks()
Returns the collection of all blocks in the drawing.
DimStyles
Visual Basic | IDimStyles DimStyles (read-only)
C++ | IDimStyles GetDimStyles()
Returns the collection of all dimension styles in the drawing.
TextStyles
Visual Basic | ITextStyles TextStyles (read-only)
C++ | ITextStyles GetTextStyles()
Returns the collection of all text styles in the drawing.
Ucses
Visual Basic | IUcses Ucses (read-only)
C++ | IUcses GetUcses()
Returns the collection of all UCSes (User Coordinate Systems) in the drawing.
NamedViews
Visual Basic | INamedViews NamedViews (read-only)
C++ | INamedViews GetNamedViews()
Returns the collection of all named views in the drawing.
Views
Visual Basic | IViews Views (read-only)
C++ | IViews GetViews()
Returns the collection of all views and viewports in the drawing.
Commands
Visual Basic | ICommands Commands (read-only)
C++ | ICommands GetCommands()
Returns the collection of commands that have been executed since the last time the drawing was saved.
Colors
Visual Basic | IColors Colors (read-only)
C++ | IColors GetColors()
Returns the collection of all colors.
Selection
Visual Basic | ISelection Selection (read-only)
C++ | ISelection GetSelection()
Returns the collection of currently selected entities in the drawing.
StatusBar
Visual Basic | BSTR StatusBar
C++ | BSTR GetStatusBar()
C++ | void SetStatusBar(BSTR)
Provides access to the message displayed in the status bar when this drawing is active and no commands are being executed.
Header
Visual Basic | IHeader Header (read-only)
C++ | IHeader GetHeader()
Returns the drawing header which contains miscellaneous drawing settings.
PickEvents
Visual Basic | IPickEvents PickEvents (read-only)
C++ | IPickEvents GetPickEvents()
Returns the object which handles mouse event notifications.
SelectionEvents
Visual Basic | ISelectionEvents SelectionEvents (read-only)
C++ | ISelectionEvents GetSelectionEvents()
Returns the object which handles entity selection event notifications.
Visible
Visual Basic | boolean Visible --ADDED FOR 1.5--
C++ | boolean GetVisible()
C++ | void SetVisible(boolean)
Controls the visibility of the drawing window.
Minimized
Visual Basic | boolean Minimized --ADDED FOR 1.5--
C++ | boolean GetMinimized()
C++ | void SetMinimized(boolean)
The minimized state of the drawing window. Minimizing the window causes it to turn into an icon at the bottom of the Vdraft window (visible if no other drawings are on top of it.) Setting Minimized to FALSE returns it to its previous state.
Maximized
Visual Basic | boolean Maximized --ADDED FOR 1.5--
C++ | boolean GetMaximized()
C++ | void SetMaximized(boolean)
The maximized state of the drawing window. Maximizing the window causes it to grow to the size of the Vdraft window. Setting Maximized to FALSE returns it to its previous state.
WindowHandle
Visual Basic | long WindowHandle (read-only) --ADDED FOR 1.5--
C++ | long GetWindowHandle()
Returns the HWND for the drawing's window.
void Activate()
Make this drawing the active window.
void Print([short copies]) (VB alternate: PrintOut)
Print the specified number of copies. Defaults to 1 if no number is specified

Visual Basic Code Sample

    Dim Vdraft as Object
    Dim Doc as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Doc = Vdraft.ActiveDocument
    Doc.PrintOut	' print a single copy of the current drawing
    Doc.PrintOut(5)	' print 5 copies of the current drawing

C++ Code Sample

    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application",NULL);
    IDocument drawing(Vdraft.GetActiveDocument());
    drawing.Print(cVariant());	// print a single copy of the current drawing
    drawing.Print(cVariant(5));	// print 5 copies of the current drawing
void PrintSetup()
Displays the Print Options dialog box.
void PrintPreview()
Displays a preview of how the drawing would print using the current settings.
void PrintPreviewClose()
Dismisses the print preview window.
void Save()
Saves the document.
void SaveAs (BSTR filename)
Saves the document under a different name.
void Close ([boolean saveChanges], [BSTR fileName]) (VB alternate: CloseOut)
Closes the drawing. If you pass no parameters, the user will be prompted to save if the drawing has been modified. Pass TRUE for saveChanges if you wish it to be saved if it has been modified since the last save. An alternate filename can be specified to save to.

Visual Basic Code Sample

    Dim Vdraft as Object
    Dim Doc as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Doc = Vdraft.ActiveDocument
    Doc.CloseOut		' same as Close from the File menu
    Doc.CloseOut False	' close without saving
    Doc.CloseOut True	' save if necessary and close
    Doc.CloseOut True, "Alt.dwg"	' save under a different name and close

C++ Code Sample

    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application",NULL);
    IDocument drawing(Vdraft.GetActiveDocument());
    drawing.Close(cVariant(),cVariant());		// same as Close from the File menu
    drawing.Close(cVariant(FALSE),cVariant());	// close without saving
    drawing.Close(cVariant(TRUE),cVariant());	// save if necessary and close
    drawing.Close(cVariant(TRUE),cVariant("Alt.dwg"));	// save under a different name and close
void Redraw()
Redraw the entire drawing.
void Regen()
Regenerate the display and redraw the entire drawing.
IEntitySet NewEntitySet() --ADDED FOR 1.01--
Create a new entity collection which can be used to hold aribitrary collections of entities.
void Dialog() --ADDED FOR 1.5--
Display the Drawing Info dialog box.
void SaveCopyAs (BSTR filename) --ADDED FOR 2.0--
Save a copy of the drawing to another name without renaming it.
void SaveAsRelease (BSTR filename, short release) --ADDED FOR 2.0--
Save the drawing using the specified file name to a specific release of AutoCAD. release can be from 7 up to 14.
void ExportBitmap (BSTR filename, veBitmapFormat bitmapformat, veBitsPerPixel bitsperpixel, short width, short height) --ADDED FOR 2.1--
Export a bitmap image of the drawing to the specified file. Width and height are in pixels.


IDocuments Interface

IDocuments

An object which allows access to all the documents currently loaded in Vdraft.
properties:
IVdraft | Application | (read-only)
IVdraft | Parent | (read-only)
long | Count | (read-only)
IDocument | Item( VARIANT which) | (read-only) (default)
methods:
IDocument | Add ([BSTR name])
IDocument | New ([BSTR name])
void | Close() (VB alternate: CloseOut)
void | Save()
void | Print() (VB alternate: PrintAll)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IVdraft Parent (read-only)
C++ | IVdraft GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of documents (drawings) currently opened in Vdraft.
Item
Visual Basic | IDocument Item( VARIANT which) (read-only) (default)
C++ | IDocument GetItem()

Retrieves the specified document. Accepts either an index number or file name

Visual Basic Code Sample

    Dim Vdraft as Object
    Dim Docs as Object
    Dim Doc as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Docs = Vdraft.Documents
    Set Doc = Docs.Item(1)	' get 1st drawing
    Set Doc = Vdraft.Documents.Item(2)	' alternate way to get 2nd drawing
    Set Doc = Docs.Item("Mine.dwg")	' get hold of drawing called "Mine.dwg"

C++ Code Sample

    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application",NULL);
    IDocuments docs(Vdraft.GetDocuments());
    IDocument dwg1(docs.GetItem(cVariant(1));	// get 1st drawing
    IDocument dwg2(docs.GetItem(cVariant("Mine.dwg")));	// get hold of drawing called "Mine.dwg"
IDocument Add ([BSTR name])

Creates or opens a drawing. If no parameter is passed, a new drawing is created using the current template or prototype drawing. If a file name is passed, it opens the drawing.

Visual Basic Code Sample

    Dim Vdraft as Object
    Dim Doc as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Doc = Vdraft.Documents.Add	' create a new drawing
    Set Doc = Vdraft.Documents.Add("Mine.dwg")	' open "Mine.dwg"

C++ Code Sample

    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application",NULL);
    IDocuments docs(Vdraft.GetDocuments());
    IDocument dwg1(docs.Add(cVariant()));	// create a new drawing
    IDocument dwg2(docs.Add(cVariant("Mine.dwg")));	// open "Mine.dwg"
IDocument New ([BSTR name])

Creates a new drawing. If no parameter is passed, the new dialog is displayed. If a name is passed, the specified template or prototype drawing is used to create a new drawing.

Visual Basic Code Sample

    Dim Vdraft as Object
    Dim Doc as Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Doc = Vdraft.Documents.New	' display the New dialog box
    Set Doc = Vdraft.Documents.New("ansib.vs")	' create a drawing using the ansib template

C++ Code Sample

    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application",NULL);
    IDocuments docs(Vdraft.GetDocuments());
    IDocument dwg1(docs.New(cVariant()));	// display the New dialog box
    IDocument dwg2(docs.Add(cVariant("Vdraft.dxf")));	// create a new drawing using Vdraft.dxf as a prototype
void Close() (VB alternate: CloseOut)
Closes all drawings. It prompts the user if any drawings are modified.
void Save()
Saves all drawings that have been modified.
void Print() (VB alternate: PrintAll)
Prints all drawings currently open.


IEntitySnap Interface

IEntitySnap

Access to the entity snap settings for the current drawing. This is the same information available on the Object and When tabs of the Snap/Grid Settings dialog.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
boolean | Snap | (default)
boolean | SnapToSelection
boolean | Endpoint
boolean | Midpoint
boolean | Center
boolean | Nearest
boolean | PointSnap
boolean | Quadrant
boolean | Insertion
boolean | Perpendicular
boolean | Intersection
methods:
void Dialog()
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Snap
Visual Basic | boolean Snap (default)
C++ | boolean GetSnap()
C++ | void SetSnap(boolean)
Controls whether or not entity snap is on. Equivalent to the Snap to Objects option on the Object tab of the Snap/Grid Settings dialog.
SnapToSelection
Visual Basic | boolean SnapToSelection
C++ | boolean GetSnapToSelection()
C++ | void SetSnapToSelection(boolean)
Controls whether or not the cursor is snapped to all entities or only the currently selected entities. Equivalent to the Snap to Selected Objects option on the When tab of the Snap/Grid Settings dialog.
Endpoint
Visual Basic | boolean Endpoint
C++ | boolean GetEndpoint()
C++ | void SetEndpoint(boolean)
Controls snapping to the endpoint of objects.
Midpoint
Visual Basic | boolean Midpoint
C++ | boolean GetMidpoint()
C++ | void SetMidpoint(boolean)
Controls snapping to the midpoint of objects.
Center
Visual Basic | boolean Center
C++ | boolean GetCenter()
C++ | void SetCenter(boolean)
Controls snapping to the center of objects.
Nearest
Visual Basic | boolean Nearest
C++ | boolean GetNearest()
C++ | void SetNearest(boolean)
Controls snapping to the nearest point of objects.
PointSnap
Visual Basic | boolean PointSnap
C++ | boolean GetPointSnap()
C++ | void SetPointSnap(boolean)
Controls snapping to points.
Quadrant
Visual Basic | boolean Quadrant
C++ | boolean GetQuadrant()
C++ | void SetQuadrant(boolean)
Controls snapping to the quadrant of circular objects.
Insertion
Visual Basic | boolean Insertion
C++ | boolean GetInsertion()
C++ | void SetInsertion(boolean)
Controls snapping to the insertion point of objects.
Perpendicular
Visual Basic | boolean Perpendicular
C++ | boolean GetPerpendicular()
C++ | void SetPerpendicular(boolean)
Controls snapping perpendicular to objects.
Intersection
Visual Basic | boolean Intersection
C++ | boolean GetIntersection()
C++ | void SetIntersection(boolean)
Controls snapping to the intersection point of objects.
void Dialog()
Display the Object tab of the Snap/Grid Settings dialog.


IGridSnap Interface

IGridSnap

Controls the grid and grid snap settings for a viewport.
properties:
IVdraft | Application | (read-only)
IView | Parent | (read-only)
boolean | Snap | (default)
boolean | Display
boolean | Isometric
IVector SnapSpacing
IVector DisplaySpacing
IVector Origin
double | IsometricSpacing
methods:
void | Update() (VB alternate: UpdateNow)
void | Dialog()
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IView Parent (read-only)
C++ | IView GetParent()
Returns the owner of this object.
Snap
Visual Basic | boolean Snap (default)
C++ | boolean GetSnap()
C++ | void SetSnap(boolean)
If the cursor snaps to the grid.
Display
Visual Basic | boolean Display
C++ | boolean GetDisplay()
C++ | void SetDisplay(boolean)
If the grid is displayed.
Isometric
Visual Basic | boolean Isometric
C++ | boolean GetIsometric()
C++ | void SetIsometric(boolean)
If isometric grid snap is on.
SnapSpacing
Visual Basic | IVector SnapSpacing
C++ | IVector GetSnapSpacing()
C++ | void SetSnapSpacing(IVector)
Controls the distance between grid snap points.
DisplaySpacing
Visual Basic | IVector DisplaySpacing
C++ | IVector GetDisplaySpacing()
C++ | void SetDisplaySpacing(IVector)
Controls the distance between the grid points that are displayed.
Origin
Visual Basic | IVector Origin
C++ | IVector GetOrigin()
C++ | void SetOrigin(IVector)
Controls the origin point for the grid, for display and snap purposes.
IsometricSpacing
Visual Basic | double IsometricSpacing
C++ | double GetIsometricSpacing()
C++ | void SetIsometricSpacing(double)
Controls the spacing for isometric snap.
void Update() (VB alternate: UpdateNow)
Bundle up all the grid/snap changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
void Dialog()
Display the Snap/Grid Settings dialog


IHeader Interface

IHeader

The drawing header which contains miscellaneous drawing settings. These are equivalent to many of the drawing variables in AutoCAD. Some other drawing settings and AutoCAD variables can be found in other interfaces such as IAngleSnap , IBlocks , IColors , IDimStyles , IEntitySnap , IGridSnap , ILayers , ILinetypes , INamedViews , ITextStyles , IUcses , IUnits , and IViews .
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
boolean | AttributeDialog
long | AttributeMode
boolean | AttributeRequest
boolean | AxisMode
IVector AxisUnit
boolean | BlipMode
double | ChamferDistanceA | --ADDED FOR 1.5--
double | ChamferDistanceB | --ADDED FOR 1.5--
long | CirclePrecision
long | CoordinateDisplay
double | CurrentElevation
double | CurrentThickness
long | DragMode
long | DrawingCodePage
boolean | FastZoom
double | FilletRadius | --ADDED FOR 1.5--
boolean | FillMode
boolean | FlatLand
boolean | Handles | --WRITE ACCESS ADDED FOR 1.5--
BSTR | HandleSeed | --WRITE ACCESS ADDED FOR 1.5--
boolean | LengthSnap | --ADDED FOR 1.5--
double | LengthSnapValue | --ADDED FOR 1.5--
IVector LimitsMax
IVector LimitsMin
boolean | LimitsCheck
long | MaxActiveViewports
BSTR MenuName
boolean | MirrorText
double | PaperSpaceElevation
IVector PaperSpaceLimitsMax
IVector PaperSpaceLimitsMin
boolean | PaperSpaceLimitsCheck
short | PointDisplayMode | --ADDED FOR 1.5--
double | PointDisplaySize | --ADDED FOR 1.5--
long | PolylineLinetypePattern
double | PolylineWidth
long | QuickText
long | RegenMode
long | ShadeDiffuse
long | ShadeEdge
double | SketchIncrement
boolean | SketchPolyline
long | SplineFrame
long | SplineSegments
long | SplineType
long | SurfaceDensityM
long | SurfaceDensityN
long | SurfaceTabulations1
long | SurfaceTabulations2
long | SurfaceType
double | TextSize
double | TraceSize
long | TreeDepth
long | UCSIcon
long | UnitMode
long | UserInteger1
long | UserInteger2
long | UserInteger3
long | UserInteger4
long | UserInteger5
long | UserReal1
long | UserReal2
long | UserReal3
long | UserReal4
long | UserReal5
boolean | UserTimer
boolean | WorldView
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
AttributeDialog
Visual Basic | boolean AttributeDialog
C++ | boolean GetAttributeDialog()
C++ | void SetAttributeDialog(boolean)
AttributeMode
Visual Basic | long AttributeMode
C++ | long GetAttributeMode()
C++ | void SetAttributeMode(long)
AttributeRequest
Visual Basic | boolean AttributeRequest
C++ | boolean GetAttributeRequest()
C++ | void SetAttributeRequest(boolean)
AxisMode
Visual Basic | boolean AxisMode
C++ | boolean GetAxisMode()
C++ | void SetAxisMode(boolean)
AxisUnit
Visual Basic | IVector AxisUnit
C++ | IVector GetAxisUnit()
C++ | void SetAxisUnit(IVector)
BlipMode
Visual Basic | boolean BlipMode
C++ | boolean GetBlipMode()
C++ | void SetBlipMode(boolean)
ChamferDistanceA
Visual Basic | double ChamferDistanceA --ADDED FOR 1.5--
C++ | double GetChamferDistanceA()
C++ | void SetChamferDistanceA(double)
ChamferDistanceB
Visual Basic | double ChamferDistanceB --ADDED FOR 1.5--
C++ | double GetChamferDistanceB()
C++ | void SetChamferDistanceB(double)
CirclePrecision
Visual Basic | long CirclePrecision
C++ | long GetCirclePrecision()
C++ | void SetCirclePrecision(long)
CoordinateDisplay
Visual Basic | long CoordinateDisplay
C++ | long GetCoordinateDisplay()
C++ | void SetCoordinateDisplay(long)
CurrentElevation
Visual Basic | double CurrentElevation
C++ | double GetCurrentElevation()
C++ | void SetCurrentElevation(double)
CurrentThickness
Visual Basic | double CurrentThickness
C++ | double GetCurrentThickness()
C++ | void SetCurrentThickness(double)
DragMode
Visual Basic | long DragMode
C++ | long GetDragMode()
C++ | void SetDragMode(long)
DrawingCodePage
Visual Basic | long DrawingCodePage
C++ | long GetDrawingCodePage()
C++ | void SetDrawingCodePage(long)
FastZoom
Visual Basic | boolean FastZoom
C++ | boolean GetFastZoom()
C++ | void SetFastZoom(boolean)
FilletRadius
Visual Basic | double FilletRadius --ADDED FOR 1.5--
C++ | double GetFilletRadius()
C++ | void SetFilletRadius(double)
FillMode
Visual Basic | boolean FillMode
C++ | boolean GetFillMode()
C++ | void SetFillMode(boolean)
FlatLand
Visual Basic | boolean FlatLand
C++ | boolean GetFlatLand()
C++ | void SetFlatLand(boolean)
Handles
Visual Basic | boolean Handles --WRITE ACCESS ADDED FOR 1.5--
C++ | boolean GetHandles()
C++ | void SetHandles(boolean)
HandleSeed
Visual Basic | BSTR HandleSeed --WRITE ACCESS ADDED FOR 1.5--
C++ | BSTR GetHandleSeed()
C++ | void SetHandleSeed(BSTR)
LengthSnap
Visual Basic | boolean LengthSnap --ADDED FOR 1.5--
C++ | boolean GetLengthSnap()
C++ | void SetLengthSnap(boolean)
LengthSnapValue
Visual Basic | double LengthSnapValue --ADDED FOR 1.5--
C++ | double GetLengthSnapValue()
C++ | void SetLengthSnapValue(double)
LimitsMax
Visual Basic | IVector LimitsMax
C++ | IVector GetLimitsMax()
C++ | void SetLimitsMax(IVector)
LimitsMin
Visual Basic | IVector LimitsMin
C++ | IVector GetLimitsMin()
C++ | void SetLimitsMin(IVector)
LimitsCheck
Visual Basic | boolean LimitsCheck
C++ | boolean GetLimitsCheck()
C++ | void SetLimitsCheck(boolean)
MaxActiveViewports
Visual Basic | long MaxActiveViewports
C++ | long GetMaxActiveViewports()
C++ | void SetMaxActiveViewports(long)
MenuName
Visual Basic | BSTR MenuName
C++ | BSTR GetMenuName()
C++ | void SetMenuName(BSTR)
MirrorText
Visual Basic | boolean MirrorText
C++ | boolean GetMirrorText()
C++ | void SetMirrorText(boolean)
PaperSpaceElevation
Visual Basic | double PaperSpaceElevation
C++ | double GetPaperSpaceElevation()
C++ | void SetPaperSpaceElevation(double)
PaperSpaceLimitsMax
Visual Basic | IVector PaperSpaceLimitsMax
C++ | IVector GetPaperSpaceLimitsMax()
C++ | void SetPaperSpaceLimitsMax(IVector)
PaperSpaceLimitsMin
Visual Basic | IVector PaperSpaceLimitsMin
C++ | IVector GetPaperSpaceLimitsMin()
C++ | void SetPaperSpaceLimitsMin(IVector)
PaperSpaceLimitsCheck
Visual Basic | boolean PaperSpaceLimitsCheck
C++ | boolean GetPaperSpaceLimitsCheck()
C++ | void SetPaperSpaceLimitsCheck(boolean)
PointDisplayMode
Visual Basic | short PointDisplayMode --ADDED FOR 1.5--
C++ | short GetPointDisplayMode()
C++ | void SetPointDisplayMode(short)
PointDisplaySize
Visual Basic | double PointDisplaySize --ADDED FOR 1.5--
C++ | double GetPointDisplaySize()
C++ | void SetPointDisplaySize(double)
PolylineLinetypePattern
Visual Basic | long PolylineLinetypePattern
C++ | long GetPolylineLinetypePattern()
C++ | void SetPolylineLinetypePattern(long)
PolylineWidth
Visual Basic | double PolylineWidth
C++ | double GetPolylineWidth()
C++ | void SetPolylineWidth(double)
QuickText
Visual Basic | long QuickText
C++ | long GetQuickText()
C++ | void SetQuickText(long)
RegenMode
Visual Basic | long RegenMode
C++ | long GetRegenMode()
C++ | void SetRegenMode(long)
ShadeDiffuse
Visual Basic | long ShadeDiffuse
C++ | long GetShadeDiffuse()
C++ | void SetShadeDiffuse(long)
ShadeEdge
Visual Basic | long ShadeEdge
C++ | long GetShadeEdge()
C++ | void SetShadeEdge(long)
SketchIncrement
Visual Basic | double SketchIncrement
C++ | double GetSketchIncrement()
C++ | void SetSketchIncrement(double)
SketchPolyline
Visual Basic | boolean SketchPolyline
C++ | boolean GetSketchPolyline()
C++ | void SetSketchPolyline(boolean)
SplineFrame
Visual Basic | long SplineFrame
C++ | long GetSplineFrame()
C++ | void SetSplineFrame(long)
SplineSegments
Visual Basic | long SplineSegments
C++ | long GetSplineSegments()
C++ | void SetSplineSegments(long)
SplineType
Visual Basic | long SplineType
C++ | long GetSplineType()
C++ | void SetSplineType(long)
SurfaceDensityM
Visual Basic | long SurfaceDensityM
C++ | long GetSurfaceDensityM()
C++ | void SetSurfaceDensityM(long)
SurfaceDensityN
Visual Basic | long SurfaceDensityN
C++ | long GetSurfaceDensityN()
C++ | void SetSurfaceDensityN(long)
SurfaceTabulations1
Visual Basic | long SurfaceTabulations1
C++ | long GetSurfaceTabulations1()
C++ | void SetSurfaceTabulations1(long)
SurfaceTabulations2
Visual Basic | long SurfaceTabulations2
C++ | long GetSurfaceTabulations2()
C++ | void SetSurfaceTabulations2(long)
SurfaceType
Visual Basic | long SurfaceType
C++ | long GetSurfaceType()
C++ | void SetSurfaceType(long)
TextSize
Visual Basic | double TextSize
C++ | double GetTextSize()
C++ | void SetTextSize(double)
TraceSize
Visual Basic | double TraceSize
C++ | double GetTraceSize()
C++ | void SetTraceSize(double)
TreeDepth
Visual Basic | long TreeDepth
C++ | long GetTreeDepth()
C++ | void SetTreeDepth(long)
UCSIcon
Visual Basic | long UCSIcon
C++ | long GetUCSIcon()
C++ | void SetUCSIcon(long)
UnitMode
Visual Basic | long UnitMode
C++ | long GetUnitMode()
C++ | void SetUnitMode(long)
UserInteger1
Visual Basic | long UserInteger1
C++ | long GetUserInteger1()
C++ | void SetUserInteger1(long)
UserInteger2
Visual Basic | long UserInteger2
C++ | long GetUserInteger2()
C++ | void SetUserInteger2(long)
UserInteger3
Visual Basic | long UserInteger3
C++ | long GetUserInteger3()
C++ | void SetUserInteger3(long)
UserInteger4
Visual Basic | long UserInteger4
C++ | long GetUserInteger4()
C++ | void SetUserInteger4(long)
UserInteger5
Visual Basic | long UserInteger5
C++ | long GetUserInteger5()
C++ | void SetUserInteger5(long)
UserReal1
Visual Basic | long UserReal1
C++ | long GetUserReal1()
C++ | void SetUserReal1(long)
UserReal2
Visual Basic | long UserReal2
C++ | long GetUserReal2()
C++ | void SetUserReal2(long)
UserReal3
Visual Basic | long UserReal3
C++ | long GetUserReal3()
C++ | void SetUserReal3(long)
UserReal4
Visual Basic | long UserReal4
C++ | long GetUserReal4()
C++ | void SetUserReal4(long)
UserReal5
Visual Basic | long UserReal5
C++ | long GetUserReal5()
C++ | void SetUserReal5(long)
UserTimer
Visual Basic | boolean UserTimer
C++ | boolean GetUserTimer()
C++ | void SetUserTimer(boolean)
WorldView
Visual Basic | boolean WorldView
C++ | boolean GetWorldView()
C++ | void SetWorldView(boolean)


IMatrix Interface

IMatrix

This represents a 4x4 matrix useful for transformations. It can handle translation, rotation, scaling, and mirroring. It also handles using entity normals and the arbitrary axis algorithm to transform between the World Coordinate System (WCS) and Entity Coordinate System (ECS).
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
double | Item(short column, short row) | (default)
methods:
void | Id()
void | CopyFrom (IVector matrix)
void | ECStoWCS (IVector normal)
void | WCStoECS (IVector normal)
void | Translation (IVector offset)
void | Rotation (double angle, [IVector basepoint], [IVector normal])
void | Scaling (IVector factors, [IVector basepoint], [IVector normal])
void | Mirror (IVector one, IVector two, [IVector normal])
void | Transform (IVector point)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object.
Item
Visual Basic | double Item(short column, short row) (default)
C++ | double GetItem()
C++ | void SetItem(short column, short row, double)
The entry in column column row row.
void Id()
Set the matrix to the identity matrix.
void CopyFrom (IVector matrix)
Copy the values from matrix into this matrix.
void ECStoWCS (IVector normal)
Set up the matrix using the normal normal so that vectors transformed by it are converting from the entity coordinate system to world coordinate system.
void WCStoECS (IVector normal)
Set up the matrix using the normal normal so that vectors transformed by it are converting from the world coordinate system to entity coordinate system.
void Translation (IVector offset)
Add a translation of offset into the matrix.
void Rotation (double angle, [IVector basepoint], [IVector normal])
Add a rotation of angle around basepoint (defaults to 0,0,0) in the plane whose normal is normal (defaults to 0,0,1 which is a 2D plan view).
void Scaling (IVector factors, [IVector basepoint], [IVector normal])
Add a scaling transformation of factors from basepoint (defaults to 0,0,0) in the plane whose normal is normal (defaults to 0,0,1 which is a 2D plan view).
void Mirror (IVector one, IVector two, [IVector normal])
Add a mirror transformation across the line described by one and two in the plane whose normal is normal (defaults to 0,0,1 which is a 2D plan view).
void Transform (IVector point)
Transform the given vector using the current transformation.


IUnits Interface

IUnits

Access to the unit settings used for displaying values in Vdraft. This is equivalent to the Unit Settings dialog. Also parses and generates strings containing units. Can be used to provide a consistent way of entering numbers for Vdraft add-ons.

Visual Basic Code Sample

    ' assume doc already points to an IDocument object
    Dim units as Object
    Dim vec as Object
    Set units = doc.Units
    ' parse the given string for feet, inches, fractions, etc.
    Set vec = units.StringToPoint ("1' 3 1/2, 4.321'")
    ' convert the vector to a string using the current units (feet, metric, etc.)
    MyString$ = units.PointToString (vec);

C++ Code Sample

    // assume doc already points to an IDocument object
    IUnits units( doc.GetUnits() );
    CString string("1' 3 1/2\", 4.321'");	// 1' 3 1/2", 4.321'
    // parse the given string for feet, inches, fractions, etc.
    IVector vec( units.StringToPoint(string) );
    // convert the vector to a string using the current units (feet, metric, etc.)
    CString newstring( units.PointToString(vec) );
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
veLinearUnits Linear
short | LinearDigits
veAngularUnits Angular
short | AngularDigits
double | AngleBase
boolean | Clockwise
veScaleOptions | ScaleMethod | (read-only) --ADDED FOR 1.5--
double | Scaling | --ADDED FOR 1.5--
veMetricDistance | Units | --ADDED FOR 1.5--
veMetricDistance | DisplayUnits | --ADDED FOR 1.5--
methods:
BSTR | PointToString (IVector point)
BSTR | CoordinateToString(double value)
BSTR | AngleToString(double angle)
IVector | StringToPoint (BSTR string)
double | StringToCoordinate (BSTR string)
double | StringToAngle (BSTR string)
void | Dialog() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Linear
Visual Basic | veLinearUnits Linear
C++ | veLinearUnits GetLinear()
C++ | void SetLinear(veLinearUnits)
Controls the units for displaying linear coordinates. Metric units are controlled by Units and DisplayUnits.
LinearDigits
Visual Basic | short LinearDigits
C++ | short GetLinearDigits()
C++ | void SetLinearDigits(short)
Controls the number of digits after the decimal point for displaying linear coordinates.
Angular
Visual Basic | veAngularUnits Angular
C++ | veAngularUnits GetAngular()
C++ | void SetAngular(veAngularUnits)
Controls the units for displaying angles.
AngularDigits
Visual Basic | short AngularDigits
C++ | short GetAngularDigits()
C++ | void SetAngularDigits(short)
Controls the number of digits after the decimal point for displaying angles.
AngleBase
Visual Basic | double AngleBase
C++ | double GetAngleBase()
C++ | void SetAngleBase(double)
Controls the base angle for displaying angles. This angle is specified counterclockwise relative to the positive x-axis.
Clockwise
Visual Basic | boolean Clockwise
C++ | boolean GetClockwise()
C++ | void SetClockwise(boolean)
Controls the direction used for displaying angles.
ScaleMethod
Visual Basic | veScaleOptions ScaleMethod (read-only) --ADDED FOR 1.5--
C++ | veScaleOptions GetScaleMethod()
Can be used to scale the internal units for display purposes. Useful for converting between arbitrary systems of measurements.
Scaling
Visual Basic | double Scaling --ADDED FOR 1.5--
C++ | double GetScaling()
C++ | void SetScaling(double)
Can be used to scale the internal units for display purposes.
Units
Visual Basic | veMetricDistance Units --ADDED FOR 1.5--
C++ | veMetricDistance GetUnits()
C++ | void SetUnits(veMetricDistance)
Controls having internal drawing units represent common metric distances.
DisplayUnits
Visual Basic | veMetricDistance DisplayUnits --ADDED FOR 1.5--
C++ | veMetricDistance GetDisplayUnits()
C++ | void SetDisplayUnits(veMetricDistance)
Controls displaying linear units as common metric distances. The internal drawing unit is considered to be an inch.
BSTR PointToString (IVector point)
Convert a point to a string using the current unit settings.
BSTR CoordinateToString(double value)
Convert a coordinate to a string using the current unit settings.
BSTR AngleToString(double angle)
Convert an angle to a string using the current unit settings.
IVector StringToPoint (BSTR string)
Convert a string to a point. Supports feet, inches, fractions, etc.
double StringToCoordinate (BSTR string)
Convert a string to a coordinate. Supports feet, inches, fractions, etc.
double StringToAngle (BSTR string)
Convert a string to an angle. Supports degrees, minutes, seconds, radians, gradians, and surveyor style angles.
void Dialog() --ADDED FOR 1.5--
Display the Unit Settings dialog.


IVector Interface

IVector

This is an object which contains point or vector information. It is used as a parameter or return value throughout the API. You can create a new one using IVdraft::NewVector. This can be useful if you wish to use the IVector math routines.

When an IVector object is returned from an entity, you have a connection to the information in the object. For example, if you retrieve the endpoint of a line, modifying the vector object actually changes the line.

Visual Basic Code Sample

    ' assume MyLine already holds an ILine object
    Dim EndPoint1 as Object
    Set EndPoint1 = MyLine.StartPoint
    EndPoint1.Set 1,2,3	' modify the endpoint of the line
    ' shorter way to modify line
    MyLine.StartPoint.Set 1,2,3

C++ Code Sample

    // assume MyLine already holds an ILine object
    IVector EndPoint1( MyLine.GetStartPoint() );
    EndPoint1.Set(1,2,cVariant(3));	// modify the endpoint of the line
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
double | x
double | y
double | z
double | Length | (read-only)
double | LengthSquared | (read-only)
double | Angle | (read-only) --ADDED FOR 1.5--
methods:
void | CopyFrom (IVector vector)
void | AddIn (IVector vector)
void | SubtractAway (IVector vector)
void | MultiplyBy (IVector vector)
void | DivideBy (IVector vector)
void | ScaleBy(double factor)
double | Distance (IVector vector)
boolean | Normalize()
double | DotProduct (IVector vector)
IVector | CrossProduct (IVector vector)
void | Set(double x,double y [,double z])
void | Set2D(double x,double y)
void | Set3D(double x,double y,double z)
void | Detach()
BSTR | Dump() (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. This is the interface the vector was obtained from, perhaps an entity or IVdraft if NewVector was used.
x
Visual Basic | double x
C++ | double Getx()
C++ | void Setx(double)
The x component of the vector.
y
Visual Basic | double y
C++ | double Gety()
C++ | void Sety(double)
The y component of the vector.
z
Visual Basic | double z
C++ | double Getz()
C++ | void Setz(double)
The z component of the vector.
Length
Visual Basic | double Length (read-only)
C++ | double GetLength()
The length of the vector.
LengthSquared
Visual Basic | double LengthSquared (read-only)
C++ | double GetLengthSquared()
The square of the length of the vector. Provided for optimization purposes (avoids square root.)
Angle
Visual Basic | double Angle (read-only) --ADDED FOR 1.5--
C++ | double GetAngle()
The angle this vector makes with the x-axis.
void CopyFrom (IVector vector)

Copy the values from vector into this vector.

this.x = vector.x
this.y = vector.y
this.z = vector.z
void AddIn (IVector vector)

Add the values from vector into this vector.

this.x = this.x + vector.x
this.y = this.y + vector.y
this.z = this.z + vector.z
void SubtractAway (IVector vector)

Subtract the values in vector from this vector.

this.x = this.x - vector.x
this.y = this.y - vector.y
this.z = this.z - vector.z
void MultiplyBy (IVector vector)

Multiply this vector by the values in vector.

this.x = this.x * vector.x
this.y = this.y * vector.y
this.z = this.z * vector.z
void DivideBy (IVector vector)

Divide this vector by the values in vector.

this.x = this.x / vector.x
this.y = this.y / vector.y
this.z = this.z / vector.z
void ScaleBy(double factor)

Scale this vector by factor.

this.x = this.x * factor
this.y = this.y * factor
this.z = this.z * factor
double Distance (IVector vector)
Return the distance from this vector to vector.
boolean Normalize()
Normalize this vector. That is, maintain the same direction but scale it so the length is 1.
double DotProduct (IVector vector)
Return the dot product between this vector and vector.
IVector CrossProduct (IVector vector)
Return the cross product between this vector and vector.
void Set(double x,double y [,double z])
Change the values in this vector. If the z value is not specified, it defaults to 0.
void Set2D(double x,double y)
Change the values in this vector using a z value of 0. Can be used in C++ to avoid the use of a VARIANT.
void Set3D(double x,double y,double z)
Change the values in this vector. Can be used in C++ to avoid the use of a VARIANT.
void Detach()
Detach this vector from its parent object. When you get a vector from an object (e.g. ILine::StartPoint), the object is automatically modified when the vector changes. Call Detach if you wish to sever this tie.
BSTR Dump() (default)
Returns a string representing the values in the vector.


IVectors Interface

IVectors

A collection of IVector objects. It is returned, for example, by IEntity::Intersection which returns all the intersections between two entities.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
long | Count | (read-only)
IVector | Item(long which) | (default)
methods:
void Add (IVector vec)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of vectors in the collection.
Item
Visual Basic | IVector Item(long which) (default)
C++ | IVector GetItem()
C++ | void SetItem(long which, IVector)
Returns vector number which out of the collection.
void Add (IVector vec)
Adds another vector to the collection.


IEntitySet Interface

IEntitySet

An arbitrary collection of entities. Includes properties and methods from bGeneralEntity and bEntities .
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
methods:
void | Add (IEntity entity)
void | Remove (IEntity entity)
void | RemoveAll()
void | AddAll() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object.
void Add (IEntity entity)
Add the entity to the list.
void Remove (IEntity entity)
Remove the entity from the list.
void RemoveAll()
Remove all the entities from the list.
void AddAll() --ADDED FOR 1.5--
Add all entities in the drawing to the list.


IEntities Interface

IEntities

The collection of all entities in the drawing. Includes properties and methods from bGeneralEntity and bEntities .
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
methods:
ILine AddLine()
ICircle AddCircle()
IArc AddArc()
IFace AddFace()
IText AddText()
IPoint AddPoint()
IShape AddShape()
ITrace AddTrace()
ISolid AddSolid()
I2DPolyline | AddLwPolyline(short vertices) --ADDED FOR 2.0--
I2DPolyline | AddPolyline(short vertices)
I3DPolyline | Add3DPolyline(short vertices)
IPolymesh | AddPolymesh(short rows, short columns)
IPolyface | AddPolyface(short vertices, short faces)
IAttdef AddAttdef()
IDimension AddDimension()
IInsert | AddInsert (BSTR blockname)
IEllipse | AddEllipse() --ADDED FOR 2.0--
ILeader | AddLeader() --ADDED FOR 2.0--
IMline | AddMline() --ADDED FOR 2.0--
IMtext | AddMtext() --ADDED FOR 2.0--
IRay | AddRay() --ADDED FOR 2.0--
ISpline | AddSpline() --ADDED FOR 2.0--
ITolerance | AddTolerance() --ADDED FOR 2.0--
IXline | AddXline() --ADDED FOR 2.0--
IImage | AddImage (BSTR imagefile) --ADDED FOR 2.0--
void | DrawLines()
void | DrawLine()
void | DrawDoubleLines()
void | DrawDoubleLine()
void | DrawLwPolyline() --ADDED FOR 2.0--
void | Draw2DPolyline()
void | Draw3DPolyline()
void | DrawCircle()
void | Draw2PointCircle()
void | Draw3PointCircle()
void | Draw3PointArcs()
void | Draw3PointArc()
void | DrawCenterStartEndArc()
void | DrawStartCenterEndArc()
void | DrawStartEndCenterArc()
void | DrawStartDirectionEndArc()
void | DrawFace()
void | DrawPoint()
void | DrawSolid()
void | DrawTrace()
void | DrawText()
void | DrawAttdef()
void | DrawInsert ([VARIANT which])
void | Draw2DSpline()
void | Draw3DSpline()
void | Draw2DQuadraticSpline()
void | Draw3DQuadraticSpline()
void | Draw2DCubicSpline()
void | Draw3DCubicSpline()
void | Draw2PointRectangle()
void | Draw3PointRectangle()
void | DrawCenterVertexPolygon()
void | DrawCenterMidpointPolygon()
void | DrawEdgePolygon()
void | DrawDonut()
void | DrawHorizontalDim ([VARIANT what])
void | DrawVerticalDim ([VARIANT what])
void | DrawAlignedDim ([VARIANT what])
void | DrawRotatedDim ([VARIANT what])
void | DrawAngularDim ([VARIANT what])
void | Draw4PointAngularDim ([VARIANT what])
void | DrawRadiusDim ([VARIANT what])
void | DrawDiameterDim ([VARIANT what])
void | DrawOrdinateXDim ([VARIANT what])
void | DrawOrdinateYDim ([VARIANT what])
void | DrawBaselineDim ([VARIANT what])
void | DrawContinuousDim ([VARIANT what])
void | DrawLeader()
void | DrawViewport()
void | DrawRay() --ADDED FOR 2.0--
void | DrawXline() --ADDED FOR 2.0--
void | DrawEllipseAxes() --ADDED FOR 2.0--
void | DrawEllipseCenter() --ADDED FOR 2.0--
void | DrawEllipseArc() --ADDED FOR 2.0--
void | DrawEllipseArcCenter() --ADDED FOR 2.0--
void | DrawImage ([VARIANT imagefile]) --ADDED FOR 2.0--
void | DrawHatch() --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
ILine AddLine()
Create a new line entity.
ICircle AddCircle()
Create a new circle entity.
IArc AddArc()
Create a new arc entity.
IFace AddFace()
Create a new face entity.
IText AddText()
Create a new text entity.
IPoint AddPoint()
Create a new point entity.
IShape AddShape()
Create a new shape entity.
ITrace AddTrace()
Create a new trace entity.
ISolid AddSolid()
Create a new solid entity.
I2DPolyline AddLwPolyline(short vertices) --ADDED FOR 2.0--
Create a new lightweight 2D polyline entity.
I2DPolyline AddPolyline(short vertices)
Create a new 2D polyline entity with the specified number of vertices. In general, you should use AddLwPolyline instead.
I3DPolyline Add3DPolyline(short vertices)
Create a new 3D polyline entity with the specified number of vertices.
IPolymesh AddPolymesh(short rows, short columns)
Create a new polymesh entity with the specified number of rows and columns.
IPolyface AddPolyface(short vertices, short faces)
Create a new polyface entity with the specified number of vertices and faces.
IAttdef AddAttdef()
Create a new attribute definition entity.
IDimension AddDimension()
Create a new dimension entity.
IInsert AddInsert (BSTR blockname)
Create a new insert entity using the specified block.
IEllipse AddEllipse() --ADDED FOR 2.0--
Create a new ellipse entity.
ILeader AddLeader() --ADDED FOR 2.0--
Create a new leader entity.
IMline AddMline() --ADDED FOR 2.0--
Create a new multi-line entity.
IMtext AddMtext() --ADDED FOR 2.0--
Create a new paragraph text entity.
IRay AddRay() --ADDED FOR 2.0--
Create a new ray entity.
ISpline AddSpline() --ADDED FOR 2.0--
Create a new spline entity.
ITolerance AddTolerance() --ADDED FOR 2.0--
Create a new tolerance entity.
IXline AddXline() --ADDED FOR 2.0--
Create a new construction line entity.
IImage AddImage (BSTR imagefile) --ADDED FOR 2.0--
Create a new image entity using the specified bitmap file.
void DrawLines()
Start the user drawing a series of lines. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawLine()
Start the user drawing a single line. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawDoubleLines()
Start the user drawing a series of double lines (polylines.) If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawDoubleLine()
Start the user drawing a single double line. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawLwPolyline() --ADDED FOR 2.0--
Start the user drawing a lightweight 2D polyline. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw2DPolyline()
Start the user drawing a 2D polyline. In general, you should use DrawLwPolyline instead. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3DPolyline()
Start the user drawing a 3D polyline. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawCircle()
Start the user drawing a center/radius circle. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw2PointCircle()
Start the user drawing a 2 point circle. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3PointCircle()
Start the user drawing a 3 point circle. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3PointArcs()
Start the user drawing a series of 3 point arcs. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3PointArc()
Start the user drawing a single 3 point arc. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawCenterStartEndArc()
Start the user drawing a center/start/end arc. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawStartCenterEndArc()
Start the user drawing a start/center/end arc. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawStartEndCenterArc()
Start the user drawing a start/end/center arc. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawStartDirectionEndArc()
Start the user drawing a start/direction/end arc. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawFace()
Start the user drawing a 3D face. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawPoint()
Start the user drawing a point. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawSolid()
Start the user drawing a 2D solid. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawTrace()
Start the user drawing a trace. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawText()
Start the user drawing text. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawAttdef()
Start the user drawing an attribute definition. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawInsert ([VARIANT which])
Start the user drawing an insert. If which is not specified, this displays the Block/Xref Manager dialog. If which is specified, it inserts the named block. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw2DSpline()
Start the user drawing a 2D spline. It draws a cubic or quadratic spline based on the IHeader::SplineType setting. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3DSpline()
void Draw2DQuadraticSpline()
Start the user drawing a 2D quadratic spline. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3DQuadraticSpline()
void Draw2DCubicSpline()
Start the user drawing a 2D cubic spline. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3DCubicSpline()
void Draw2PointRectangle()
Start the user drawing a 2 point rectangle. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw3PointRectangle()
Start the user drawing a 3 point rectangle. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawCenterVertexPolygon()
Start the user drawing a center/vertex polygon. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawCenterMidpointPolygon()
Start the user drawing a center/midpoint polygon. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawEdgePolygon()
Start the user drawing a polygon by specifying two edges. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawDonut()
Start the user drawing a donut. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawHorizontalDim ([VARIANT what])

Start the user drawing a horizontal dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawVerticalDim ([VARIANT what])

Start the user drawing a vertical dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawAlignedDim ([VARIANT what])

Start the user drawing an aligned dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawRotatedDim ([VARIANT what])

Start the user drawing a rotated dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawAngularDim ([VARIANT what])

Start the user drawing an angular dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void Draw4PointAngularDim ([VARIANT what])

Start the user drawing an angular 4 point dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawRadiusDim ([VARIANT what])

Start the user drawing a radius dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawDiameterDim ([VARIANT what])

Start the user drawing a diameter dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawOrdinateXDim ([VARIANT what])

Start the user drawing an x ordinate dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawOrdinateYDim ([VARIANT what])

Start the user drawing a y ordinate dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawBaselineDim ([VARIANT what])

Start the user drawing a baseline dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawContinuousDim ([VARIANT what])

Start the user drawing a continuous dimension.

If what is not specified, this is the same as choosing the option from the menu or toolbar. If an entity is selected, it will be dimensioned then the user prompted for the final pick. If no entity is selected, the user is prompted for all point picks.
If what is FALSE, the user is prompted for all point picks.
If what is an IEntity , the entity will be dimensioned then the user prompted for the final pick.
If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawLeader()
Start the user drawing a leader. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawViewport()
Start the user drawing a paperspace viewport. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawRay() --ADDED FOR 2.0--
Start the user drawing a ray. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawXline() --ADDED FOR 2.0--
Start the user drawing a construction line. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawEllipseAxes() --ADDED FOR 2.0--
Start the user drawing an ellipse by specifying the axes first. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawEllipseCenter() --ADDED FOR 2.0--
Start the user drawing a ellipse by specifying the center first. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawEllipseArc() --ADDED FOR 2.0--
Start the user drawing a elliptical arc by specifying the axes first. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawEllipseArcCenter() --ADDED FOR 2.0--
Start the user drawing a elliptical arc by specifying the center first. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawImage ([VARIANT imagefile]) --ADDED FOR 2.0--
Start the user drawing a bitmap image. If nothing is passed for an image file, the user will be prompted to choose a bitmap. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.
void DrawHatch() --ADDED FOR 2.0--
Start the user drawing a hatch. If you wish to retrieve the result or interact with the user, see IPickEvents for more information.


ISelection Interface

ISelection

The collection of all selected entities in the drawing. Includes properties and methods from bGeneralEntity and bEntities .
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
methods:
void | Add (IEntity entity)
void | Remove (IEntity entity)
void | RemoveAll()
void | AddAll() --ADDED FOR 1.5--
void | AddPrevious() --ADDED FOR 1.5--
void | CrossingWindow (IVector corner1, IVector corner2) --ADDED FOR 1.5--
void | ContainingWindow (IVector corner1, IVector corner2) --ADDED FOR 1.5--
void | PickSingle (IVector point) --ADDED FOR 1.5--
void | CopyToClipboard ([IVector basepoint]) --ADDED FOR 1.5--
void | CutToClipboard ([IVector basepoint]) --ADDED FOR 1.5--
void | WindowToClipboard() --ADDED FOR 1.5--
void | TextToClipboard() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
void Add (IEntity entity)
Select the entity.
void Remove (IEntity entity)
Deselect the entity.
void RemoveAll()
Deselect all entities.
void AddAll() --ADDED FOR 1.5--
Select all entities in the drawing.
void AddPrevious() --ADDED FOR 1.5--
Add the previous selection set to the current selection set.
void CrossingWindow (IVector corner1, IVector corner2) --ADDED FOR 1.5--
Select all the entities even partly contained in the given window.
void ContainingWindow (IVector corner1, IVector corner2) --ADDED FOR 1.5--
Select all the entities completely contained in the given window.
void PickSingle (IVector point) --ADDED FOR 1.5--
Select the entity close to the given point.
void CopyToClipboard ([IVector basepoint]) --ADDED FOR 1.5--
Copy the currently selected entities to the clipboard. When pasted back in, the specified basepoint is used as the basepoint for inserting. basepoint defaults to the origin.
void CutToClipboard ([IVector basepoint]) --ADDED FOR 1.5--
Cut the currently selected entities to the clipboard. This places the entities on the clipboard and removes them from the drawing. When pasted back in, the specified basepoint is used as the basepoint for inserting. basepoint defaults to the origin.
void WindowToClipboard() --ADDED FOR 1.5--
Copies the drawing window as a metafile and bitmap to the clipboard.
void TextToClipboard() --ADDED FOR 1.5--
Extracts the text from the selected text and attributes and places them on the clipboard. This text could then be pasted into Vdraft, a word processor, etc.


IEntity Interface

IEntity

Includes properties and methods from bGeneralEntity .
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (read-only) (default)
veEntityType | Type | (read-only)
BSTR | Handle | (read-only)
boolean | HasXData | (read-only)
IXData | XData | (read-only)
boolean | AutoDraw
methods:
IVector | Snap2Endpoint (IVector closeto)
IVector | Snap2Midpoint (IVector closeto)
IVector | Snap2Center (IVector closeto)
IVector | Snap2Nearest (IVector closeto)
IVector | Snap2Point (IVector closeto)
IVector | Snap2Quadrant (IVector closeto)
IVector | Snap2Insertion (IVector closeto)
IVector | Snap2Perpendicular (IVector closeto, IVector prevpoint)
IVectors | Intersection (IEntity entity, [boolean infinite1], [boolean infinite2])
boolean | ExtendToSet (IVector point)
boolean | TrimToSet (IVector point)
boolean | Break (IVector point1, IVector point2)
void | Update() (VB alternate: UpdateNow)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name (read-only) (default)
C++ | BSTR GetName()
Returns the name of the entity such as "Line" or "Circle".
Type
Visual Basic | veEntityType Type (read-only)
C++ | veEntityType GetType()
Returns the entity type.
Handle
Visual Basic | BSTR Handle (read-only)
C++ | BSTR GetHandle()
Returns the entity handle. An entity's handle never changes and is never reused in a drawing. This can be used as a unique identifier for the entity across drawing sessions.
HasXData
Visual Basic | boolean HasXData (read-only)
C++ | boolean GetHasXData()
If the entity has extended entity data attached to it.
XData
Visual Basic | IXData XData (read-only)
C++ | IXData GetXData()
Returns the entity's extended entity data.
AutoDraw
Visual Basic | boolean AutoDraw
C++ | boolean GetAutoDraw()
C++ | void SetAutoDraw(boolean)
Controls the entity's auto draw setting, which is on by default. If on, the entity is automatically redrawn when the interface is dismissed (for example, by going out of scope.) This is appropriate for most entities, but may not be desired for vertex entities. While modifying multiple vertices of a polyline, turning off AutoDraw for each vertex makes the process smoother. The polyline can be redrawn at the end.
IVector Snap2Endpoint (IVector closeto)
Returns the end point of the entity that is closest to closeto.
IVector Snap2Midpoint (IVector closeto)
Returns the midpoint of the entity that is closest to closeto.
IVector Snap2Center (IVector closeto)
Returns the center of the entity that is closest to closeto.
IVector Snap2Nearest (IVector closeto)
Returns the point on the entity that is closest to closeto.
IVector Snap2Point (IVector closeto)
Returns the location of an IPoint .
IVector Snap2Quadrant (IVector closeto)
Returns the quadrant point of the entity that is closest to closeto.
IVector Snap2Insertion (IVector closeto)
Returns the insertion point of the entity for IText , IAttdef , and IInsert
IVector Snap2Perpendicular (IVector closeto, IVector prevpoint)
Returns the point on the entity that is closest to closeto such that the point and prevpoint make a line that is perpendicular to the entity.
IVectors Intersection (IEntity entity, [boolean infinite1], [boolean infinite2])

Returns a list of all the intersections between this entity and entity.

If infinite1 is TRUE, this entity is considered to be infinite.
If infinite2 is TRUE, entity is considered to be infinite.
Both values default to FALSE.
An infinite line segment is a line that extends forever in both directions. An infinite arc is a circle.
boolean ExtendToSet (IVector point)
Extend the end of the entity closest to point to meet the current selection set.
boolean TrimToSet (IVector point)
Trim the end of the entity closest to point to the current selection set.
boolean Break (IVector point1, IVector point2)
Break the entity using point1 and point2.
void Update() (VB alternate: UpdateNow)
Bundle up all the entity changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)


I2DPolyline Interface

I2DPolyline

A 2D polyline entity. This can represent either old-style polyline, vertex, and seqend entities or the new-style lightweight polyline. Includes properties and methods from IEntity .
properties:
I2DVertices | Vertices | (read-only)
boolean | Closed
vePolylineCurve Curve
double | EndWidth
double | StartWidth
double | Length | (read-only) --ADDED FOR 1.5--
double | Area | (read-only) --ADDED FOR 2.0--
double | Elevation | (read-only) --ADDED FOR 1.51--
boolean | IsLightWeight | (read-only) --ADDED FOR 2.0--
methods:
boolean | Explode() --ADDED FOR 1.5--
veFilletChamfer | Fillet() --ADDED FOR 1.5--
veFilletChamfer | Chamfer() --ADDED FOR 1.5--
Vertices
Visual Basic | I2DVertices Vertices (read-only)
C++ | I2DVertices GetVertices()
Returns the collection of vertices.
Closed
Visual Basic | boolean Closed
C++ | boolean GetClosed()
C++ | void SetClosed(boolean)
If the polyline is closed.
Curve
Visual Basic | vePolylineCurve Curve
C++ | vePolylineCurve GetCurve()
C++ | void SetCurve(vePolylineCurve)
Controls whether the polyline is drawn as line segments or a spline. You cannot set this value for lightweight polylines.
EndWidth
Visual Basic | double EndWidth
C++ | double GetEndWidth()
C++ | void SetEndWidth(double)
Controls the default end width for segments in the polyline.
StartWidth
Visual Basic | double StartWidth
C++ | double GetStartWidth()
C++ | void SetStartWidth(double)
Controls the default start width for segments in the polyline.
Length
Visual Basic | double Length (read-only) --ADDED FOR 1.5--
C++ | double GetLength()
Returns the overall length.
Area
Visual Basic | double Area (read-only) --ADDED FOR 2.0--
C++ | double GetArea()
Returns the area enclosed by the polyline. Note: This currently returns 0 if the polyline contains arcs.
Elevation
Visual Basic | double Elevation (read-only) --ADDED FOR 1.51--
C++ | double GetElevation()
Returns the elevation.
IsLightWeight
Visual Basic | boolean IsLightWeight (read-only) --ADDED FOR 2.0--
C++ | boolean GetIsLightWeight()
Is this an AutoCAD Release 14 style lightweight polyline?
boolean Explode() --ADDED FOR 1.5--
Turn the polyline into a series of lines and arcs.
veFilletChamfer Fillet() --ADDED FOR 1.5--
Fillet the polyline using IHeader::FilletRadius.
veFilletChamfer Chamfer() --ADDED FOR 1.5--
Chamfer the polyline using IHeader::ChamferDistanceA and IHeader::ChamferDistanceB.


I2DVertex Interface

I2DVertex

A 2D vertex entity. 2D vertices only exist attached to I2DPolyline entities in an I2DVertices collection. For lightweight polylines this isn't an actual entity. Includes properties and methods from IEntity .
properties:
IVector Where
double | EndWidth
double | StartWidth
double | Bulge
double | Tangent
boolean | ControlPoint | (read-only)
boolean | CurveFit | (read-only)
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the location of the vertex.
EndWidth
Visual Basic | double EndWidth
C++ | double GetEndWidth()
C++ | void SetEndWidth(double)
Controls the end width of the following segment if set. Otherwise the value from the polyline is used.
StartWidth
Visual Basic | double StartWidth
C++ | double GetStartWidth()
C++ | void SetStartWidth(double)
Controls the start width of the following segment if set. Otherwise the value from the polyline is used.
Bulge
Visual Basic | double Bulge
C++ | double GetBulge()
C++ | void SetBulge(double)
Controls the bulge factor of the following segment. If the bulge is 0, the following segment is a straight line. If non-zero, the following segment is an arc. The bulge is the tangent of one fourth the included angle.
Tangent
Visual Basic | double Tangent
C++ | double GetTangent()
C++ | void SetTangent(double)
Controls the tangent at the vertex for curve fitting. Not used for lightweight polylines.
ControlPoint
Visual Basic | boolean ControlPoint (read-only)
C++ | boolean GetControlPoint()
If this is a spline control point or was added to smooth out the spline.
CurveFit
Visual Basic | boolean CurveFit (read-only)
C++ | boolean GetCurveFit()
If this is a user specified vertex or was added by curve fitting.


I2DVertices Interface

I2DVertices

The collection of vertices used in I2DPolyline .
properties:
IVdraft | Application | (read-only)
I2DPolyline | Parent | (read-only)
long | Count | --WRITE ACCESS ADDED FOR 2.0--
I2DVertex | Item(long index) | (read-only) (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | I2DPolyline Parent (read-only)
C++ | I2DPolyline GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count --WRITE ACCESS ADDED FOR 2.0--
C++ | long GetCount()
C++ | void SetCount(long)
The number of vertices. Currently you can only set this value for lightweight polylines.
Item
Visual Basic | I2DVertex Item(long index) (read-only) (default)
C++ | I2DVertex GetItem()
Returns the specified vertex.


I3DPolyline Interface

I3DPolyline

A 3D polyline entity. Includes properties and methods from IEntity .
properties:
IVertices | Vertices | (read-only)
boolean | Closed
vePolylineCurve Curve
double | Length | (read-only) --ADDED FOR 1.5--
methods:
boolean Explode() --ADDED FOR 1.5--
Vertices
Visual Basic | IVertices Vertices (read-only)
C++ | IVertices GetVertices()
Returns the collection of vertices.
Closed
Visual Basic | boolean Closed
C++ | boolean GetClosed()
C++ | void SetClosed(boolean)
If the polyline is closed.
Curve
Visual Basic | vePolylineCurve Curve
C++ | vePolylineCurve GetCurve()
C++ | void SetCurve(vePolylineCurve)
Controls whether the polyline is drawn as line segments or a spline.
Length
Visual Basic | double Length (read-only) --ADDED FOR 1.5--
C++ | double GetLength()
Returns the overall length.
boolean Explode() --ADDED FOR 1.5--
Turn the polyline into a series of lines.


I3DSolid Interface

I3DSolid

An ACIS 3D solid entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IArc Interface

IArc

An arc entity. Includes properties and methods from IEntity .
properties:
IVector | Center | (VB alternate: Where)
double | Radius
double | StartAngle
double | EndAngle
double | Length | (read-only)
double | ChordedArea | (read-only)
double | PieArea | (read-only)
IVector | StartPoint | (VB alternate: Where1) (read-only)
IVector | EndPoint | (VB alternate: Where2) (read-only)
Center
Visual Basic | IVector Center (VB alternate: Where)
C++ | IVector GetCenter()
C++ | void SetCenter(IVector)
Controls the center.
Radius
Visual Basic | double Radius
C++ | double GetRadius()
C++ | void SetRadius(double)
Controls the radius.
StartAngle
Visual Basic | double StartAngle
C++ | double GetStartAngle()
C++ | void SetStartAngle(double)
Controls the start angle. The arc is drawn counterclockwise from the StartAngle to the EndAngle.
EndAngle
Visual Basic | double EndAngle
C++ | double GetEndAngle()
C++ | void SetEndAngle(double)
Controls the end angle. The arc is drawn counterclockwise from the StartAngle to the EndAngle.
Length
Visual Basic | double Length (read-only)
C++ | double GetLength()
Returns the length.
ChordedArea
Visual Basic | double ChordedArea (read-only)
C++ | double GetChordedArea()
Returns the area bounded by the arc and the line connecting the endpoints.
PieArea
Visual Basic | double PieArea (read-only)
C++ | double GetPieArea()
Returns the area bounded by the arc and lines drawn from the center to the endpoints.
StartPoint
Visual Basic | IVector StartPoint (VB alternate: Where1) (read-only)
C++ | IVector GetStartPoint()
Returns the location of the point on the arc at StartAngle.
EndPoint
Visual Basic | IVector EndPoint (VB alternate: Where2) (read-only)
C++ | IVector GetEndPoint()
Returns the location of the point on the arc at EndAngle.


IArcAlignedText Interface

IArcAlignedText

An entity which has text that is curved in an arc. Includes properties and methods from IEntity .
--ADDED FOR 2.1--


IAttdef Interface

IAttdef

An attribute definition entity. If an IBlock is created with attribute definitions in it, new IInsert entities will contain IAttribute objects.

Includes properties and methods from IEntity and bGeneralText .

properties:
boolean | Visible
boolean | Constant
boolean | Verify
boolean | Preset
BSTR Tag
BSTR Prompt
Visible
Visual Basic | boolean Visible
C++ | boolean GetVisible()
C++ | void SetVisible(boolean)
If the attribute is displayed.
Constant
Visual Basic | boolean Constant
C++ | boolean GetConstant()
C++ | void SetConstant(boolean)
If the attribute value is fixed.
Verify
Visual Basic | boolean Verify
C++ | boolean GetVerify()
C++ | void SetVerify(boolean)
If the user should verify the attribute value.
Preset
Visual Basic | boolean Preset
C++ | boolean GetPreset()
C++ | void SetPreset(boolean)
If the value is preset.
Tag
Visual Basic | BSTR Tag
C++ | BSTR GetTag()
C++ | void SetTag(BSTR)
Controls the attribute tag. This is displayed when it's an attribute definition. When an attribute is created, this value may be displayed in the insert's property dialog box.
Prompt
Visual Basic | BSTR Prompt
C++ | BSTR GetPrompt()
C++ | void SetPrompt(BSTR)
Controls the attribute prompt. When an attribute is created, this value may be displayed in the insert's property dialog box.


IAttribute Interface

IAttribute

An attribute entity. Attributes only exist attached to IInsert entities. The attribute value can be found in bGeneralText::Text

Includes properties and methods from IEntity and bGeneralText .

properties:
boolean | Visible | (read-only)
boolean | Constant | (read-only)
boolean | Verify | (read-only)
boolean | Preset | (read-only)
BSTR Tag
Visible
Visual Basic | boolean Visible (read-only)
C++ | boolean GetVisible()
If the attribute is displayed.
Constant
Visual Basic | boolean Constant (read-only)
C++ | boolean GetConstant()
If the attribute value is fixed.
Verify
Visual Basic | boolean Verify (read-only)
C++ | boolean GetVerify()
If the user should verify the attribute value.
Preset
Visual Basic | boolean Preset (read-only)
C++ | boolean GetPreset()
If the value is preset.
Tag
Visual Basic | BSTR Tag
C++ | BSTR GetTag()
C++ | void SetTag(BSTR)
Controls the attribute tag. This value may be displayed in the insert's property dialog box.


IAttributes Interface

IAttributes

A collection of IAttribute entities associated with an IInsert entity.
properties:
IVdraft | Application | (read-only)
IInsert | Parent | (read-only)
long | Count | (read-only)
IAttribute | Item(long index) | (read-only) (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IInsert Parent (read-only)
C++ | IInsert GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of attributes in the collection.
Item
Visual Basic | IAttribute Item(long index) (read-only) (default)
C++ | IAttribute GetItem()
Returns the specified attribute.


IBody Interface

IBody

An ACIS body entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


ICircle Interface

ICircle

A circle entity. Includes properties and methods from IEntity .
properties:
IVector | Center | (VB alternate: Where)
double | Radius
double | Circumference | (read-only)
double | Area | (read-only)
Center
Visual Basic | IVector Center (VB alternate: Where)
C++ | IVector GetCenter()
C++ | void SetCenter(IVector)
Controls the center.
Radius
Visual Basic | double Radius
C++ | double GetRadius()
C++ | void SetRadius(double)
Controls the radius.
Circumference
Visual Basic | double Circumference (read-only)
C++ | double GetCircumference()
Returns the circumference.
Area
Visual Basic | double Area (read-only)
C++ | double GetArea()
Returns the area.


IDimension Interface

IDimension

A dimension entity. Includes properties and methods from IEntity .
properties:
double | Angle
IVector Dxf10
IVector Dxf11
IVector Dxf12
IVector Dxf13
IVector Dxf14
IVector Dxf15
IVector Dxf16
double | HorizontalAngle
double | LeaderLength
double | ObliqueAngle
IDimStyle Style
BSTR String
double | TextAngle
boolean | TextHomePosition
methods:
boolean Explode() --ADDED FOR 1.5--
Angle
Visual Basic | double Angle
C++ | double GetAngle()
C++ | void SetAngle(double)
Dxf10
Visual Basic | IVector Dxf10
C++ | IVector GetDxf10()
C++ | void SetDxf10(IVector)
Dxf11
Visual Basic | IVector Dxf11
C++ | IVector GetDxf11()
C++ | void SetDxf11(IVector)
Dxf12
Visual Basic | IVector Dxf12
C++ | IVector GetDxf12()
C++ | void SetDxf12(IVector)
Dxf13
Visual Basic | IVector Dxf13
C++ | IVector GetDxf13()
C++ | void SetDxf13(IVector)
Dxf14
Visual Basic | IVector Dxf14
C++ | IVector GetDxf14()
C++ | void SetDxf14(IVector)
Dxf15
Visual Basic | IVector Dxf15
C++ | IVector GetDxf15()
C++ | void SetDxf15(IVector)
Dxf16
Visual Basic | IVector Dxf16
C++ | IVector GetDxf16()
C++ | void SetDxf16(IVector)
HorizontalAngle
Visual Basic | double HorizontalAngle
C++ | double GetHorizontalAngle()
C++ | void SetHorizontalAngle(double)
LeaderLength
Visual Basic | double LeaderLength
C++ | double GetLeaderLength()
C++ | void SetLeaderLength(double)
ObliqueAngle
Visual Basic | double ObliqueAngle
C++ | double GetObliqueAngle()
C++ | void SetObliqueAngle(double)
Style
Visual Basic | IDimStyle Style
C++ | IDimStyle GetStyle()
C++ | void SetStyle(IDimStyle)
String
Visual Basic | BSTR String
C++ | BSTR GetString()
C++ | void SetString(BSTR)
TextAngle
Visual Basic | double TextAngle
C++ | double GetTextAngle()
C++ | void SetTextAngle(double)
TextHomePosition
Visual Basic | boolean TextHomePosition
C++ | boolean GetTextHomePosition()
C++ | void SetTextHomePosition(boolean)
boolean Explode() --ADDED FOR 1.5--
Explode the dimension into the lines, text, etc. that make up the dimension.


IEllipse Interface

IEllipse

An ellipse entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--
properties:
IVector | CenterPoint | (VB alternate: Where)
double | MajorRadius
double | MinorRadius
IVector MajorAxis
IVector MinorAxis
double | MinorAxisRatio
double | StartAngle
double | EndAngle
double | Area | (read-only)
double | Length | (read-only)
boolean | IsEllipticalArc | (read-only) --ADDED FOR 2.1--
CenterPoint
Visual Basic | IVector CenterPoint (VB alternate: Where)
C++ | IVector GetCenterPoint()
C++ | void SetCenterPoint(IVector)
Controls the center.
MajorRadius
Visual Basic | double MajorRadius
C++ | double GetMajorRadius()
C++ | void SetMajorRadius(double)
Controls the distance from the center to the point on the ellipse where the major axis intersects it.
MinorRadius
Visual Basic | double MinorRadius
C++ | double GetMinorRadius()
C++ | void SetMinorRadius(double)
Controls the distance from the center to the point on the ellipse where the minor axis intersects it.
MajorAxis
Visual Basic | IVector MajorAxis
C++ | IVector GetMajorAxis()
C++ | void SetMajorAxis(IVector)
Controls the direction and length of the longest axis of the ellipse relative to the center.
MinorAxis
Visual Basic | IVector MinorAxis
C++ | IVector GetMinorAxis()
C++ | void SetMinorAxis(IVector)
Controls the direction and length of the shortest axis of the ellipse relative to the center.
MinorAxisRatio
Visual Basic | double MinorAxisRatio
C++ | double GetMinorAxisRatio()
C++ | void SetMinorAxisRatio(double)
Controls the ratio of the minor axis to the major axis. This value is always greater than 0 and less than or equal to 1.
StartAngle
Visual Basic | double StartAngle
C++ | double GetStartAngle()
C++ | void SetStartAngle(double)
EndAngle
Visual Basic | double EndAngle
C++ | double GetEndAngle()
C++ | void SetEndAngle(double)
Area
Visual Basic | double Area (read-only)
C++ | double GetArea()
Length
Visual Basic | double Length (read-only)
C++ | double GetLength()
IsEllipticalArc
Visual Basic | boolean IsEllipticalArc (read-only) --ADDED FOR 2.1--
C++ | boolean GetIsEllipticalArc()


IFace Interface

IFace

A 3D face entity. Includes properties and methods from IEntity .
properties:
double | Circumference | (read-only)
double | Area | (read-only)
IVector Where(short which)
boolean | Visible(short which)
Circumference
Visual Basic | double Circumference (read-only)
C++ | double GetCircumference()
Returns the circumference.
Area
Visual Basic | double Area (read-only)
C++ | double GetArea()
Returns the area.
Where
Visual Basic | IVector Where(short which)
C++ | IVector GetWhere()
C++ | void SetWhere(short which, IVector)
Controls the location of the corners of the face. which ranges from 1 to 4.
Visible
Visual Basic | boolean Visible(short which)
C++ | boolean GetVisible()
C++ | void SetVisible(short which, boolean)
Controls the visibility of the edges of the face. which ranges from 1 to 4.


IFaceVertex Interface

IFaceVertex

A face vertex entity. Face vertices only exist attached to IPolyface entities in an IFaceVertices collection. Includes properties and methods from IEntity .
properties:
short | Corner(short which)
boolean | Visible(short which)
methods:
void | SetCorners(short val1, short val2, short val3, short val4)
void | SetVisibility(boolean flag1, boolean flag2, boolean flag3, boolean flag4)
Corner
Visual Basic | short Corner(short which)
C++ | short GetCorner()
C++ | void SetCorner(short which, short)
Controls which vertices from IPolyface::Vertices are used to draw this face. which ranges from 1 to 4.
Visible
Visual Basic | boolean Visible(short which)
C++ | boolean GetVisible()
C++ | void SetVisible(short which, boolean)
Controls which edges of the face are visible. which ranges from 1 to 4.
void SetCorners(short val1, short val2, short val3, short val4)
Sets all four corners at once. Controls which vertices from IPolyface::Vertices are used to draw this face.
void SetVisibility(boolean flag1, boolean flag2, boolean flag3, boolean flag4)
Sets the visibility of all four edges at once.


IFaceVertices Interface

IFaceVertices

The collection of faces used in IPolyface . This describes how to connect the dots.
properties:
IVdraft | Application | (read-only)
IPolyface | Parent | (read-only)
long | Count | (read-only)
IFaceVertex | Item(long index) | (read-only) (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IPolyface Parent (read-only)
C++ | IPolyface GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of faces.
Item
Visual Basic | IFaceVertex Item(long index) (read-only) (default)
C++ | IFaceVertex GetItem()
Returns the specified face.


IHatch Interface

IHatch

A hatch entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IImage Interface

IImage

An image entity. It is bitmap (JPEG, TIFF, BMP, etc.). Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IInsert Interface

IInsert

An insert entity. This is an instance of an IBlock . Includes properties and methods from IEntity .
properties:
IBlock | Block | (read-only)
IVector Where
IVector Scaling
double | Rotation
short | Columns
short | Rows
double | ColumnSpacing
double | RowSpacing
IAttributes | Attributes | (read-only)
boolean | HasAttributes | (read-only)
methods:
boolean Explode() --ADDED FOR 1.5--
Block
Visual Basic | IBlock Block (read-only)
C++ | IBlock GetBlock()
Returns the block this is an instance of.
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the insertion point.
Scaling
Visual Basic | IVector Scaling
C++ | IVector GetScaling()
C++ | void SetScaling(IVector)
Controls the scaling.
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
Controls the rotation.
Columns
Visual Basic | short Columns
C++ | short GetColumns()
C++ | void SetColumns(short)
Controls the number of columns. If Columns or Rows is set to a number greater than 1, the insert is a multiple insert or minsert. The insert is displayed multiple times using the spacing described in ColumnSpacing and RowSpacing.
Rows
Visual Basic | short Rows
C++ | short GetRows()
C++ | void SetRows(short)
Controls the number of rows. If Columns or Rows is set to a number greater than 1, the insert is a multiple insert or minsert. The insert is displayed multiple times using the spacing described in ColumnSpacing and RowSpacing.
ColumnSpacing
Visual Basic | double ColumnSpacing
C++ | double GetColumnSpacing()
C++ | void SetColumnSpacing(double)
Controls the column spacing. If Columns or Rows is set to a number greater than 1, the insert is a multiple insert or minsert. The insert is displayed multiple times using the spacing described in ColumnSpacing and RowSpacing.
RowSpacing
Visual Basic | double RowSpacing
C++ | double GetRowSpacing()
C++ | void SetRowSpacing(double)
Controls the row spacing. If Columns or Rows is set to a number greater than 1, the insert is a multiple insert or minsert. The insert is displayed multiple times using the spacing described in ColumnSpacing and RowSpacing.
Attributes
Visual Basic | IAttributes Attributes (read-only)
C++ | IAttributes GetAttributes()
If the insert HasAttributes, this returns a list of all its attributes.
HasAttributes
Visual Basic | boolean HasAttributes (read-only)
C++ | boolean GetHasAttributes()
If the insert has attributes.
boolean Explode() --ADDED FOR 1.5--
Explode the insert into the entities described by the associated IBlock . Attribute information is lost.


ILeader Interface

ILeader

A leader entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


ILine Interface

ILine

A line entity. Includes properties and methods from IEntity .
properties:
IVector | StartPoint | (VB alternate: Where1)
IVector | EndPoint | (VB alternate: Where2)
double | Length | (read-only)
double | Angle | (read-only) --ADDED FOR 1.5--
methods:
veFilletChamfer | Fillet (ILine line, IVector pick1,IVector pick2) --ADDED FOR 1.5--
veFilletChamfer | Chamfer (ILine line, IVector pick1,IVector pick2) --ADDED FOR 1.5--
StartPoint
Visual Basic | IVector StartPoint (VB alternate: Where1)
C++ | IVector GetStartPoint()
C++ | void SetStartPoint(IVector)
Controls the first endpoint.
EndPoint
Visual Basic | IVector EndPoint (VB alternate: Where2)
C++ | IVector GetEndPoint()
C++ | void SetEndPoint(IVector)
Controls the other endpoint.
Length
Visual Basic | double Length (read-only)
C++ | double GetLength()
Returns the length.
Angle
Visual Basic | double Angle (read-only) --ADDED FOR 1.5--
C++ | double GetAngle()
Returns the angle the line makes with the x axis.
veFilletChamfer Fillet (ILine line, IVector pick1,IVector pick2) --ADDED FOR 1.5--
Fillet this line and line. The portion of this line closest to pick1 and the portion of line closest to pick2 are preserved. The other ends may be trimmed. Uses IHeader::FilletRadius for determining how to fillet the lines.
veFilletChamfer Chamfer (ILine line, IVector pick1,IVector pick2) --ADDED FOR 1.5--
Chamfer this line and line. The portion of this line closest to pick1 and the portion of line closest to pick2 are preserved. The other ends may be trimmed. Uses IHeader::ChamferDistanceA and IHeader::ChamferDistanceB for determining how to chamfer the lines.


IMline Interface

IMline

A multi-line entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IMtext Interface

IMtext

A paragraph text entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--
properties:
IVector | BasePoint | (VB alternate: Where)
double | Rotation
IVector XAxis
double | Width
double | Height
BSTR Text
ITextStyle Style
veMtextJustification Justification
veMtextDirection Direction
BasePoint
Visual Basic | IVector BasePoint (VB alternate: Where)
C++ | IVector GetBasePoint()
C++ | void SetBasePoint(IVector)
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
XAxis
Visual Basic | IVector XAxis
C++ | IVector GetXAxis()
C++ | void SetXAxis(IVector)
Width
Visual Basic | double Width
C++ | double GetWidth()
C++ | void SetWidth(double)
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Text
Visual Basic | BSTR Text
C++ | BSTR GetText()
C++ | void SetText(BSTR)
Style
Visual Basic | ITextStyle Style
C++ | ITextStyle GetStyle()
C++ | void SetStyle(ITextStyle)
Justification
Visual Basic | veMtextJustification Justification
C++ | veMtextJustification GetJustification()
C++ | void SetJustification(veMtextJustification)
Direction
Visual Basic | veMtextDirection Direction
C++ | veMtextDirection GetDirection()
C++ | void SetDirection(veMtextDirection)


IOle2Frame Interface

IOle2Frame

An entity which represents an embedded object from another program. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IOleFrame Interface

IOleFrame

An oleframe entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IPoint Interface

IPoint

A point entity. IHeader::PointDisplayMode and IHeader::PointDisplaySize can be used to cause all points to be displayed as boxes, circles, etc. By default points appear as dots. Includes properties and methods from IEntity .
properties:
IVector Where
double Rotation
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the location.
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
Controls the rotation. Only used if IHeader::PointDisplayMode is set to something other than 0.


IPolyface Interface

IPolyface

A polyface entity. It consists of a list of vertices and a description of how to connect the dots to draw the polyface. Includes properties and methods from IEntity .
properties:
IVertices | Vertices | (read-only)
IFaceVertices | FaceVertices | (read-only)
Vertices
Visual Basic | IVertices Vertices (read-only)
C++ | IVertices GetVertices()
Returns the collection of vertices. This represents all the points used in the polyface.
FaceVertices
Visual Basic | IFaceVertices FaceVertices (read-only)
C++ | IFaceVertices GetFaceVertices()
Returns the collection of faces. This describes how to connect the dots listed in Vertices.


IPolymesh Interface

IPolymesh

A polymesh entity. It consists of a rectangular array of vertices that are connected in a grid to display the polymesh. Includes properties and methods from IEntity .
properties:
IVertices | Vertices | (read-only)
boolean | ColumnClosed
boolean | RowClosed
short | ColumnSize | (read-only)
short | RowSize | (read-only)
vePolylineCurve | ColumnCurve | (read-only)
vePolylineCurve | RowCurve | (read-only)
Vertices
Visual Basic | IVertices Vertices (read-only)
C++ | IVertices GetVertices()
Returns the collection of vertices.
ColumnClosed
Visual Basic | boolean ColumnClosed
C++ | boolean GetColumnClosed()
C++ | void SetColumnClosed(boolean)
If the column portion of the polymesh is closed.
RowClosed
Visual Basic | boolean RowClosed
C++ | boolean GetRowClosed()
C++ | void SetRowClosed(boolean)
If the row portion of the polymesh is closed.
ColumnSize
Visual Basic | short ColumnSize (read-only)
C++ | short GetColumnSize()
Returns the number of columns.
RowSize
Visual Basic | short RowSize (read-only)
C++ | short GetRowSize()
Returns the number of rows.
ColumnCurve
Visual Basic | vePolylineCurve ColumnCurve (read-only)
C++ | vePolylineCurve GetColumnCurve()
Controls whether the column portion of the polymesh is drawn as line segments or a spline.
RowCurve
Visual Basic | vePolylineCurve RowCurve (read-only)
C++ | vePolylineCurve GetRowCurve()
Controls whether the row portion of the polymesh is drawn as line segments or a spline.


IProxy Interface

IProxy

A proxy entity. This is a custom object created by an ARX application in AutoCAD. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IRay Interface

IRay

A ray entity. It is a line which is infinite in one direction. Includes properties and methods from IEntity .
--ADDED FOR 2.0--
properties:
IVector | BasePoint | (VB alternate: Where)
IVector Direction
IVector SecondPoint
double | Angle
BasePoint
Visual Basic | IVector BasePoint (VB alternate: Where)
C++ | IVector GetBasePoint()
C++ | void SetBasePoint(IVector)
Controls the point the ray starts at.
Direction
Visual Basic | IVector Direction
C++ | IVector GetDirection()
C++ | void SetDirection(IVector)
Controls the direction of the ray.
SecondPoint
Visual Basic | IVector SecondPoint
C++ | IVector GetSecondPoint()
C++ | void SetSecondPoint(IVector)
This is an alternate way to describe the direction of the ray. It is a point the ray goes through.
Angle
Visual Basic | double Angle
C++ | double GetAngle()
C++ | void SetAngle(double)
This is an alternate way to describe the direction of the ray.


IRegion Interface

IRegion

An ACIS region entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IRtext Interface

IRtext

An entity which can either display the text from an external/remote text file or which displays the text resulting from a Diesel expression. Includes properties and methods from IEntity .
--ADDED FOR 2.1--
properties:
IVector | BasePoint | (VB alternate: Where)
double | Rotation
double | Height
ITextStyle Style
BSTR FileName
boolean | IsExpression
BSTR Expression
BasePoint
Visual Basic | IVector BasePoint (VB alternate: Where)
C++ | IVector GetBasePoint()
C++ | void SetBasePoint(IVector)
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
The height for each line of text. Must be greater than zero.
Style
Visual Basic | ITextStyle Style
C++ | ITextStyle GetStyle()
C++ | void SetStyle(ITextStyle)
FileName
Visual Basic | BSTR FileName
C++ | BSTR GetFileName()
C++ | void SetFileName(BSTR)
The name of the external, or remote, ASCII text file. This string is empty if IsExpression is TRUE.
IsExpression
Visual Basic | boolean IsExpression
C++ | boolean GetIsExpression()
C++ | void SetIsExpression(boolean)
Is the text of this entity the result of a Diesel expression?
Expression
Visual Basic | BSTR Expression
C++ | BSTR GetExpression()
C++ | void SetExpression(BSTR)
This is the text of the Diesel expression. This string is empty if IsExpression is FALSE.


IShape Interface

IShape

A shape entity. Includes properties and methods from IEntity .
properties:
IVector Where
BSTR ShapeName
short | ShapeNumber
double | Rotation
double | Size
ITextStyle Style
double | XScaling
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the location.
ShapeName
Visual Basic | BSTR ShapeName
C++ | BSTR GetShapeName()
C++ | void SetShapeName(BSTR)
Controls the name of the shape used from the SHX file.
ShapeNumber
Visual Basic | short ShapeNumber
C++ | short GetShapeNumber()
C++ | void SetShapeNumber(short)
Controls the index of the shape used from the SHX file.
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
Controls the rotation.
Size
Visual Basic | double Size
C++ | double GetSize()
C++ | void SetSize(double)
Controls the overall scaling.
Style
Visual Basic | ITextStyle Style
C++ | ITextStyle GetStyle()
C++ | void SetStyle(ITextStyle)
Controls the style used for determining the SHX file used.
XScaling
Visual Basic | double XScaling
C++ | double GetXScaling()
C++ | void SetXScaling(double)
Controls how the width is scaled.


ISolid Interface

ISolid

A 2D solid entity. This is equivalent to an ITrace entity. Includes properties and methods from IEntity .
properties:
double | Circumference | (read-only)
double | Area | (read-only)
IVector Where(short which)
Circumference
Visual Basic | double Circumference (read-only)
C++ | double GetCircumference()
Returns the circumference.
Area
Visual Basic | double Area (read-only)
C++ | double GetArea()
Returns the area.
Where
Visual Basic | IVector Where(short which)
C++ | IVector GetWhere()
C++ | void SetWhere(short which, IVector)
Controls the location of the corners of the solid. which ranges from 1 to 4.


ISpline Interface

ISpline

A spline entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


IText Interface

IText

A text entity. Includes properties and methods from IEntity and bGeneralText .


ITolerance Interface

ITolerance

A tolerance entity. Includes properties and methods from IEntity .
--ADDED FOR 2.0--


ITrace Interface

ITrace

A trace entity. This is equivalent to an ISolid entity. Includes properties and methods from IEntity .
properties:
double | Circumference | (read-only)
double | Area | (read-only)
IVector Where(short which)
Circumference
Visual Basic | double Circumference (read-only)
C++ | double GetCircumference()
Returns the circumference.
Area
Visual Basic | double Area (read-only)
C++ | double GetArea()
Returns the area.
Where
Visual Basic | IVector Where(short which)
C++ | IVector GetWhere()
C++ | void SetWhere(short which, IVector)
Controls the location of the corners of the trace. which ranges from 1 to 4.


IVertex Interface

IVertex

A vertex entity. Vertices only exist attached to I3DPolyline , IPolymesh , or IPolyface entities in an IVertices collection. Includes properties and methods from IEntity .
properties:
IVector Where
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the location of the vertex.


IVertices Interface

IVertices

The collection of vertices used in I3DPolyline , IPolymesh , and IPolyface .
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
long | Count | (read-only)
IVertex | Item(long index) | (read-only) (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner polyline of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of vertices.
Item
Visual Basic | IVertex Item(long index) (read-only) (default)
C++ | IVertex GetItem()
Returns the specified vertex.


IViewport Interface

IViewport

A viewport entity. This represents a paperspace viewport. The view information is encoded in extended entity data but it is easiest to access it through the associated IView . Includes properties and methods from IEntity .
properties:
IVector | Center | (VB alternate: Where)
double | Width
double | Height
short | Status
Center
Visual Basic | IVector Center (VB alternate: Where)
C++ | IVector GetCenter()
C++ | void SetCenter(IVector)
Controls the center.
Width
Visual Basic | double Width
C++ | double GetWidth()
C++ | void SetWidth(double)
Controls the width.
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Controls the height.
Status
Visual Basic | short Status
C++ | short GetStatus()
C++ | void SetStatus(short)
Controls the status. 0 means the viewport is turned off. Greater than zero indicates the stacking order of the viewport, relative to other viewports.


IWipeout Interface

IWipeout

An entity that displays a solid area using the background color of the window. It can be used to obscure parts of other entities drawn before it. Includes properties and methods from IEntity .
--ADDED FOR 2.1--


IXData Interface

IXData

See Also
IApplicationIDs
DXF-Groups

The collection of extended entity data (xdata) for an entity. Arbitrary application-specific information can be attached to or read from an entity using this interface. You first need to register an application ID with the drawing so that you can handle your xdata separately from other applications which may also have xdata attached to this entity.

The data attached to an entity comes in group code/data pairs. The group code describes the data type. It can also tell Vdraft to modify certain data when the entity is modified. See DXF-Groups for group codes and their meanings.

The following code demonstrates adding application ids, reading existing xdata, modifying existing xdata, and adding new xdata to an entity. It first ensures that the application id, "MyApp", is registered with the drawing. It then looks up the application id in the entity's xdata. If it finds it, it increments a counter. If it doesn't find it, it adds several pieces of data. You can examine the results by looking at the property dialog for the entity. Press the refresh button in the lower right corner after the counter is incremented to see the data change.

Visual Basic Code Sample

    ' assume ent points to an entity and doc points to the drawing
    Dim apps As Object
    Dim xdata As Object
    '
    ' 1st register an application id
    Set apps = doc.ApplicationIDs
    If not apps.HasItem ("MyApp") Then
        apps.Add ("MyApp")
    End If
    '
    ' check if we already have data attached to entity
    Set xdata = ent.XData
    If xdata.FindApplicationID ("MyApp") Then
        xdata.Next	' step past the application id
        ' the next item should have group code 1070
        ' this is a counter that we will increment
        If xdata.Group = 1070 Then
            xdata.Short = xdata.Short + 1
        End If
    Else
        xdata.AddApplicationID "MyApp"
        xdata.Add 1070, 1
        xdata.Add 1000, "this is a string"
    End If

C++ Code Sample

    // assume ent points to an entity and doc points to the drawing
    IApplicationIDs apps( doc.GetApplicationIDs() );
    // 1st register an application id
    if (!apps.HasItem("MyApp"))
        apps.Add("MyApp");
    //
    // check if we already have data attached to entity
    IXData xdata( ent.GetXData() );
    if (xdata.FindApplicationID("MyApp"))
    {
        xdata.Next();	// step past the application id
        // the next item should have group code 1070
        // this is a counter that we will increment
        if (xdata.GetGroup() == 1070)
            xdata.SetShort( xdata.GetShort() + 1 );
    }
    else
    {
        apps.AddApplicationID("MyApp");
        apps.Add(1070, cVariant(1));
        apps.Add(1000, cVariant("this is a string"));
    }
properties:
IVdraft | Application | (read-only)
IEntity | Parent | (read-only)
short | Group | (read-only)
veXDataType | Type | (read-only)
short | Index
BSTR String
veXDataControl Control
ILayer Layer
BSTR Handle
IVector Vector
double | Double
short | Short
long | Long
methods:
boolean | Next()
boolean | Add (short group, VARIANT data)
boolean | Remove()
boolean | FindApplicationID (BSTR appname)
boolean | AddApplicationID (BSTR appname)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IEntity Parent (read-only)
C++ | IEntity GetParent()
Returns the owner of this object.
Group
Visual Basic | short Group (read-only)
C++ | short GetGroup()
The DXF group code describing the data type. See DXF-Groups for details. You can also use Type for a simpler way to find the type.
Type
Visual Basic | veXDataType Type (read-only)
C++ | veXDataType GetType()
Returns the type of the associated data. Once you know the data type, you know whether to access it using String, Control, Layer, Handle, Vector, Double, Short, or Long.
Index
Visual Basic | short Index
C++ | short GetIndex()
C++ | void SetIndex(short)
Controls which xdata element is being worked with. You can use Next to step through a series of elements.
String
Visual Basic | BSTR String
C++ | BSTR GetString()
C++ | void SetString(BSTR)
If Group is 1000 or 1001 or Type is veXDT_String, this provides access to the current xdata element.
Control
Visual Basic | veXDataControl Control
C++ | veXDataControl GetControl()
C++ | void SetControl(veXDataControl)
If Group is 1002 or Type is veXDT_Control, this provides access to the current xdata element.
Layer
Visual Basic | ILayer Layer
C++ | ILayer GetLayer()
C++ | void SetLayer(ILayer)
If Group is 1003 or Type is veXDT_Layer, this provides access to the current xdata element.
Handle
Visual Basic | BSTR Handle
C++ | BSTR GetHandle()
C++ | void SetHandle(BSTR)
If Group is 1005 or Type is veXDT_Handle, this provides access to the current xdata element.
Vector
Visual Basic | IVector Vector
C++ | IVector GetVector()
C++ | void SetVector(IVector)
If Group is 1010, 1011, 1012, or 1013 or Type is veXDT_Vector, this provides access to the current xdata element. Note that this automatically handles the group codes for the y and z coordinates.
Double
Visual Basic | double Double
C++ | double GetDouble()
C++ | void SetDouble(double)
If Group is 1040, 1041, or 1042 or Type is veXDT_Double, this provides access to the current xdata element.
Short
Visual Basic | short Short
C++ | short GetShort()
C++ | void SetShort(short)
If Group is 1070 or Type is veXDT_Short, this provides access to the current xdata element.
Long
Visual Basic | long Long
C++ | long GetLong()
C++ | void SetLong(long)
If Group is 1071 or Type is veXDT_Long, this provides access to the current xdata element.
boolean Next()
Step to the next xdata element.
boolean Add (short group, VARIANT data)
Add a new group code/data pair after the current element.
boolean Remove()
Remove the xdata element at the current index.
boolean FindApplicationID (BSTR appname)
Position the xdata index at the location where the application id is located. Return FALSE if the given application id doesn't exist in this xdata.
boolean AddApplicationID (BSTR appname)
Add the given application id to this xdata.


IXline Interface

IXline

A construction line entity. It is a line which is infinite in both directions. Includes properties and methods from IEntity .
--ADDED FOR 2.0--
properties:
IVector | BasePoint | (VB alternate: Where)
IVector Direction
IVector SecondPoint
double | Angle
BasePoint
Visual Basic | IVector BasePoint (VB alternate: Where)
C++ | IVector GetBasePoint()
C++ | void SetBasePoint(IVector)
A point on the xline.
Direction
Visual Basic | IVector Direction
C++ | IVector GetDirection()
C++ | void SetDirection(IVector)
Controls the direction of the xline.
SecondPoint
Visual Basic | IVector SecondPoint
C++ | IVector GetSecondPoint()
C++ | void SetSecondPoint(IVector)
This is an alternate way to describe the direction of the xline. It is a point the xline goes through.
Angle
Visual Basic | double Angle
C++ | double GetAngle()
C++ | void SetAngle(double)
This is an alternate way to describe the direction of the xline.


IApplicationEvents Interface

IApplicationEvents

Allows plug-ins to add items to the pulldown menu, add keyboard commands, etc. Visual Basic users should refer to the Vevents.ocx . C++ users can get more information by looking at Vdraft plug-ins .

C++ Code Sample

    enum eMenuItems
    {	eMI_CurvedLeader	};
    veReturn vfCommand(vtAddOnID id, long eventid)
    {
        if (eventid == eMI_CurvedLeader)
            { . . . }
    }
    veReturn vfLoad(vtAddOnID id)
    {
        if (!vdraft.CreateDispatch("Vdraft.Application", NULL))
            return veR_Unload;
        CString item("&Curved Leader"),
            status("Draw an arc with an arrow and text");
        IApplicationEvents events(vdraft.GetEvents());
        events.AddToolsCommand(id,eMI_CurvedLeader,item,status);
        CString keys("cleader");
        events.AddKeyboardCommand(id,eMI_CurvedLeader,keys);
        return veR_OK;
    }
properties:
IVdraft | Application | (read-only)
IVdraft | Parent | (read-only)
methods:
boolean | AddToolsCommand (long addonid, long menuid, BSTR menutext, BSTR statusbar)
boolean | AddToolsOption (long addonid, long menuid, long eventid, BSTR buttontext)
boolean | RemoveToolsOption(long addonid, long menuid, long eventid)
boolean | AddKeyboardCommand (long addonid, long eventid, BSTR keystrokes)
long | CallAddOnFunction (BSTR DLLfile, BSTR function, VARIANT argument1, VARIANT argument2) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IVdraft Parent (read-only)
C++ | IVdraft GetParent()
Returns the owner of this object.
boolean AddToolsCommand (long addonid, long menuid, BSTR menutext, BSTR statusbar)

Add an entry to the Vdraft Tools menu. This command only works for plug-ins.

addonid is the id that Vdraft gives you when your DLL exported functions are called by Vdraft.
menuid is a value you assign to this menu item that you wish to have returned to you when the menu item is chosen by the user. Since it’s a long, it could be a pointer to some structure or a simple id number.
menutext is the text that is to actually appear on the menu.
statusbar is the text that should appear on the status bar when the user has the mouse over the menu entry.

AddToolsCommand adds a menu item called 'menutext' to the Tools menu. When the menu item is hilighted, 'statusbar' appears on the status bar as short help. When the user picks the item, vfCommand will be called by Vdraft with info->eventid set to the menuid if no additional options have been registered. AddToolsOption can be used to add subitems to this menu.

    #define MENUID		1
    #define OPTOINID1	1
    #define OPTIONID2	2
    events->AddToolsCommand(info->pluginid, MENUID, "&My Menu Item", "Status bar help.");
    events->AddToolsOption(info->pluginid, MENUID, OPTIONID1, "&First Button");
    events->AddToolsOption(info->pluginid, MENUID, OPTIONID2, "&Second Button");
boolean AddToolsOption (long addonid, long menuid, long eventid, BSTR buttontext)

If you've called AddToolsOption, then a dialog will be displayed with a button for each option that was added. When a button is pressed, the event will be eaVPE_ToolCommand & info->eventid will represent the option chosen.

addonid is the id that Vdraft gives you when your DLL exported functions are called by Vdraft.
boolean RemoveToolsOption(long addonid, long menuid, long eventid)

Removes an option from a tools menu.

addonid is the id that Vdraft gives you when your DLL exported functions are called by Vdraft.
boolean AddKeyboardCommand (long addonid, long eventid, BSTR keystrokes)

Creates a new keyboard command for the user. This enables you to effectively create your own "short cut keys" as well as other types of keyboard commands for the user.

addonid is the id that Vdraft gives you when your DLL exported functions are called by Vdraft.
long CallAddOnFunction (BSTR DLLfile, BSTR function, VARIANT argument1, VARIANT argument2) --ADDED FOR 2.0--

Calls a function in one of the plug-ins Vdraft currently has loaded. The return value is simply the plug-in function's return value. If the call fails, the return value will be veAddOnFunctionReturnStatus

DLLfile is the name of a plug-in which Vdraft has loaded. You don't need to include the path.
funtion is the name of a function which has been exported from the plug-in.
argument1 and argument2 are optional parameters which get passed to the plug-in function.


IPickEvents Interface

IPickEvents

See Also
OCX-Events
cVdraftEvent
Plug-Ins

Handles mouse event notifications. You can set information such as cursor tips and popup menu items then call RequestPick or RequestDraw for C++ or use the OCX for Visual Basic. RequestPick is used for general mouse events. RequestDraw is used when you want to be notified when the user has picked a point on an object or finished drawing the object.

DrawX is a code sample showing how to use pick events for interactively creating entities. You will find sample code under \Vdraft\Programs\Cpp and \Vdraft\Programs\VB.

Visual Basic Code Sample

    Private Sub Command1_Click()
        Dim doc As Object
        Dim pick As Object
            '
        If VdraftEvents1.Connect = False Then
            Exit Sub
        End If
            '
        Set doc = VdraftEvents1.Vdraft.ActiveDocument
        ' have the user draw a single line
        doc.Entities.DrawLine
        ' we want to know when the user finishes
        VdraftEvents1.RequestDraw doc.PickEvents, 0
    End Sub
    '
    ' handle the DrawDone event from the OCX
    Private Sub VdraftEvents1_DrawDone(ByVal info As Long)
        ' do something now that we know the line has been drawn
    End Sub

C++ Code Sample

    // respond to a menu event
    veReturn vfCommand(vtAddOnID id, long eventid)
    {
        if (eventid != MYMENUITEM)
            return veR_OK;
        IDocument doc(vdraft.GetActiveDocument());
        //
        // have them draw a line
        IEntities entities(doc.GetEntities());
        entities.DrawLine();
        //
        // ask to be notified when they're done
        IPickEvents pick(doc.GetPickEvents());
        pick.RequestDraw(id,cVariant());
        return veR_OK;
    }
    // vfDrawEvent is called when the user picks points on the line, cancels, etc.
    veReturn vfDrawEvent(vtAddOnID id, veDrawEvent event, double* point, short picknumber, long info)
    {	// do something with the event
    }
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
BSTR Name
BSTR StatusBar
boolean | NotifyDone
boolean | NotifyProperties
boolean | NotifyUndo
long | HelpToken
IVector BasePoint
methods:
boolean | RequestPick(long addonid, [long userinfo])
void | SetCursorTips (BSTR tip1, [VARIANT tip2], [VARIANT tip3], [VARIANT tip4])
void | SetCursorTipInfo (veCursorTipInfo tipinfo, IVector basepoint)
boolean | RequestDraw(long addonid, [long userinfo])
boolean | TriggerPick (IVector point)
boolean | TriggerPopup (vePickPopup event)
boolean | TriggerLength(double length)
boolean | TriggerAngle(double angle)
boolean | TriggerOffset (IVector offset)
boolean | TriggerScale (IVector scale)
boolean | TriggerHeight(double height)
boolean | TriggerWidth(double width)
boolean | TriggerRadius(double radius)
boolean | TriggerDiameter(double diameter)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name
C++ | BSTR GetName()
C++ | void SetName(BSTR)
When using RequestPick, the name appears on the popup menu after Done and Cancel, and before Properties. For example, if you were having the user pick points in order to build them a chair, the popup could read "Done Chair", "Cancel Chair", and "Chair Properties...". Done and Properties would be active if you enabled NotifyDone and NotifyProperties respectively.
StatusBar
Visual Basic | BSTR StatusBar
C++ | BSTR GetStatusBar()
C++ | void SetStatusBar(BSTR)
When using RequestPick, this text appears on the status bar.
NotifyDone
Visual Basic | boolean NotifyDone
C++ | boolean GetNotifyDone()
C++ | void SetNotifyDone(boolean)
When using RequestPick, this enables the Done option on the popup. If the user chooses Done, you are notified through the PickDone OCX event or the vfPickEvent plug-in callback.
NotifyProperties
Visual Basic | boolean NotifyProperties
C++ | boolean GetNotifyProperties()
C++ | void SetNotifyProperties(boolean)
When using RequestPick, this enables the Properties option on the popup. If the user chooses Properties, you are notified through the PickProperties OCX event or the vfPickEvent plug-in callback.
NotifyUndo
Visual Basic | boolean NotifyUndo
C++ | boolean GetNotifyUndo()
C++ | void SetNotifyUndo(boolean)
When using RequestPick, this enables the Undo option on the popup. If the user chooses Undo, you are notified through the PickUndo OCX event or the vfPickEvent plug-in callback.
HelpToken
Visual Basic | long HelpToken
C++ | long GetHelpToken()
C++ | void SetHelpToken(long)
When using RequestPick, this enables the Help option on the popup. If the user chooses Help, you are notified through the Help OCX event or the vfHelpEvent plug-in callback. The specified token value is returned to you so you can display context sensitive help.
BasePoint
Visual Basic | IVector BasePoint
C++ | IVector GetBasePoint()
C++ | void SetBasePoint(IVector)
When using RequestPick, this specifies the base point used for calculating cursor tips if you use SetCursorTipInfo.
boolean RequestPick(long addonid, [long userinfo])
Sets up Vdraft so it prompts the user to pick a point. Name, StatusBar, NotifyDone, NotifyProperties, NotifyUndo, HelpToken, BasePoint, SetCursorTips, and SetCursorTipInfo can all be used to customize Vdraft's behavior. addonid is the id passed to the plug-in in vfLoad. Note: Visual Basic users should call RequestPick from the OCX instead.
void SetCursorTips (BSTR tip1, [VARIANT tip2], [VARIANT tip3], [VARIANT tip4])
When using RequestPick, this allows you to specify from one to four cursor tips that will appear to instruct the user on what to do.
void SetCursorTipInfo (veCursorTipInfo tipinfo, IVector basepoint)
When using RequestPick, this allows the cursor tips to be calculated automatically as the user moves the cursor. The cursor tip can display the distance or angle to the basepoint, etc.
boolean RequestDraw(long addonid, [long userinfo])
Call this when the user is drawing an object (such as after a call to IEntities::DrawLine) to have Vdraft inform you when the user has finished, cancelled, etc. Events are passed through vfDrawEvent. addonid is the id passed to the plug-in in vfLoad. Note: Visual Basic users should call RequestDraw from the OCX instead.
boolean TriggerPick (IVector point)
Use to force feed a point pick into Vdraft. A common way to use this is to allow the user to pick some points, but have other points be calculated by the add-on. This can be used with RequestDraw to allow a combination of interaction and automatic point picks.
boolean TriggerPopup (vePickPopup event)
Use to cause the specified event. For example, passing vePP_Undo is the equivalent of choosing Undo from the current popup menu.
boolean TriggerLength(double length)
If the current action is displaying a length cursor tip, calling TriggerLength is the equivalent of typing the length into Vdraft.
boolean TriggerAngle(double angle)
If the current action is displaying an angle cursor tip, calling TriggerAngle is the equivalent of typing the angle into Vdraft.
boolean TriggerOffset (IVector offset)
If the current action is displaying an offset cursor tip, calling TriggerOffset is the equivalent of typing the offset into Vdraft.
boolean TriggerScale (IVector scale)
If the current action is displaying a scale cursor tip, calling TriggerScale is the equivalent of typing the scale into Vdraft.
boolean TriggerHeight(double height)
If the current action is displaying a height cursor tip, calling TriggerHeight is the equivalent of typing the height into Vdraft.
boolean TriggerWidth(double width)
If the current action is displaying a width cursor tip, calling TriggerWidth is the equivalent of typing the width into Vdraft.
boolean TriggerRadius(double radius)
If the current action is displaying a radius cursor tip, calling TriggerRadius is the equivalent of typing the radius into Vdraft.
boolean TriggerDiameter(double diameter)
If the current action is displaying a diameter cursor tip, calling TriggerDiameter is the equivalent of typing the diameter into Vdraft.


ISelectionEvents Interface

ISelectionEvents

See Also
OCX-Events
cVdraftEvent
Plug-Ins
This collection of functions has to do with receiving notifications from Vdraft whenever the user has completed some selection process. You can have the user select a single entity, a group of entities, etc. This gives you ability to make your application interactive with the user.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
BSTR Name
BSTR StatusBar
methods:
boolean | RequestSelect(long addonid, [long userinfo])
boolean | RequestSingleSelect(long addonid, [long userinfo])
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name
C++ | BSTR GetName()
C++ | void SetName(BSTR)
This text is displayed on the popup menu and cursor tip to help inform the user what the current action is.
StatusBar
Visual Basic | BSTR StatusBar
C++ | BSTR GetStatusBar()
C++ | void SetStatusBar(BSTR)
This text is displayed on the status bar to help inform the user what the current action is.
boolean RequestSelect(long addonid, [long userinfo])
This allows the user to select multiple objects (as with many commands such as Move). The add-on is notified of relevant events through calls to vfSelectEvent. addonid is the id passed to the plug-in in vfLoad. Note: Visual Basic users should call RequestSelect from the OCX instead.
boolean RequestSingleSelect(long addonid, [long userinfo])
This allows the user to select a single object (as with commands such as Trim). The add-on is notified of relevant events through calls to vfSelectEvent. addonid is the id passed to the plug-in in vfLoad. Note: Visual Basic users should call RequestSelect from the OCX instead.


IApplicationID Interface

IApplicationID

properties:
IVdraft | Application | (read-only)
IApplicationIDs | Parent | (read-only)
BSTR | Name | (default)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IApplicationIDs Parent (read-only)
C++ | IApplicationIDs GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.


IApplicationIDs Interface

IApplicationIDs

See Also
IXData
An application ID is the name you give your application for internal tracking in the drawing database. For example, with XData, the application IDs are used to tell which data belongs to which applications, since an entity could have any amount of XData attached to it, and this data could belong to any of several applications.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
IApplicationID | Item( VARIANT which) | (read-only) (default)
methods:
IApplicationID | Add (BSTR name)
boolean | Remove (IApplicationID entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of application IDs in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | IApplicationID Item( VARIANT which) (read-only) (default)
C++ | IApplicationID GetItem()
Returns the specified table entry. which can be a string (name) or index.
IApplicationID Add (BSTR name)
Adds a table entry with the given name.
boolean Remove (IApplicationID entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


IBlock Interface

IBlock

See Also
IBlocks
Controls the settings for an individual block.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (default)
IVector Where
IVector | ExtentsMin | (read-only)
IVector | ExtentsMax | (read-only)
boolean | IsXref | (read-only)
boolean | IsAnonymous | (read-only)
boolean | HasAttributes | (read-only)
IEntitySet | Inserts | (read-only)
methods:
void | SaveAs (BSTR filename) --ADDED FOR 1.5--
void | CopyToClipboard() --ADDED FOR 1.5--
void | XrefReload() --ADDED FOR 1.5--
void | XrefDetach() --ADDED FOR 1.5--
void | XrefBind() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. This may be IBlocks or IInsert .
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
The base point of the block.
ExtentsMin
Visual Basic | IVector ExtentsMin (read-only)
C++ | IVector GetExtentsMin()
The minimum values of the extents of the block.
ExtentsMax
Visual Basic | IVector ExtentsMax (read-only)
C++ | IVector GetExtentsMax()
The maximum values of the extents of the block.
IsXref
Visual Basic | boolean IsXref (read-only)
C++ | boolean GetIsXref()
If the block is an Xref (external reference.)
IsAnonymous
Visual Basic | boolean IsAnonymous (read-only)
C++ | boolean GetIsAnonymous()
If the block is anonymous (such as dimension or hatching blocks.)
HasAttributes
Visual Basic | boolean HasAttributes (read-only)
C++ | boolean GetHasAttributes()
If the block definition includes attributes.
Inserts
Visual Basic | IEntitySet Inserts (read-only)
C++ | IEntitySet GetInserts()
Returns the list of all inserts of this block.
void SaveAs (BSTR filename) --ADDED FOR 1.5--
Save the block to a file.
void CopyToClipboard() --ADDED FOR 1.5--
Copy the block to the clipboard.
void XrefReload() --ADDED FOR 1.5--
If the block is an Xref, reload it. Useful if the Xref has changed since the drawing was loaded. Note that by default Vdraft automatically reloads Xrefs that have been changed from within Vdraft.
void XrefDetach() --ADDED FOR 1.5--
If the block is an Xref, remove the Xref definition from the drawing. Use only if the Xref is unreferenced.
void XrefBind() --ADDED FOR 1.5--
If the block is an Xref, bring the block definition into the drawing. The block is no longer an Xref after binding.


IBlocks Interface

IBlocks

The collection of blocks ( IBlock objects) in the drawing.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
IBlock | Item( VARIANT which) | (read-only) (default)
IVector InsertBase
IVector PaperSpaceInsertBase
boolean | XrefVisibility
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
IBlock | Add (BSTR name, IVector basepoint, [veBlockDefinitionMethod how])
IBlock | Load (BSTR filename, [boolean asxref], [BSTR blockname])
boolean | Remove (IBlock entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of blocks in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | IBlock Item( VARIANT which) (read-only) (default)
C++ | IBlock GetItem()
Returns the specified table entry. which can be a string (name) or index.
InsertBase
Visual Basic | IVector InsertBase
C++ | IVector GetInsertBase()
C++ | void SetInsertBase(IVector)
Controls the base point for the entire drawing. If the drawing is inserted as a block or Xref in another drawing, this point is used as the "handle" for the drawing. Note that if the drawing is displayed in paperspace, PaperSpaceInsertBase is used instead.
PaperSpaceInsertBase
Visual Basic | IVector PaperSpaceInsertBase
C++ | IVector GetPaperSpaceInsertBase()
C++ | void SetPaperSpaceInsertBase(IVector)
Controls the base point for the entire drawing if it's in paperspace. If the drawing is inserted as a block or Xref in another drawing, this point is used as the "handle" for the drawing. Note that if the drawing is displayed in modelspace, InsertBase is used instead.
XrefVisibility
Visual Basic | boolean XrefVisibility
C++ | boolean GetXrefVisibility()
C++ | void SetXrefVisibility(boolean)
Controls the visibility of Xrefs.
void Dialog()
Display the Block/Xref Manager dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the block changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
IBlock Add (BSTR name, IVector basepoint, [veBlockDefinitionMethod how])
Create a new block from the current selection set.
IBlock Load (BSTR filename, [boolean asxref], [BSTR blockname])

Load a block (drawing) from disk into the drawing. You could then use IEntities::AddInsert or IEntities::DrawInsert to insert the block.

asxref is an option you can use to indicate that the new block definition should be an Xref. Defaults to FALSE.
blockname can be specified if you want to specify the block name. By default the block name is simply the file name.
boolean Remove (IBlock entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


IColor Interface

IColor

A single color palette entry.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (read-only) (default)
short | Number | (read-only)
short | Red | (read-only)
short | Green | (read-only)
short | Blue | (read-only)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. My be an IColors , ILayer , or IEntity .
Name
Visual Basic | BSTR Name (read-only) (default)
C++ | BSTR GetName()
For the basic colors this returns a name. For other colors it returns the color index.
Number
Visual Basic | short Number (read-only)
C++ | short GetNumber()
Returns the color index. This could be used for various ColorNumber properties.
Red
Visual Basic | short Red (read-only)
C++ | short GetRed()
The red component of the color. Varies from 0 (no red) to 255 (pure red.)
Green
Visual Basic | short Green (read-only)
C++ | short GetGreen()
The green component of the color. Varies from 0 (no green) to 255 (pure green.)
Blue
Visual Basic | short Blue (read-only)
C++ | short GetBlue()
The blue component of the color. Varies from 0 (no blue) to 255 (pure blue.)


IColors Interface

IColors

The collection of colors ( IColor objects) that Vdraft supports. Allows you to change or access the current color as well as find out details about the color palette.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
IColor | Item( VARIANT which) | (read-only) (default)
IColor Active
IColor | SameAsLayer | (read-only)
IColor | SameAsBlock | (read-only)
methods:
void Dialog()
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of colors Vdraft supports. Currently this is 257 (colors 1-255 and SameAsLayer and SameAsBlock.)
Item
Visual Basic | IColor Item( VARIANT which) (read-only) (default)
C++ | IColor GetItem()
Returns the specified color entry. Can be a color name or index. Possible names include black, white, red, green, blue, cyan, yellow, magenta as well as Same as Block and Same as Layer. Note that black and white sometimes switch to adjust to the user's current background color.
Active
Visual Basic | IColor Active
C++ | IColor GetActive()
C++ | void SetActive(IColor)
Returns or sets the current color, that is, the color that new entities are drawn with by default.
SameAsLayer
Visual Basic | IColor SameAsLayer (read-only)
C++ | IColor GetSameAsLayer()
An entity which has a color that is "same as layer" inherits its color from the layer it is on.
SameAsBlock
Visual Basic | IColor SameAsBlock (read-only)
C++ | IColor GetSameAsBlock()
An entity which has a color that is "same as block" inherits its color from the block it is in. If it's not in a block, it is displayed as color 7 (white or black depending on your background color.)
void Dialog()
Display the Color dialog


IDimStyle Interface

IDimStyle

See Also
IDimStyles
Controls the settings for an individual dimension style.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (default)
double | ExtensionAboveLine
double | OffsetFromFeature
boolean | Extension1Visibility
boolean | Extension2Visibility
double | CenterMarkSize
IColor ExtensionColor
boolean | CreateCenterLines
boolean | ForceInteriorLines
boolean | BoxAroundText
double | Scaling
double | BaselineIncrement
double | TextGap
IColor DimensionLineColor
double | TickExtension
double | TickSize
double | ArrowSize
boolean | SeparateArrowHeads
veCommonArrowsType | ArrowsType | (read-only)
veSeparateArrowsType | Arrow1Type | (read-only)
veSeparateArrowsType | Arrow2Type | (read-only)
IBlock ArrowsBlock
IBlock Arrow1Block
IBlock Arrow2Block
double | TextHeight
double | TextHeightValue
double | VerticalPosition
veDimStyleAlignment Alignment
veDimStyleVertical Vertical
veDimStyleHorizontal Horizontal
IColor TextColor
double | ToleranceHeightScaling
double | RoundOff
BSTR PreText
BSTR PostText
double | LengthScaling
veDimStyleTolerance Tolerance
double | Upper
double | Lower
boolean | AlternateUnits
short | AlternatePrecision
BSTR AlternatePostText
double | AlternateScaling
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. May be IDimStyles or IDimension .
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
ExtensionAboveLine
Visual Basic | double ExtensionAboveLine
C++ | double GetExtensionAboveLine()
C++ | void SetExtensionAboveLine(double)
OffsetFromFeature
Visual Basic | double OffsetFromFeature
C++ | double GetOffsetFromFeature()
C++ | void SetOffsetFromFeature(double)
Extension1Visibility
Visual Basic | boolean Extension1Visibility
C++ | boolean GetExtension1Visibility()
C++ | void SetExtension1Visibility(boolean)
Extension2Visibility
Visual Basic | boolean Extension2Visibility
C++ | boolean GetExtension2Visibility()
C++ | void SetExtension2Visibility(boolean)
CenterMarkSize
Visual Basic | double CenterMarkSize
C++ | double GetCenterMarkSize()
C++ | void SetCenterMarkSize(double)
ExtensionColor
Visual Basic | IColor ExtensionColor
C++ | IColor GetExtensionColor()
C++ | void SetExtensionColor(IColor)
CreateCenterLines
Visual Basic | boolean CreateCenterLines
C++ | boolean GetCreateCenterLines()
C++ | void SetCreateCenterLines(boolean)
ForceInteriorLines
Visual Basic | boolean ForceInteriorLines
C++ | boolean GetForceInteriorLines()
C++ | void SetForceInteriorLines(boolean)
BoxAroundText
Visual Basic | boolean BoxAroundText
C++ | boolean GetBoxAroundText()
C++ | void SetBoxAroundText(boolean)
Scaling
Visual Basic | double Scaling
C++ | double GetScaling()
C++ | void SetScaling(double)
BaselineIncrement
Visual Basic | double BaselineIncrement
C++ | double GetBaselineIncrement()
C++ | void SetBaselineIncrement(double)
TextGap
Visual Basic | double TextGap
C++ | double GetTextGap()
C++ | void SetTextGap(double)
DimensionLineColor
Visual Basic | IColor DimensionLineColor
C++ | IColor GetDimensionLineColor()
C++ | void SetDimensionLineColor(IColor)
TickExtension
Visual Basic | double TickExtension
C++ | double GetTickExtension()
C++ | void SetTickExtension(double)
TickSize
Visual Basic | double TickSize
C++ | double GetTickSize()
C++ | void SetTickSize(double)
ArrowSize
Visual Basic | double ArrowSize
C++ | double GetArrowSize()
C++ | void SetArrowSize(double)
SeparateArrowHeads
Visual Basic | boolean SeparateArrowHeads
C++ | boolean GetSeparateArrowHeads()
C++ | void SetSeparateArrowHeads(boolean)
ArrowsType
Visual Basic | veCommonArrowsType ArrowsType (read-only)
C++ | veCommonArrowsType GetArrowsType()
Arrow1Type
Visual Basic | veSeparateArrowsType Arrow1Type (read-only)
C++ | veSeparateArrowsType GetArrow1Type()
Arrow2Type
Visual Basic | veSeparateArrowsType Arrow2Type (read-only)
C++ | veSeparateArrowsType GetArrow2Type()
ArrowsBlock
Visual Basic | IBlock ArrowsBlock
C++ | IBlock GetArrowsBlock()
C++ | void SetArrowsBlock(IBlock)
Arrow1Block
Visual Basic | IBlock Arrow1Block
C++ | IBlock GetArrow1Block()
C++ | void SetArrow1Block(IBlock)
Arrow2Block
Visual Basic | IBlock Arrow2Block
C++ | IBlock GetArrow2Block()
C++ | void SetArrow2Block(IBlock)
TextHeight
Visual Basic | double TextHeight
C++ | double GetTextHeight()
C++ | void SetTextHeight(double)
TextHeightValue
Visual Basic | double TextHeightValue
C++ | double GetTextHeightValue()
C++ | void SetTextHeightValue(double)
VerticalPosition
Visual Basic | double VerticalPosition
C++ | double GetVerticalPosition()
C++ | void SetVerticalPosition(double)
Alignment
Visual Basic | veDimStyleAlignment Alignment
C++ | veDimStyleAlignment GetAlignment()
C++ | void SetAlignment(veDimStyleAlignment)
Vertical
Visual Basic | veDimStyleVertical Vertical
C++ | veDimStyleVertical GetVertical()
C++ | void SetVertical(veDimStyleVertical)
Horizontal
Visual Basic | veDimStyleHorizontal Horizontal
C++ | veDimStyleHorizontal GetHorizontal()
C++ | void SetHorizontal(veDimStyleHorizontal)
TextColor
Visual Basic | IColor TextColor
C++ | IColor GetTextColor()
C++ | void SetTextColor(IColor)
ToleranceHeightScaling
Visual Basic | double ToleranceHeightScaling
C++ | double GetToleranceHeightScaling()
C++ | void SetToleranceHeightScaling(double)
RoundOff
Visual Basic | double RoundOff
C++ | double GetRoundOff()
C++ | void SetRoundOff(double)
PreText
Visual Basic | BSTR PreText
C++ | BSTR GetPreText()
C++ | void SetPreText(BSTR)
PostText
Visual Basic | BSTR PostText
C++ | BSTR GetPostText()
C++ | void SetPostText(BSTR)
LengthScaling
Visual Basic | double LengthScaling
C++ | double GetLengthScaling()
C++ | void SetLengthScaling(double)
Tolerance
Visual Basic | veDimStyleTolerance Tolerance
C++ | veDimStyleTolerance GetTolerance()
C++ | void SetTolerance(veDimStyleTolerance)
Upper
Visual Basic | double Upper
C++ | double GetUpper()
C++ | void SetUpper(double)
Lower
Visual Basic | double Lower
C++ | double GetLower()
C++ | void SetLower(double)
AlternateUnits
Visual Basic | boolean AlternateUnits
C++ | boolean GetAlternateUnits()
C++ | void SetAlternateUnits(boolean)
AlternatePrecision
Visual Basic | short AlternatePrecision
C++ | short GetAlternatePrecision()
C++ | void SetAlternatePrecision(short)
AlternatePostText
Visual Basic | BSTR AlternatePostText
C++ | BSTR GetAlternatePostText()
C++ | void SetAlternatePostText(BSTR)
AlternateScaling
Visual Basic | double AlternateScaling
C++ | double GetAlternateScaling()
C++ | void SetAlternateScaling(double)


IDimStyles Interface

IDimStyles

The collection of dimension styles ( IDimStyle objects) in the drawing. Allows you to change or access the current dimension style as well as control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
IDimStyle | Item( VARIANT which) | (read-only) (default)
IDimStyle Active
IDimStyle | Unnamed | (read-only)
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
IDimStyle | Add (BSTR name)
boolean | Remove (IDimStyle entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of dimension styles in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | IDimStyle Item( VARIANT which) (read-only) (default)
C++ | IDimStyle GetItem()
Returns the specified table entry. which can be a string (name) or index.
Active
Visual Basic | IDimStyle Active
C++ | IDimStyle GetActive()
C++ | void SetActive(IDimStyle)
Returns or sets the active dimension style, that is, the dimension style new dimensions are drawn with by default.
Unnamed
Visual Basic | IDimStyle Unnamed (read-only)
C++ | IDimStyle GetUnnamed()
Returns the unnamed dimension style.
void Dialog()
Display the Dimension Styles dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the dimension style changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
IDimStyle Add (BSTR name)
Add a table entry with the given name.
boolean Remove (IDimStyle entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


ILayer Interface

ILayer

See Also
ILayers
Controls the settings for an individual layer.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (default)
boolean | On
boolean | Frozen
IColor Color
short | ColorNumber
ILinetype Linetype
boolean | FrozenInView( IView view) | --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. This may be ILayers or an entity.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
On
Visual Basic | boolean On
C++ | boolean GetOn()
C++ | void SetOn(boolean)
Controls the visibility of the layer.
Frozen
Visual Basic | boolean Frozen
C++ | boolean GetFrozen()
C++ | void SetFrozen(boolean)
Controls the frozen state of the layer.
Color
Visual Basic | IColor Color
C++ | IColor GetColor()
C++ | void SetColor(IColor)
Controls the color of the layer. You can also use ColorNumber.

Visual Basic Code Sample

    ' set the color of the current layer to red
    ' assume doc already points to an IDocument object
    Dim Layer As Object
    Dim Red As Object
    Set Layer = doc.Layers.Active
    Set Red = doc.Colors.Item ("red")
    Set Layer.Color = Red

C++ Code Sample

    // set the color of the current layer to red
    // assume doc already points to an IDocument object
    ILayers layers( doc.GetLayers() );
    ILayer layer( layers.GetActive() );
    IColors colors( doc.GetColors() );
    IColor red( colors.GetItem( cVariant("red") ) );
    layer.SetColor(red);
ColorNumber
Visual Basic | short ColorNumber
C++ | short GetColorNumber()
C++ | void SetColorNumber(short)
Controls the color of the layer. You can also use Color.

Visual Basic Code Sample

    ' set the color of the current layer to red
    ' assume doc already points to an IDocument object
    Dim Layer As Object
    Set Layer = doc.Layers.Active
    Layer.ColorNumber = 1	' color #1 is red

C++ Code Sample

    // set the color of the current layer to red
    // assume doc already points to an IDocument object
    ILayers layers( doc.GetLayers() );
    ILayer layer( layers.GetActive() );
    layer.SetColorNumber(1);	// color #1 is red
Linetype
Visual Basic | ILinetype Linetype
C++ | ILinetype GetLinetype()
C++ | void SetLinetype(ILinetype)
Controls the linetype of the layer.
FrozenInView
Visual Basic | boolean FrozenInView( IView view) --ADDED FOR 1.5--
C++ | boolean GetFrozenInView()
C++ | void SetFrozenInView( IView view, boolean)
Controls the visibility of the layer in a given paperspace viewport.


ILayers Interface

ILayers

The collection of layers ( ILayer objects) in the drawing. Allows you to change or access the current layer as well as control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
ILayer | Item( VARIANT which) | (read-only) (default)
ILayer Active
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
ILayer | Add (BSTR name)
boolean | Remove (ILayer entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of layers in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | ILayer Item( VARIANT which) (read-only) (default)
C++ | ILayer GetItem()
Returns the specified table entry. which can be a string (name) or index.
Active
Visual Basic | ILayer Active
C++ | ILayer GetActive()
C++ | void SetActive(ILayer)
Returns or sets the active layer, that is, the layer that new entities are placed on by default.
void Dialog()
Display the Layer dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the layer changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
ILayer Add (BSTR name)
Add a table entry with the given name.
boolean Remove (ILayer entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


ILinetype Interface

ILinetype

See Also
ILinetypes
Controls the settings for an individual linetype.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (default)
BSTR Description
short | Count | (read-only)
double | Item(short index)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. This may be ILayer , ILinetypes , or an entity.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
Description
Visual Basic | BSTR Description
C++ | BSTR GetDescription()
C++ | void SetDescription(BSTR)
Text that describes the linetype.
Count
Visual Basic | short Count (read-only)
C++ | short GetCount()
The number of dashes, dots, and spaces in the linetype.
Item
Visual Basic | double Item(short index)
C++ | double GetItem()
C++ | void SetItem(short index, double)
An individual element of a linetype definition. Numbers above 0 represent the length of a dash. 0 represents a dot. Numbers below 0 represent the length of a space. Entries should alternate between a dash or dot and a space.


ILinetypes Interface

ILinetypes

The collection of linetypes ( ILinetype objects) in the drawing. Allows you to change or access the current linetype as well as control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
ILinetype | Item( VARIANT which) | (read-only) (default)
ILinetype Active
double | Scaling
boolean | PaperSpaceScaling
ILinetype | SameAsLayer | (read-only)
ILinetype | SameAsBlock | (read-only)
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
ILinetype | Add (BSTR name)
boolean | Remove (ILinetype entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of linetypes in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | ILinetype Item( VARIANT which) (read-only) (default)
C++ | ILinetype GetItem()
Returns the specified table entry. which can be a string (name) or index.
Active
Visual Basic | ILinetype Active
C++ | ILinetype GetActive()
C++ | void SetActive(ILinetype)
Returns or sets the active linetype, that is, the linetype that new entities are drawn with by default.
Scaling
Visual Basic | double Scaling
C++ | double GetScaling()
C++ | void SetScaling(double)
Controls the global scale factor used for displaying linetypes. The smaller the number, the smaller the dashes are drawn.
PaperSpaceScaling
Visual Basic | boolean PaperSpaceScaling
C++ | boolean GetPaperSpaceScaling()
C++ | void SetPaperSpaceScaling(boolean)
Same as PSLTSCALE in AutoCAD.
SameAsLayer
Visual Basic | ILinetype SameAsLayer (read-only)
C++ | ILinetype GetSameAsLayer()
An entity which has a linetype that is "same as layer" inherits its linetype from the layer it is on.
SameAsBlock
Visual Basic | ILinetype SameAsBlock (read-only)
C++ | ILinetype GetSameAsBlock()
An entity which has a linetype that is "same as block" inherits its linetype from the block it is in. If it's not in a block, it is displayed as CONTINUOUS.
void Dialog()
Display the Linetype dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the linetype changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
ILinetype Add (BSTR name)
Add a table entry with the given name.
boolean Remove (ILinetype entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


INamedView Interface

INamedView

See Also
INamedViews
IView
Controls the settings for an individual named view. Use IView::View to have a viewport use the settings from this named view.
properties:
IVdraft | Application | (read-only)
INamedViews | Parent | (read-only)
BSTR | Name | (default)
IVector Center
IVector Direction
IVector Target
double | Height
double | Width
double | Twist
double | LensLength
double | FrontClip
double | BackClip
boolean | UseFrontClip
boolean | UseBackClip
boolean | InPaperSpace
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | INamedViews Parent (read-only)
C++ | INamedViews GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
Center
Visual Basic | IVector Center
C++ | IVector GetCenter()
C++ | void SetCenter(IVector)
Controls the center of this view.
Direction
Visual Basic | IVector Direction
C++ | IVector GetDirection()
C++ | void SetDirection(IVector)
Controls the 3D direction of this view.
Target
Visual Basic | IVector Target
C++ | IVector GetTarget()
C++ | void SetTarget(IVector)
Controls the 3D target point of this view.
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Controls the height of this view.
Width
Visual Basic | double Width
C++ | double GetWidth()
C++ | void SetWidth(double)
Controls the width of this view.
Twist
Visual Basic | double Twist
C++ | double GetTwist()
C++ | void SetTwist(double)
Controls the twist (rotation around the z axis) of this view.
LensLength
Visual Basic | double LensLength
C++ | double GetLensLength()
C++ | void SetLensLength(double)
Controls the lens length of this view for perspective. Currently unused by Vdraft.
FrontClip
Visual Basic | double FrontClip
C++ | double GetFrontClip()
C++ | void SetFrontClip(double)
Controls the front clipping plane of this view. Currently unused by Vdraft.
BackClip
Visual Basic | double BackClip
C++ | double GetBackClip()
C++ | void SetBackClip(double)
Controls the back clipping plane of this view. Currently unused by Vdraft.
UseFrontClip
Visual Basic | boolean UseFrontClip
C++ | boolean GetUseFrontClip()
C++ | void SetUseFrontClip(boolean)
If the front clipping plane is used. Currently unused by Vdraft.
UseBackClip
Visual Basic | boolean UseBackClip
C++ | boolean GetUseBackClip()
C++ | void SetUseBackClip(boolean)
If the back clipping plane is used. Currently unused by Vdraft.
InPaperSpace
Visual Basic | boolean InPaperSpace
C++ | boolean GetInPaperSpace()
C++ | void SetInPaperSpace(boolean)
If this is a paperspace or modelspace view.


INamedViews Interface

INamedViews

The collection of named views ( INamedView objects) in the drawing. Allows you to control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
INamedView | Item( VARIANT which) | (read-only) (default)
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
INamedView | Add (BSTR name)
void | Remove (INamedView entry)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of named views in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | INamedView Item( VARIANT which) (read-only) (default)
C++ | INamedView GetItem()
Returns the specified table entry. which can be a string (name) or index.
void Dialog()
Display the Named Views dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the named view changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
INamedView Add (BSTR name)
Add a table entry with the given name.
void Remove (INamedView entry)
Remove the specified table entry.


ITextStyle Interface

ITextStyle

See Also
ITextStyles
Controls the settings for an individual text style.
properties:
IVdraft | Application | (read-only)
IDispatch | Parent | (read-only)
BSTR | Name | (default)
double | Height
double | LastHeight
double | ObliqueAngle
double | XScaling
boolean | UpsideDown
boolean | Backwards
BSTR Font
BSTR BigFont
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDispatch Parent (read-only)
C++ | IDispatch GetParent()
Returns the owner of this object. My be an ITextStyles or a text entity.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Controls the default height for new text entities created with this style.
LastHeight
Visual Basic | double LastHeight
C++ | double GetLastHeight()
C++ | void SetLastHeight(double)
The height of the last text entity drawn with this style. Used for drawing new text entities.
ObliqueAngle
Visual Basic | double ObliqueAngle
C++ | double GetObliqueAngle()
C++ | void SetObliqueAngle(double)
Controls the default oblique angle for new text entities created with this style.
XScaling
Visual Basic | double XScaling
C++ | double GetXScaling()
C++ | void SetXScaling(double)
Controls the default x scale factor for new text entities created with this style.
UpsideDown
Visual Basic | boolean UpsideDown
C++ | boolean GetUpsideDown()
C++ | void SetUpsideDown(boolean)
Controls the default upsidedown setting for new text entities created with this style.
Backwards
Visual Basic | boolean Backwards
C++ | boolean GetBackwards()
C++ | void SetBackwards(boolean)
Controls the default backwards setting for new text entities created with this style.
Font
Visual Basic | BSTR Font
C++ | BSTR GetFont()
C++ | void SetFont(BSTR)
Controls the font used to display text of this style.
BigFont
Visual Basic | BSTR BigFont
C++ | BSTR GetBigFont()
C++ | void SetBigFont(BSTR)
Controls the big font used to display text of this style. Big fonts are used to represent non-ASCII characters.


ITextStyles Interface

ITextStyles

The collection of text styles ( ITextStyle objects) in the drawing. Allows you to change or access the current text style as well as control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
ITextStyle | Item( VARIANT which) | (read-only) (default)
ITextStyle Active
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
ITextStyle | Add (BSTR name)
boolean | Remove (ITextStyle entry) --ADDED FOR 2.0--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of text styles in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | ITextStyle Item( VARIANT which) (read-only) (default)
C++ | ITextStyle GetItem()
Returns the specified table entry. which can be a string (name) or index.
Active
Visual Basic | ITextStyle Active
C++ | ITextStyle GetActive()
C++ | void SetActive(ITextStyle)
Returns or sets the active text style, that is, the style new text entities are drawn with by default.
void Dialog()
Display the Text Styles dialog
void Update() (VB alternate: UpdateNow)
Bundle up all the text style changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
ITextStyle Add (BSTR name)
Add a table entry with the given name.
boolean Remove (ITextStyle entry) --ADDED FOR 2.0--
Removes the given entry if it isn't referenced by another object in the drawing.


IUcs Interface

IUcs

See Also
IUcses
Controls the settings for an individual User Coordinate System (UCS) entry.
properties:
IVdraft | Application | (read-only)
IUcses | Parent | (read-only)
BSTR | Name | (default)
IVector Origin
IVector XAxis
IVector YAxis
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IUcses Parent (read-only)
C++ | IUcses GetParent()
Returns the owner of this object.
Name
Visual Basic | BSTR Name (default)
C++ | BSTR GetName()
C++ | void SetName(BSTR)
The name of the entry.
Origin
Visual Basic | IVector Origin
C++ | IVector GetOrigin()
C++ | void SetOrigin(IVector)
Controls the origin point of this UCS.
XAxis
Visual Basic | IVector XAxis
C++ | IVector GetXAxis()
C++ | void SetXAxis(IVector)
Controls the direction of the x axis for this UCS.
YAxis
Visual Basic | IVector YAxis
C++ | IVector GetYAxis()
C++ | void SetYAxis(IVector)
Controls the direction of the y axis for this UCS.


IUcses Interface

IUcses

The collection of User Coordinate Systems ( IUcs objects) in the drawing. Allows you to change or access the current UCS as well as control the settings for individual entries.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
long | Count | (read-only)
boolean | HasItem( VARIANT which) | (read-only)
IUcs | Item( VARIANT which) | (read-only) (default)
IUcs Active
IUcs | PaperSpace | (read-only)
methods:
void | Dialog()
void | Update() (VB alternate: UpdateNow)
IUcs | Add (BSTR name)
void | Remove (IUcs entry)
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of UCSes in the current drawing.
HasItem
Visual Basic | boolean HasItem( VARIANT which) (read-only)
C++ | boolean GetHasItem()
Returns TRUE if the specified entry exists in the table. which can be a string (name) or index.
Item
Visual Basic | IUcs Item( VARIANT which) (read-only) (default)
C++ | IUcs GetItem()
Returns the specified table entry. which can be a string (name) or index.
Active
Visual Basic | IUcs Active
C++ | IUcs GetActive()
C++ | void SetActive(IUcs)
Returns or sets the active UCS, that is, the UCS that new entities are placed on by default.
PaperSpace
Visual Basic | IUcs PaperSpace (read-only)
C++ | IUcs GetPaperSpace()
Returns or sets the active UCS used in paperspace.
void Dialog()
void Update() (VB alternate: UpdateNow)
Bundle up all the UCS changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
IUcs Add (BSTR name)
Add a table entry with the given name.
void Remove (IUcs entry)
Remove the specified table entry.


IView Interface

IView

See Also
IViews
Controls the settings for an individual viewport.
properties:
IVdraft | Application | (read-only)
IViews | Parent | (read-only)
IVector Center
IVector Direction
IVector Target
double | Height
double | Width
double | Twist
double | LensLength
double | FrontClip
double | BackClip
boolean | UseFrontClip
boolean | UseBackClip
IVector | UpperRight | (read-only)
IVector | LowerLeft | (read-only)
IGridSnap | GridSnap | (read-only)
IAngleSnap | AngleSnap | (read-only)
IViewport | Entity | (read-only)
double | PaperspaceScale | --ADDED FOR 1.5--
methods:
IVector | TranslatePoint (IVector point)
void | Redraw()
void | Regen()
void | Extents()
void | View (INamedView namedView)
void | ViewPoint (IVector vpoint)
void | ZoomWindow (IVector corner1,IVector corner2)
void | PanWindow (IVector point1,IVector point2)
void | ZoomFactor(double factor)
void | PreTranslate (IVector offset)
void | PostTranslate (IVector offset)
void | PreScale (IVector scale)
void | PostScale (IVector scale)
void | PreRotate(double xangle, double yangle, double zangle)
void | PostRotate(double xangle, double yangle, double zangle)
void | CenterPreRotate(double xangle, double yangle, double zangle)
void | CenterPostRotate(double xangle, double yangle, double zangle)
void | Update() (VB alternate: UpdateNow)
void | Plan() --ADDED FOR 1.5--
void | LastView() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IViews Parent (read-only)
C++ | IViews GetParent()
Returns the owner of this object.
Center
Visual Basic | IVector Center
C++ | IVector GetCenter()
C++ | void SetCenter(IVector)
Controls the center of this view.
Direction
Visual Basic | IVector Direction
C++ | IVector GetDirection()
C++ | void SetDirection(IVector)
Controls the 3D direction of this view.
Target
Visual Basic | IVector Target
C++ | IVector GetTarget()
C++ | void SetTarget(IVector)
Controls the 3D target point of this view.
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Controls the height of this view.
Width
Visual Basic | double Width
C++ | double GetWidth()
C++ | void SetWidth(double)
Controls the width of this view.
Twist
Visual Basic | double Twist
C++ | double GetTwist()
C++ | void SetTwist(double)
Controls the twist (rotation around the z axis) of this view.
LensLength
Visual Basic | double LensLength
C++ | double GetLensLength()
C++ | void SetLensLength(double)
Controls the lens length of this view for perspective. Currently unused by Vdraft.
FrontClip
Visual Basic | double FrontClip
C++ | double GetFrontClip()
C++ | void SetFrontClip(double)
Controls the front clipping plane of this view. Currently unused by Vdraft.
BackClip
Visual Basic | double BackClip
C++ | double GetBackClip()
C++ | void SetBackClip(double)
Controls the back clipping plane of this view. Currently unused by Vdraft.
UseFrontClip
Visual Basic | boolean UseFrontClip
C++ | boolean GetUseFrontClip()
C++ | void SetUseFrontClip(boolean)
If the front clipping plane is used. Currently unused by Vdraft.
UseBackClip
Visual Basic | boolean UseBackClip
C++ | boolean GetUseBackClip()
C++ | void SetUseBackClip(boolean)
If the back clipping plane is used. Currently unused by Vdraft.
UpperRight
Visual Basic | IVector UpperRight (read-only)
C++ | IVector GetUpperRight()
Returns the upper right corner of the viewport.
LowerLeft
Visual Basic | IVector LowerLeft (read-only)
C++ | IVector GetLowerLeft()
Returns the lower right corner of the viewport.
GridSnap
Visual Basic | IGridSnap GridSnap (read-only)
C++ | IGridSnap GetGridSnap()
Returns the object which controls grid and grid snap settings in the viewport.
AngleSnap
Visual Basic | IAngleSnap AngleSnap (read-only)
C++ | IAngleSnap GetAngleSnap()
Returns the object which controls angle snap settings in the viewport.
Entity
Visual Basic | IViewport Entity (read-only)
C++ | IViewport GetEntity()
Returns the entity representing the viewport (for non-tiled viewports.)
PaperspaceScale
Visual Basic | double PaperspaceScale --ADDED FOR 1.5--
C++ | double GetPaperspaceScale()
C++ | void SetPaperspaceScale(double)
Controls the ratio of paperspace units to the viewport's units.
IVector TranslatePoint (IVector point)
Run the point through the viewing transformation for the viewport.
void Redraw()
Redraw the viewport.
void Regen()
Regenerate the display list then redraw the viewport.
void Extents()
Change the view so the entire extents of the drawing are displayed.
void View (INamedView namedView)
Restore the saved view settings into the viewport.
void ViewPoint (IVector vpoint)
Display the drawing from the given viewpoint.
void ZoomWindow (IVector corner1,IVector corner2)
Zoom in on a specific area of the drawing you define via a magnifying window.
void PanWindow (IVector point1,IVector point2)
Pan the view. point1 is moved to the previous location of point2.
void ZoomFactor(double factor)
Magnify the view based on the given factor.
void PreTranslate (IVector offset)
Shift the view by the given offset before the other transformations are applied.
void PostTranslate (IVector offset)
Shift the view by the given offset after the other transformations are applied.
void PreScale (IVector scale)
Scale the view by the given factors before the other transformations are applied. Use (0,0,0) as a basepoint. Other basepoints can be specified by making use of PreTranslate and PostTranslate.
void PostScale (IVector scale)
Scale the view by the given factors after the other transformations are applied. Use (0,0,0) as a basepoint. Other basepoints can be specified by making use of PreTranslate and PostTranslate.
void PreRotate(double xangle, double yangle, double zangle)
Rotate the view by the given angles before the other transformations are applied. Use (0,0,0) as a basepoint. Other basepoints can be specified by making use of PreTranslate and PostTranslate.
void PostRotate(double xangle, double yangle, double zangle)
Rotate the view by the given angles after the other transformations are applied. Use (0,0,0) as a basepoint. Other basepoints can be specified by making use of PreTranslate and PostTranslate.
void CenterPreRotate(double xangle, double yangle, double zangle)
Rotate the view by the given angles around the center of the view before the other transformations are applied.
void CenterPostRotate(double xangle, double yangle, double zangle)
Rotate the view by the given angles around the center of the view after the other transformations are applied.
void Update() (VB alternate: UpdateNow)
Bundle up all the view changes into a command and adds it to the undo list. This happens automatically when the object is released (by going out of scope or being explicitly released.)
void Plan() --ADDED FOR 1.5--
Switch to plan view. This is the default 2D view looking straight down the z axis.
void LastView() --ADDED FOR 1.5--
Restore the previous view.


IViews Interface

IViews

The collection of views or viewports ( IView objects) in the drawing. Allows you to change or access the current viewport as well as control the view in individual viewports. If the drawing is in modelspace, this may be tiled viewports. If the drawing is in paperspace, this represents paperspace viewports.
properties:
IVdraft | Application | (read-only)
IDocument | Parent | (read-only)
IView | Item(long index) | (read-only) (default)
long | Count | (read-only)
boolean | HasPaperSpace | (read-only)
boolean | InPaperSpace
boolean | InPaperPorts
IView ActiveView
IView | PaperSpace | (read-only)
IVector | ExtentsMax | (read-only)
IVector | ExtentsMin | (read-only)
IVector | PaperSpaceExtentsMax | (read-only)
IVector | PaperSpaceExtentsMin | (read-only)
methods:
IView | Add (IVector corner1, IVector corner2)
void | Remove (IView entry)
void | Redraw() --ADDED FOR 1.5--
void | Regen() --ADDED FOR 1.5--
Application
Visual Basic | IVdraft Application (read-only)
C++ | IVdraft GetApplication()
Returns the main IVdraft object.
Parent
Visual Basic | IDocument Parent (read-only)
C++ | IDocument GetParent()
Returns the owner of this object.
Item
Visual Basic | IView Item(long index) (read-only) (default)
C++ | IView GetItem()
Returns the specified view entry.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of viewports in the current drawing.
HasPaperSpace
Visual Basic | boolean HasPaperSpace (read-only)
C++ | boolean GetHasPaperSpace()
If the drawing has paperspace.
InPaperSpace
Visual Basic | boolean InPaperSpace
C++ | boolean GetInPaperSpace()
C++ | void SetInPaperSpace(boolean)
If paperspace is currently displayed.
InPaperPorts
Visual Basic | boolean InPaperPorts
C++ | boolean GetInPaperPorts()
C++ | void SetInPaperPorts(boolean)
If a viewport in paperspace is currently the active viewport.
ActiveView
Visual Basic | IView ActiveView
C++ | IView GetActiveView()
C++ | void SetActiveView(IView)
Returns the active viewport.
PaperSpace
Visual Basic | IView PaperSpace (read-only)
C++ | IView GetPaperSpace()
Returns the paperspace viewport.
ExtentsMax
Visual Basic | IVector ExtentsMax (read-only)
C++ | IVector GetExtentsMax()
The maximum values of the extents of the drawing in modelspace.
ExtentsMin
Visual Basic | IVector ExtentsMin (read-only)
C++ | IVector GetExtentsMin()
The minimum values of the extents of the drawing in modelspace.
PaperSpaceExtentsMax
Visual Basic | IVector PaperSpaceExtentsMax (read-only)
C++ | IVector GetPaperSpaceExtentsMax()
The maximum values of the extents of the drawing in paperspace.
PaperSpaceExtentsMin
Visual Basic | IVector PaperSpaceExtentsMin (read-only)
C++ | IVector GetPaperSpaceExtentsMin()
The minimum values of the extents of the drawing in paperspace.
IView Add (IVector corner1, IVector corner2)
If the drawing is in paperspace, this adds a new viewport. corner1 and corner2 are the paperspace coordinates of opposite corners of the location of the new viewport.
void Remove (IView entry)
Remove the specified viewport.
void Redraw() --ADDED FOR 1.5--
Redraw everthing.
void Regen() --ADDED FOR 1.5--
Regenerate the display list and redraw everything.


Vdraft API Help

Programming for Virtual Drafter

  • Start Here.
  • Introduction and Overview.
  • API Overview.


bEntities Interface

bEntities

See Also
IEntities
ISelection
IEntitySet
All entity collections use these properties.
properties:
boolean | HasItems | (read-only)
long | Count | (read-only)
IEntity | Item( VARIANT which) | (read-only) (default)
IEntity | Last | (read-only)
IEntity | First | (read-only) --ADDED FOR 1.5--
IEntity | Next | (read-only) --ADDED FOR 1.5--
HasItems
Visual Basic | boolean HasItems (read-only)
C++ | boolean GetHasItems()
If there are any entities in this collection.
Count
Visual Basic | long Count (read-only)
C++ | long GetCount()
The number of entities in the collection.
Item
Visual Basic | IEntity Item( VARIANT which) (read-only) (default)
C++ | IEntity GetItem()
Returns the specified entry. which can be either an index or a handle ( BSTR .)
Last
Visual Basic | IEntity Last (read-only)
C++ | IEntity GetLast()
Returns the last entity in the list.
First
Visual Basic | IEntity First (read-only) --ADDED FOR 1.5--
C++ | IEntity GetFirst()
Returns the first entity in the list.
Next
Visual Basic | IEntity Next (read-only) --ADDED FOR 1.5--
C++ | IEntity GetNext()
Item, Last, First, and Next remember the index of the entity referenced so that Next can be used to quickly step through the entities.


bGeneralEntity Interface

bGeneralEntity

All entities and entity collections support these methods and properties. The terms entity and object are both used to refer to the graphical items in the drawing such as lines and circles.
properties:
IColor Color
short | ColorNumber
ILayer Layer
ILineType | LineType
double | Thickness
boolean | PaperSpace
IVector Normal
methods:
void | Redraw()
void | Regen()
void | Erase()
void | Delete()
void | Move (IVector offset)
IDispatch | Copy (IVector offset)
void | Scale (IVector basepoint, IVector scale) (VB alternate: ScaleIt)
void | Rotate (IVector basepoint, double angle)
void | Mirror (IVector point1, IVector point2, [boolean mirrortext])
IDispatch | MirrorCopy (IVector point1, IVector point2, [boolean mirrortext])
void | Dialog()
boolean | Offset (IVector vec, [double distance]) --ADDED FOR 1.5--
IDispatch | Array(short numrows,short numcols,double rowspacing,double colspacing, double rotation) --ADDED FOR 1.5--
IDispatch | Array3D(short numrows,short numcols,short numlevels,double rowspacing,double colspacing,double levelspacing, double rotation) --ADDED FOR 1.5--
IDispatch | PolarArray (short numitems,double fillangle,double angletween,IVector center, [IVector refpoint]) --ADDED FOR 1.5--
void | DisplayGrips() --ADDED FOR 1.5--
void | EraseGrips() --ADDED FOR 1.5--
Color
Visual Basic | IColor Color
C++ | IColor GetColor()
C++ | void SetColor(IColor)
Controls the color. You can also use ColorNumber.
ColorNumber
Visual Basic | short ColorNumber
C++ | short GetColorNumber()
C++ | void SetColorNumber(short)
Controls the color. You can also use Color.
Layer
Visual Basic | ILayer Layer
C++ | ILayer GetLayer()
C++ | void SetLayer(ILayer)
Controls the layer.
LineType
Visual Basic | ILineType LineType
C++ | ILineType GetLineType()
C++ | void SetLineType(ILineType)
Controls the linetype. Some entities (such as text) ignore this value.
Thickness
Visual Basic | double Thickness
C++ | double GetThickness()
C++ | void SetThickness(double)
Controls the thickness. Some entities (such as 3D faces) ignore this value.
PaperSpace
Visual Basic | boolean PaperSpace
C++ | boolean GetPaperSpace()
C++ | void SetPaperSpace(boolean)
Controls whether the object(s) are in paperspace or modelspace.
Normal
Visual Basic | IVector Normal
C++ | IVector GetNormal()
C++ | void SetNormal(IVector)
Controls the normal. This is the vector that is perpendicular to the plane the object(s) are in. The default is (0,0,1). The length of the normal must be 1. Some entities (such as 3D faces) ignore this value.
void Redraw()
Redraw the object(s).
void Regen()
Regenerate the display list for the object(s). If the object(s) have been modified, this is done automatically when the interface is released.
void Erase()
Temporarily erases the object(s) without deleting it from the drawing.
void Delete()
Permanently deletes the object(s) from the drawing.
void Move (IVector offset)
Move the object(s).
IDispatch Copy (IVector offset)
Copy the object(s) offset from the original. This returns an object of the same type as the original.
void Scale (IVector basepoint, IVector scale) (VB alternate: ScaleIt)
Scale the object(s). The specified scale factors are relative to the given basepoint.
void Rotate (IVector basepoint, double angle)
Rotate the object(s) relative to the given basepoint.
void Mirror (IVector point1, IVector point2, [boolean mirrortext])
Mirror the object(s) across the line described by point1 and point2. If mirrortext is TRUE, text becomes upsidedown or backwards as appropriate. If mirrortext is FALSE, the text location is mirrored, but the text keeps its original orientation. If mirrortext is not specified, the setting from IHeader::MirrorText is used.
IDispatch MirrorCopy (IVector point1, IVector point2, [boolean mirrortext])
Create a copy of the object(s) then mirror the new object(s) across the line described by point1 and point2. If mirrortext is TRUE, text becomes upsidedown or backwards as appropriate. If mirrortext is FALSE, the text location is mirrored, but the text keeps its original orientation. If mirrortext is not specified, the setting from IHeader::MirrorText is used. This returns an object of the same type as the original.
void Dialog()
Display the entity or group property dialog.
boolean Offset (IVector vec, [double distance]) --ADDED FOR 1.5--
Create a copy of the object(s) and offset them. If distance is not specified, offset through the given point. If distance is specified, offset at the given distance using vec to determine which side of the original(s) to use.
IDispatch Array(short numrows,short numcols,double rowspacing,double colspacing, double rotation) --ADDED FOR 1.5--
Create a 2D rectangular array of the object(s). The orientation of the array is relative to the current view. This returns an object of the same type as the original.
IDispatch Array3D(short numrows,short numcols,short numlevels,double rowspacing,double colspacing,double levelspacing, double rotation) --ADDED FOR 1.5--
Create a 3D rectangular array of the object(s). The orientation of the array is relative to the current view. This returns an object of the same type as the original.
IDispatch PolarArray (short numitems,double fillangle,double angletween,IVector center, [IVector refpoint]) --ADDED FOR 1.5--
Create a polar array of the object(s). Two of the three parameters, numitems, fillangle, angletween should be non-zero; the other value should be 0. If refpoint is specified, the orientation of the object(s) is maintained; object(s) are rotated around center relative to refpoint. The orientation of the array is relative to the current view. This returns an object of the same type as the original.
void DisplayGrips() --ADDED FOR 1.5--
Display the object manipulation grips for the object(s).
void EraseGrips() --ADDED FOR 1.5--
Erase the object manipulation grips for the object(s).


bGeneralText Interface

bGeneralText

IText , IAttdef , and IAttribute entities support these methods and properties.
properties:
IVector AlignPoint
boolean | Backwards
double | Height
veJustifyHorizontal Horizontal
double | ObliqueAngle
double | Rotation
IVector Where
IVector WhereJustified
BSTR Text
ITextStyle Style
boolean | Upsidedown
veJustifyVertical Vertical
double | XScaling
AlignPoint
Visual Basic | IVector AlignPoint
C++ | IVector GetAlignPoint()
C++ | void SetAlignPoint(IVector)
Controls the align point. Used if Horizontal is set to veJH_Align.
Backwards
Visual Basic | boolean Backwards
C++ | boolean GetBackwards()
C++ | void SetBackwards(boolean)
If the text is displayed backwards.
Height
Visual Basic | double Height
C++ | double GetHeight()
C++ | void SetHeight(double)
Controls the height.
Horizontal
Visual Basic | veJustifyHorizontal Horizontal
C++ | veJustifyHorizontal GetHorizontal()
C++ | void SetHorizontal(veJustifyHorizontal)
Controls the horizontal justification.
ObliqueAngle
Visual Basic | double ObliqueAngle
C++ | double GetObliqueAngle()
C++ | void SetObliqueAngle(double)
Controls the obliquing angle.
Rotation
Visual Basic | double Rotation
C++ | double GetRotation()
C++ | void SetRotation(double)
Controls how the baseline of the text is rotated.
Where
Visual Basic | IVector Where
C++ | IVector GetWhere()
C++ | void SetWhere(IVector)
Controls the location of the text.
WhereJustified
Visual Basic | IVector WhereJustified
C++ | IVector GetWhereJustified()
C++ | void SetWhereJustified(IVector)
Controls the point horizontally and vertically justified text uses.
Text
Visual Basic | BSTR Text
C++ | BSTR GetText()
C++ | void SetText(BSTR)
Controls the text string.
Style
Visual Basic | ITextStyle Style
C++ | ITextStyle GetStyle()
C++ | void SetStyle(ITextStyle)
Controls the style which determines the font used to display the text.
Upsidedown
Visual Basic | boolean Upsidedown
C++ | boolean GetUpsidedown()
C++ | void SetUpsidedown(boolean)
If the text is displayed upsidedown.
Vertical
Visual Basic | veJustifyVertical Vertical
C++ | veJustifyVertical GetVertical()
C++ | void SetVertical(veJustifyVertical)
Controls the horizontal justification.
XScaling
Visual Basic | double XScaling
C++ | double GetXScaling()
C++ | void SetXScaling(double)
Controls how the width is scaled.


Sample Code - Reading IColors

C/C++ Sample Code

Reading IColors

See Also
C/C++ Sample Code
IColors
IColor

Test reads every color in the IColors table for the active drawing. This example shows using LPDISPATCH values as parameters, how to use all the methods belonging to IColors (excepting GetApplication() and GetParent())

// Read all the colors in the colors “table”
// the parameter is the value returned from IDocument::GetColors
void ReadAllColors(IColors& table)
{
    ReadColor( table.GetActive() );
    ReadColor( table.GetSameAsLayer() );
    ReadColor( table.GetSameAsBlock() );
    //  now read each table entry one by one
    int count = table.GetCount();
    for (int i=1; i<=count; i++)
        ReadColor( table.GetItem( cVariant(i) ) );
    table.Dialog();			// bring up the colors dialog box for the user
}

//  Read the values of the given IColor object
void ReadColor(IColor& entry)
{
    CString sName = entry.GetName();	// Name readonly
    int IVal = entry.GetNumber();	// Number readonly
    double dVal = entry.GetRed();	// Red readonly
    dVal = entry.GetGreen();		// Green readonly
    dVal = entry.GetBlue();		// Blue readonly
}


Sample Code - Starting Vdraft

C/C++ Sample Code

Starting Vdraft

The following C++ sample code shows one method of getting Vdraft started up and of then getting a handle to a current document (creating one, if there isn’t one already active).

    //  grab a pointer to Vdraft.  Open the application.
    IVdraft Vdraft;
    if (! Vdraft.CreateDispatch("Vdraft.Application", NULL))
    {
        //  Vdraft did not start.  Handle accordingly for your app…
    }

    CString AppName = Vdraft.GetName();	// this should return “Vdraft”
    ASSERT (AppName == "Vdraft");
    //  get a pointer to the currently active document
    IDocuments Dox(Vdraft.GetDocuments());
    if (Dox.Count() == 0)
        // if no drawings are loaded, create one
        Dox.Add(cVariant());

    IDocument Doc(Vdraft.ActiveDocument());
    CString DocName = Doc.GetFullName();	// get the name of the currently active document
    //
    //  (whatever other processing you need/want to do)
    //

From this point on you have access to Vdraft and all it wonders. If you keep “Vdraft” as a global object, or wrap it up in a class, or something of the like, then it can be accessed at any time you need Vdraft.


Sample Code - Retrieving Header Variables

C/C++ Sample Code

Retrieving Header/System Variables

This example illustrates a hypothetical application that needs to read every header variable in the the drawing. This comes in two parts: the OnHeader() function, which might be attached to a dialog box button in the app and GetHeader() which retrieves every header variable. Obviously, as presented, this is not very useful code, but it does illustrate how to get Vdraft, and how every header variable might be accessed. See IHeader for more information.

void CAutoTestDlg::OnHeader()
{
    IVdraft app;
    if ( !app.CreateDispatch("Vdraft.Application", NULL) )
        return;				// failed to find Vdraft

    IDocument doc(app.GetActiveDocument());	// get the active document
    GetAllHeaders( doc.GetHeader() );	// interface to the header vars
}

void GetAllHeaders(LPDISPATCH idisp)
{
    CString prop_str;			// temp vars for storing the values
    double prop_double;
    int prop_int;
    BOOL prop_bool;

    IHeader header(idisp);			// create an IHeader object from the dispatch handle

    prop_bool = header.GetAttributeDialog();
    prop_int = header.GetAttributeMode();
    prop_bool = header.GetAttributeRequest();
    prop_bool = header.GetAxisMode();
    IVector axis_unit( header.GetAxisUnit() );
    prop_str = axis_unit.Dump();
    prop_bool = header.GetBlipMode();
    prop_int = header.GetCirclePrecision();
    prop_int = header.GetCoordinateDisplay();
    prop_double = header.GetCurrentElevation();
    prop_double = header.GetCurrentThickness();
    prop_int = header.GetDragMode();
    prop_int = header.GetDrawingCodePage();
    prop_bool = header.GetFastZoom();
    prop_bool = header.GetFillMode();
    prop_bool = header.GetFlatLand();
    prop_bool = header.GetHandles();
    IVector limits_max( header.GetLimitsMax() );
    prop_str = limits_max.Dump();
    IVector limits_min( header.GetLimitsMin() );
    prop_str = limits_min.Dump();
    prop_bool = header.GetLimitsCheck();
    prop_int = header.GetMaxActiveViewports();
    prop_bool = header.GetMirrorText();
    prop_double = header.GetPaperSpaceElevation();
    IVector pspace_limits_max( header.GetPaperSpaceLimitsMax() );
    prop_str = pspace_limits_max.Dump();
    IVector pspace_limits_min( header.GetPaperSpaceLimitsMin() );
    prop_str = pspace_limits_min.Dump();
    prop_bool = header.GetPaperSpaceLimitsCheck();
    prop_int = header.GetPolylineLinetypePattern();
    prop_double = header.GetPolylineWidth();
    prop_int = header.GetQuickText();
    prop_int = header.GetRegenMode();
    prop_int = header.GetShadeDiffuse();
    prop_int = header.GetShadeEdge();
    prop_double = header.GetSketchIncrement();
    prop_bool = header.GetSketchPolyline();
    prop_int = header.GetSplineFrame();
    prop_int = header.GetSplineSegments();
    prop_int = header.GetSplineType();
    prop_int = header.GetSurfaceDensityM();
    prop_int = header.GetSurfaceDensityN();
    prop_int = header.GetSurfaceTabulations1();
    prop_int = header.GetSurfaceTabulations2();
    prop_int = header.GetSurfaceType();
    prop_double = header.GetTextSize();
    prop_double = header.GetTraceSize();
    prop_int = header.GetTreeDepth();
    prop_int = header.GetUCSIcon();
    prop_int = header.GetUnitMode();
    prop_int = header.GetUserInteger1();
    prop_int = header.GetUserInteger2();
    prop_int = header.GetUserInteger3();
    prop_int = header.GetUserInteger4();
    prop_int = header.GetUserInteger5();
    prop_int = header.GetUserReal1();
    prop_int = header.GetUserReal2();
    prop_int = header.GetUserReal3();
    prop_int = header.GetUserReal4();
    prop_int = header.GetUserReal5();
    prop_bool = header.GetUserTimer();
    prop_bool = header.GetWorldView();
}


Sample Code - Running Through Every Entity in a Drawing

C/C++ Sample Code

Running Through Every Entity in a Drawing

See Also
Sample C/C++ Code
IEntities
IVdraft

This is a simple code fragment that acquires each entity in the currently active drawing and calls some other routine (ProcessEntity() – not defined in this example) to do something with each one of these. This might be counting the number of each type of entity, or looking for XData belonging to this application, etc..

    void CheckAllEntities()
    {
         IVdraft app;					// for the Vdraft application
         if ( !app.CreateDispatch("Vdraft.Application", NULL) )
              return;				// failed to find Vdraft

         IDocument doc(app.GetActiveDocument());	// get the active drawing
         IEntities entities(doc.GetEntities());		// get the entities in the drawing
         int count = entities.GetCount();		// how many are there?
         for (int i=1; i<=count; i++)			// do for each one of them
              ProcessEntity( entities.GetItem( cVariant(i) ) );	// call some function with the entity
    }


Sample Code - Interpreting XData

C/C++ Sample Code

Interpreting XData

See Also
veXDataType
IXData

The following example shows how you might run through the XData attached to an entity. “idisp” is a dispatch handle for an entity’s XData. This might be retrieved by calling the XData() function on a given entity.

void TestXData(IXData& xdata)
{
    CString sVal;				// for holding the various values
    double dVal;
    int iVal;
    while ( xdata.Next() )
    {
        int index = xdata.GetIndex();		// get the xdata index
        int group = xdata.GetGroup();		// get the group code (see DXF)
        switch ( xdata.GetType() )		// process according to the type of data it is
        {
            case veXDT_String:		// string data
                 sVal = xdata.GetString();
                 break;
            case veXDT_Control:		// XData control string
                 iVal = xdata.GetControl();
                 break;
            case veXDT_Layer:		// layer
            {
                 ILayer layer( xdata.GetLayer() );	// retrieve it as a layer object
                 sVal = layer.GetName();		// get the layer’s name
                 break;
            }
            case veXDT_Handle:		// entity handle
                  sVal = xdata.GetHandle();
                  break;
            case veXDT_Vector:		// Vector data
            {
                 IVector vec( xdata.GetVector() );
                 sVal = vec.Dump();
                 break;
            }
            case veXDT_Double:		// double floating point data
                 dVal = xdata.GetDouble();
                 break;
            case veXDT_Short:		// short integer
                 iVal = xdata.GetShort();
                 break;
            case veXDT_Long:		// long integer
                 iVal = xdata.GetLong();
                 break;
        }
    }
}


cVdraftEvent

cPickEvent cDrawEvent cSelectEvent

cPickEvent, cSelectEvent and cDrawEvent are classes, derived from the cVdraftEvent base class, that encapsulate event handling under C/C++. cPickEvent encapsulates the Vdraft pick event notifications. cDrawEvent encapsulates Vdraft drawing event notifications, and cSelectEvent encapsulates Vdraft selection events.

The file VAngular.Cpp, in Vdraft\Programs\Cpp\AngDim, shows one example of using cSelectEvent. The file VLeader.Cpp in Vdraft\Programs\Cpp\VCurveLdr shows a sample usage of cDrawEvent.

Besides making events just easier to use under C/C++, these classes also automatically take care of such issues as multiple overlapping events taking place across multiple drawings. You do not have to track what event goes with what drawing and so forth in your own code; these classes do that for you. In your event requests, you simply pass a pointer to the class object that is handling the particular requested event and, voila, the correct handler will be called.

Using these classes is optional, of course. You can call into Vdraft directly for event requests and so forth. The sample app DrawX, under Vdraft\Programs\Cpp\DrawX, does not use any of these wrapper classes. It’s a good example of the mechanics of event request and notification in Vdraft.

See Also:

ISelectionEvents

IPickEvents

IApplicationEvents

PlugIns


IDispatch Interface

IDispatch

This represents a generic handle to an interface. Methods and properties may list an option as an IDispatch to indicate that the actual value may be one of several different interfaces.


(Untitled)

BSTR

A BSTR is a special type of string. It stands for Basic STRing and came originally from Basic. It is a string preceded by a value giving the string's length.

Visual C/C++ Books Online defines a BSTR as

A length-prefixed string used by OLE Automation data manipulation functions.

typedef OLECHAR *BSTR;

Under Visual Basic, it is handled for you automatically. You need only deal with strings as you always do.

Under Visual C/C++, the easiest way to deal with BSTR parameters is to use CString objects and simply use them where ever a BSTR is asked for. Alternatively, you can use the SysAllocString() function to transform an ordinary string into a BSTR. (See the topics "Data Manipulation Functions" and "String Manipulation Functions" in Microsoft's Books Online for more information about BSTR's.)


Class Hierarchy Chart

Object Hierarchy Chart

IVdraft
IApplicationEvents
IDocuments
IDocument
IApplicationIDs IApplicationID
IBlocks IBlock IEntitySet
IColors IColor
IDimStyles IDimStyle
IEntities IEntity IXData
IEntitySet IEntity
IEntitySnap
IHeader
ILayers ILayer
ILineTypes ILineType
INamedViews INamedView
IPickEvents
ISelectionEvent
ITextStyles ITextStyle
IUcses IUcs
IUnits
IViews IView IAngleSnap
IGridSnap
IEntity
IArc
IAttdef
IBlock
ICircle
IDimension
IFace
IInsert IAttributes IAttribute
ILine
IPoint
I2DPolyline I2DVertices I2DVertex
I3DPolyline IVertices IVertex
IPolymesh IVertices IVertex
IPolyface IVertices IVertex
IFaceVertices IFaceVertex
IShape
ISolid
IText
ITrace
IViewport
IMatrix
IVector
IVectors
cVariant
cVdraftEvent
cDrawEvent
cPickEvent
cSelectionEvent


(Untitled)

ActiveX

A lot of programmers are intimidated by ActiveX (aka OLE) Automation. Yes, it is – or can be – a vast subject, full of esoteric knowledge such as only dusty medievel mystics would really care for. But what’s that got to do with us? Nothing!

Working with Vdraft is easy. We have hidden most of the complexities and made it as easy as we can. Think of ActiveX simply as a behind-the-scenes bit of VooDoo that you don’t really need to know much about, and you’ll be fine.

(Truly, it’s a lot easier than trying to decipher ARX !!)


Enumerated Types

VUtil.Bas – Defined Symbols for VB

See Also
C++ version of symbols

This shows the contents of the VUTIL.BAS file. You should include this file in your VB applications when working with Vdraft.

Attribute VB_Name = "Vutil"
' (C) Copyright 1997 by SoftSource.  All rights reserved.
' Useful constants for use with Vdraft

' IUnits::Linear - veLinearUnits
Public Const veLU_Scientific = 1
Public Const veLU_Decimal = 2
Public Const veLU_Engineering = 3
Public Const veLU_Architectural = 4
Public Const veLU_Fractional = 5

' IUnits::Angular - veAngularUnits
Public Const veAU_DecimalDegrees = 0
Public Const veAU_DegMinSec = 1
Public Const veAU_Grads = 2
Public Const veAU_Radians = 3
Public Const veAU_Surveyor = 4

' IDimStyle::Alignment - veDimStyleAlignment
Public Const veDSA_Horizontal = 0
Public Const veDSA_DimLine = 1
Public Const veDSA_Inside = 2
Public Const veDSA_Outside = 3

' IDimStyle::Vertical - veDimStyleVertical
Public Const veDSV_Centered = 0
Public Const veDSV_Above = 1
Public Const veDSV_Relative = 2

' IDimStyle::Horizontal - veDimStyleHorizontal
Public Const veDSH_Default = 0
Public Const veDSH_TextIn = 1
Public Const veDSH_TextArrowsIn = 2

' IDimStyle::Tolerance - veDimStyleTolerance
Public Const veDST_None = 0
Public Const veDST_Variance = 1
Public Const veDST_Limits = 2

' IDimStyle::ArrowsType - veCommonArrowsType
Public Const veCAT_Block = 0
Public Const veCAT_Default = 1
Public Const veCAT_Dot = 2
Public Const veCAT_Tick = 3

' IDimStyle::Arrow1Type
' IDimStyle::Arrow2Type - veSeparateArrowsType
Public Const veSAT_Block = 0
Public Const veSAT_Default = 1
Public Const veSAT_Dot = 2

' IEntity::Type - veEntityType
Public Const veET_Line = 0
Public Const veET_Point = 1
Public Const veET_Circle = 2
Public Const veET_Shape = 3
Public Const veET_Text = 4
Public Const veET_Arc = 5
Public Const veET_Trace = 6
Public Const veET_Solid = 7
Public Const veET_Insert = 8
Public Const veET_Attdef = 9
Public Const veET_Attrib = 10
Public Const veET_2DPolyline = 11
Public Const veET_3DPolyline = 12
Public Const veET_Polymesh = 13
Public Const veET_Polyface = 14
Public Const veET_2DVertex = 15
Public Const veET_Vertex = 16
Public Const veET_FaceVertex = 17
Public Const veET_3DFace = 18
Public Const veET_HorizontalDim = 19
Public Const veET_VerticalDim = 20
Public Const veET_RotatedDim = 21
Public Const veET_AlignedDim = 22
Public Const veET_Angular4PointDim = 23
Public Const veET_DiameterDim = 24
Public Const veET_RadiusDim = 25
Public Const veET_Angular3PointDim = 26
Public Const veET_OrdinateXDim = 27
Public Const veET_OrdinateYDim = 28
Public Const veET_Viewport = 29

' IXData::Type - veXDataType
Public Const veXDT_Invalid = 0
Public Const veXDT_String = 1
Public Const veXDT_Control = 2
Public Const veXDT_Layer = 3
Public Const veXDT_RawData = 4
Public Const veXDT_Handle = 5
Public Const veXDT_Vector = 6
Public Const veXDT_Double = 7
Public Const veXDT_Short = 8
Public Const veXDT_Long = 9

' IXData::Control - veXDataControl
Public Const veXDC_Start = 0    ' starting brace '{'
Public Const veXDC_End = 1  	' ending brace '}'

' IPolyline::Curve
' IPolyline::ColumnCurve
' IPolyline::RowCurve - vePolylineCurve
Public Const vePC_NoCurve = 0
Public Const vePC_Curved = 1
Public Const vePC_Cubic = 2
Public Const vePC_Quadratic = 3

' IText::Horizontal
' IAttdef::Horizontal
' IAttribute::Horizontal - veJustifyHorizontal
Public Const veJH_Left = 0
Public Const veJH_Center = 1
Public Const veJH_Right = 2
Public Const veJH_Align = 3
Public Const veJH_Middle = 4
Public Const veJH_Fit = 5

' IText::Vertical
' IAttdef::Vertical
' IAttribute::Vertical - veJustifyVertical
Public Const veJV_Baseline = 0
Public Const veJV_Bottom = 1
Public Const veJV_Middle = 2
Public Const veJV_Top = 3

' IBlocks::Add - veBlockDefinitionMethod
Public Const veBDM_EntitiesRemoved = 0
Public Const veBDM_ReplacedByInsert = 1
Public Const veBDM_EntitiesLeft = 2

' IMousePick::SetCursorTipInfo - veCursorTipInfo
Public Const veCTI_None = 0
Public Const veCTI_Offset = 1
Public Const veCTI_Scale = 2
Public Const veCTI_Angle = 3
Public Const veCTI_LengthAngle = 4
Public Const veCTI_Height = 5
Public Const veCTI_Width = 6
Public Const veCTI_Radius = 7
Public Const veCTI_Length = 8
Public Const veCTI_Diameter = 9

' IMousePick::TriggerPopup - vePickPopup
Public Const vePP_Done = 0
Public Const vePP_Cancel = 1
Public Const vePP_Properties = 2
Public Const vePP_Undo = 3
Public Const vePP_Help = 4
Public Const vePP_TypeCoordinates = 5

' handy function for setting a VB window to "always on top"
Declare Sub SetWindowPos Lib "User32" (ByVal hWnd&, ByVal hWndAfter&, ByVal x&, ByVal y&, ByVal cx&, ByVal cy&, ByVal flag&)

Public Sub WindowOnTop(ByVal hWnd&)
    SetWindowPos hWnd, -1, 0, 0, 0, 0, &HB
End Sub


(Untitled)

LPDISPATCH

An LPDISPATCH is a special Windows data type relating to ActiveX and ActiveX Automation. It is defined (in OLEAUTO.H, included with MSVC 4.x) as a pointer to an IDispatch interface object. What it amounts to is the way that ActiveX Automation connections and linkages are referred to.

Under Visual Basic, for instance, you do not have to deal directly with these data types; VB does all that for you. Under C++, you will need to deal with them, though it can be made very simple and fool-proof.

In one sense it's an indefinite pointer because in itself it contains no information about what sort of object or interface it is pointing to. For this reason, it is best to deal only briefly with LPDISPATCH's, passing them off quickly to the appropriate constructors. For example:

    // first get the active document in Vdraft
    IDocument Doc(Vdraft.GetActiveDocument());	// for currently active doc
    // Each of these deals with - quietly - an LPDISPATCH object.
    // It is passed immediately and invisibly to the constructor.
    IEntities entities(Doc.GetEntities());		// the drawing entities
    ICircle newcircle(entities.AddCircle());	// create a new line


Using Excel with Vdraft

Since Microsoft Excel works with ActiveX Automation, it also can be used to give instructions to or get information back from Vdraft. The techniques to use with Excel are quite similar to those for working with Visual Basic.

This also means that Microsoft Word, Access and other systems that support VBA (Visual Basic for Applicaions) should work similarly with Vdraft.

Included with the Vdraft package are some sample Excel applications, in \Vdraft\Programs\Excel. For example, you will find Excel\Attribs\ATTEXT.XLS. This sample will read the currently active drawing and list all the blocks containing attributes in that drawing.


Using C++

Working with Vdraft from C++ is quite simple. Using the tools provided you can access Vdraft as if it was just another collection of objects in your project.

Don’t get intimidated by Windows, OLE, ActiveX or Automation. These can be complex topics to fully understand, but just using them is simple. We have provided for you a CPP file and some header files that take away most of the complexity, awe and mystery of dealing with ActiveX Automation. By adding Vdraft.Cpp to your project, you can then deal with Vdraft as it was just another set of classes: objects you create, call member methods and properties of, and so on.

You start a conversation with the following lines:

    #include "Vdraft.h"
    IVdraft Vdraft;
    Vdraft.CreateDispatch("Vdraft.Application", NULL);
Methods are accessed using standard C++ syntax.

    Vdraft.Quit();
You can retrieve properties by prefixing the name with Get and set them by prefixing with Set.

    IDocument doc( Vdraft.GetActiveDocument() );
    vector.Setx(5);
The return value of one function can be passed to the constructor of the appropriate class.

    IVector vector( line.GetStartPoint() );
Parameters listed as VARIANT can often be different data types. Vutil.h defines cVariant, which can be used to conveniently pass VARIANT parameters.

    IVector vector( Vdraft.NewVector(cVariant(1), cVariant(2), cVariant(3)) );
Parameters listed as BSTR are strings – of a special type. If you are using MFC, you may simply pass a CString and not worry about it. Otherwise, you can use the SysAllocString() function and its relatives to create BSTR’s suitable for passing across Automation.

Parameters listed in square brackets are a special type of VARIANT where you don't need to specify a value. Note that you still need to pass the parameter in C++.

    IVector vector( Vdraft.NewVector(cVariant(1), cVariant(2), cVariant()) );	// z value empty
Default properties and methods have no meaning in C++.

Arrays are numbered starting at 1. For example, when using Item (which will accept an index as a parameter) with any of the tables the first entry is 1, not 0.


Using VB

Calling Vdraft from Visual Basic is extremely easy. Everything in VB is an object, one way or another. Forms, buttons, lines, circles, grid controls, pictures, etc. Vdraft is basically just one more object – one made up of a lot a of other objects.

Don’t get intimidated by Windows, OLE, ActiveX or Automation. These can be complex topics to understand, but just using them is simplicity itself.

The first step from Visual Basic is always to get a connection to Vdraft from your application. This can be done when your application first starts up and kept throughout the life of your app, or it can be obtained at any time, released at any time and obtained again as needed. This can be accomplished as shown here:

    Dim Vdraft As Object
    Set Vdraft = CreateObject("Vdraft.Application")
This gives you an object which has the methods and properties listed under IVdraft. It behaves just like any other object with methods and properties under VB.

Properties and methods can be accessed using the “dot” syntax. For example,

    Set doc = Vdraft.ActiveDocument
This gives you an object with the methods and properties listed under IDocument.

You declare Vdraft object variables As Object. Use the Set syntax to set the variable.

    Dim doc As Object
    Set doc = Vdraft.ActiveDocument

In some cases an alternate name is listed when there is a naming conflict with Visual Basic keywords, e.g. Closeout instead of Close in the IDocuments interface. These are noted throughout the API reference; often you will see a version of a method or property listed for C++ and another listed for Visual Basic.

Parameters listed as VARIANT are equivalent to VB’s Variant data type. This means several different types may be valid. For example, Item in the IDocuments interface can accept either an index or a file name.

Parameters listed as BSTR are normal Visual Basic strings. (It stands for Basic String.)

Parameters listed in square brackets are optional. The following are all valid:

    Set vec = Vdraft.NewVector(1,2,3)
    Set vec = Vdraft.NewVector(1,2)
    Set vec = Vdraft.NewVector
If you don't explicitly list a property or method for an interface, the default (if any) will be used. The following pairs of lines are equivalent:

    Print Vdraft.Name
    Print Vdraft
    Set entity = Entities.Item(1)
    Set entity = Entities(1)


VARIANT

Many properties and methods need to work with parameters whose type may vary. When a function accepts a VARIANT, this means that it may accept, for example, either a double or a string. In Visual Basic this is handled automatically for you. In C++ the easiest way to deal with this is to use the cVariant class which hides the details from you.


Sample Code - Listing All Active Drawings

Visual Basic Sample Code

Listing All Active Drawings

See Also
VB Sample Code
C/C++ Sample Code

The following code is a working sample snipped out of an actual VB application written for Vdraft. It polls Vdraft for all the currently active (i.e., opened) drawings and lists them in a VB list box.

ActiveDrawingsList is a list box used for holding and display all the active drawings

    ' Initialize
    Dim i%, j%
    Dim Vdraft, Docs, Dok As Object
    Set Vdraft = CreateObject("Vdraft.Application")
    Set Docs = Vdraft.Documents

    '   Now fill in the list box
    With MainForm.ActiveDrawingsList
        .Clear
        ' get all the current drawings from Vdraft
        If (Not Docs Is Nothing) Then
            i% = Docs.Count
            For j% = 1 To i%
                 Set Dok = Docs.Item(j%)
                 .AddItem Dok.Name
            Next
        End If
    End With


Sample Code - VB Essentials

Visual Basic Sample Code

The Essentials of Working with Vdraft

See Also
VB Sample Code
C/C++ Sample Code

Accessing Vdraft using ActiveX Automation from Visual Basic is very simple. The syntax looks like normal Visual Basic syntax with methods (functions and procedures) and properties being referenced off of existing objects.

The first step is to use CreateObject to get the Vdraft application object. From there you use the dot (".") syntax to access methods and properties as in the following example which prints out the name of the current layer in the current drawing.

    Dim Vdraft, Drawing, Layers, ActiveLayer as Object
    Set Vdraft = CreateObject(“Vdraft.Application”)
    Set Drawing = Vdraft.ActiveDocument
    Set Layers = Drawing.Layers
    Set ActiveLayer = Layers.Active
    Print ActiveLayer

    ...

NOTE: The above code is equivalent to the following code. They are identical. Visual Basic allows you to be somewhat cavalier with ActiveX Automation, if you wish. The above code might be easier to read depending on your overall application. The code below is considerably smaller. Both work fine.

    Dim Vdraft as Object
    Set Vdraft = CreateObject(“Vdraft.Application”)
    Print Vdraft.ActiveDocument.Layers.Active

Alternatively, especially from Visual Basic, you may wish to make use of the Vdraft OCX. This also allows you to receive notification of certain events. For Visual Basic, the OCX is the only way to receive such notifications. See Vdraft OCX for more information


Sample Code - Starting Vdraft

Visual Basic Sample Code

Starting Vdraft

This sample shows how to start up Vdraft correctly from Visual Basic and also how to recover should Vdraft not be started by the CreateObject() call. This might happen for any number of reasons (usually because the system could not locate Vdraft.exe). This code will offer the user the option of continuing with the application without Vdraft’s presence. This may or may not make sense depending on your app.

    '   Open the communication channels to Vdraft
    Dim Vdraft As Object				' object handle to the Vdraft application
    Dim Docs As Object				' object handle to the Documents collection
    On Error GoTo Form_Load_Err1			' in case the CreateObject() fails
    Set Vdraft = CreateObject("Vdraft.Application") ' get a channel to Vdraft
    Set Docs = Vdraft.Documents			' successful: get the documents collection
    GoTo Form_Load_Continue				' continue around the error trap code

Form_Load_Err1:						' error with createobject()
    Dim Msg$					' user error message
    Msg$ = "Unable to get a connection to Vdraft"
    Msg$ = Msg$ & CRLF & CRLF & "'" & Err.Description
    Msg$ = Msg$ & "'" & CRLF & CRLF & "Continue without Vdraft?"
    If MsgBox(Msg$, 52, AppName$ & " -- Error!") = 7 Then
        End					' quit
    End if

    '  what ever processing might be needed for your application.  Set flags, etc.,
    '  to show that Vdraft is not available.
    On Error GoTo 0					' cancel the error trap
        Resume Form_Load_Continue

    Form_Load_Continue:				' continue the form load process
    '
    '   continue on with what ever other startup code is needed...
    '