Events [ActiveX and VBA Reference: AAR]

Events

A

Activate event Triggered when a document window is activated.

AppActivate event Triggered just before the main application window is activated.

AppDeactivate event Triggered just before the main application window is deactivated.

ARXLoaded event Triggered when an ObjectARX application has been loaded.

ARXUnloaded event Triggered when an ObjectARX application has been unloaded.

B

BeginClose event Triggered immediately after AutoCAD receives a request to close a drawing.

BeginCommand event Triggered immediately after a command is issued, but before it completes.

BeginDocClose event Triggered immediately after AutoCAD receives a request to close a drawing.

BeginDoubleClick event Triggered after the user double-clicks an object in the drawing.

BeginFileDrop event Triggered when a file is dropped on the main application window.

BeginLISP event Triggered immediately after AutoCAD receives a request to evaluate a LISP expression.

BeginModal event Triggered just before a modal dialog is displayed.

BeginOpen event Triggered immediately after AutoCAD receives a request to open an existing drawing.

BeginPlot event Triggered immediately after AutoCAD receives a request to print a drawing.

BeginQuit event Triggered just before an AutoCAD session ends or a document closes.

BeginRightClick event Triggered after the user right-clicks on the drawing window.

BeginSave event Triggered immediately after AutoCAD receives a request to save the drawing.

BeginShortcutMenuCommand event Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in command mode.

BeginShortcutMenuDefault event Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in default mode.

BeginShortcutMenuEdit event Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in edit mode.

BeginShortcutMenuGrip event Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in grip mode.

BeginShortcutMenuOSnap event Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in osnap mode.

D

Deactivate event Triggered when the drawing window is deactivated.

E

EndCommand event Triggered immediately after a command completes.

EndLISP event Triggered upon completion of evaluating a LISP expression.

EndModal event Triggered just after a modal dialog is dismissed.

EndOpen event Triggered immediately after AutoCAD finishes opening an existing drawing.

EndPlot event Triggered after a document has been sent to the printer.

EndSave event Triggered when AutoCAD has finished saving the drawing.

EndShortcutMenu event Triggered after the shortcut menu appears.

L

LayoutSwitched event Triggered after the user switches to a different layout.

LISPCancelled event Triggered when the evaluation of a LISP expression is cancelled.

M

Modified event Triggered when an object or collection in the drawing has been modified.

N

NewDrawing event Triggered just before a new drawing is created.

O

ObjectAdded event Triggered when an object has been added to the drawing.

ObjectErased event Triggered when an object has been erased from the drawing.

ObjectModified event Triggered when an object in the drawing has been modified.

S

SelectionChanged event Triggered when the current pickfirst selection set changes.

SysVarChanged event Triggered when the value of a system variable is changed.

W

WindowChanged event Triggered when there is a change to the application or document windows.

WindowMovedOrResized event Triggered just after the application or drawing window has been moved or resized.


Activate event [ActiveX and VBA Reference: AAR]

Activate Event

Triggered when a document window is activated.

See Also | Example

Signature

object.Activate()

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

Remarks

No events will be fired while a modal dialog is being displayed.

Comments?


AppActivate event [ActiveX and VBA Reference: AAR]

AppActivate Event

Triggered just before the main application window is activated.

See Also | Example

Signature

object.AppActivate()

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Remarks

No events will be fired while a modal dialog is being displayed.


AppDeactivate event [ActiveX and VBA Reference: AAR]

AppDeactivate Event

Triggered just before the main application window is deactivated.

See Also | Example

Signature

object.AppDeactivate()

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Remarks

No events will be fired while a modal dialog is being displayed.


ARXLoaded event [ActiveX and VBA Reference: AAR]

ARXLoaded Event

Triggered when an ObjectARX application has been loaded.

See Also | Example

Signature

object.ARXLoaded(FullPathName)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

FullPathName

String
The full path and file name of the ObjectARX application that has been loaded.

Remarks

No events will be fired while a modal dialog is being displayed.


ARXUnloaded event [ActiveX and VBA Reference: AAR]

ARXUnloaded Event

Triggered when an ObjectARX application has been unloaded.

See Also | Example

Signature

object.ARXUnloaded(FullPathName)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

FullPathName

String
The full path and file name of the ObjectARX application that has been unloaded.

Remarks

No events will be fired while a modal dialog is being displayed.


BeginClose event [ActiveX and VBA Reference: AAR]

BeginClose Event

Triggered immediately after AutoCAD receives a request to close a drawing.

See Also | Example

Signature

object.BeginClose( )

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

Remarks

You should use the BeginDocClose event rather than the BeginClose event because the BeginDocClose event enables you to keep a drawing from being closed.

No events occur while a modal dialog is displayed.


BeginCommand event [ActiveX and VBA Reference: AAR]

BeginCommand Event

Triggered immediately after a command is issued, but before it completes.

See Also | Example

Signature

object.BeginCommand(CommandName)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

CommandName

String
The name of the command being issued.

Remarks

The BeginCommand event is triggered as soon as AutoCAD receives a request to issue a command. This request can come either interactively by a user through the AutoCAD user interface or programmatically. The BeginCommand event is followed by the EndCommand event after AutoCAD completes processing the command. If the user cancels out of the command, the EndCommand event will not be triggered.

The BeginCommand event will be fired for any basic AutoCAD command, or any command registered on the AutoCAD command stack via an ObjectARX application, or the Visual LISP vlax-add-cmd function.

This event will not be fired for LISP functions defined as external subroutines via the LISP vl-acad-defun function. These functions are not exposed to the command stack, even though you execute them from the AutoCAD command line. Instead, these functions will trigger the BeginLISP and EndLISP events. If you need LISP commands to be recognized when they execute you will need to use the Visual LISP vlax-add-cmd function to register the command correctly to the AutoCAD command stack.

If you undefine an AutoCAD command and then redefine it via the LISP vl-acad-defun function, the BeginCommand event may not be triggered until an actual AutoCAD command is called (command "_.LINE" ...) for instance.

AutoCAD commands are stored in groups in the command stack. One instance of the command stack is created per AutoCAD session. This stack consists of the native AutoCAD commands, as well as any custom commands you add to it.

No events will be fired while a modal dialog is being displayed.


BeginDocClose event [ActiveX and VBA Reference: AAR]

BeginDocClose Event

Triggered immediately after AutoCAD receives a request to close a drawing.

See Also | Example

Signature

object.BeginDocClose(Cancel)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

Cancel

Boolean
Determines whether to prevent the drawing from being closed.

TRUE: The drawing is prevented from closing.

FALSE: The drawing is not prevented from closing.

Remarks

You can use this event to keep a drawing from being closed. This event should be used instead of the BeginClose event.

No events occur while a modal dialog is being displayed.


BeginDoubleClick event [ActiveX and VBA Reference: AAR]

BeginDoubleClick Event

Triggered after the user double-clicks an object in the drawing.

See Also | Example

Signature

object.BeginDoubleClick(PickPoint)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

PickPoint

Variant (three-element array of doubles); input to the handler
The 3D WCS coordinate that was double-clicked.

Remarks

No events will be fired while a modal dialog is being displayed.


BeginFileDrop event [ActiveX and VBA Reference: AAR]

BeginFileDrop Event

Triggered when a file is dropped on the main application window.

See Also | Example

Signature

object.BeginFileDrop(FileName, Cancel)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

FileName

String; input to the handler
The name of the file that has been dropped on the main application window.

Cancel

Boolean; output from the handler

TRUE: Aborts the loading of the drawing.

FALSE: Allows the loading of the drawing to continue.

Remarks

No events will be fired while a modal dialog is being displayed.


BeginLISP event [ActiveX and VBA Reference: AAR]

BeginLISP Event

Triggered immediately after AutoCAD receives a request to evaluate a LISP expression.

See Also | Example

Signatures: Detail

object.BeginLISP(FirstLine)

object

Application object, Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and the document.

FirstLine

String; input-only
The name of the LISP expression about to be executed by the LISP interpreter. FirstLine will not have any case conversion of the alpha characters.

If the LISP function being executed is defined (with defun) as a C:xxx function and is being executed as an AutoCAD command (such as just using the xxx part of the function name and no parentheses), then FirstLine will be the complete function name including the C: prefix and will be enclosed inside a pair of parentheses—just the way it would appear when executed as a true LISP function call. Otherwise, FirstLine will be the actual LISP expression that has been typed in at the AutoCAD command line or is part of a menu macro.

For example:

  • If there is a user-defined LISP function loaded called C:TEST, and it is executed by typing "TEST" at the command line, then FirstLine will be (C:TEST)
  • If there is a user defined LISP function loaded called calc and it is executed as (cAlc), then FirstLine will be (cAlc).
  • If a menu macro contains (getvar "cmdecho"), then FirstLine will be (get "cmdecho").

Remarks

No events will be fired while a modal dialog is being displayed.


BeginModal event [ActiveX and VBA Reference: AAR]

BeginModal Event

Triggered just before a modal dialog is displayed.

See Also | Example

Signature

object.BeginModal()

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Remarks

No events will be fired while a modal dialog is being displayed.

You should never issue a message box from within an event handler for the BeginModal event.


BeginOpen event [ActiveX and VBA Reference: AAR]

BeginOpen Event

Triggered immediately after AutoCAD receives a request to open an existing drawing.

See Also | Example

Signature

object.BeginOpen(Filename)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Filename

String
The name of the file being opened.

Remarks

The BeginOpen event is triggered as soon as AutoCAD receives a request to open an existing file. This request can come either interactively by a user through the File Open dialog box or programmatically.

The BeginOpen event does not trigger when opening a DXF format file.

When opening an existing file, the BeginOpen event will be followed by the EndOpen event when AutoCAD completes the opening of the drawing. For example, when a user selects File > Open, then chooses the file to open from the dialog box and selects the Open button, the BeginOpen event is triggered (as soon as the Open button is processed). Once the drawing is visible in the AutoCAD window and is ready for work, the EndOpen event is triggered.

When creating a new file, the NewDrawing event is triggered.

No events will be fired while a modal dialog is being displayed.


BeginPlot event [ActiveX and VBA Reference: AAR]

BeginPlot Event

Triggered immediately after AutoCAD receives a request to print a drawing.

See Also | Example

Signature

object.BeginPlot(DrawingName)

object

Application object, Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

DrawingName

String; input to the handler
The name of the drawing that is being sent to the printer.

Remarks

No events will be fired while a modal dialog is being displayed.


BeginQuit event [ActiveX and VBA Reference: AAR]

BeginQuit Event

Triggered just before an AutoCAD session ends or a document closes.

See Also | Example

Signature

object.BeginQuit (Cancel)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Cancel

Boolean; output from the handler

TRUE: Aborts the shutdown of AutoCAD.

FALSE: Allows the shutdown of AutoCAD to continue.

Remarks

The BeginQuit event marks the end of the AutoCAD session.


BeginRightClick event [ActiveX and VBA Reference: AAR]

BeginRightClick Event

Triggered after the user right-clicks on the drawing window.

See Also | Example

Signature

object.BeginRightClick(PickPoint)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

PickPoint

Variant (three-element array of doubles); input to the handler
The 3D WCS coordinate that was right-clicked.

Remarks

No events will be fired while a modal dialog is being displayed.


BeginSave event [ActiveX and VBA Reference: AAR]

BeginSave Event

Triggered immediately after AutoCAD receives a request to save the drawing.

See Also | Example

Signature

object.BeginSave(Filename)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Filename

String
The name of the file being saved.

Remarks

The BeginSave event is triggered as soon as AutoCAD receives a request to save along with the name of the file to save. This request can come either interactively by a user through the interface or programmatically.

The BeginSave event is followed by the EndSave event after AutoCAD completes the saving of the drawing.

No events will be fired while a modal dialog is being displayed.


BeginShortcutMenuCommand event [ActiveX and VBA Reference: AAR]

BeginShortcutMenuCommand Event

Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in command mode.

See Also | Example

Signature

object.BeginShortcutMenuCommand(ShortcutMenu, Command)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu about to be displayed.

Command

String; input to the handler only
The name of the command in process.

Remarks

This event allows you to make changes to the shortcut menu before it is displayed. To make changes to the shortcut menu, edit the PopupMenu object that is passed in to your handler from the event. This same PopupMenu object is passed out of the handler as the current shortcut menu. Use the EndShortcutMenu event to perform any cleanup work on the shortcut menu.

There is a command in progress when this event is triggered.

This event is triggered after all shortcut menu elements, including any ObjectARX command additions, have occurred.

No events will be fired while a modal dialog is being displayed.


BeginShortcutMenuDefault event [ActiveX and VBA Reference: AAR]

BeginShortcutMenuDefault Event

Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in default mode.

See Also | Example

Signature

object.BeginShortcutMenuDefault(ShortcutMenu)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu about to be displayed.

Remarks

This event allows you to make changes to the shortcut menu before it is displayed. To make changes to the shortcut menu, edit the PopupMenu object that is passed in to your handler from the event. This same PopupMenu object is passed out as the current shortcut menu. Use the EndShortcutMenu event to perform any cleanup work on the shortcut menu.

There is no selection set active and no command in process when this event is triggered.

This event is triggered after all shortcut menu elements, including any ObjectARX command additions, have occurred.

No events will be fired while a modal dialog is being displayed.


BeginShortcutMenuEdit event [ActiveX and VBA Reference: AAR]

BeginShortcutMenuEdit Event

Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in edit mode.

See Also | Example

Signature

object.BeginShortcutMenuEdit(ShortcutMenu, SelectionSet)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu about to be displayed.

SelectionSet

SelectionSet object; input/output from the handler
The pickfirst selection set.

Remarks

This event allows you to make changes to the shortcut menu before it is displayed. To make changes to the shortcut menu, edit the PopupMenu object that is passed in to your handler from the event. This same PopupMenu object is passed out of the handler as the current shortcut menu. Use the EndShortcutMenu event to perform any cleanup work on the shortcut menu.

There is a selection set active but no command in progress when this event is triggered.

This event is triggered after all shortcut menu elements, including any ObjectARX command additions, have occurred.

No events will be fired while a modal dialog is being displayed.


BeginShortcutMenuGrip event [ActiveX and VBA Reference: AAR]

BeginShortcutMenuGrip Event

Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in grip mode.

See Also | Example

Signature

object.BeginShortcutMenuGrip(ShortcutMenu)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu about to be displayed.

Remarks

This event allows you to make changes to the shortcut menu before it is displayed. To make changes to the shortcut menu, edit the PopupMenu object that is passed in to your handler from the event. This same PopupMenu object is passed out as the current shortcut menu. Use the EndShortcutMenu event to perform any cleanup work on the shortcut menu.

There is a hot grip active when this event is triggered.

This event is triggered after all shortcut menu elements, including any ObjectARX command additions, have occurred.

No events will be fired while a modal dialog is being displayed.


BeginShortcutMenuOSnap event [ActiveX and VBA Reference: AAR]

BeginShortcutMenuOSnap Event

Triggered after the user right-clicks on the drawing window, and before the shortcut menu appears in osnap mode.

See Also | Example

Signature

object.BeginShortcutMenuGrip(ShortcutMenu)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu about to be displayed.

Remarks

This event allows you to make changes to the shortcut menu before it is displayed. To make changes to the shortcut menu, edit the PopupMenu object that is passed in to your handler from the event. This same PopupMenu object is passed out as the current shortcut menu. Use the EndShortcutMenu event to perform any cleanup work on the shortcut menu.

This event is triggered after all shortcut menu elements, including any ObjectARX command additions, have occurred.

No events will be fired while a modal dialog is being displayed.


Deactivate event [ActiveX and VBA Reference: AAR]

Deactivate Event

Triggered when the drawing window is deactivated.

See Also | Example

Signature

object.Deactivate()

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

Remarks

No events will be fired while a modal dialog is being displayed.


EndCommand event [ActiveX and VBA Reference: AAR]

EndCommand Event

Triggered immediately after a command completes.

See Also | Example

Signature

object.EndCommand(CommandName)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

CommandName

String
The name of the command that was issued.

Remarks

The EndCommand event follows the BeginCommand event after AutoCAD completes processing the command. If the user cancels out of the command, the EndCommand event will not be triggered.

The BeginCommand event will be fired for any basic AutoCAD command, or any command registered on the AutoCAD command stack via an ObjectARX application, or the Visual LISP vlax-add-cmd function. It will not be fired for any normally defun'd C: LISP function because it is not exposed to the command stack, even though you execute it from the AutoCAD command Line. If you need LISP commands to be recognized when they execute, you will need to use the Visual LISP vlax-add-cmd function to register the command correctly to the AutoCAD command stack.

If you undefine an AutoCAD command and then redefine it via a LISP defun, the BeginCommand event may not be triggered until an actual AutoCAD command is called; for example, (command "_.LINE" ...).

AutoCAD commands are stored in groups in the command stack. One instance of the command stack is created per AutoCAD session. This stack consists of the native AutoCAD commands, as well as any custom commands you add to it.

No events will be fired while a modal dialog is being displayed.


EndLISP event [ActiveX and VBA Reference: AAR]

EndLISP Event

Triggered upon completion of evaluating a LISP expression.

See Also | Example

Signature

object.EndLISP()

object

Application object, Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

Remarks

This event will occur after either a normal termination of the LISP evaluation, or after a cancellation of the LISP evaluation.

No events will be fired while a modal dialog is being displayed.


EndModal event [ActiveX and VBA Reference: AAR]

EndModal Event

Triggered just after a modal dialog is dismissed.

See Also | Example

Signature

object.EndModal()

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Remarks

No events will be fired while a modal dialog is being displayed.


EndOpen event [ActiveX and VBA Reference: AAR]

EndOpen Event

Triggered immediately after AutoCAD finishes opening an existing drawing.

See Also | Example

Signature

object.EndOpen(Filename)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Filename

String
The name of the file being opened.

Remarks

The EndOpen event follows the BeginOpen event after AutoCAD completes the opening of an existing drawing.

No events will be fired while a modal dialog is being displayed.


EndPlot event [ActiveX and VBA Reference: AAR]

EndPlot Event

Triggered after a document has been sent to the printer.

See Also | Example

Signature

object.EndPlot(DrawingName)

Elements

object

Application, Document
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application or a document.

DrawingName

String; input to the handler
The name of the drawing that has been printed.

Remarks

No events will be fired while a modal dialog is being displayed.


EndSave event [ActiveX and VBA Reference: AAR]

EndSave Event

Triggered when AutoCAD has finished saving the drawing.

See Also | Example

Signature

object.EndSave(Filename)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Filename

String
The name of the file that was saved.

Remarks

The EndSave event follows the BeginSave event after AutoCAD completes the saving of the drawing.

No events will be fired while a modal dialog is being displayed.


EndShortcutMenu event [ActiveX and VBA Reference: AAR]

EndShortcutMenu Event

Triggered after the shortcut menu appears.

See Also | Example

Signature

object.EndShortcutMenu(ShortcutMenu)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ShortcutMenu

PopupMenu object; input/output from the handler
The shortcut menu that has been displayed.

Remarks

Use this event to perform any cleanup work on the shortcut menu.

No events will be fired while a modal dialog is being displayed.


LayoutSwitched event [ActiveX and VBA Reference: AAR]

LayoutSwitched Event

Triggered after the user switches to a different layout.

See Also | Example

Signature

object.LayoutSwitched(LayoutName)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

LayoutName

String; input to the handler
The name of the layout the user has switched to.

Remarks

No events will be fired while a modal dialog is being displayed.


LISPCancelled event [ActiveX and VBA Reference: AAR]

LISPCancelled Event

Triggered when the evaluation of a LISP expression is cancelled.

See Also | Example

Signature

object.LISPCancelled()

object

Application object, Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

Remarks

No events will be fired while a modal dialog is being displayed.


Modified event [ActiveX and VBA Reference: AAR]

Modified Event

Triggered when an object or collection in the drawing has been modified.

See Also | Example

Signature

object.Modified(Entity)

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Hyperlink, Hyperlinks, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace, PaperSpace, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, SelectionSet, SelectionSets, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
An object expression that evaluates to a valid container object.

Entity

A Drawing Object
The object in the drawing that is modified can be any one of the drawing objects.

Remarks

This event will be triggered whenever the object is modified. Modification includes whenever the value of a property is set, even if the new value is equal to the current value.

When coding in VBA, you must provide an event handler for all objects enabled for the Modified event. If you do not provide a handler, VBA may terminate unexpectedly.

No events will be fired while a modal dialog is being displayed.


NewDrawing event [ActiveX and VBA Reference: AAR]

NewDrawing Event

Triggered just before a new drawing is created.

See Also | Example

Signature

object.NewDrawing()

Elements

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Remarks

No events will be fired while a modal dialog is being displayed.


ObjectAdded event [ActiveX and VBA Reference: AAR]

ObjectAdded Event

Triggered when an object has been added to the drawing.

See Also | Example

Signature

object.ObjectAdded(Entity)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

Entity

A Drawing Object; input to the handler
The object that was added to the drawing. It can be any one of the drawing objects.

Remarks

No events will be fired while a modal dialog is being displayed.


ObjectErased event [ActiveX and VBA Reference: AAR]

ObjectErased Event

Triggered when an object has been erased from the drawing.

See Also | Example

Signature

object.ObjectErased(ObjectID)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

ObjectID

Long; input to the handler
The object ID of the object that was erased.

Remarks

No events will be fired while a modal dialog is being displayed.


ObjectModified event [ActiveX and VBA Reference: AAR]

ObjectModified Event

Triggered when an object in the drawing has been modified.

See Also | Example

Signature

object.ObjectModified(Entity)

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

Entity

A Drawing Object; input to the handler
The object in the drawing that is modified. It can be any one of the drawing objects.

Remarks

This event takes place after the modification operation is complete.

No events will be fired while a modal dialog is being displayed.


SelectionChanged event [ActiveX and VBA Reference: AAR]

SelectionChanged Event

Triggered when the current pickfirst selection set changes.

See Also | Example

Signature

object.SelectionChanged()

object

Document object
An object expression that evaluates to a valid container object. In this case, the only valid container is a document.

Remarks

No events will be fired while a modal dialog is being displayed.


SysVarChanged event [ActiveX and VBA Reference: AAR]

SysVarChanged Event

Triggered when the value of a system variable is changed.

See Also | Example

Signature

object.SysVarChanged(SysVarName, NewVal)

object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

SysVarName

String; input to the handler
The name of the system variable whose value has changed.

NewVal

Variant; input to the handler
The new value of the system variable.

Remarks

This event indicates an attempt was made to change a system variable. It does not indicate the actual value was changed. In some cases, it is possible to set a system variable without causing its value to change. For example, if FILLMODE was 0 and someone tried to set it to 0, then you would get an event for that system variable even though the call had no actual effect on the value of FILLMODE.

No events will be fired while a modal dialog is being displayed.


WindowChanged event [ActiveX and VBA Reference: AAR]

WindowChanged Event

Triggered when there is a change to the application or document windows.

See Also | Example

Signature

object.WindowChanged(WindowState)

object

Application object, Document object
The object or objects this event applies to.

WindowState

Integer; input to the handler.

acMin | The window is minimized.
acMax | The window is maximized.
acNorm | The window is normal (neither minimized nor maximized).

Remarks

This event is helpful when implementing toolbars or modeless dialog boxes that track with the application or document window. The VB or ObjectARX application can use the HWNDFrame parameter to get the coordinates of the window, convert those coordinates to either screen or parent coordinates, and use this information to position other windows.

No events will be fired while a modal dialog is being displayed.


WindowMovedOrResized event [ActiveX and VBA Reference: AAR]

WindowMovedOrResized Event

Triggered just after the application or drawing window has been moved or resized.

See Also | Example

Signature

object.WindowMovedOrResized(HWNDFrame, Moved)

object

Application object, Document object
An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

HWNDFrame

Long; input to the handler
The application or document window frame.

Moved

Boolean; input to the handler

TRUE: The window was moved.

FALSE: The window was resized.

Remarks

This event is helpful when implementing toolbars or modeless dialog boxes that track with the application or document window. The VB or ObjectARX application can use the HWNDFrame parameter to get the coordinates of the window, convert those coordinates to either screen or parent coordinates, and use this information to position other windows.

No events will be fired while a modal dialog is being displayed.


Methods [ActiveX and VBA Reference: AAR]

Methods

A

Activate method Makes the specified drawing active.

Add method Creates a member object and adds it to the appropriate collection.

Add3DFace method Creates a 3DFace object given four vertices.

Add3dMesh method Creates a free-form 3D mesh, given the number of points in the M and N directions and the coordinates of the points in the M and N directions.

Add3DPoly method Creates a 3D polyline from the given array of coordinates.

AddArc method Creates an arc given the center, radius, start angle, and end angle of the arc.

AddAttribute method Creates an attribute definition at the given location with the specified properties.

AddBox method Creates a 3D solid box with edges parallel to the axes of the WCS.

AddCircle method Creates a circle given a center point and radius.

AddCone method Creates a 3D solid cone with the base on the XY plane of the WCS.

AddCustomInfo method Adds a custom property field at the end of the existing list of fields.

AddCustomObject method Creates a Custom object.

AddCylinder method Creates a 3D solid cylinder whose base is on the XY plane of the WCS.

AddDim3PointAngular method Creates an angular dimension using 3 points.

AddDimAligned method Creates an aligned dimension object.

AddDimAngular method Creates an angular dimension for an arc, two lines, or a circle.

AddDimArc method Creates an arc length dimension for an arc.

AddDimDiametric method Creates a diametric dimension for a circle or arc given the two points on the diameter and the length of the leader line.

AddDimOrdinate method Creates an ordinate dimension given the definition point and the leader endpoint.

AddDimRadial method Creates a radial dimension for the selected object at the given location.

AddDimRadialLarge method Creates a jogged radial dimension for an arc, circle, or polyline arc segment.

AddDimRotated method Creates a rotated linear dimension.

AddEllipse method Creates an ellipse in the XY plane of the WCS given the center point, a point on the major axis, and the radius ratio.

AddEllipticalCone method Creates a 3D solid elliptical cone on the XY plane of the WCS given the Center, MajorRadius, MinorRadius, and Height.

AddEllipticalCylinder method Creates a 3D solid elliptical cylinder whose base is on the XY plane of the WCS, given the Center, MajorRadius, MinorRadius, and Height.

AddExtrudedSolid method Creates an extruded solid given the Profile, Height, and TaperAngle.

AddExtrudedSolidAlongPath method Creates an extruded solid given the profile and an extrusion path.

AddFitPoint method Adds the fit point to the spline at a given index.

AddHatch method Creates a Hatch object.

AddItems method Adds one or more objects to the specified selection set.

AddLeader method Creates a leader line, given the coordinates of the points.

AddLightWeightPolyline method Creates a lightweight polyline from a list of vertices.

AddLine method Creates a line passing through two points.

AddMenuItem method Adds a popup menu item to a popup menu.

AddMInsertBlock method Inserts an array of blocks.

AddMLeader method Creates an mleader line, given coordinates.

AddMLine method Creates multiple lines passing through an array of points.

AddMtext method Creates an MText entity in a rectangle defined by the insertion point and width of the bounding box.

AddObject method Adds an object to a named dictionary.

AddPoint method Creates a Point object at a given location.

AddPolyfaceMesh method Creates a polyface mesh from a list of vertices.

AddPolyline method Creates a polyline from a list of vertices.

AddPViewport method Adds a paper space viewport, given the center, height, and width.

AddRaster method Creates a new raster image based on an existing image file.

AddRay method Creates a ray passing through two unique points.

AddRegion method Creates a region from a set of entities. The given entities must form a closed coplanar region.

AddRevolvedSolid method Creates a revolved solid, given the region around an axis.

AddSection method Creates a section plane

AddSeparator method Adds a separator to an existing menu or toolbar.

AddShape method Creates a Shape object based on a template identified by name, at the given insertion point, scale factor, and rotation.

AddSolid method Creates a 2D solid polygon.

AddSphere method Creates a sphere given the center and radius.

AddSpline method Creates a quadratic or cubic NURBS (nonuniform rational B-spline) curve.

AddSubMenu method Adds a submenu to an existing menu.

AddTable method Adds a table to a drawing.

AddText method Creates a single line of text.

AddTolerance method Creates a tolerance entity.

AddToolbarButton method Adds a toolbar item to a toolbar at a specified position.

AddTorus method Creates a torus at the given location.

AddTrace method Creates a Trace object from an array of points.

AddVertex method Adds a vertex to a lightweight polyline or a section.

AddWedge method Creates a wedge with edges parallel to the axes given the length, width, and height.

AddXLine method Creates an xline (an infinite line) passing through two specified points.

AddXRecord method Creates an XRecord object in any dictionary.

AngleFromXAxis method Gets the angle of a line from the X axis.

AngleToReal method Converts an angle as a string to a real (double) value.

AngleToString method Converts an angle from a real (double) value to a string.

AppendInnerLoop method Appends an inner loop to the hatch.

AppendItems method Appends one or more entities to the specified group.

AppendOuterLoop method Appends an outer loop to the hatch.

AppendVertex method Appends a vertex to the end of a 3DPolyline, Polyline, or PolygonMesh object.

ArrayPolar method Creates a polar array of objects given a NumberOfObjects, AngleToFill, and CenterPoint.

ArrayRectangular method Creates a 2D or 3D rectangular array of objects.

AttachExternalReference method Attaches an external reference (xref) to the drawing.

AttachToolbarToFlyout method Attaches a toolbar to a toolbar button defined as a flyout.

AuditInfo method Evaluates the integrity of the drawing.

B

Bind method Binds an external reference (xref) to a drawing.

Block method Returns the block of a SortentsTable object.

Boolean method Performs a Boolean operation (union, intersect, or subtract) between the object and another 3DSolid or Region object.

C

CheckInterference method Checks for interference between two solids and, if specified, creates a solid from the interference.

Clear method Clears the specified selection set of all items.

ClearSubSelection method Removes a subselection set of cells from a table.

ClearTableStyleOverrides method Clears table style overrides.

ClipBoundary method Specifies the clipping boundary for a raster image or an underlay.

Close method Closes the specified drawing, or all open drawings.

ConvertToAnonymousBlock method Converts a dynamic block to a regular anonymous block.

ConvertToStaticBlock method Converts a dynamic block to a regular named block.

Copy method Duplicates the given object to the same location.

CopyFrom Method Copies the settings for a dimension style, layout, or plot configuration.

CopyObjects Method Duplicates multiple objects (deep cloning).

CopyProfile Method Copies the specified profile.

CreateCellStyle method Creates a cell style with the given name.

CreateCellStyleFromStyle method Creates a cell style from a given name.

CreateContent method Creates new content in a cell.

CreateEntry method Creates a new entry in the File Dependency List.

CreateJog method Creates a jog on the section plane.

CreateTypedArray Method Creates a variant that contains an array of typed arguments.

D

Delete method Deletes a specified object or a set of saved layer settings.

DeleteCellContent method Deletes the cell content in the specified row and column.

DeleteCellStyle method Deletes a cell style.

DeleteColumns method Deletes columns from a table.

DeleteConfiguration method Deletes a viewport configuration.

DeleteContent method Deletes content of a cell.

DeleteFitPoint method Deletes the fit point of a spline at a given index.

DeleteProfile Method Deletes the specified profile.

DeleteRows method Deletes rows from a table.

Detach method Detaches an external reference (xref) from a drawing.

Display method Toggles the display control of the PViewport object on or off.

DisplayPlotPreview method Displays the Plot Preview dialog box with the full view preview.

DistanceToReal method Converts a distance from a string to a real (double) value.

Dock method Docks the toolbar to the owning frame window.

E

ElevateOrder method Elevates the order of the spline to the given order.

EnableMergeAll method Controls cell merging.

EndUndoMark method Marks the end of a block of operations.

Erase method Erases all the objects in a selection set.

Eval method Evaluates an expression in VBA.

Evaluate method Evaluates the given hatch or leader.

Explode method Explodes the compound object into subentities.

Export method Exports an AutoCAD drawing or a group of saved layer settings to a file.

ExportProfile method Exports the active profile so it can be shared with other users.

F

FieldCode method Returns a text string containing field codes.

Float method Floats the toolbar.

FormatValue method Gets the formatted text string for the specified row and column.

G

GenerateLayout method Generates the layout of a table.

GenerateSectionGeometry method Generates 2D or 3D section geometry.

GenerateUsageData method Generates data specifying whether a layer is in use.

GetAcadState method Gets an AcadState object to monitor the state of AutoCAD from out-of-process applications.

GetAlignment method Returns the cell alignment for a row type.

GetAlignment2 method Gets the cell alignment.

GetAllProfileNames method Gets all available profiles for the system.

GetAngle method Gets the angle specified. Considers the setting of the ANGBASE system variable.

GetAttachmentPoint method Returns the attachment point for the specified row and column.

GetAttributes method Gets the attributes in the block reference.

GetAutoScale method Returns the value specifying whether auto scale is used in the specified row and column.

GetAutoScale2 method Gets the auto-scale flag value for a cell.

GetBackgroundColor method Returns the background color value for the specified row type.

GetBackgroundColorNone method Returns the value specifying that there is no background color for the specified row type.

GetBitmaps method Gets the large and small bitmaps used as icons for the toolbar item.

GetBlockAttributeValue method Gets the attribute value in block content with attribute definition id.

GetBlockAttributeValue method Returns the attribute value of the specified cell for the attribute definition object contained in the block.

GetBlockAttributeValue2 method Gets the attribute value associated to a specifed block cell.

GetBlockAttributeValue32 method For a 64-Bit system, gets a block cell's attribute value.

GetBlockAttributeValue32 method For a 64-Bit system, gets the attribute value in block content with attribute definition id.

GetBlockRotation method Returns the block rotation angle for the specified row and column.

GetBlockScale method Returns the block scale value for the specified row and column.

GetBlockTableRecordId method Returns the block table record ID of the cell.

GetBlockTableRecordId2 method Gets the block table record object id associated to a specifed cell.

GetBlockTableRecordId32 method For a 64-Bit system, gets a cell's block table record id.

GetBoundingBox method Gets two points of a box enclosing the specified object.

GetBreakHeight method Get a table's break height.

GetBulge method Gets the bulge value at a given index of the polyline.

GetCanonicalMediaNames method Gets all available canonical media names for the specified plot device.

GetCellAlignment method Returns the alignment for the cell in the specified row and column.

GetCellBackgroundColor method Returns the background true color value of a cell in the specified row and column.

GetCellBackgroundColorNone method Returns the value specifying that there is no background color for the specified row and column.

GetCellClass method Gets the class of a cell style.

GetCellContentColor method Returns the true color value for the content of the specified row and column.

GetCellContentColor2 method Gets the true color vlaue for a cell.

GetCellDataType method Gets the cell data and unit type for the given row and column.

GetCellExtents method Returns the cell extents for the specified row and column.

GetCellFormat method Gets the cell format for the given row and column.

GetCellGridColor method Returns the grid color value for an edge of the specified row and column.

GetCellGridLineWeight method Returns the grid lineweight value for an edge of the specified row and column.

GetCellGridVisibility method Returns the grid visibility value for an edge of the specified row and column.

GetCellState method Get a cell's state.

GetCellStyle method Gets the cell style.

GetCellStyleOverrides method Returns the cell style overrides.

GetCellTextHeight method Returns the text height for the specified row and column.

GetCellTextStyle method Returns the text style name for the specified row and column.

GetCellType method Returns the cell type for the specified row and column.

GetCellValue method Gets the cell value for the given row and column.

GetColor method Returns the true color value for the specified row type.

GetColumnName method Gets a column's name.

GetColumnWidth method Returns the column width for the column at the specified column index in the table.

GetConstantAttributes method Gets the constant attributes in the block or external reference.

GetContentColor method Returns the true color value for the specified row type.

GetContentLayout method Get a cell's content layout.

GetContentType method Get a cell's content type.

GetControlPoint method Gets the coordinates of the control point at a given index.

GetCorner method Gets a corner of a rectangle.

GetCustomByIndex method Returns the custom property name (key) and value that correspond to an index value.

GetCustomByKey method Returns the custom property value that corresponds to a name (key) value.

GetCustomData method Gets the custom data associated to a cell.

GetCustomScale method Gets the custom scale for a layout or plot configuration.

GetDataFormat method Gets a cell's format.

GetDataLink method Gets the data link for the specified cell.

GetDataLink32 method For a 64-Bit system, gets the data link for a cell.

GetDataType method Returns the data type and unit type for the specifed row type.

GetDataType2 method Gets the row data type and unit type for the specified row type and nContent.

GetDistance method Gets the distance from the prompt line or a selected set of points on the screen.

GetDynamicBlockProperties method Gets the properties of the dynamic block.

GetEntity method Gets an object interactively.

GetExtensionDictionary method Gets the extension dictionary associated with an object.

GetFieldId method Returns the field object ID of the specified cell.

GetFieldId2 method Gets the field object id associated to the specifed cell.

GetFieldId232 method For a 64-Bit system, gets a cell's field object id.

GetFieldId32 method Returns the field object ID of the specified cell for a 64-bit system.

GetFitPoint method Gets the fit point of a spline at a given index.

GetFont method Gets the definition data of the font for the TextStyle.

GetFormat method Returns the format for the specifed row type.

GetFormat method Gets the format for the specified row type.

GetFormat2 method Gets the format of a cell style.

GetFormula method Get a cell's formula.

GetFullDrawOrder method Returns all of the objects in a block, sorted by draw order with the bottom object first.

GetGridColor method Returns the grid color value for a grid linetype and row type.

GetGridColor2 method Gets the gridColor for the specified cell.

GetGridDoubleLineSpacing method Gets the lineSpacing value for the specified cell.

GetGridLineStyle method Get a cell's gridLineStyle.

GetGridLinetype method Gets the idLinetype with the gridLinetype value for the specified cell.

GetGridLinetype32 method For a 64-Bit system, gets the idLinetype with the gridLinetype value for the specified cell.

GetGridLineWeight method Returns a grid lineweight value for a grid linetype and row type.

GetGridLineWeight2 method Gets the gridLineWeight value for the specified cell.

GetGridSpacing method Gets the grid spacing for the viewport.

GetGridVisibility method Returns a grid visibility value for the specifed grid linetype and row type.

GetGridVisibility2 method Returns the gridVisibility value for the specified cell.

GetHasDataLink method Check if a cell has a data link.

GetHasFormula method Check if a cell has a formula.

GetInput method Converts a user's input string into a keyword index.

GetInteger method Gets an integer value from the user.

GetInterfaceObject method Accepts a program ID and attempts to load it into AutoCAD as an in-process server.

GetInvisibleEdge method Gets the visibility setting for an edge of a 3DFace object at a given index.

GetIsCellStyleInUse method Gets the usage status of a cell style.

GetIsMergeAllEnabled method Gets value of the "merge all" property.

GetKeyword Method Gets a keyword string from the user.

GetLiveSection method Gets the live section plane that is currently enabled in the database.

GetLocaleMediaName method Gets the localized version of the canonical media name.

GetLoopAt method Gets the hatch loop at a given index.

GetMargin method Get a cell's margin value.

GetMinimumColumnWidth method Gets the minimum column width for the column at the specified column index in the table.

GetMinimumRowHeight method Returns the minimum row height for the specified row.

GetName method Gets the name (keyword) of an object in a dictionary.

GetObject method Gets the object in a dictionary, given the name (keyword) of the object.

GetOrientation method Gets the angle specified. Ignores the setting of the ANGBASE system variable.

GetOverride method Get a cell's overrides.

GetPaperMargins method Gets the margins for the layout or plot configuration.

GetPaperSize method Gets the width and height of the configured paper.

GetPlotDeviceNames method Gets all available plot device names.

GetPlotStyleTableNames method Gets all available plot style table names.

GetPoint method Gets the point selected in AutoCAD.

GetProjectFilePath method Gets the directory in which AutoCAD looks for external reference files.

GetReal method Gets a real (double) value from the user.

GetRelativeDrawOrder method Returns the objects specified, sorted by the draw order, with the bottom object first.

GetRemoteFile method Downloads the file specified by a URL.

GetRotation method Gets the rotation value for a cell.

GetRotation method Gets the rotation of a cell style.

GetRowHeight method Returns the row height for the row at the specified row index in the table.

GetRowType method Returns the row type for the specified row.

GetScale method Gets the scale value for a cell.

GetSectionTypeSettings method Gets the section type settings object.

GetSettings method Gets the section settings object.

GetSnapSpacing method Gets the snap spacing for the viewport.

GetString method Gets a string from the user.

GetSubEntity method Gets an object or subentity interactively.

GetSubSelection method Returns the row and column indexes of the cells in a subselection set.

GetText method Returns the text value for the specified row and column.

GetTextHeight method Returns the text height for the specified row type.

GetTextHeight2 method Gets the text height for a cell.

GetTextRotation method Returns the text rotation for the specified row and column.

GetTextString method Gets the text value of a cell.

GetTextStyle method Gets the text style name for the specified row types.

GetTextStyle2 method Gets the text style name for a cell.

GetUCSMatrix method Gets the transformation matrix consisting of UCS coordinate system data.

GetUniqueCellStyleName method Gets a unique cell style name with the base name that is passed as the prefix.

GetUniqueSectionName method Finds a unique section plane name.

GetValue method Gets the value of a cell.

GetVariable method Gets the current setting of an AutoCAD system variable.

GetWeight method Gets the weight of the control point at a given index.

GetWidth method Gets the start and end width for a polyline.

GetWindowToPlot method Gets the coordinates that define the portion of the layout to plot.

GetXdata method Gets the extended data (XData) associated with an object.

GetXRecordData method Gets the extended record data (XRecordData) associated with a dictionary.

H

HandleToObject method Gets the object that corresponds to the given handle.

Highlight method Sets the highlight status for the given object, or for all objects in a given selection set.

HitTest method Performs a hit test on the section plane.

HitTest method Returns the cell at the specified location.

I

Import method Imports a drawing or a group of saved layer settings from a file.

ImportProfile method Imports a profile created by another user.

IndexOf method Provides the index of an entry in the File Dependency List.

InitializeUserInput method Initializes the GetKeyword method.

InsertBlock method Inserts a drawing file or a named block that has been defined in the current drawing.

InsertColumns method Inserts columns in a table.

InsertColumnsAndInherit method Insert columns into a table from another table.

InsertInMenuBar method Inserts the popup menu into the AutoCAD menu bar at a specified location.

InsertLoopAt method Inserts a loop at a given index of a hatch.

InsertMenuInMenuBar method Inserts a menu into the AutoCAD menu bar.

InsertRows method Inserts rows in a table.

InsertRowsAndInherit method Insert rows into a table from another table.

IntersectWith method Gets the points where one object intersects another object in the drawing.

IsContentEditable method Check if a cell has editable content.

IsEmpty method Determines if a cell is empty based on its row and column position

IsFormatEditable method Check if a cell has editable format.

IsMergeAllEnabled method Checks if cell merging is on.

IsMergedCell method Returns the merge status of a cell.

IsRemoteFile method Returns the URL from which a remote file was downloaded.

IsURL method Validates a given URL.

Item method Gets the member object at a given index in a collection, group, or selection set.

L

LaunchBrowserDialog method Launches a dialog box in which a user can enter a URL.

LayerPropertyOverrides method Specifies whether the viewport has layer property overrides.

ListARX method Gets the currently loaded ObjectARX applications.

Load method Loads a menu group from a customization (CUI) file or the definition of a linetype from a library (LIN) file.

LoadARX method Loads the specified ObjectARX application.

LoadDVB method Loads the specified AutoCAD VBA project file.

LoadShapeFile method Loads a shape file (SHX).

M

MergeCells method Merges cells in a table.

Mirror method Creates a mirror-image copy of a planar object around an axis.

Mirror3d method Creates a mirror image of the given object about a plane.

Move method Moves an object along a vector.

MoveAbove method Moves objects above the target in the draw order.

MoveBelow method Moves objects below the target in the draw order.

MoveContent method Moves the index content of a cell.

MoveToBottom method Moves objects to the bottom of the draw order.

MoveToTop method Moves objects to the top of the draw order.

N

New method Creates a new document in SDI mode.

NumCustomInfo method Returns the number of custom property fields that have been set.

O

ObjectIDToObject method Gets the object that corresponds to the given object ID.

ObjectIDToObject32 method Gets the object that corresponds to the given object ID for a 64-bit system.

Offset method Creates a new object at a specified offset distance from an existing object.

Open method Opens an existing drawing file (DWG) and makes it the active document.

OverwritePropChanged method Indicates whether properties were changed.

P

PlotToDevice method Plots a layout to a device.

PlotToFile method Plots a layout to the specified file.

PolarPoint method Gets the point at a specified angle and distance from a given point.

Prompt method Displays a prompt on the command line.

PurgeAll method Removes unused named references such as unused blocks or layers from the document.

PurgeFitData method Purges the fit data of a spline.

PutRemoteFile method Uploads a file to a remote FTP location specified by a URL known to AutoCAD.

Q

Quit method Closes the drawing file and exits the AutoCAD application.

R

RealToString method Converts a real (double) value to a string.

RecomputeTableBlock method Updates a table block.

RefreshPlotDeviceInfo method Updates the plot, canonical media, and plot style table information to reflect the current system state.

Regen method Regenerates the entire drawing and recomputes the screen coordinates and view resolution for all objects.

Reload method Reloads the external reference (xref).

Remove method Removes a named object from the dictionary.

RemoveAllOverrides method Removes all the overrides for a cell.

RemoveCustomByIndex method Deletes the custom property name (key) and value that correspond to an index value.

RemoveCustomByKey method Deletes the custom property value that corresponds to a name (key) value.

RemoveDataLink method Removes the data link for the specified cell.

RemoveEntry method Removes an identified entry from the File Dependency List.

RemoveFromMenuBar method Removes the popup menu from the AutoCAD menu bar.

RemoveItems method Removes specified items from the group or selection set.

RemoveMenuFromMenuBar method Removes the popup menu, as specified from the collection, from the AutoCAD menu bar.

RemoveVertex method Removes a vertex in the section line.

Rename method Renames an item in a dictionary or a set of saved layer settings.

RenameCellStyle method Renames a cell style.

RenameProfile method Renames the specified profile.

Replace method Replaces an item in the dictionary by a given item.

ReselectSubRegion method Returns subentities of a selection set in a table.

ResetBlock method Resets the dynamic block to the default state.

ResetCellValue method Reset the cell value for the given row and column.

ResetProfile method Resets the value in the specified profile to its default values.

Restore method Restores a group of layer property settings.

Reverse method Reverses the direction of a spline.

Rotate method Rotates an object around a base point.

Rotate3d method Rotates an object around a 3D axis. Point1 and Point2 define the line that becomes the axis of rotation.

RunMacro method Runs a VBA macro from the Application object.

S

Save method Saves a document or group of layer property settings; no longer supported for menu groups.

SaveAs method Saves the document to a specified file; no longer supported for menu groups.

ScaleEntity method Scales an object equally in the X, Y, and Z directions.

SectionSolid method Creates a region that represents the intersection of a plane defined by three points and the solid.

Select method Selects objects and places them into a selection set.

Select method Selects a cell in a table.

SelectAtPoint method Selects an object passing through a given point and places it into a selection set.

SelectByPolygon method Selects objects within a fence and adds them to the selection set.

SelectOnScreen method Prompts the user to pick an object from the screen.

SelectSubRegion method Selects a set of cells in a table.

SendCommand method Sends a command string from a VB or VBA application to the document for processing.

SendModelessOperationEnded method Indicates a modeless operation has ended.

SendModelessOperationStart method Indicates a modeless operation will start.

SetAlignment method Sets a cell alignment for the specified row types.

SetAlignment2 method Sets the cell alignment.

SetAutoScale method Sets the value specifying whether auto scale is used in the specified row and column.

SetAutoScale2 method Sets the auto-scale flag value for a cell.

SetBackgroundColor method Sets a background color value for the specifed row types.

SetBackgroundColorNone method Sets the value specifying whether there is no background color for the specified row types.

SetBitmaps method Sets the large and small bitmaps used as icons for the toolbar item.

SetBlockAttributeValue method Sets the attribute value in block content with attribute definition id.

SetBlockAttributeValue method Sets the attribute value of the specified cell for the attribute definition object that is contained in the block.

SetBlockAttributeValue2 method Sets the attribute value associated to a specifed block cell.

SetBlockAttributeValue32 method For a 64-Bit system, sets a block cell's attribute value.

SetBlockAttributeValue32 method For a 64-Bit system, sets the attribute value in block content with attribute definition id.

SetBlockRotation method Sets the block rotation angle for the specified row and column.

SetBlockScale method Sets the block scale value for the specified row and column.

SetBlockTableRecordId method Sets the block table record ID of the cell.

SetBlockTableRecordId2 method Sets the block table record object id associated to a specifed cell.

SetBlockTableRecordId32 method For a 64-Bit system, sets a cell's block table record id.

SetBreakHeight method Set a table's break height.

SetBulge method Sets the bulge for the polyline at the given index.

SetCellAlignment method Sets the cell alignment for the specified row and column.

SetCellBackgroundColor method Sets the background true color value for the specified row and column.

SetCellBackgroundColorNone method Sets the value specifying that there is no background color for the specified row and column.

SetCellClass method Sets the class of a cell style.

SetCellContentColor method Sets the true color value for the content of the specified row and column.

SetCellContentColor2 method Sets the true color vlaue for a cell.

SetCellDataType method Sets the cell data and unit type for the given row and column.

SetCellFormat method Sets the cell format for the given row and column.

SetCellGridColor method Sets the grid color value for an edge of the specified row and column.

SetCellGridLineWeight method Sets the grid lineweight value for an edge of the specified row and column.

SetCellGridVisibility method Sets the grid visibility value for an edge of the specified row and column.

SetCellState method Set a cell's state.

SetCellStyle method Sets the cell style.

SetCellTextHeight method Sets the text height for the specified row and column.

SetCellTextStyle method Sets the text style name for the specified row and column.

SetCellType method Sets the cell type for the specified row and column.

SetCellValue method Sets the cell value for the given row and column.

SetColor method Sets the true color value for the specified row types.

SetColorBookColor method Specifies the color name from an existing color book.

SetColumnName method Sets a column's name.

SetColumnWidth method Sets the column width for the column at the specified column index in the table.

SetContentColor method Sets the true color value for the specified row types.

SetContentLayout method Set a cell's content layout.

SetControlPoint method Sets the control point of the spline at a given index.

SetCustomByIndex method Sets the custom property name (key) and value that correspond to an index value.

SetCustomByKey method Sets the custom property value that corresponds to a name (key) value.

SetCustomData method Sets the custom data associated to a cell.

SetCustomScale method Sets the custom scale for a layout or plot configuration.

SetDatabase method Associates an AutoCAD database with the LayerStateManager object.

SetDataFormat method Sets a cell's format.

SetDataLink method Sets the data link for the specified cell.

SetDataLink32 method For a 64-Bit system, sets the data link for a cell.

SetDataType method Sets the data type and unit type for the specifed row type.

SetDataType2 method Sets the row data type and unit type for the specified row type and nContent.

SetFieldId method Sets the field object ID of the specified cell.

SetFieldId2 method Sets the field object id associated to a specifed cell.

SetFieldId232 method For a 64-Bit system, Sets a cell's field object id.

SetFieldId32 method Sets the field object ID of the specified cell for a 64-bit system.

SetFitPoint method Sets a fit point for the spline.

SetFont method Sets the definition data of the font for the TextStyle.

SetFormat method For internal use only.

SetFormat method Sets the format for the specified row type.

SetFormat2 method Sets the format of a cell style.

SetFormula method Set a cell's formula.

SetGridColor method Sets the grid color value for the specified grid linetypes and row types.

SetGridColor2 method Sets the gridColor for the specified cell.

SetGridDoubleLineSpacing method Sets the lineSpacing value for the specified cell.

SetGridLineStyle method Set a cell's gridLineStyle.

SetGridLinetype method Sets the object with the gridLinetype value for the specified cell.

SetGridLinetype32 method For a 64-Bit system, sets an ojbect from a cell with a specific gridLineType.

SetGridLineWeight method Sets the grid lineweight value for the specified grid linetypes and row types.

SetGridLineWeight2 method Sets the gridLineWeight value for the specified cell.

SetGridSpacing method Sets the grid spacing for the viewport.

SetGridVisibility method Sets the grid visibility value for the specified grid linetype and row types.

SetGridVisibility2 method Sets the gridVisibility value for the specified cell.

SetInvisibleEdge method Sets the visibility state of an edge at a given index.

SetLayoutsToPlot method Specifies the layout or layouts to plot.

SetMargin method Set a cell's margin value.

SetNames method Specifies the color name and book name of the color.

SetOverride method Set a cell's override.

SetPattern method Sets the pattern name and pattern type for the hatch.

SetProjectFilePath method Sets the directory in which AutoCAD looks for external reference files.

SetRelativeDrawOrder method Sets the relative draw order specified, with the bottom objects first.

SetRGB Method Specifies the RGB values of the True Color.

SetRotation method Sets the rotation value for a cell.

SetRotation method Sets the rotation of a cell style.

SetRowHeight method Sets the height for the row at the specified row index in the table.

SetScale method Sets the scale value for a cell.

SetSnapSpacing method Sets the snap spacing for the viewport.

SetSubSelection method Sets the row and column indices of the cells in a subselection set.

SetText method Sets the text value for the specified row and column.

SetTextHeight method Sets the text height for the specified row types.

SetTextHeight2 method Sets the text height for a cell.

SetTextRotation method Sets the text rotation for the specified row and column.

SetTextString method Sets the text value of a cell.

SetTextStyle method Sets the text style name for the specified row types.

SetTextStyle2 method Sets the text style name for a cell.

SetToolTip method Sets a cell's tool tip.

SetValue method Sets the value of a cell.

SetValueFromText method Sets the value of a cell by parsing the text.

SetVariable method Sets the value of an AutoCAD system variable.

SetView method Sets the view in a viewport to a saved view in the Views Collection object.

SetWeight method Sets the weight of the control point at a given index.

SetWidth method Sets the start and end width of a polyline, given the segment index.

SetWindowToPlot method Sets the coordinates that define the portion of the layout to plot.

SetXdata method Sets the extended data (XData) associated with an object.

SetXRecordData method Sets the extended record data (XRecordData) associated with a dictionary.

SliceSolid method Creates a slice of the 3DSolid object given three points that define the plane.

Split method Splits a viewport into the given number of views.

StartBatchMode method Starts printing in batch mode.

StartUndoMark method Marks the beginning of a block of operations.

SwapOrder method Swaps the draw order positions of two objects.

SyncModelView method Updates the viewport parameters with the parameters in the associated model view.

T

TransformBy method Moves, scales, or rotates an object given a 4x4 transformation matrix.

TranslateCoordinates method Translates a point from one coordinate system to another.

U

Unload method Unloads the menu group or external reference.

UnloadARX method Unloads the specified AutoCAD ARX application.

UnloadDVB method Unloads the specified AutoCAD VBA project file.

UnmergeCells method Splits merged cells in a table.

Update method Updates the object to the drawing screen.

UpdateAllDataLinks method Updates all of a table's data links.

UpdateDataLink method Updates a cell's data links.

UpdateEntry method Erases and then recreates an identified entry in the File Dependency List.

UpdateMTextAttribute method Updates attribute from the multi-line mtext (and vice versa!)

UpdateMTextAttribute method Updates attribute from the multi-line mtext (and vice versa!)

W

WBlock method Writes out the given selection set as a new drawing file.

Z

ZoomAll method Zooms the current viewport to display the entire drawing.

ZoomCenter method Zooms the current viewport to a specified center point and magnification.

ZoomExtents method Zooms the current viewport to the drawing extents.

ZoomPickWindow method Zooms the current viewport to a window defined by points picked on the screen.

ZoomPrevious method Zooms the current viewport to its previous extents.

ZoomScaled method Zooms the current viewport to given scale factor.

ZoomWindow method Zooms the current viewport to the area specified by two opposite corners of a rectangle.


Activate method [ActiveX and VBA Reference: AAR]

Activate Method

Makes the specified drawing active.

See Also | Example

Signature

object.Activate

Object

Document
The object or objects this method applies to.


Add method [ActiveX and VBA Reference: AAR]

Add Method

Creates a member object and adds it to the appropriate collection.

See Also | Example

Signatures: Overview

Blocks

RetVal = object.Add(InsertionPoint, Name)

UCSs

RetVal = object.Add(Origin, XAxisPoint, YAxisPoint, Name)

Hyperlinks

RetVal = object.Add(Name[, Description][, NamedLocation])

PlotConfigurations

RetVal = object.Add(Name[, ModelType])

Dictionaries,

DimStyles, Documents,
Groups; Layers,
Layouts, Linetypes,
Materials,
PlotConfigurations,
PopupMenus, Projects,
RegisteredApplications,
SelectionSets,
TextStyles, Toolbars,
Views, Viewports

RetVal = object.Add(Name)

Signatures: Detail

RetVal = object.Add(InsertionPoint, Name)

Object

Blocks
The collection to add the new object to.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying where the Blocks Collection object will be added.

Name

String; input-only
The name of the block to add to the collection.

RetVal

Block object
The newly added Block object.

RetVal = object.Add(Origin, XAxisPoint, YAxisPoint, Name)

Object

UCSs
The collection to add the new object to.

Origin

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying where the UCS is to be added.

XAxisPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the positive X axis of the UCS. The XAxisPoint and YAxisPoint together cannot specify the same location as the Origin.

YAxisPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the positive Y axis of the UCS.
(The Z axis follows by applying the right-hand rule.)

Name

String; input-only
The name of the UCS to add to the collection.

RetVal

UCS object
The newly added UCS object.

RetVal = object.Add(Name[, Description][, NamedLocation])

Object

Hyperlinks
The collection to add the new object to.

Name

String; input-only
The name of the hyperlink to add.

Description

Variant; input-only; optional
The description of the hyperlink to add.

NamedLocation

Variant; input-only; optional
A given location, such as a named view in AutoCAD or a bookmark in a word processing program. If you specify a named view to jump to in an AutoCAD drawing, AutoCAD restores that view when the hyperlink is opened.

RetVal

Hyperlink
The newly added object.

RetVal = object.Add(Name[, ModelType])

Object

PlotConfigurations
The collection to add the new object to.

Name

String; input-only
The name of the object to add to the collection.

ModelType

Boolean; input-only; optional
TRUE: The plot configuration applies only to the Model tab.
FALSE: The plot configuration applies to all layouts.

RetVal

PlotConfiguration
The newly added object.

RetVal = object.Add(Name)

Object

Dictionaries, DimStyles, Documents, Groups; Layers, Layouts, Linetypes, PopupMenus, RegisteredApplications, SelectionSets, TextStyles, Toolbars, Views, Viewports
The collection to add the new object to.

Name

String; input-only; optional for the Documents collection.
The name of the object to add to the collection. For the Documents collection, this name represents the name of the drawing template to use and will accept a URL address or a fully qualified path and file name.

RetVal

Dictionary, DimStyle, Document, Group, Layer, Layout, Linetype, PopupMenu, RegisteredApp, SelectionSet, TextStyle, Toolbar, View, Viewport
The newly added object.

Remarks

Although you can create a linetype and add it to the Linetypes Collection object using this method, it will be created with the default properties only. Because you cannot edit properties of the Linetype object with this release of ActiveX Automation, use the Load method to load existing linetypes into your drawing.

Layers are created with default color and linetype properties. The default color is white, and the default linetype is standard.

Documents collection: When accessing a secure URL, a dialog box will be posted that prompts the user for the necessary password information. Message boxes may also be displayed if the user has not suppressed this activity in the browser. When downloading a file, AutoCAD creates a temporary file for internal processing. Do not attempt to access this temporary file. Information in this file is deleted at the end of the AutoCAD session.

Group object: You should not specify a Name that is excessively long or contains spaces, because these names are not handled well in the Group dialog box and cannot be entered at the command line.


Add3DFace method [ActiveX and VBA Reference: AAR]

Add3DFace Method

Creates a 3DFace object given four vertices.

See Also | Example

Signature

RetVal = object.Add3DFace(Point1, Point2, Point3[, Point4])

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the 3DFace object.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the 3DFace object.

Point3

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the 3DFace object.

Point4

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying a point on the 3DFace object. If omitted, this point will default to the coordinates of Point3 in order to create a three-sided face.

RetVal

3DFace object
The newly created 3DFace object.

Remarks

To create a three-sided face, omit the last point. Use the SetInvisibleEdge method to set the visibility of an edge.

Points must be entered sequentially in either a clockwise or counterclockwise direction to create a 3DFace object. You can create multiple adjacent faces by specifying the first two points of an additional face exactly as the last two points of the previous face.

Point4

Point1, Point4

Point1

Point3

Point3, Point2

Point2


Add3dMesh method [ActiveX and VBA Reference: AAR]

Add3DMesh Method

Creates a free-form 3D mesh, given the number of points in the M and N directions and the coordinates of the points in the M and N directions.

See Also | Example

Signature

RetVal = object.Add3Dmesh(M, N, PointsMatrix)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

M, N

Integer; input-only
Dimensions of the point array. The size of the mesh in both the M and N directions is limited to between 2 and 256.

PointsMatrix

Variant (array of doubles); input-only
M x N matrix of 3D WCS coordinates. Defining vertices begins with vertex (0,0). Supplying the coordinate locations for each vertex in row M must be done before specifying vertices in row M + 1.

RetVal

PolygonMesh object
A PolygonMesh as the newly created 3DMesh object.

Remarks

Vertices may be any distance from each other.

A PolygonMesh is always open in both M and N directions. A mesh can be closed after creation by using the MClose and NClose properties on the PolygonMesh object.

A PolygonMesh is always created as a simple mesh. A mesh can be smoothed after creation by using the Type property.


Add3DPoly method [ActiveX and VBA Reference: AAR]

Add3DPoly Method

Creates a 3D polyline from the given array of coordinates.

See Also | Example

Signature

RetVal = object.Add3Dpoly(PointsArray)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PointsArray

Variant (array of doubles); input-only
An array of 3D WCS coordinates. The polyline will be created according to the order of the coordinates in the array. The number of elements in the array must be a multiple of three. (Three elements define a single coordinate.)

RetVal

3DPolyline object
The newly created 3DPolyline object.

Remarks

To close the polyline, use the Closed property on the 3DPolyline object.


AddArc method [ActiveX and VBA Reference: AAR]

AddArc Method

Creates an arc given the center, radius, start angle, and end angle of the arc.

See Also | Example

Signature

RetVal = object.AddArc(Center, Radius, StartAngle, EndAngle)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center point of the arc.

Radius

Double; input-only
The radius of the arc.

StartAngle, EndAngle

Double; input-only
The start and end angles, in radians, defining the arc. A start angle greater than an end angle defines a counterclockwise arc.

RetVal

Arc object
The newly created Arc object.


AddAttribute method [ActiveX and VBA Reference: AAR]

AddAttribute Method

Creates an attribute definition at the given location with the specified properties.

See Also | Example

Signature

RetVal = object.AddAttribute(Height, Mode, Prompt, InsertionPoint, Tag, Value)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Height

Double; input-only
The text height in the current drawing unit.

Mode

AcAttributeMode enum; input-only
(any combination of constants can be used by adding them together):

acAttributeModeInvisible

acAttributeModeConstant

acAttributeModeVerify

acAttributeModeLockPosition

acAttributeModeMultipleLine

acAttributeModePreset

Prompt

String; input-only
This string appears when a block containing this attribute is inserted. The default for this string is the Tag string. Inputting acAttributeModeConstant for the Mode parameter disables the prompt.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the location for the attribute.

Tag

String; input-only
This non-null string identifies each occurrence of the attribute. Enter any characters except spaces or exclamation points. AutoCAD changes lowercase letters to uppercase.

Value

String; input-only
This non-null string is the default attribute value.

RetVal

Attribute object
The newly created Attribute object.

Remarks

The Mode values are as follows:

acAttributeModeInvisible

Specifies that attribute values won't appear when you insert the block. The ATTDISP command overrides the Invisible mode.

acAttributeModeConstant

Gives attributes a fixed value for block insertions.

acAttributeModeVerify

acAttributeModeLockPosition

Locks the position of the attributes.

acAttributeModeMultipleLine

Allows the attributes to carry-over onto multiple lines. Prompts you to verify that the attribute value is correct when you insert the block.

acAttributeModePreset

Sets the attribute to its default value when you insert a block containing a current attribute. The value cannot be edited in this mode.

An attribute definition is associated to the block for which it is created. Attribute definitions created in model space or paper space are not considered to be attached to any given block.

The AFLAGS system variable stores the mode setting. You can query this value using the GetVariable method, or set it using the SetVariable method.


AddBox method [ActiveX and VBA Reference: AAR]

AddBox Method

Creates a 3D solid box with edges parallel to the axes of the WCS.

See Also | Example

Signature

RetVal = object.AddBox(Origin, Length, Width, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Origin

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the origin of the box. This coordinate represents the center of the bounding box for the object, not a corner.

Length

Double; input-only
The length of the box. Must be a positive number.

Width

Double; input-only
The width of the box. Must be a positive number.

Height

Double; input-only
The height of the box. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created box.


AddCircle method [ActiveX and VBA Reference: AAR]

AddCircle Method

Creates a circle given a center point and radius.

See Also | Example

Signature

RetVal = object.AddCircle(Center, Radius)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the circle's center.

Radius

Double; input-only
The radius of the circle. Must be a positive number.

RetVal

Circle object
The newly created Circle object.

Remarks

This circle is created on the XY plane of the WCS.


AddCone method [ActiveX and VBA Reference: AAR]

AddCone Method

Creates a 3D solid cone with the base on the XY plane of the WCS.

See Also | Example

Signature

RetVal = object.AddCone(Center, BaseRadius, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the bounding box.

BaseRadius

Double; input-only
The radius of the cone base. Must be a positive number.

Height

Double; input-only
The height of the cone. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created cone.


AddCustomInfo method [ActiveX and VBA Reference: AAR]

AddCustomInfo Method

Adds a custom property field at the end of the existing list of fields.

See Also | Example

Signature

object.AddCustomInfo(key, Value)

Object

SummaryInfo
The object or objects this method applies to.

key

String; the name of the custom property.

Value

String; the value of the custom property.


AddCustomObject method [ActiveX and VBA Reference: AAR]

AddCustomObject Method

Creates a Custom object.

See Also | Example

Signature

RetVal = object.AddCustomObject(ClassName)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ClassName

String; input-only
The rxClassName must be defined in an ObjectARX® application (ObjectARX DLL) or the method will fail.

RetVal

Custom object
The newly created Custom object.

Remarks

The ObjectARX DLL defining the rxClassName custom class must be loaded. Use the LoadARX method on the Application object to explicitly load the ObjectARX DLL.


AddCylinder method [ActiveX and VBA Reference: AAR]

AddCylinder Method

Creates a 3D solid cylinder whose base is on the XY plane of the WCS.

See Also | Example

Signature

RetVal = object.AddCylinder(Center, Radius, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
A 3D WCS coordinates specifying the center of the bounding box.

Radius

Double; input-only
The cylinder radius. Must be a positive number.

Height

Double; input-only
The cylinder height. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created cylinder.


AddDim3PointAngular method [ActiveX and VBA Reference: AAR]

AddDim3PointAngular Method

Creates an angular dimension using 3 points.

See Also | Example

Signature

RetVal = object.AddDim3PointAngular(AngleVertex, FirstEndPoint, SecondEndPoint, TextPoint)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

AngleVertex

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the vertex of the angle to be measured.

FirstEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the first extension line passes.

SecondEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the second extension line passes.

TextPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point at which the dimension text is to be displayed.

RetVal

Dim3PointAngular object
The newly created angular dimension.


AddDimAligned method [ActiveX and VBA Reference: AAR]

AddDimAligned Method

Creates an aligned dimension object.

See Also | Example

Signature

RetVal = object.AddDimAligned(ExtLine1Point, ExtLine2Point, TextPosition)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ExtLine1Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first endpoint of the extension line.

ExtLine2Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second endpoint of the extension line.

TextPosition

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the text position.

RetVal

DimAligned object
The newly created aligned dimension.

Remarks

In aligned dimensions, the dimension line is parallel to the extension line origins. The extension line origins are specified using the ExtLine1Point and ExtLine2Point properties.


AddDimAngular method [ActiveX and VBA Reference: AAR]

AddDimAngular Method

Creates an angular dimension for an arc, two lines, or a circle.

See Also | Example

Signature

RetVal = object.AddDimAngular(AngleVertex, FirstEndPoint, SecondEndPoint, TextPoint)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

AngleVertex

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the circle or arc, or the common vertex between the two dimensioned lines.

FirstEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the first extension line passes.

SecondEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the second extension line passes.

TextPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point at which the dimension text is to be displayed.

RetVal

DimAngular object
The newly created angular dimension.

Remarks

The AngleVertex is the center of the circle or arc, or the common vertex between the two lines being dimensioned. FirstEndPoint and SecondEndPoint are the points through which the two extension lines pass.

The AngleVertex can be the same as one of the angle endpoints. If you need extension lines, they will be added automatically. The endpoints provided are used as origin points for the extension lines.


AddDimArc method [ActiveX and VBA Reference: AAR]

AddDimArc Method

Creates an arc length dimension for an arc.

See Also | Example

Signature

RetVal = object.AddDimArc(ArcCenter, FirstEndPoint, SecondEndPoint, ArcPoint)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ArcCenter

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the arc.

FirstEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the first extension line passes.

SecondEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the second extension line passes.

ArcPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the arc.

RetVal

DimArcLength object
The newly created arc length dimension.

Remarks

The ArcCenter is the center of the arc being dimensioned. FirstEndPoint and SecondEndPoint are the points through which the two extension lines pass.

Note To access this method, use the AcadBlock, AcadModelSpace, or AcadPaperSpace interface.


AddDimDiametric method [ActiveX and VBA Reference: AAR]

AddDimDiametric Method

Creates a diametric dimension for a circle or arc given the two points on the diameter and the length of the leader line.

See Also | Example

Signature

RetVal = object.AddDimDiametric(ChordPoint, FarChordPoint, LeaderLength)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ChordPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first diameter point on the circle or arc.

FarChordPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second diameter point on the circle or arc.

LeaderLength

Double; input-only
The positive value representing the length from the ChordPoint to the annotation text or dogleg.

RetVal

DimDiametric object
The newly created diameter dimension object.

Remarks

Different types of diameter dimensions are created depending on the size of the circle or arc, the length of the leader line, and the values of the DIMUPT, DIMTOFL, DIMFIT, DIMTIH, DIMTOH, DIMJUST, and DIMTAD system variables.

For horizontal dimension text, if the angle of the dimension line is more than 15 degrees from horizontal, and is outside the circle or arc, AutoCAD draws a hook line, also called a landing or dogleg. The hook line is one arrowhead long, and is placed next to the dimension text, as shown in the first two illustrations.

This function uses the LeaderLength parameter as the distance from the ChordPoint to the point where the dimension will do a horizontal dogleg to the annotation text (or stop if no dogleg is necessary).

The LeaderLength setting will only be used during the creation of the dimension (and even then only if the dimension is set to use the default text position value). After the dimension has been closed for the first time, changing the LeaderLength value will not affect how the dimension displays, but the new setting will be stored and will show up in DXF, LISP, and ADSRX.


AddDimOrdinate method [ActiveX and VBA Reference: AAR]

AddDimOrdinate Method

Creates an ordinate dimension given the definition point and the leader endpoint.

See Also | Example

Signature

RetVal = object.AddDimOrdinate(DefinitionPoint, LeaderEndPoint, UseXAxis)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

DefinitionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point to be dimensioned.

LeaderEndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the endpoint of the leader. This will be the location at which the dimension text is displayed.

UseXAxis

Integer; input-only

TRUE: Creates an ordinate dimension displaying the X axis value.

FALSE: Creates an ordinate dimension displaying the Y axis value.

RetVal

DimOrdinate object
The newly created ordinate dimension object.

Remarks

Ordinate dimensions display the X or Y coordinate of an object along with a simple leader line. The absolute value of the coordinate is used according to the prevailing standards for ordinate dimensions.

An ordinate dimension measuring the absolute
X position of a point tangent to a circle


AddDimRadial method [ActiveX and VBA Reference: AAR]

AddDimRadial Method

Creates a radial dimension for the selected object at the given location.

See Also | Example

Signature

RetVal = object.AddDimRadial(Center, ChordPoint, LeaderLength)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center point on the circle or arc.

ChordPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point on the circle or arc to attach the leader line.

LeaderLength

Double; input-only
The positive value representing the length from the ChordPoint to the annotation text or dogleg.

RetVal

DimRadial object
The newly created radius dimension object.

Remarks

Different types of radial dimensions are created depending on the size of the circle or arc, the TextPosition property and the values in the DIMUPT, DIMTOFL, DIMFIT, DIMTIH, DIMTOH, DIMJUST, and DIMTAD dimension system variables. (System variables can be queried or set using the GetVariable and SetVariable methods.)

For horizontal dimension text, if the angle of the dimension line is more than 15 degrees from horizontal, and is outside the circle or arc, AutoCAD draws a hook line, also called a landing or dogleg. The hook line is one arrowhead long, and is placed next to the dimension text, as shown in the first two illustrations.

This method uses length as the distance from the ChordPoint out to where the dimension will do a horizontal dogleg to the annotation text (or stop if no dogleg is necessary).

The LeaderLength setting will only be used during the creation of the dimension (and even then only if the dimension is set to use the default text position value). After the dimension has been closed for the first time, changing the LeaderLength value will not affect how the dimension displays, but the new setting will be stored and will show up in DXF, LISP, and ADSRX.


AddDimRadialLarge method [ActiveX and VBA Reference: AAR]

AddDimRadialLarge Method

Creates a jogged radial dimension for an arc, circle, or polyline arc segment.

See Also | Example

Signature

RetVal = object.AddDimRadialLarge(Center, ChordPoint, OverrideCenter, JogPoint, JogAngle As Double)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the arc, circle, or polyline arc segment.

ChordPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the chord point for the arc.

OverrideCenter

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the override center location or pick point.

JogPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the jog location or pick point.

JogAngle

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the jog angle.

RetVal

DimRadialLarge object
The newly created jogged radius dimension.

Remarks

The Center is the center of the arc, circle, or polyline arc segment being dimensioned. The OverrideCenter is the origin point of the dimension.

Note To access this method, use the AcadBlock, AcadModelSpace, or AcadPaperSpace interface.


AddDimRotated method [ActiveX and VBA Reference: AAR]

AddDimRotated Method

Creates a rotated linear dimension.

See Also | Example

Signature

RetVal = object.AddDimRotated(XLine1Point, XLine2Point, DimLineLocation, RotationAngle)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

XLine1Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first end of the linear dimension to be measured. This is where the first extension line will be attached.

XLine2Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second end of the linear dimension to be measured. This is where the second extension line will be attached.

DimLineLocation

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point on the dimension line. This will define the placement of the dimension line and the dimension text.

RotationAngle

Double; input-only
The angle, in radians, of rotation displaying the linear dimension.

RetVal

DimRotated object
The newly created rotated linear dimension object.

Remarks

A linear dimension created at 45 degrees


AddEllipse method [ActiveX and VBA Reference: AAR]

AddEllipse Method

Creates an ellipse in the XY plane of the WCS given the center point, a point on the major axis, and the radius ratio.

See Also | Example

Signature

RetVal = object.AddEllipse(Center, MajorAxis, RadiusRatio)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the ellipse.

MajorAxis

Variant (double); input-only
A positive value defining the length of the major axis of the ellipse.

RadiusRatio

Double; input-only
A positive value defining the major to minor axis ratio of an ellipse. A radius ratio of 1.0 defines a circle.

Radius ratio = 0.25

Radius ratio = 0.75

RetVal

Ellipse object
The newly created Ellipse object.

Remarks

The ellipse may be closed, or open (elliptical arc), and is created on the XY plane of the current WCS.

This object represents a true ellipse, not a polyline approximation.

Minor axis

Major axis


AddEllipticalCone method [ActiveX and VBA Reference: AAR]

AddEllipticalCone Method

Creates a 3D solid elliptical cone on the XY plane of the WCS given the Center, MajorRadius, MinorRadius, and Height.

See Also | Example

Signature

RetVal = object.AddEllipticalCone(Center, MajorRadius, MinorRadius, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the bounding box.

MajorRadius

Double; input-only
The length of the major radius for the ellipse base. Must be a positive number.

MinorRadius

Double; input-only
The length of the minor radius for the ellipse base. Must be a positive number.

Height

Double; input-only
The height of the cone. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created elliptical cone.


AddEllipticalCylinder method [ActiveX and VBA Reference: AAR]

AddEllipticalCylinder Method

Creates a 3D solid elliptical cylinder whose base is on the XY plane of the WCS, given the Center, MajorRadius, MinorRadius, and Height.

See Also | Example

Signature

RetVal = object.AddEllipticalCylinder(Center, MajorRadius, MinorRadius, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the bounding box.

MajorRadius

Double; input-only
The length of the major radius for the ellipse base. Must be a positive number.

MinorRadius

Double; input-only
The length of the minor radius for the ellipse base. Must be a positive number.

Height

Double; input-only
The height of the cylinder. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created elliptical cylinder.


AddExtrudedSolid method [ActiveX and VBA Reference: AAR]

AddExtrudedSolid Method

Creates an extruded solid given the Profile, Height, and TaperAngle.

See Also | Example

Signature

RetVal = object.AddExtrudedSolid(Profile, Height, TaperAngle)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Profile

Profile object; input-only
The Region object only.

Height

Double; input-only
The height of the extrusion along the Z axis of the object's coordinate system. If you enter a positive number, AutoCAD extrudes the object along the positive Z axis. If you enter a negative number, AutoCAD extrudes the object along the negative Z axis.

TaperAngle

Double; input-only
The taper angle of the extrusion must be provided in radians. The range of the taper angle is from -90 to +90 degrees.
Positive angles taper in from the base, negative angles taper out. The default angle, 0, extrudes a 2D object perpendicular to its plane.

RetVal

3DSolid object
A 3DSolid object as the newly created extruded solid.

Remarks

You can extrude only 2D planar regions.

Tapered extrusions are possible only with loops that are continuous at the vertices. A large taper angle or long extrusion height can cause the object, or portions of the object, to intersect with itself before reaching the extrusion height. AutoCAD does not allow an extrusion when the resulting solid intersects with itself.


AddExtrudedSolidAlongPath method [ActiveX and VBA Reference: AAR]

AddExtrudedSolidAlongPath Method

Creates an extruded solid given the profile and an extrusion path.

See Also | Example

Signature

RetVal = object.AddExtrudedSolidAlongPath(Profile, Path)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Profile

Profile object; input-only
The Region object only.

Path

Path object; input-only
The Polyline, Circle, Ellipse, Spline, or Arc object only.

RetVal

3DSolid object
The extruded 3DSolid object.

Remarks

You can extrude only 2D planar regions.

The path should not lie on the same plane as the profile, nor should it have areas of high curvature.


AddFitPoint method [ActiveX and VBA Reference: AAR]

AddFitPoint Method

Adds the fit point to the spline at a given index.

See Also | Example

Signature

object.AddFitPoint Index, FitPoint

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
Position in the fit point list to add the fit point. If the index is a negative number, then the point is added to the beginning of the spline. If the index exceeds the number of fit points in the spline, then the point is added to the end of the spline.

FitPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the fit point to be added.

Remarks

AutoCAD adds the point and refits the spline through the new set of points. To view the changes, use the Update or Regen method.


AddHatch method [ActiveX and VBA Reference: AAR]

AddHatch Method

Creates a Hatch object.

See Also | Example

Signature

RetVal = object.AddHatch(PatternType, PatternName, Associativity [, HatchObjectType])

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PatternType

AcPatternType or AcGradientPatternType enum; input-only
If the HatchObjectType enum value is acHatchObject, then use the AcPatternType enum; if the HatchObjectType enum value is AcGradientObject, then use the AcGradientPatternType enum.

PatternName

String; input-only
If the HatchObjectType enum value is acHatchObject, then PatternName should contain the hatch pattern name. If the HatchObjectType enum value is acGradientObject, then PatternName should contain one of the the gradient pattern names listed in GradientName.

Associativity

Boolean; input-only

TRUE: The hatch will be associative.

FALSE: The hatch will not be associative.

HatchObjectType

HatchObjectType; optional; input-only
The default value is the AcHatchObjectType enum value of AcHatchObject. If the AcHatchObjectType enum value is AcGradientObject, then PatternType should be of type AcGradientPatternType, and PatternName should contain the gradient pattern name.

RetVal

Hatch object
The newly created Hatch object.

Remarks

The PatternType constant values are as follows:

acHatchPatternTypePredefined

Selects the pattern name from those defined in the acad.pat file.

acHatchPatternTypeUserDefined

Defines a pattern of lines using the current linetype.

acHatchPatternTypeCustomDefined

Selects the pattern name from a PAT file other than the acad.pat file.

After the Hatch object is created, you must add the outer loop using the AppendOuterLoop method. The outer loop must be closed and must be created before any inner loops can be created. Inner loops are created one at a time, using the AppendInnerLoop method.

WARNING! Once the Hatch object has been created, you must append the outer loop to the Hatch object for it to become a valid AutoCAD object. If you attempt any operation other than calling the AppendOuterLoop method, AutoCAD will enter an unpredictable state.


AddItems method [ActiveX and VBA Reference: AAR]

AddItems Method

Adds one or more objects to the specified selection set.

See Also | Example

Signature

object.AddItems Items

Object

SelectionSet
The object or objects this method applies to.

Items

Variant
An array of objects to add to the selection set.

Remarks

Objects currently in the specified selection set remain in the selection set. To replace the objects in the selection set, clear the selection set using the Clear method, then add the objects.

To remove individual objects from a selection set, use the RemoveItems method.


AddLeader method [ActiveX and VBA Reference: AAR]

AddLeader Method

Creates a leader line, given the coordinates of the points.

See Also | Example

Signature

RetVal = object.AddLeader(PointsArray, Annotation, Type)

Object

ModelSpace collection, PaperSpace collection, Block
The object or objects this method applies to.

PointsArray

Variant (array of doubles); input-only
The array of 3D WCS coordinates specifying the leader. You must provide at least two points to define the leader. The third point is optional.

Annotation

Object; input-only
A Tolerance, MText, BlockRef object or NULL.

Type

AcLeaderType enum; input-only

acAttributeModeLockPosition

acAttributeModeMultipleLine

acLineNoArrow

acLineWithArrow

acSplineNoArrow

acSplineWithArrow

RetVal

Leader object
The newly created Leader object.

Remarks

The leader is a line that connects some annotation to a feature in a drawing. Leaders and their annotation are associative, which means if you modify the annotation, the leader updates accordingly. The annotation can be a Tolerance, Mtext, or BlockRef object.

You can also create leaders that are not associated to a particular object. To do this, simply input a NULL object as the annotation.


AddLightWeightPolyline method [ActiveX and VBA Reference: AAR]

AddLightWeightPolyline Method

Creates a lightweight polyline from a list of vertices.

See Also | Example

Signature

RetVal = object.AddLightWeightPolyline(VerticesList)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

VerticesList

Variant (array of doubles)
The array of 2D OCS coordinates specifying the vertices of the polyline. At least two points (four elements) are required for constructing a lightweight polyline. The array size must be a multiple of 2.

RetVal

LightweightPolyline object
The newly created LightweightPolyline object.

Remarks

The vertices specify the endpoints for the line segments that make up the polyline. To add an arc segment, first create the polyline with all line segments, and then add a bulge to the individual segments you want to be arcs. To add a bulge value to a segment, use the SetBulge method.

The elevation for the polyline will be set at the current elevation for the layout. Use the ElevationModelspace or ElevationPaperspace property to determine the elevation for the polyline.

Coordinates can be converted to and from the OCS using the TranslateCoordinates method.


AddLine method [ActiveX and VBA Reference: AAR]

AddLine Method

Creates a line passing through two points.

See Also | Example

Signature

RetVal = object.AddLine(StartPoint, EndPoint)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

StartPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the line start point.

EndPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the line endpoint.

RetVal

Line object
The newly created Line object.


AddMenuItem method [ActiveX and VBA Reference: AAR]

AddMenuItem Method

Adds a popup menu item to a popup menu.

See Also | Example

Signature

RetVal = object.AddMenuItem(Index, Label, Macro)

Object

PopupMenu
The object or objects this method applies to.

Index

Variant; input-only
The index location in the popup menu where the item is to be added. The index must be either an integer or a string.

If an integer is supplied to specify a given location in the menu, the index must be between 0 and N-1, where N is the number of objects in the popup menu. The new item will be added immediately before the specified index location. To add the new menu item to the end of a menu, set the index to be greater than N.

If a string is specified and the indexed item does not exist, then the new menu item is added at the end of the menu.

Label

String; input-only
The label for the menu item. The label may contain DIESEL string expressions. Labels also identify the accelerator keys (keyboard key sequences) that correspond to the menu item by placing an ampersand (&) in front of the accelerator character.

Macro

String; input-only
The name of the macro associated with this menu item.

RetVal

PopupMenuItem object
The newly created popup menu item.


AddMInsertBlock method [ActiveX and VBA Reference: AAR]

AddMInsertBlock Method

Inserts an array of blocks.

See Also | Example

Signature

RetVal = object.AddMInsertBlock(InsertionPoint, Name, XScale, YScale, ZScale, Rotation, NumRows, NumColumns, RowSpacing, ColumnSpacing [, Password])

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates at which to insert the array of blocks.

Name

String; input-only
The name of the MInsertBlock.
NOTE: You cannot precede the name of an MInsertBlock with an asterisk to separate the block's objects during insertion, as you can with a standard Block.

XScale

Double; input-only
The X scale factor.

YScale

Double; input-only
The Y scale factor.

ZScale

Double; input-only
The Z scale factor.

Rotation

Double; input-ony
The rotation angle in radians.

NumRows

Long; input-only
A positive integer representing the number of rows for the array.

NumColumns

Long; input-only
A positive integer representing the number of columns for the array.

RowSpacing

Long; input-only
The distance between the array rows.

ColumnSpacing

Long;input-only
The distance between the array columns.

Password

Variant; input-only; optional

RetVal

MInsertBlock object
The newly created array of blocks.

Remarks

The following illustration shows an array of inserted blocks.

Original block | Array of inserted blocks


AddMLeader method [ActiveX and VBA Reference: AAR]

AddMLeader Method

Creates an mleader line, given coordinates.

See Also | Example

Signature

RetVal = object.AddMLeader(pointsArray, leaderLineIndex)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

pointsArray

Variant (three-element array of Doubles); input-only
The array of 3D WCS coordinates specifying the leader. You must provide at least two point to define the leader. The third point is optional.

leaderLineIndex

Long; input-only
Input index of the mleader cluster.

RetVal

MLeader object
The newly created MLeader object.


AddMLine method [ActiveX and VBA Reference: AAR]

AddMLine Method

Creates multiple lines passing through an array of points.

See Also | Example

Signature

RetVal = object.AddMLine(VertexList)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

VertexList

Variant (array of doubles); input-only
An array of the 3D WCS coordinates specifying the vertices for the multiline.

RetVal

MLine object
The newly created MLine object.


AddMtext method [ActiveX and VBA Reference: AAR]

AddMText Method

Creates an MText entity in a rectangle defined by the insertion point and width of the bounding box.

See Also | Example

Signature

RetVal = object.AddMText(InsertionPoint, Width, Text)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

InsertionPoint

Variant (three-element array of doubles); input-only
The insertion point of the mtext bounding box.

Width

Double; input-only
The width of the mtext bounding box.

Text

String; input-only
The actual text string for the MText object.

RetVal

MText object
The newly created MText object.


AddObject method [ActiveX and VBA Reference: AAR]

AddObject Method

Adds an object to a named dictionary.

See Also | Example

Signature

RetVal = object.AddObject(Keyword, ObjectName)

Object

Dictionary
The object or objects this method applies to.

Keyword

String; input-only
The keyword to be listed in the dictionary for this object.

ObjectName

String; input-only
The rxClassName of the object to be created in the dictionary.

RetVal

Object
The newly created object.

Remarks

This method adds a new entry specified by ObjectName to the dictionary. If the entry already exists, it is replaced by the new object. The name of the object is specified by Keyword.

For example, an object with the Keyword "ThirdKeyword" and an object type "Object3" can be added to MyDictionary to create the following:

MyDictionary
Keyword	Object
FirstKeyword	Object1
SecondKeyword	Object2
ThirdKeyword	Object3

NOTE The ObjectARX application that defines the object must be loaded for this method to function correctly. See the LoadARX method for information on loading ObjectARX applications.


AddPoint method [ActiveX and VBA Reference: AAR]

AddPoint Method

Creates a Point object at a given location.

See Also | Example

Signature

RetVal = object.AddPoint(Point)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only
The coordinates of the point to be created.

RetVal

Point object
The newly created Point object.


AddPolyfaceMesh method [ActiveX and VBA Reference: AAR]

AddPolyfaceMesh Method

Creates a polyface mesh from a list of vertices.

See Also | Example

Signature

RetVal = object.AddPolyfaceMesh(VerticesList, FaceList)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

VerticesList

Variant (array of doubles); input-only
An array of 3D WCS coordinates used to create the polyface mesh vertices. At least four points (twelve elements) are required for constructing a polyface mesh object. The array size must be a multiple of three.

FaceList

Variant (array of Integers); input-only
An array of integers representing the vertex numbers for each face. Faces are defined in groups of four vertex index values, so the size of this array must be a multiple of four.

RetVal

PolyfaceMesh object
The newly created PolyfaceMesh object.

Remarks

Creating a polyface mesh is similar to creating a rectangular mesh. To create a polyface mesh, you specify the coordinates for its vertices and the vertex numbers for all the vertices of that face.

In the following illustration, face 1 is defined by vertices 1, 5, 6, and 2. Face 2 is defined by vertices 1, 4, 3, and 2. Face 3 is defined by vertices 1, 4, 7, and 5, and face 4 is defined by vertices 3, 4, 7, and 8.

To make an edge invisible, enter the vertex number for the edge as a negative value. For instance, to make the edge between vertices 5 and 7 invisible in the following illustration, you would set the following:

Face 3, vertex 3: -7


AddPolyline method [ActiveX and VBA Reference: AAR]

AddPolyline Method

Creates a polyline from a list of vertices.

See Also | Example

Signature

RetVal = object.AddPolyline(VerticesList)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

VerticesList

Variant (array of doubles); input-only
An array of OCS coordinates used to create the polyline vertices. Each vertex is represented with three elements, with the first two being the X and Y coodinates in OCS; the third element is ignored. At least two points (six elements) are required for constructing a polyline object. The array size must be a multiple of three.

RetVal

Polyline object
The newly created Polyline object.

Remarks

To create a polyline containing arcs, first create the straight polyline, and then set the bulge at specific vertices using the SetBulge method.

This method exists for backward compatibility only. Use the AddLightweightPolyline method to create polylines with an optimized format that saves memory and disk space.

Coordinates can be converted to and from the OCS using the TranslateCoordinates method.


AddPViewport method [ActiveX and VBA Reference: AAR]

AddPViewport Method

Adds a paper space viewport, given the center, height, and width.

See Also | Example

Signature

RetVal = object.AddPViewport(Center, Width, Height)

Object

PaperSpace collection
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The center coordinates of the viewport.

Width

Double; input-only
The width of the viewport. Must be a positive number.

Height

Double; input-only
The height of the viewport. Must be a positive number.

RetVal

PViewport object
The newly created PViewport object.


AddRaster method [ActiveX and VBA Reference: AAR]

AddRaster Method

Creates a new raster image based on an existing image file.

See Also | Example

Signature

RetVal = object.AddRaster(ImageFileName, InsertionPoint, ScaleFactor, RotationAngle)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ImageFileName

String; input-only
The full path and file name of the image.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates in the drawing where the raster image will be created.

ScaleFactor

Double; input-only
The raster image scale factor. The default image scale factor is 1. The scale factor must be a positive number. You can set the scale of the image to the scale of the geometry created in the AutoCAD drawing.

RotationAngle

Double; input-only
The rotation angle in radians for the raster image.

RetVal

Raster object
The newly created Raster object.

Remarks

Images placed through the AddRaster method are not actually part of the drawing file. The raster image is linked to the drawing file through a path name or document ID. Linked image paths can be changed or removed at any time by using the SupportPath property. By attaching images using linked image paths, you place images in your drawing without increasing the file size of the drawing.

You can add the same raster image file to your drawing file multiple times. Each instance has its own clip boundary and its own settings for brightness, contrast, fade, and transparency. A single image can be cut into multiple pieces that can be rearranged independently in your drawing.


AddRay method [ActiveX and VBA Reference: AAR]

AddRay Method

Creates a ray passing through two unique points.

See Also | Example

Signature

RetVal = object.AddRay(Point1, Point2)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the finite start point of the ray.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying a point through which the ray will pass. The ray extends from Point1, through Point2 to infinity.

RetVal

Ray object
The newly created Ray object.


AddRegion method [ActiveX and VBA Reference: AAR]

AddRegion Method

Creates a region from a set of entities. The given entities must form a closed coplanar region.

See Also | Example

Signature

RetVal = object.AddRegion(ObjectList)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

ObjectList

Array of Objects
The array of objects forming the closed coplanar face to be made into a region. This array may contain the following object types: Line, Arc, Circle, Elliptical Arc, LightweightPolyline, Spline.

RetVal

Variant
This method outputs an array of the newly created Region objects.

Remarks

This method will create a region out of every closed loop formed by the input array of curves. AutoCAD converts closed 2D and planar 3D polylines to separate regions, and then converts polylines, lines, and curves that form closed planar loops. If more than two curves share an endpoint, the resultant region might be arbitrary.

You can explode a region into the individual loops by using the Explode method. The Boolean method allows you to create composite 3D solids or regions from the intersection, union, or subtraction of a solid or region from another solid or region.

The total number of Region objects created is Ubound(objRegions) - Lbound(objRegions) + 1.


AddRevolvedSolid method [ActiveX and VBA Reference: AAR]

AddRevolvedSolid Method

Creates a revolved solid, given the region around an axis.

See Also | Example

Signature

RetVal = object.AddRevolvedSolid(Profile, AxisPoint, AxisDir, Angle)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Profile

Region object; input-only

AxisPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the start point of the axis of revolution.

AxisDir

Variant (three-element array of doubles); input-only
A 3D vector specifying the direction of the axis of revolution.

Angle

Double; input-only
The angle of revolution in radians. Enter 6.28 for a full circle revolution.

RetVal

3DSolid object
A 3DSolid object as the newly created revolved solid.

Remarks

The region to revolve must be closed. You cannot revolve objects contained within a block. You can revolve only one object at a time.

The right-hand rule determines the positive direction of rotation.


AddSection method [ActiveX and VBA Reference: AAR]

AddSection method

Creates a section plane

See Also | Example

object

Block
The object or objects to which this method applies.

FromPoint

Variant; input-only

ToPoint

Variant; input-only

planeVector

Variant; input-only


AddSeparator method [ActiveX and VBA Reference: AAR]

AddSeparator Method

Adds a separator to an existing menu or toolbar.

See Also | Example

Signature

RetVal = object.AddSeparator(Index)

Object

PopupMenu, Toolbar
The object or objects this method applies to.

Index

Variant; input-only
The index location in the menu or toolbar where the item is to be added.

If an integer is used to specify a given location in the menu or toolbar, the index must be between 1 and N-1, where N is the number of objects in the popup menu or in the toolbar. The separator will be added immediately before the specified index location. To add the separator to the end of a menu or toolbar, set the index to be greater than N.

If a string is specified and the indexed item does not exist, then the separator is added at the end of the menu or toolbar.

RetVal

PopupMenuItem object or ToolbarItem object
The newly created separator item.

Remarks

The first item in a menu or toolbar cannot be a separator, therefore you cannot add a separator into index position 0.

You cannot add a separator immediately next to another separator.


AddShape method [ActiveX and VBA Reference: AAR]

AddShape Method

Creates a Shape object based on a template identified by name, at the given insertion point, scale factor, and rotation.

See Also | Example

Signature

RetVal = object.AddShape(Name, InsertionPoint, ScaleFactor, Rotation)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Name

String; input-only
The name of the shape to insert.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates at which to insert the shape.

ScaleFactor

Double; input-only
The scale factor to be applied to the shape. Use 1.0 to specify no scale. Must be a positive number.

Rotation

Double; input-only
The angle of rotation in radians to be applied to the shape.

RetVal

Shape object
The newly created Shape object.

Remarks

Before adding a Shape object, you must load the file containing the desired shape using the LoadShapeFile method.


AddSolid method [ActiveX and VBA Reference: AAR]

AddSolid Method

Creates a 2D solid polygon.

See Also | Example

Signature

RetVal = object.AddSolid(Point1, Point2, Point3, Point4)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only

Point2

Variant (three-element array of doubles); input-only

Point3

Variant (three-element array of doubles); input-only

Point4

Variant (three-element array of doubles); input-only

RetVal

Solid object
The newly created polygon.

Remarks

The first two points define one edge of the polygon. The third point is defined diagonally opposite from the second. If the fourth point is set equal to the third point, then a filled triangle is created.

Solids are filled only when the FILLMODE system variable is set to On. To set or query a system variable, use the SetVariable and GetVariable methods, respectively.


AddSphere method [ActiveX and VBA Reference: AAR]

AddSphere Method

Creates a sphere given the center and radius.

See Also | Example

Signature

RetVal = object.AddSphere(Center, Radius)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the sphere center point.

Radius

Double; input-only
The radius of the sphere. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created sphere.


AddSpline method [ActiveX and VBA Reference: AAR]

AddSpline Method

Creates a quadratic or cubic NURBS (nonuniform rational B-spline) curve.

See Also | Example

Signature

RetVal = object.AddSpline(PointsArray, StartTangent, EndTangent)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PointsArray

Variant (array of doubles); input-only
An array of 3D WCS coordinates defining the spline curve. At least two points (six elements) are required for constructing a Spline object. The array size must be in multiples of three.

StartTangent

Variant (three-element array of doubles); input-only
A 3D vector specifying the tangency of the spline curve at the first point.

EndTangent

Variant (three-element array of doubles); input-only
A 3D vector specifying the tangency of the spline curve at the last point.

RetVal

Spline object
The newly created Spline object.

Remarks

The StartTangent and EndTangent parameters specify the tangents at the two ends of the spline. By default, a spline is created open. The read-only Closed property indicates whether the spline is open or closed.


AddSubMenu method [ActiveX and VBA Reference: AAR]

AddSubMenu Method

Adds a submenu to an existing menu.

See Also | Example

Signature

RetVal = object.AddSubMenu(Index, Label)

Object

PopupMenu
The object or objects this method applies to.

Index

Variant; input-only
The index location in the menu where the item is to be added.

If an integer is used to specify a given location in the menu, the index must be between 0 and N-1, where N is the number of objects in the popup menu. The new item will be added immediately before the specified index location. To add the new menu item to the end of a menu, set the index to be greater than N.

If a string is specified and the indexed item does not exist, then the new menu item is added at the end of the menu.

Label

String; input-only
The label for the menu item. The label may contain DIESEL string expressions. Labels also identify the accelerator keys (keyboard key sequences) that correspond to the menu item by placing an ampersand (&) in front of the accelerator character.

RetVal

PopupMenu object
The newly created submenu. This new cascading menu is blank, and can be populated with standard menu handling techniques.

Remarks

This method creates a new PopupMenuItem object and adds it to the designated menu. This special kind of PopupMenuItem object is assigned the type of acSubmenu.

In the following example menu, the Align Text menu item has been inserted into the Dimension menu at the 17th index. The Align Text menu item is of the type acSubmenu. All other menu entries in the example are of the type acMenuItem or acMenuSeparator. The small cascading menu that is displayed when Align Text is selected is the new menu that was returned by the AddSubmenu method. It has been populated using the AddMenuItem and AddSeparator methods.


AddTable method [ActiveX and VBA Reference: AAR]

AddTable Method

Adds a table to a drawing.

See Also | Example

Signature

RetVal = object.AddTable(InsertionPoint, NumRows, NumColumns, RowHeight, ColWidth)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

InsertionPoint

Location to insert the table

NumRows

Long; the number of rows in the table

NumColumns

Long; the number of columns in the table

RowHeight

Double; the height of the rows in the table

ColWidth

Double; the width of the columns in the table

RetVal

Table object
The newly created table object.


AddText method [ActiveX and VBA Reference: AAR]

AddText Method

Creates a single line of text.

See Also | Example

Signature

RetVal = object.AddText(TextString, InsertionPoint, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

TextString

String; input-only
The actual text to be displayed.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates on the drawing where the text is placed.

Height

Double; input-only
The height of the text. Must be a positive number.

RetVal

Text object
The newly created Text object.


AddTolerance method [ActiveX and VBA Reference: AAR]

AddTolerance Method

Creates a tolerance entity.

See Also | Example

Signature

RetVal = object.AddTolerance(Text, InsertionPoint, Direction)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Text

String; input-only
The text string for the tolerance.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates in the drawing specifying the placement of the tolerance symbol.

Direction

Variant (three-element array of doubles); input-only
A 3D directional vector specifying the direction of the tolerance symbol.

RetVal

Tolerance object
The newly created Tolerance object.


AddToolbarButton method [ActiveX and VBA Reference: AAR]

AddToolbarButton Method

Adds a toolbar item to a toolbar at a specified position.

See Also | Example

Signature

RetVal = object.AddToolbarButton(Index, Name, HelpString, Macro[, FlyoutButton])

Object

Toolbar
The object or objects this method applies to.

Index

Variant; input-only
The index location in the toolbar where the item is to be added.
The index must be either an integer or a string. If an integer is specified, the index must be between 0 and N-1, where N is the number of objects in the toolbar. The new item will be added immediately before the specified index location.

Name

String; input-only
The string that identifies the toolbar button. The string must comprise alphanumeric characters with no punctuation other than a dash (-) or an underscore (_). This string is displayed as the tooltip when the cursor is placed over the toolbar button.

HelpString

String; input-only
The string that is displayed in the AutoCAD status line for the button.

Macro

String; input-only
The name of the macro associated with this item.

FlyoutButton

Variant; input-only; optional
A Boolean variable stating if the new button is to be a flyout button or not. If the button is a flyout button, this parameter must be set to TRUE. If the button is not a flyout button, this parameter can be set to FALSE or ignored and the new ToolbarItem object will be returned.

TRUE: The button is a flyout button.

FALSE: The button is not a flyout button.

RetVal

ToolbarItem object
The newly created toolbar item.

Remarks

You can only add or remove toolbar buttons when the toolbar is visible.


AddTorus method [ActiveX and VBA Reference: AAR]

AddTorus Method

Creates a torus at the given location.

See Also | Example

Signature

RetVal = object.AddTorus(Center, TorusRadius, TubeRadius)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates in the drawing around which the torus is centered.

TorusRadius

Double; input-only
The distance from the center of the torus to the center of the tube. Must be a positive number.

TubeRadius

Double; input-only
The radius of the tube. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created torus.


AddTrace method [ActiveX and VBA Reference: AAR]

AddTrace Method

Creates a Trace object from an array of points.

See Also | Example

Signature

RetVal = object.AddTrace(PointsArray)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PointsArray

Variant (array of doubles); input-only
An array of 3D WCS coordinates specifying the trace endpoints.

RetVal

Trace object
The newly created Trace object.

System Variables

To set the Fill mode, use the FILLMODE system variable. The TRACEWID system variable stores the current width used for Trace objects.

Remarks

The endpoints of a trace are always on the centerline and are always cut square. AutoCAD automatically calculates the correct bevels for connection to adjacent trace segments.

Traces are solid filled when the Fill mode is on. When Fill mode is off, only the outline of a trace appears.


AddVertex method [ActiveX and VBA Reference: AAR]

AddVertex Method

Adds a vertex to a lightweight polyline or a section.

See Also | Example

Signature

object.AddVertex Index, Point

Object

LightweightPolyline, Section
The object or objects this method applies to.

Index

Integer; input-only
The index in the array of vertices where the vertex is to be added. Index must be a positive integer. The first element of the array is index 0.

Point

Variant (three-element array of doubles); input-only
The 3D OCS coordinates at which to create the new vertex.

Remarks

For lightweight polylines, the vertex specifies the endpoint for a new line segment. To add an arc segment to a lightweight polyline, first create the line segment, and then add a "bulge" to the individual segment that is to become an arc. To add a bulge value to a segment, use the SetBulge method.

For sections, the vertex specifies a point on the section line.

Coordinates can be converted to and from the OCS using the TranslateCoordinates method.


AddWedge method [ActiveX and VBA Reference: AAR]

AddWedge Method

Creates a wedge with edges parallel to the axes given the length, width, and height.

See Also | Example

Signature

RetVal = object.AddWedge(Center, Length, Width, Height)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the wedge face.

Length

Double; input-only
The length of the wedge corresponding to the X axis. Must be a positive number.

Width

Double; input-only
The width of the wedge corresponding to the Y axis. Must be a positive number.

Height

Double; input-only
The height of the wedge corresponding to the Z axis. Must be a positive number.

RetVal

3DSolid object
A 3DSolid object as the newly created wedge.


AddXLine method [ActiveX and VBA Reference: AAR]

AddXLine Method

Creates an xline (an infinite line) passing through two specified points.

See Also | Example

Signature

RetVal = object.AddXline(Point1, Point2)

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only

Point2

Variant (three-element array of doubles); input-only

RetVal

XLine object
The newly created XLine object.


AddXRecord method [ActiveX and VBA Reference: AAR]

AddXRecord Method

Creates an XRecord object in any dictionary.

See Also | Example

Signature

RetVal = object.AddXRecord(Keyword)

Object

Dictionary
The object or objects this method applies to.

Keyword

String, input-only
The name of the XRecord within the dictionary.

RetVal

XRecord object
The newly created XRecord object.


AngleFromXAxis method [ActiveX and VBA Reference: AAR]

AngleFromXAxis Method

Gets the angle of a line from the X axis.

See Also | Example

Signature

RetVal = AngleFromXAxis(Point1, Point2)

Object

Utility
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The start point of the line.

Point2

Variant (three-element array of doubles); input-only
The endpoint of the line.

RetVal

Double
The angle of the line in radians.


AngleToReal method [ActiveX and VBA Reference: AAR]

AngleToReal Method

Converts an angle as a string to a real (double) value.

See Also | Example

Signature

RetVal = AngleToReal(Angle, Unit)

Object

Utility
The object or objects this method applies to.

Angle

String; input-only
The angle as a string value.

Unit

AcAngleUnits enum; input-only
The unit to which the string will be converted.

acDegrees

acDegreeMinuteSeconds

acGrads

acRadians

RetVal

Double
The angle as a real number.


AngleToString method [ActiveX and VBA Reference: AAR]

AngleToString Method

Converts an angle from a real (double) value to a string.

See Also | Example

Signature

RetVal = AngleToString(Angle, Unit, Precision)

Object

Utility
The object or objects this method applies to.

Angle

Double; input-only

Unit

AcAngleUnits enum; input-only

acDegrees

acDegreeMinuteSeconds

acGrads

acRadians

Precision

Integer; input-only
The precision of the angle. An integer between 0 and 8.

RetVal

String
The angle as a string.


AppendInnerLoop method [ActiveX and VBA Reference: AAR]

AppendInnerLoop Method

Appends an inner loop to the hatch.

See Also | Example

Signature

object.AppendInnerLoop Loop

Object

Hatch
The object or objects this method applies to.

Loop

Variant (object, or array of objects); input-only
An array of objects forming a closed boundary. The array can consist of one or more objects. If more than one object is used, their endpoints must coincide for the loop to be created properly. The loop may contain the following types of objects:
Line, Polyline, Circle, Ellipse, Spline, Region

Remarks

After the Hatch object has been created using the AddHatch method, add the outer loop using AppendOuterLoop. The outer loop must be closed and must be created before any inner loops can be added.


AppendItems method [ActiveX and VBA Reference: AAR]

AppendItems Method

Appends one or more entities to the specified group.

See Also | Example

Signature

object.AppendItems Objects

Object

Group
The object or objects this method applies to.

Objects

Variant (array of objects)
An array of objects to append. The array can consist of any Drawing Objects.

Remarks

To query items in a group, use the Item method.

To remove individual items from a group, use the RemoveItems method.


AppendOuterLoop method [ActiveX and VBA Reference: AAR]

AppendOuterLoop Method

Appends an outer loop to the hatch.

See Also | Example

Signature

object.AppendOuterLoop loop

Object

Hatch
The object or objects this method applies to.

Loop

Object (array of objects); input-only
An array of objects forming a closed boundary. The array can consist of one or more objects. If more than one object is used, their endpoints must coincide for the loop to be created properly. The loop may contain the following types of objects: Line, Polyline, Circle, Ellipse, Spline, Region

Remarks

After the Hatch object has been created using the AddHatch method, add the outer loop. The outer loop must be closed and must be created before any inner loops can be added. After a valid outer loop has been created, add any inner loops, one at a time, using the AppendInnerLoop method.

Once you have finished defining the boundaries for the hatch, use the Evaluate method to calculate the hatch lines or fill for the boundaries, then use the Regen method to update the display of the hatch.


AppendVertex method [ActiveX and VBA Reference: AAR]

AppendVertex Method

Appends a vertex to the end of a 3DPolyline, Polyline, or PolygonMesh object.

See Also | Example

Signature

object.AppendVertex Point

Object

3DPolyline , Polyline, PolygonMesh
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only
The coordinates specifying the vertex to be appended.

PolygonMesh object: An array of 3D WCS coordinates specifying the appended row of vertices.

3DPolyline object: An array of 3D WCS coordinates specifying the vertex to append.

Polyline object: An array of 3D coordinates. The X and Y coordinates are given in OCS, the Z coordinate is ignored.

Remarks

PolygonMesh: When you append a vertex to the end of a PolygonMesh object, you are appending a row of vertices. For example, for a 4 x 3 PolygonMesh you define 12 vertices. Appending a vertex would make the matrix 5 x 3, thereby requiring three additional coordinates. If the 4 x 3 matrix had the following as its last vertex:

  • vertex(3,0): 6,6,6
  • vertex(3,1): 7,7,7
  • vertex(3,2): 8,8,8

You would append:

  • vertex(4,0): 10,10,10
  • vertex(4,1): 10,5,0
  • vertex(4,2): 10,20,30

The OCS coordinates for the Polyline object can be converted to and from other coordinate systems using the TranslateCoordinates method.


ArrayPolar method [ActiveX and VBA Reference: AAR]

ArrayPolar Method

Creates a polar array of objects given a NumberOfObjects, AngleToFill, and CenterPoint.

See Also | Example

Signature

RetVal = object.ArrayPolar (NumberOfObjects, AngleToFill, CenterPoint)

Object

All Drawing Objects
The object or objects this method applies to.

NumberOfObjects

Integer; input-only
The number of objects to be created in the polar array. This must be a positive integer greater than 1.

AngleToFill

Double; input-only
The angle to fill in radians. A positive value specifies counterclockwise rotation. A negative value specifies clockwise rotation. An error is returned for an angle that equals 0.

CenterPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center point for the polar array.

RetVal

Variant Array (array of objects)
The array of new objects.

Remarks

AutoCAD determines the distance from the array's center point to a reference point on the last object selected. The reference point used depends on the type of object previously selected. AutoCAD uses the center point of a circle or arc, the insertion point of a block or shape, the start point of text, and one endpoint of a line or trace.

Note that this method does not support the Rotate While Copying option of the AutoCAD ARRAY command.

Polar array with NumberOfObjects = 5, AngleToFill = 180, CenterPoint = 0,0,0.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.

AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference.


ArrayRectangular method [ActiveX and VBA Reference: AAR]

ArrayRectangular Method

Creates a 2D or 3D rectangular array of objects.

See Also | Example

Signature

RetVal = object.ArrayRectangular (NumberOfRows, NumberOfColumns, NumberOfLevels, DistBetweenRows, DistBetweenColumns, DistBetweenLevels)

Object

All Drawing Objects
The object or objects this method applies to.

NumberOfRows

Integer; input-only
The number of rows in the rectangular array. This must be a positive number. If this number is 1, then NumberOfColumns must be greater than 1.

NumberOfColumns

Integer; input-only
The number of columns in the rectangular array. This must be a positive number. If this number is 1, then NumberOfRows must be greater than 1.

NumberOfLevels

Integer; input-only
The number of levels in a 3D array.

DistBetweenRows

Double; input-only
The distance between the rows. If the distance between rows is a positive number, rows are added upward from the base entity. If the distance is a negative number, rows are added downward.

DistBetweenColumns

Double; input-only
The distance between the columns. If the distance between columns is a positive number, columns are added to the right of the base entity. If the distance is a negative number, columns are added to the left.

DistBetweenLevels

Double; input-only
The distance between the array levels. If the distance between levels is a positive number, levels are added in the positive direction from the base entity. If the distance is a negative number, levels are added in the negative direction.

RetVal

Variant Array (array of objects)
The array of newly created objects.

Remarks

For a 2D array, specify the NumberOfRows, NumberOfColumns, DistBetweenRow, and DistBetweenColumns. For creating a 3D array, specify the NumberOfLevels and DistBetweenLevels as well.

A rectangular array is constructed by replicating the object in the selection set the appropriate number of times. If you define one row, you must specify more than one column and vice versa.

The object in the selection set is assumed to be in the lower left-hand corner, and the array is generated up and to the right. If the distance between rows is a negative number, rows are added downward. If the distance between columns is a negative number, the columns are added to the left.

AutoCAD builds the rectangular array along a baseline defined by the current snap rotation angle. This angle is zero by default, so the rows and columns of a rectangular array are orthogonal with respect to the X and Y drawing axes. You can change this angle and create a rotated array by setting the snap rotation angle to a nonzero value. To do this, use the SnapRotationAngle property.

Rectangular array with NumberOfRows = 4,
NumberOfColumns = 3, DistBetweenRows = a,
DistBetweenColumns = b.
The base entity is represented in blue.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.

AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference.


AttachExternalReference method [ActiveX and VBA Reference: AAR]

AttachExternalReference Method

Attaches an external reference (xref) to the drawing.

See Also | Example

Signature

RetVal = object.AttachExternalReference (PathName, Name, InsertionPoint, XScale, YScale, ZScale, Rotation, bOverlay [, Password])

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PathName

String; input-only
The full path and file name of the drawing to be referenced.

Name

String; input-only
The name for the xref to be created.

InsertionPoint

Variant (three-element array of Doubles); input-only
The 3D WCS coodinates specifying the point at which an ExternalReference instance is inserted into the drawing. The insertion point in the current drawing is aligned with the point defined by the BASE system variable in the referenced file.

XScale

Double; input-only
The X scaling factor for the xref instance.

YScale

Double; input-only
The Y scaling factor for the xref instance.

ZScale

Double; input-only
The Z scaling factor for the xref instance.

Rotation

Double; input-only
The rotation angle for the xref instance. This angle is specified in radians.

bOverlay

Boolean; input-only

TRUE: The xref instance is an overlay.

FALSE: The xref instance is an attachment.

Password

Variant; input-only; optional

RetVal

ExternalReference object
The newly created ExternalReference object.

Remarks

Like Block objects, attached ExternalReference objects can be nested. If another person is editing the drawing to be referenced, the drawing attached is based on the most recently saved version.

If the referenced file is missing or corrupt, its data is not displayed in the current drawing.


AttachToolbarToFlyout method [ActiveX and VBA Reference: AAR]

AttachToolbarToFlyout Method

Attaches a toolbar to a toolbar button defined as a flyout.

See Also | Example

Signature

object.AttachToolbarToFlyout(MenuGroupName, ToolbarName)

Object

ToolbarItem
The object or objects this method applies to.

MenuGroupName

String; input-only
The name of the menu group containing the toolbar you want to attach.

ToolbarName

String; input-only
The name of the toolbar you want to attach.

Remarks

To create a new button as a flyout, use the AddToolBarButton method and set the FlyoutButton parameter to TRUE. Once a button has been created as a flyout button, you can then use the AttachToolbarToFlyout method to attach a flyout toolbar to that button.

To query a toolbar button to see if it is a flyout button, use the Type property. To find the toolbar attached to a flyout toolbar button, use the Flyout property.


AuditInfo method [ActiveX and VBA Reference: AAR]

AuditInfo Method

Evaluates the integrity of the drawing.

See Also | Example

Signature

object.AuditInfo FixError

Object

Document
The object or objects this method applies to.

FixError

Boolean; input-only

TRUE: AutoCAD should attempt to fix any problems it encounters.

FALSE: AutoCAD should not attempt to fix any problems it encounters.

Remarks

For every error detected, AutoCAD provides a description of the error and recommends corrective action.

If you specify FixError = TRUE, AutoCAD will attempt to fix any errors it encounters.


Bind method [ActiveX and VBA Reference: AAR]

Bind Method

Binds an external reference (xref) to a drawing.

See Also | Example

Signature

object.Bind(bPrefixName)

Object

Block
The object or objects this method applies to.

bPrefixName

Boolean; input-only

TRUE: Symbol names are not prefixed.

FALSE: Symbol names are prefixed with <blockname>$x$.

Remarks

Binding an xref to a drawing makes the xref a permanent part of the drawing and no longer an externally referenced file. The externally referenced information becomes a block. When the externally referenced drawing is updated, the bound xref is not updated. This method binds the entire drawing's database, including all of its dependent symbols. Dependent symbols are named objects such as blocks, dimension styles, layers, linetypes, and text styles. Binding the xref allows named objects from the xref to be used in the current drawing.

If the bPrefixName parameter is set to FALSE, the symbol names of the xref drawing are prefixed in the current drawing with <blockname>$x$, where x is an integer that is automatically incremented to avoid overriding existing block definitions. If the bPrefixName parameter is set to TRUE, the symbol names of the xref drawing are merged into the current drawing without the prefix. If duplicate names exist, AutoCAD uses the symbols already defined in the local drawing. If you are unsure whether your drawing contains duplicate symbol names, it is recommended that you set bPrefixName to FALSE.


Block method [ActiveX and VBA Reference: AAR]

Block Method

Returns the block of a SortentsTable object.

See Also | Example

Signature

RetVal = object.Block

object

SortentsTable
The object or objects this method applies to.

RetVal

The Block of the object.


Boolean method [ActiveX and VBA Reference: AAR]

Boolean Method

Performs a Boolean operation (union, intersect, or subtract) between the object and another 3DSolid or Region object.

See Also | Example

Signature

object.Boolean(Operation, Object)

Object

3DSolid, Region
The object or objects this method applies to.

Operation

AcBooleanType enum; input-only

acUnion: Performs a union operation.

acIntersection: Performs an intersection operation.

acSubtraction: Performs a subtraction operation.

Object

Object; input-only
The object the operation is performed against.

Remarks

The first object is modified as a result of the operation.

Solids before Boolean intersection | Resulting solid from Boolean intersection

NOTE If there is no result from the operation, the first object is not changed. For example, when finding the intersection between two non-intersecting objects, there is no change to the first object.


CheckInterference method [ActiveX and VBA Reference: AAR]

CheckInterference Method

Checks for interference between two solids and, if specified, creates a solid from the interference.

See Also | Example

Signature

RetVal = object.CheckInterference(Object, CreateInterferenceSolid)

Object

3DSolid object; input-only
The object to check against.

CreateInterferenceSolid

Boolean; input-only

TRUE: Creates the interference solid.

FALSE: Does not create the interference solid.

RetVal

3DSolid object
The resulting object if CreateInterferenceSolid is set to TRUE.


Clear method [ActiveX and VBA Reference: AAR]

Clear Method

Clears the specified selection set of all items.

See Also | Example

Signature

object.Clear

Object

SelectionSet
The object or objects this method applies to.

Remarks

Items cleared from a selection set remain in the drawing; they are simply no longer associated to the selection set.

To clear a subset of the items in a selection set, use the RemoveItems method.

This method differs from the Delete method in that it does not remove objects from the drawing.


ClearSubSelection method [ActiveX and VBA Reference: AAR]

ClearSubSelection Method

Removes a subselection set of cells from a table.

See Also | Example

Signature

object.ClearSubSelection

Object

Table
The object or objects this method applies to.


ClearTableStyleOverrides method [ActiveX and VBA Reference: AAR]

ClearTableStyleOverrides Method

Clears table style overrides.

See Also | Example

Signature

object.ClearTableStyleOverrides(flag)

Object

Table
The object or objects this method applies to.

flag

Long; one of three integer values

0 | Deletes all table and cell overrides.
1 | Deletes all table overrides, but retains cell overrides.
2 | Deletes all cell overrides, but retains table overrides.


ClipBoundary method [ActiveX and VBA Reference: AAR]

ClipBoundary Method

Specifies the clipping boundary for a raster image or an underlay.

See Also | Example

Signature

object.ClipBoundary PointsArray

Object

Raster, DwfUnderlay
The object or objects this method applies to.

PointsArray

Variant (array of two-element array of doubles); input-only
An array of 2D WCS coordinates specifying the clipping boundary of a raster image or underlay.

Remarks

You can define a region of an image or underlay object for display and plotting by clipping the object. Multiple instances of the same object can have different boundaries.

The clipping boundary must be a closed 2D polygon or rectangle with vertices constrained to lie within the boundaries of the image or underlay.

To clip an image or underlay, the object's boundary must be visible. Use the ClippingEnabled property to turn the clipping boundary on or off.


Close method [ActiveX and VBA Reference: AAR]

Close Method

Closes the specified drawing, or all open drawings.

See Also | Example

Signature

object.Close([SaveChanges][, FileName])

Object

Document; Documents
The document to close.

SaveChanges

Variant; input-only; optional
(Not applicable when called from Documents collection.)
Specifies if the drawing is to be saved or not.

TRUE: Save the drawing.

FALSE: Do not save the drawing.

FileName

String; input-only; optional
(Not applicable when called from Documents collection.)
The name to assign to the drawing. If no name is provided when saving a drawing for the first time, the drawing will be saved using the VBA project information: ThisDrawing.Path\ThisDrawing.Name.

Remarks

If there are no changes to the drawing, SaveChanges and FileName are ignored. If there are changes to the drawing, SaveChanges specifies whether changes should be saved. The default value for the SaveChanges parameter is TRUE.

  • If SaveChanges is TRUE and there is not yet a file name associated with a drawing, then the FileName argument is used. If FileName is omitted, or if calling this method from the Documents collection, an error will be issued.
  • If SaveChanges is FALSE, then the drawing is closed and the changes are not saved.

Calling this method from the Documents collection in MDI mode will close all open drawings. To close a single drawing, call this method from the drawing to be closed.

You cannot close a drawing from inside an event handler for that drawing.

NOTE Closing a drawing destroys the Document object. Never try to reference an object once it has been destroyed, or in this case, closed. In-process clients (VBA macros) may notice that objects are not destroyed until the subroutine is exited. However, references to destroyed objects are not recommended at all, even in the in-process code.


ConvertToAnonymousBlock method [ActiveX and VBA Reference: AAR]

ConvertToAnonymousBlock Method

Converts a dynamic block to a regular anonymous block.

Signature

object.ConvertToAnonymousBlock

object

BlockRef, MInsertBlock
The object or objects this method applies to.

Remarks

Note To access this method, use the IAcadBlockReference2 or IAcadMInsertBlock2 interface.


ConvertToStaticBlock method [ActiveX and VBA Reference: AAR]

ConvertToStaticBlock Method

Converts a dynamic block to a regular named block.

Signature

object.ConvertToStaticBlock(newBlockName)

object

BlockRef, MInsertBlock
The object or objects this method applies to.

newBlockName

String; input-only
The name for the block.

Remarks

Note To access this method, use the IAcadBlockReference2 or IAcadMInsertBlock2 interface.


Copy method [ActiveX and VBA Reference: AAR]

Copy Method

Duplicates the given object to the same location.

See Also | Example

Signature

RetVal = object.Copy

Object

All Drawing Objects

RetVal

Object
The newly created duplicate object.

Remarks

AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.


CopyFrom Method [ActiveX and VBA Reference: AAR]

CopyFrom Method

Copies the settings for a dimension style, layout, or plot configuration.

See Also | Example

Signature

object.CopyFrom SourceObject

Object

DimStyle, Layout, PlotConfiguration object
The object or objects this property applies to.

SourceObject

The source object to be copied; input only

Layout and PlotConfiguration objects: The source object must be a PlotConfiguration object.

DimStyle objects: The source object must be either a DimStyle, Document, Dim3PointAngular, DimAngular, DimDiametric, DimOrdinate, DimRadial, DimRotated, Tolerance, or Leader.

Remarks

DimStyle: This method allows users to copy dimension style data into an existing dimstyle from three different types of sources.

1. If SourceObject is a dimension (this includes all dimension objects), Tolerance, or Leader object, this method copies the style for that object plus any object overrides.

2. If SourceObject is a DimStyle object, this method copies the style data from that dimension style.

3. If SourceObject is a Document object, this method copies the active dimension style settings for the drawing plus any drawing overrides.


CopyObjects Method [ActiveX and VBA Reference: AAR]

CopyObjects Method

Duplicates multiple objects (deep cloning).

See Also | Example

Signature

RetVal = object.CopyObjects(Objects[, Owner][, IDPairs])

Object

Database, Document
The object or objects this method applies to.

Objects

Variant (array of objects); input-only
The array of primary objects to be copied. All the objects must have the same owner, and the owner must belong to the database or document that is calling this method.

Owner

Variant (a single object); input-only; optional
The new owner for the copied objects. If no owner is specified, the objects will be created with the same owner as the objects in the Objects array.

IDPairs

Variant (array of IDPair objects); input-output; optional
Information on what happened during the copy and translation process.
Input: an empty variant.
Output: an array of IDPair objects.

RetVal

Variant (array of objects)
An array of newly created duplicate objects. Only primary objects are returned in this array. For more information on what occured during the CopyObjects operation, or a list of objects owned by primary objects that were also copied, consult the IDPairs array.

Remarks

To copy objects to another open drawing, set the Owner parameter to the other drawing's model space.

During the CopyObjects operation, objects that are owned or referenced by the primary objects in the Objects parameter will also be copied.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.


CopyProfile Method [ActiveX and VBA Reference: AAR]

CopyProfile Method

Copies the specified profile.

See Also | Example

Signature

object.CopyProfile oldProfileName, newProfileName

Object

PreferencesProfiles
The object or objects this method applies to.

oldProfileName

String; input-only
The name of the profile to copy.

newProfileName

String; input-only
The name of the new profile to be created.


CreateCellStyle method [ActiveX and VBA Reference: AAR]

CreateCellStyle Method

Creates a cell style with the given name.

See Also | Example

Signature

object.CreateCellStyle(StringCellStyle)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
New cell style name.


CreateCellStyleFromStyle method [ActiveX and VBA Reference: AAR]

CreateCellStyleFromStyle Method

Creates a cell style from a given name.

See Also | Example

Signature

object.CreateCellStyleFromStyle(StringCellStyle, StringSourceCellStyle)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
New cell style name.

StringSourceCellStyle

String; Input
Source cell style name.


CreateContent method [ActiveX and VBA Reference: AAR]

CreateContent Method

Creates new content in a cell.

See Also | Example

Signature

RetVal = object.CreateContent nRow, nCol, nIndex

Object

Table
The object this method applies to.

nRow

Long; Input-only
The row number of the cell to check.

nCol

Long; Input-only
The column number of the cell to check.

nIndex

Long; Input-only
Index at which to create the new context.

RetVal

Long
An ID for the created content.


CreateEntry method [ActiveX and VBA Reference: AAR]

CreateEntry Method

Creates a new entry in the File Dependency List.

See Also | Example

Signature

object.CreateEntry (Feature, FullFileName, AffectsGraphics, noIncrement)

object

FileDependencies
The object or objects this method applies to.

Feature

String; input-only
Description of the application or feature creating the entry.

FullFileName

String; input-only
Name of the file to be stored in the File Dependency List (must be an existing file).

AffectsGraphics

Boolean; input-only
True means that the entry affects the on-screen view of the drawing file, specifically the graphics cache; false means it does not affect the on-screen view.

noIncrement

Boolean; input-only
True does not increment the reference count on existing entries; false increments the reference count when an existing entry is added.

Remarks

This method takes a string indicating a feature description. The string is stored with the File Dependency List (FDL) entry and identifies the application or feature that created this entry, such as Acad::xref. No unique-application-name checking is done on the feature string. This method also takes a parameter to indicate the name of the file stored in the FDL, and the stored path, if any, can be included. If no path is included, AutoCAD searches for the file in the current directory and the AutoCAD support file search path, and the found is stored with the entry. If the file cannot be found or if it cannot be opened, no entry is created and 0 is returned. If the file is found, its time/date and file size are stored with the entry, and a unique index is assigned to the entry and is returned.

You can use this method to recreate a set of entries by setting noIncrement to True. This prevents the increment of the reference count when an entry already is in the FDL. If noIncrement is set to False, then the same entry can be added multiple times. In this case, the reference count is incremented for the entry to record the number of times the entry is referenced in the FDL. Duplicate records are never created.


CreateJog method [ActiveX and VBA Reference: AAR]

CreateJog method

Creates a jog on the section plane.

See Also | Example

Signature

object.CreateJog varPt

object

Section
The object or objects to which this method applies.

varPt

Variant; input-only
Point at which to create the jog.


CreateTypedArray Method [ActiveX and VBA Reference: AAR]

CreateTypedArray Method

Creates a variant that contains an array of typed arguments.

See Also | Example

Signature

CreateTypedArray(VarArr, Type, Value1, [value2, value3, ...valueN])

Object

Utility
The object or objects this method applies to.

VarArr

Variant; output-only
The array of values as a variant.

Type

Visual Basic 6 Constant; input-only
The type of values you are supplying.
vbBoolean, vbInteger, vbLong, vbSingle, or vbDouble.

Value1 [Value2, ...ValueN.]

Of the type specified in the Type parameter above; input-only
The value(s) to be included in the variant.

Remarks

The resulting variant can be passed into any AutoCAD method or property that accepts an array of numbers as a variant.

This method can only be accessed using late-binding programming techniques. To use this method, define the utility object as Object (Dim myObj As Object), not as AcadUtility.


Delete method [ActiveX and VBA Reference: AAR]

Delete Method

Deletes a specified object or a set of saved layer settings.

See Also | Example

Signature

object.Delete

Object

All Drawing Objects, Block, Dictionary, DimStyle, Group, Hyperlink, Layer, LayerStateManager, Layout, Linetype, PlotConfiguration, PopupMenuItem, PViewport, RegisteredApplication, SelectionSet, TextStyle, Toolbar, ToolbarItem, UCS, View, Viewport, XRecord
The object or objects this method applies to.

Remarks

When you delete an object in a collection, all remaining items in the collection are reassigned a new index based on the current count. You should therefore avoid loops that delete an object while iterating through the collection. For example, the following VBA code will result in a runtime error:

For i = 0 To ThisDrawing.Groups.Count - 1
    ThisDrawing.Groups.Item(i).Delete
Next I

Instead, use the following VBA code to delete all members in a collection:

for each obj in ThisDrawing.Groups
    obj.Delete
next obj

You can also use the following VBA code to delete a single member of a collection:

ThisDrawing.Groups.item("group1").Delete

An error will result if you attempt to delete a collection object.

ToolbarItem: You can only add or remove toolbar items when the toolbar is visible.

AcadLayerStateManager: This object takes an argument, Name, which is a string representing the layer state to be deleted.


DeleteCellContent method [ActiveX and VBA Reference: AAR]

DeleteCellContent Method

Deletes the cell content in the specified row and column.

See Also | Example

Signature

object.DeleteCellContent(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell


DeleteCellStyle method [ActiveX and VBA Reference: AAR]

DeleteCellStyle Method

Deletes a cell style.

See Also | Example

Signature

object.DeleteCellStyle(StringCellStyle)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.


DeleteColumns method [ActiveX and VBA Reference: AAR]

DeleteColumns Method

Deletes columns from a table.

See Also | Example

Signature

object.DeleteColumns(col, cols)

Object

Table
The object or objects this method applies to.

col

Long; the column index

cols

Long; the number of columns to delete from the table


DeleteConfiguration method [ActiveX and VBA Reference: AAR]

DeleteConfiguration Method

Deletes a viewport configuration.

See Also | Example

Signature

object.DeleteConfiguration Name

Object

Viewports
The object or objects this method applies to.

Name

String
The name of the viewport configuration to delete.

Remarks

A viewport configuration consists of a single viewport that has been split using the Split method. Once a viewport has been split, the resulting viewports are considered a viewport configuration. All the viewports in the configuration have the same name as the original viewport before the split.


DeleteContent method [ActiveX and VBA Reference: AAR]

DeleteContent Method

Deletes content of a cell.

See Also | Example

Signature

object.DeleteContent nRow, nCol

Object

Table
The object this method applies to.

nRow

Long; Input-only
The row number of the cell to delete.

nCol

Long; Input-only
The column number of the cell to delete.


DeleteFitPoint method [ActiveX and VBA Reference: AAR]

DeleteFitPoint Method

Deletes the fit point of a spline at a given index.

See Also | Example

Signature

object.DeleteFitPoint Index

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
An index position in the fit point list. Positive integers between 0 and N-1, where N is the total number of fit points for the spline.

Remarks

AutoCAD removes the fit point and refits the spline through the remaining points. There must be at least three fit points in the spline for this method to succeed. To view the changes, use the Update or Regen method.


DeleteProfile Method [ActiveX and VBA Reference: AAR]

DeleteProfile Method

Deletes the specified profile.

See Also | Example

Signature

object.DeleteProfile ProfileName

Object

PreferencesProfiles
The object or objects this method applies to.

ProfileName

String
The name of the profile to delete.


DeleteRows method [ActiveX and VBA Reference: AAR]

DeleteRows Method

Deletes rows from a table.

See Also | Example

Signature

object.DeleteRows(row, Rows)

Object

Table
The object or objects this method applies to.

row

Long; the row index

Rows

Long; the number of rows to delete from the table


Detach method [ActiveX and VBA Reference: AAR]

Detach Method

Detaches an external reference (xref) from a drawing.

See Also | Example

Signature

object.Detach()

Object

Block
The object or objects this method applies to.

Remarks

Detaching an xref removes the xref from the current drawing. All copies of the xref are erased, and the xref definition is deleted. All xref-dependent symbol table information (such as layers and linetypes) is deleted from the current drawing.

You cannot detach an xref that contains other xrefs.


Display method [ActiveX and VBA Reference: AAR]

Display Method

Toggles the display control of the PViewport object on or off.

See Also | Example

Signature

object.Display Status

Object

PViewport
The object or objects this method applies to.

Status

Boolean; input-only

TRUE: Viewport display is on.

FALSE: Viewport display is off.

Remarks

The display control must be on before the MSpace property can be used to activate the model space editing capabilities.

Use the ViewportOn property to determine if a paper space viewport display has already been turned on with this method.


DisplayPlotPreview method [ActiveX and VBA Reference: AAR]

DisplayPlotPreview Method

Displays the Plot Preview dialog box with the full view preview.

See Also | Example

Signature

object.DisplayPlotPreview Preview

Object

Plot
The object or objects this method applies to.

Preview

AcPreviewMode enum; input-only

acFullPreview

Remarks

The preview is invoked on the active layout.

Full preview displays the drawing on the screen as it will appear when plotted on paper. This requires a regeneration of the drawing. It is faster than the normal plot regeneration because AutoCAD performs no vector sorting or optimization.

The NumberOfCopies property and SetLayoutsToPlot method settings are ignored during the call to this method.

This method is not available while in batchmode and will return E_FAIL if called in batchmode.

The associated drawing is made active when this method is called. This drawing will remain active after completion of the DisplayPlotPreview method.

This method puts the associated drawing into a special display mode that can only be exited by user interaction. Thus, upon successful return from the DisplayPlotPreview method, the associated drawing will be active, and will be left in plot preview display mode.


DistanceToReal method [ActiveX and VBA Reference: AAR]

DistanceToReal Method

Converts a distance from a string to a real (double) value.

See Also | Example

Signature

RetVal = DistanceToReal(Distance, Unit)

Object

Utility
The object or objects this method applies to.

Distance

String; input-only
The distance as a string value.

Unit

AcUnits enum; input-only
The unit to which the string is to be converted.

acDefaultUnits

acScientific

acDecimal

acEngineering

acArchitectural

acFractional

RetVal

Double
The distance as a real number.


Dock method [ActiveX and VBA Reference: AAR]

Dock Method

Docks the toolbar to the owning frame window.

See Also | Example

Signature

object.Dock Side

Object

Toolbar
The object or objects this method applies to.

Side

AcToolbarDockStatus enum; input-only
The side of the toolbar to dock.

acToolbarDockTop

acToolbarDockBottom

acToolbarDockLeft

acToolbarDockRight


ElevateOrder method [ActiveX and VBA Reference: AAR]

ElevateOrder Method

Elevates the order of the spline to the given order.

See Also | Example

Signature

object.ElevateOrder Order

Object

Spline

Order

Integer; input-only
A positive value greater than the current order. The maximum order is 26.

Remarks

The order of a spline is equal to the degree of the spline plus one (+1). You can query the degree of the spline by using the Degree property.

Entering a value greater than the current value increases the number of control points uniformly across the spline for more localized control. Once a spline order has been elevated, it cannot be reduced.

When a spline is elevated, it is converted from an interpolated (fit) spline to a control point spline. This means that after elevation, the spline no longer has fit tangents and the StartTangent and EndTangent properties for the spline are no longer accessible. The only way to edit a control point spline is through the ControlPoints property, or the SetControlPoint or GetControlPoint methods.


EnableMergeAll method [ActiveX and VBA Reference: AAR]

EnableMergeAll Method

Controls cell merging.

See Also | Example

Signature

object.EnableMergeAll nRow, nCol, bEnable

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

bEnable

Boolean; Input-only
The flag for cell merging.


EndUndoMark method [ActiveX and VBA Reference: AAR]

EndUndoMark Method

Marks the end of a block of operations.

See Also | Example

Signature

object.EndUndoMark

Object

Document
The object or objects this method applies to.

Remarks

This method allows AutoCAD to close the environment so operations from StartUndoMark to EndUndoMark can be treated as a group of operations.


Erase method [ActiveX and VBA Reference: AAR]

Erase Method

Erases all the objects in a selection set.

See Also | Example

Signature

object.Erase

Object

SelectionSet
The object or objects this method applies to.


Eval method [ActiveX and VBA Reference: AAR]

Eval Method

Evaluates an expression in VBA.

See Also | Example

Signature

object.Eval(Expression)

Object

Application
The object or objects this method applies to.

Expression

String; input-only
The expression to be evaluated.

Remarks

This method allows Automation clients to execute a line of VBA code in the context of the current project without creating modules and functions.


Evaluate method [ActiveX and VBA Reference: AAR]

Evaluate Method

Evaluates the given hatch or leader.

See Also | Example

Signature

object.Evaluate

Object

Hatch, Leader
The object or objects this method applies to.

Remarks

Leader: Evaluates the relation of the leader to its associated annotation, and updates the leader geometry if necessary.

Hatch: Evaluates the hatch lines or solid fill for the Hatch object using the specified hatch pattern. For regular hatch patterns, this method performs intersection calculations between pattern definition lines and hatch boundary curves to form hatch lines. For solid fill hatch patterns, this method performs triangulation of the hatch area and fills in the triangular meshes with the given color.


Explode method [ActiveX and VBA Reference: AAR]

Explode Method

Explodes the compound object into subentities.

See Also | Example

Signature

RetVal = object.Explode

Object

3DPolyline , BlockRef, ExternalReference, LightweightPolyline, MInsertBlock, Polygonmesh, Polyline, Region
The object or objects this method applies to.

RetVal

Variant (array of objects)
The array of exploded objects.

Remarks

Depending on the type of compound object you're exploding, different results occur. Refer to the EXPLODE command topic in the AutoCAD Command Reference for a detailed list of explodable objects and their results.

You do not have to explode a block in order to manipulate its constituent entities. All block definitions have an Item method that allow you to manipulate the entities within the block without exploding the block definition itself.


Export method [ActiveX and VBA Reference: AAR]

Export Method

Exports an AutoCAD drawing or a group of saved layer settings to a file.

See Also | Example

Signatures: Overview

Drawings

object.Export FileName, Extension, SelectionSet

Layer Settings

object.Export Name, FileName

Signatures: Detail

object.Export FileName, Extension, SelectionSet

Object

Document
The object or objects this method applies to.

FileName

String; input-only
The name for the newly exported file.

Extension

String; input-only
This string should contain three characters specifying the type of file to export the drawing into. Case is not important. Use one of the following extensions: .wmf, .sat, .eps, .dsf, or .bmp.

SelectionSet

SelectionSet object; input-only
For WMF, SAT, and BMP formats, the selection set specifies the objects to be exported. For EPS and DXF formats, the selection set is ignored and the entire drawing is exported.

object.Export Name, FileName

Object

LayerStateManager
A LayerStateManager object.

Name

String; input-only
The name of the saved layer settings you are exporting.

FileName

String; input-only
The name of the file you are exporting layer settings to.

Remarks

When exporting to WMF or BMP formats, a nonempty selection set must be provided. This selection set specifies the objects from the drawing to export. If an empty selection set is provided, AutoCAD will prompt the user to select the objects to export.

When exporting to SAT format, a nonempty selection set must be provided. This selection set specifies the objects from the drawing to export. Only Region objects, 3DSolid objects, non-manifold solids, and other ShapeManager entities that do not fit the characteristics of the 3DSolid or Region objects will be exported; all other objects in the selection set will be ignored. If an empty selection set is provided, AutoCAD will not prompt the user to select the objects to export.

When exporting to EPS and DXF formats, the selection set is ignored and the entire drawing is exported.

When exporting saved layer settings, you must name your output file with a .las extension in order for AutoCAD to automatically identify it as a saved layer settings export file.


ExportProfile method [ActiveX and VBA Reference: AAR]

ExportProfile Method

Exports the active profile so it can be shared with other users.

See Also | Example

Signature

object.ExportProfile Profile, RegFile

Object

PreferencesProfiles
The object or objects this method applies to.

Profile

String; input-only
The name of the profile to be exported.

RegFile

String; input-only
The name of the file the profile will be exported to. The extension of the file should be .arg.


FieldCode method [ActiveX and VBA Reference: AAR]

FieldCode Method

Returns a text string containing field codes.

See Also | Example

Signature

RetVal = object.FieldCode

object

Text, MText
The object or objects this method applies to.

RetVal

String; the field codes of the object.


Float method [ActiveX and VBA Reference: AAR]

Float Method

Floats the toolbar.

See Also | Example

Signature

object.Float Top, Left, NumberFloatRows

Object

Toolbar
The object or objects this method applies to.

Top

Integer; input-only
The pixel location for the top edge of the toolbar.

Left

Integer; input-only
The pixel location for the left edge of the toolbar.

NumberFloatRows

Integer; input-only
The number of rows to create in the horizontal toolbar. The buttons on the toolbar will be distributed automatically across the number of rows designated.


FormatValue method [ActiveX and VBA Reference: AAR]

FormatValue Method

Gets the formatted text string for the specified row and column.

See Also | Example

Signature

RetVal = object.FormatValue row, col, nOption, pVal

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell.

col

Integer; Input-only
The column number of the cell.

nOption

AcFormatOption; Input-only
The formatting option flag.

RetVal

String
The formatted text in the table.


GenerateLayout method [ActiveX and VBA Reference: AAR]

GenerateLayout Method

Generates the layout of a table.

See Also | Example

Signature

object.GenerateLayout()

Object

Table
The object or objects this method applies to.

Remarks

This method updates the Table object according to the current table style. This method computes the table geometry, including gridlines, text content, block content, and background fills.


GenerateSectionGeometry method [ActiveX and VBA Reference: AAR]

GenerateSectionGeometry method

Generates 2D or 3D section geometry.

See Also | Example

Signature

object.GenerateSectionGeometry pEntity, pIntersectionBoundaryObjs, pIntersectionFillObjs, pBackgroudnObjs, pForegroudObjs, pCurveTangencyObjs

object

Section
The object or objects to which this method applies.

pEntity

IAcadEntity; input-only
The sectionable entity.

pIntersectionBoundaryObjs

Variant; output-only
Intersection boundary objects.

pIntersectionFillObjs

Variant; output-only
Objects representing intersection fill annotation geometry.

pBackgroundObjs

Variant; output-only
Background geometry objects.

pForegroundObjs

Variant; output-only
Foreground geometry objects.

pCurveTangencyObjs

Variant; output-only
Curve tangency geometry objects.


GenerateUsageData method [ActiveX and VBA Reference: AAR]

GenerateUsageData Method

Generates data specifying whether a layer is in use.

See Also | Example

Signature

object.GenerateUsageData

object

Layers
The object or objects this method applies to.


GetAcadState method [ActiveX and VBA Reference: AAR]

GetAcadState Method

Gets an AcadState object to monitor the state of AutoCAD from out-of-process applications.

See Also | Example

Signature

RetVal = object.GetAcadState()

Object

Application
The object or objects this method applies to.

RetVal

AcadState
An object containing an IsQuiescent property used to monitor the state of AutoCAD.

Remarks

It is recommended that you call this method immediately after acquiring the AutoCAD appplication object. This is the best opportunity to identify AutoCAD in a quiescent state.


GetAlignment method [ActiveX and VBA Reference: AAR]

GetAlignment Method

Returns the cell alignment for a row type.

See Also | Example

Signature

RetVal = object.GetAlignment(rowType)

Object

Table, TableStyle
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

AcCellAlignment enum; the alignment used for the row types

acBottomCenter | Centers text at a point based on the bottom of the text.
acBottomLeft | Left-justifies text at a point based on the bottom of the text.
acBottomRight | Right-justifies text at a point based on the bottom of the text.
acMiddleCenter | Centers text at a point based on the middle of the text.
acMiddleLeft | Left-justifies text at a point based on the middle of the text.
acMiddleRight | Right-justifies text at a point based on the middle of the text.
acTopCenter | Centers text at a point based on the top of the text.
acTopLeft | Left-justifies text at a point based on the top of the text.
acTopRight | Right-justifies text at a point based on the top of the text.


GetAlignment2 method [ActiveX and VBA Reference: AAR]

GetAlignment2 Method

Gets the cell alignment.

See Also | Example

Signature

RetVal = object.GetAlignment2 bstrCellStyle

Object

Table, TableStyle
The objects this method applies to.

bstrCellStyle

String; Input-only
The cell style to check.

RetVal

AcCellAlignment
The cell alignment.


GetAllProfileNames method [ActiveX and VBA Reference: AAR]

GetAllProfileNames Method

Gets all available profiles for the system.

See Also | Example

Signature

object.GetAllProfileNames(pNames)

Object

PreferencesProfiles
The object or objects this method applies to.

pNames

Variant (array of strings)
The array of available profile names for the system.


GetAngle method [ActiveX and VBA Reference: AAR]

GetAngle Method

Gets the angle specified. Considers the setting of the ANGBASE system variable.

See Also | Example

Signature

RetVal = GetAngle([Point][, Prompt])

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying the first point.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Double
The angle specified.

Remarks

AutoCAD pauses for user input of an angle and sets the return value to the value of the selected angle. The Point parameter specifies an angle base point in the two-dimensional WCS. The Prompt parameter specifies a string that AutoCAD displays before it pauses. Both Point and Prompt are optional.

The AutoCAD user can specify the angle by entering a number in the current angular units format. The user can set the angle also by specifying two 2D locations on the graphics screen. AutoCAD draws a rubber-band line from the first point to the current crosshair position to help the user visualize the angle. If the Point parameter is provided, AutoCAD uses this value as the first of the two points. The angle is measured in the XY plane of the WCS (GetAngle ignores the Z field of Point).

Regardless of the method used to specify the angle, GetAngle always sets the return value to a value expressed in radians. The direction of angular increase is always counterclockwise.

This function is almost identical to GetOrientation, but it takes into account the current value of the ANGBASE system variable. For GetOrientation, the zero angle is always to the right: "east" or "three o'clock." For GetAngle, the zero angle is the value of ANGBASE, which can be set to any of the four 90-degree quadrants. Both GetAngle and GetOrientation return a (real) angle value in radians measured counterclockwise from a base (zero) angle. For GetAngle, the base equals ANGBASE; for GetOrientation, the base is at the right. Both functions honor the current value of ANGDIR, which affects the value the user enters but not the value that these functions return.
User input (degrees) | GetAngle returns | GetOrientation returns
0 | 0.0 | 1.5708
-90 | 1.5708 | 3.14159
180 | 3.14159 | 4.71239
90 | 4.71239 | 0.0

You can use GetAngle to obtain a rotation amount for a block insertion, because an input of 0 degrees always returns 0 radians. You can use GetOrientation to obtain the baseline angle for a text entity to be aligned with other objects.

If a keyword is returned instead of an angle, AutoCAD will generate the error message "User input keyword." Use the GetInput method to obtain the keyword from the return value.


GetAttachmentPoint method [ActiveX and VBA Reference: AAR]

GetAttachmentPoint Method

Returns the attachment point for the specified row and column.

See Also | Example

Signature

object.GetAttachmentPoint(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column


GetAttributes method [ActiveX and VBA Reference: AAR]

GetAttributes Method

Gets the attributes in the block reference.

See Also | Example

Signature

RetVal = object.GetAttributes()

Object

BlockRef, ExternalReference, MInsertBlock
The object or objects this method applies to.

RetVal

Variant (array of AttributeReference objects)
The array of AttributeReference objects.

Remarks

This method returns an array of editable attribute references attached to the block reference.

You can only return the constant attributes for an external reference. To find the constant attributes of an external reference or block reference, use the GetConstantAttributes method.


GetAutoScale method [ActiveX and VBA Reference: AAR]

GetAutoScale Method

Returns the value specifying whether auto scale is used in the specified row and column.

See Also | Example

Signature

RetVal = object.GetAutoScale(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

RetVal

Boolean


GetAutoScale2 method [ActiveX and VBA Reference: AAR]

GetAutoScale2 Method

Gets the auto-scale flag value for a cell.

See Also | Example

Signature

RetVal = object.GetAutoScale2 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

Boolean; Output-only
The flag value.


GetBackgroundColor method [ActiveX and VBA Reference: AAR]

GetBackgroundColor Method

Returns the background color value for the specified row type.

See Also | Example

Signature

RetVal = object.GetBackgroundColor(rowType)

Object

Table, TableStyle
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

AcCmColor object
AutoCAD true color object.


GetBackgroundColorNone method [ActiveX and VBA Reference: AAR]

GetBackgroundColorNone Method

Returns the value specifying that there is no background color for the specified row type.

See Also | Example

Signature

RetVal = object.GetBackgroundColorNone(rowType)

Object

Table, TableStyle
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

Boolean; the value specifying no background color for the row type.


GetBitmaps method [ActiveX and VBA Reference: AAR]

GetBitmaps Method

Gets the large and small bitmaps used as icons for the toolbar item.

See Also | Example

Signature

object.GetBitmaps(SmallIconName, LargeIconName)

object

ToolbarItem
The object or objects this method applies to.

SmallIconName

String; output-only
The path and file name for the small bitmap.

LargeIconName

String; output-only
The path and file name for the large bitmap.


GetBlockAttributeValue method [ActiveX and VBA Reference: AAR]

GetBlockAttributeValue Method

Gets the attribute value in block content with attribute definition id.

See Also | Example

Signature

RetVal = object.GetBlockAttributeValue attdefId

Object

MLeader
The object or objects this method applies to.

attdefID

Long; Input-only
The attribute definition ID.

value

String
The attribute value.


GetBlockAttributeValue method [ActiveX and VBA Reference: AAR]

GetBlockAttributeValue Method

Returns the attribute value of the specified cell for the attribute definition object contained in the block.

See Also | Example

Signature

RetVal = object.GetBlockAttributeValue(row, col, attdefId)

Object

Table
The object or objects this method applies to.

row

Integer; the row

col

Integer; the column

attdefId

Long_PTR; the object ID

RetVal

String


GetBlockAttributeValue2 method [ActiveX and VBA Reference: AAR]

GetBlockAttributeValue2 Method

Gets the attribute value associated to a specifed block cell.

See Also | Example

Signature

RetVal = object.GetBlockAttributeValue2 nRow, nCol, nContent, blkId, value

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

blkId

Long_PTR; Input-only
The block table record object id to check.

RetVal

String
The returned block attribute value.


GetBlockAttributeValue32 method [ActiveX and VBA Reference: AAR]

GetBlockAttributeValue32 Method

For a 64-Bit system, gets a block cell's attribute value.

See Also | Example

Signature

RetVal = object.GetBlockAttributeValue32 nRow, nCol, nContent, blkId, value

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

blkId

Long; Input-only
The value of the block table record.

RetVal

String
The attribute value.


GetBlockAttributeValue32 method [ActiveX and VBA Reference: AAR]

GetBlockAttributeValue32 Method

For a 64-Bit system, gets the attribute value in block content with attribute definition id.

See Also | Example

Signature

RetVal = object.GetBlockAttributeValue32 attdefId

Object

MLeader
The object this method applies to.

attdefId

Long; Input-only
The index of the column.

RetVal

String
The attribute value.


GetBlockRotation method [ActiveX and VBA Reference: AAR]

GetBlockRotation Method

Returns the block rotation angle for the specified row and column.

See Also | Example

Signature

RetVal = object.GetBlockRotation(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

Double


GetBlockScale method [ActiveX and VBA Reference: AAR]

GetBlockScale Method

Returns the block scale value for the specified row and column.

See Also | Example

Signature

RetVal = object.GetBlockScale(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

RetVal

Double


GetBlockTableRecordId method [ActiveX and VBA Reference: AAR]

GetBlockTableRecordId Method

Returns the block table record ID of the cell.

See Also | Example

Signature

RetVal = object.GetBlockTableRecordId(row, col)

Object

Table
The object or objects this method applies to.

row

Integer; the row

col

Integer; the column

RetVal

Long_PTR


GetBlockTableRecordId2 method [ActiveX and VBA Reference: AAR]

GetBlockTableRecordId2 Method

Gets the block table record object id associated to a specifed cell.

See Also | Example

Signature

object.GetBlockTableRecordId2 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

RetVal

Long_PTR; Output-only
The pointer to hold the block table record object id.


GetBlockTableRecordId32 method [ActiveX and VBA Reference: AAR]

GetBlockTableRecordId32 Method

For a 64-Bit system, gets a cell's block table record id.

See Also | Example

Signature

RetVal = object.GetBlockTableRecordId32 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

RetVal

Long; Output-only
The block table record.


GetBoundingBox method [ActiveX and VBA Reference: AAR]

GetBoundingBox Method

Gets two points of a box enclosing the specified object.

See Also | Example

Signature

object.GetBoundingBox MinPoint, MaxPoint

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

MinPoint

Variant (three-element array of doubles); output-only
The 3D WCS coordinates specifying the minimum point of the object's bounding box.

MaxPoint

Variant (three-element array of doubles); output-only
The 3D WCS coordinates specifying the maximum point of the object's bounding box.

Remarks

The corners are returned in WCS coordinates with the box edges parallel to the WCS X, Y, and Z axes.

 | MaxPoint
MinPoint |


GetBreakHeight method [ActiveX and VBA Reference: AAR]

GetBreakHeight Method

Get a table's break height.

See Also | Example

Signature

RetVal = object.GetBreakHeight nIndex, pHeight

Object

Table
The object this method applies to.

nIndex

Integer; Input-only
The index of the table.

RetVal

Double
The height value.


GetBulge method [ActiveX and VBA Reference: AAR]

GetBulge Method

Gets the bulge value at a given index of the polyline.

See Also | Example

Signature

RetVal = object.GetBulge(Index)

Object

LightweightPolyline, Polyline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the vertex you wish to query. The index must be a positive integer beginning with zero.

RetVal

Double
The bulge value for the vertex at the given index.

Remarks

Polyline: this method will fail if the polyline Type property is not acSimplePoly.

The bulge is the tangent of 1/4 of the included angle for the arc between the selected vertex and the next vertex in the polyline's vertex list. A negative bulge value indicates that the arc goes clockwise from the selected vertex to the next vertex. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.


GetCanonicalMediaNames method [ActiveX and VBA Reference: AAR]

GetCanonicalMediaNames Method

Gets all available canonical media names for the specified plot device.

See Also | Example

Signature

RetVal = object.GetCanonicalMediaNames()

Object

Layout, PlotConfiguration
The object or objects this method applies to.

RetVal

Variant (array of strings)
The array of available media names for the specified plot device.

Remarks

You should call RefreshPlotDeviceInfo before the first time you use this method. Once you have called RefreshPlotDeviceInfo, you don't need to call it again unless your plot device information changes during the session.


GetCellAlignment method [ActiveX and VBA Reference: AAR]

GetCellAlignment Method

Returns the alignment for the cell in the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellAlignment(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

AcCellAlignment enum

acBottomCenter

acBottomLeft

acBottomRight

acMiddleCenter

acMiddleLeft

acMiddleRight

acTopCenter

acTopLeft

acTopRight


GetCellBackgroundColor method [ActiveX and VBA Reference: AAR]

GetCellBackgroundColor Method

Returns the background true color value of a cell in the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellBackgroundColor(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

AcCmColor object
AutoCAD true color object.


GetCellBackgroundColorNone method [ActiveX and VBA Reference: AAR]

GetCellBackgroundColorNone Method

Returns the value specifying that there is no background color for the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellBackgroundColorNone(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

Boolean


GetCellClass method [ActiveX and VBA Reference: AAR]

GetCellClass Method

Gets the class of a cell style.

See Also | Example

Signature

RetVal = object.GetCellClass (StringCellStyle)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

RetVal

Integer
Cell style class.


GetCellContentColor method [ActiveX and VBA Reference: AAR]

GetCellContentColor Method

Returns the true color value for the content of the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellContentColor(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

AcCmColor object
AutoCAD true color object.


GetCellContentColor2 method [ActiveX and VBA Reference: AAR]

GetCellContentColor2 Method

Gets the true color vlaue for a cell.

See Also | Example

Signature

RetVal = object.GetCellContentColor2 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

AcadAcCmColor
The pointer referencing the color value.


GetCellDataType method [ActiveX and VBA Reference: AAR]

GetCellDataType Method

Gets the cell data and unit type for the given row and column.

See Also | Example

Signature

object.GetCellDataType row, col, pDataType, pUnitType

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

pDataType

AcValueDataType; Output-only
The cell data type.

pUnitType

AcValueUnitType; Output-only
The cell unit type.


GetCellExtents method [ActiveX and VBA Reference: AAR]

GetCellExtents Method

Returns the cell extents for the specified row and column.

See Also | Example

Signature

object.GetCellExtents(row, col, bOuterCell)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

bOuterCell

Boolean

TRUE: The specified cell is an outer cell.

FALSE: The specified cell is an inner cell.


GetCellFormat method [ActiveX and VBA Reference: AAR]

GetCellFormat Method

Gets the cell format for the given row and column.

See Also | Example

Signature

RetVal = object.GetCellFormat row, col, pFormat

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

RetVal

String
The cell format.


GetCellGridColor method [ActiveX and VBA Reference: AAR]

GetCellGridColor Method

Returns the grid color value for an edge of the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellGridColor(row, col, edge)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

edge

AcCellEdgeMask enum

acBottomMask | Bottom edge index of the cell.
acTopMask | Top edge index of the cell.
acLeftMask | Left edge index of the cell.
acRightMask | Right edge index of the cell.

RetVal

AcCmColor object
AutoCAD true color object.


GetCellGridLineWeight method [ActiveX and VBA Reference: AAR]

GetCellGridLineWeight Method

Returns the grid lineweight value for an edge of the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellGridLineWeight(row, col, edge)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

edge

AcCellEdgeMask enum

acBottomMask | Bottom edge index of the cell.
acTopMask | Top edge index of the cell.
acLeftMask | Left edge index of the cell.
acRightMask | Right edge index of the cell.

RetVal

ACAD_LWEIGHT enum

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault


GetCellGridVisibility method [ActiveX and VBA Reference: AAR]

GetCellGridVisibility Method

Returns the grid visibility value for an edge of the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellGridVisibility(row, col, edge)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

edge

AcCellEdgeMask enum

acBottomMask | Bottom edge index of the cell.
acTopMask | Top edge index of the cell.
acLeftMask | Left edge index of the cell.
acRightMask | Right edge index of the cell.

RetVal

Boolean


GetCellState method [ActiveX and VBA Reference: AAR]

GetCellState Method

Get a cell's state.

See Also | Example

Signature

RetVal = object.GetCellState nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

AcCellState
The cell state.


GetCellStyle method [ActiveX and VBA Reference: AAR]

GetCellStyle Method

Gets the cell style.

See Also | Example

Signature

RetVal = object.GetCellStyle nRow, nCol, pCellStyle

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

RetVal

String
The cell style.


GetCellStyleOverrides method [ActiveX and VBA Reference: AAR]

GetCellStyleOverrides Method

Returns the cell style overrides.

See Also | Example

Signature

object.GetCellStyleOverrides(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell


GetCellTextHeight method [ActiveX and VBA Reference: AAR]

GetCellTextHeight Method

Returns the text height for the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellTextHeight(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

Double


GetCellTextStyle method [ActiveX and VBA Reference: AAR]

GetCellTextStyle Method

Returns the text style name for the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellTextStyle(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

String


GetCellType method [ActiveX and VBA Reference: AAR]

GetCellType Method

Returns the cell type for the specified row and column.

See Also | Example

Signature

RetVal = object.GetCellType(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

AcCellType enum

acBlockCell

acTextCell

acUnknownCell


GetCellValue method [ActiveX and VBA Reference: AAR]

GetCellValue Method

Gets the cell value for the given row and column.

See Also | Example

Signature

RetVal = object.GetCellValue row, col

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

RetVal

VARIANT
The cell value.


GetColor method [ActiveX and VBA Reference: AAR]

GetColor Method

Returns the true color value for the specified row type.

See Also | Example

Signature

RetVal = object.GetColor(rowType)

Object

TableStyle
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

AcCmColor object
AutoCAD true color object.


GetColumnName method [ActiveX and VBA Reference: AAR]

GetColumnName Method

Gets a column's name.

See Also | Example

Signature

RetVal = object.GetColumnName nIndex

Object

Table
The object this method applies to.

nIndex

Integer; Input-only
The index of the column.

RetVal

String; Output-only
The name of the column.


GetColumnWidth method [ActiveX and VBA Reference: AAR]

GetColumnWidth Method

Returns the column width for the column at the specified column index in the table.

See Also | Example

Signature

RetVal = object.GetColumnWidth(col)

Object

Table
The object or objects this method applies to.

col

Long; the column

RetVal

Double


GetConstantAttributes method [ActiveX and VBA Reference: AAR]

GetConstantAttributes Method

Gets the constant attributes in the block or external reference.

See Also | Example

Signature

RetVal = object.GetConstantAttributes()

Object

BlockRef, ExternalReference, MInsertBlock
The object or objects this method applies to.

RetVal

Variant (array of Attribute objects)
The array of Attribute objects that are constant for the block reference.

Remarks

This method returns an array of constant attributes attached to the block or external reference. The attributes returned are the constant attribute definitions, not attribute references.


GetContentColor method [ActiveX and VBA Reference: AAR]

GetContentColor Method

Returns the true color value for the specified row type.

See Also | Example

Signature

RetVal = object.GetContentColor(rowType)

Object

Table
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

AcCmColor object
AutoCAD true color object.


GetContentLayout method [ActiveX and VBA Reference: AAR]

GetContentLayout Method

Get a cell's content layout.

See Also | Example

Signature

RetVal = object.GetContentLayout nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

AcCellContentLayout
The layout value.


GetContentType method [ActiveX and VBA Reference: AAR]

GetContentType Method

Get a cell's content type.

See Also | Example

Signature

RetVal = object.GetContentType nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

AcCellContentType
The content type.


GetControlPoint method [ActiveX and VBA Reference: AAR]

GetControlPoint Method

Gets the coordinates of the control point at a given index.

See Also | Example

Signature

RetVal = object.GetControlPoint(Index)

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the control point you wish to query. The index must be a positive integer beginning with zero.

RetVal

Variant (three-element array of doubles)
The 3D WCS coordinates of the control point at the given index location.

Remarks

Control points fine-tune a spline definition by adding weight to a portion of the spline curve.

You can query the total number of control points in a spline using the NumberOfControlPoints property. You can set a new coordinate location for a control point by using the SetControlPoint method. You can set a new weight for a control point by using the SetWeight method.


GetCorner method [ActiveX and VBA Reference: AAR]

GetCorner Method

Gets a corner of a rectangle.

See Also | Example

Signature

RetVal = GetCorner(Point[, Prompt])

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the base point of the rectangle.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Variant (three-element array of doubles)
The 3D WCS coordinates representing the corner of the rectangle.

Remarks

AutoCAD pauses for user input of the corner of a rectangle, and sets the return value to the value of the selected point. The Point parameter specifies the base point of the rectangle in the 3D WCS coordinates; this parameter is required. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The prompt is optional.

The AutoCAD user can specify the corner by entering a point in the WCS coordinate format; GetCorner treats Point as a three-dimensional point. The user can specify the corner also by specifying a location on the graphics screen. AutoCAD draws a dynamically sized rectangle from Point to the current crosshair position to help the user visualize the location of the second corner. The rectangle is drawn in the XY plane of the WCS. When the pointing device is used, GetCorner ignores the Z field of Point and sets the Z field of result to the current elevation.


GetCustomByIndex method [ActiveX and VBA Reference: AAR]

GetCustomByIndex Method

Returns the custom property name (key) and value that correspond to an index value.

See Also | Example

Signature

RetVal = object.GetCustomByIndex(Index, pKey, pValue)

Object

SummaryInfo
The object or objects this method applies to.

Index

Long; the index value of the property. The index range is from zero to one less than the number of custom properties.

pKey

String; output-only. The custom property name that corresponds to the index value.

pValue

String; output-only. The custom property value that corresponds to the index value.

RetVal

String; the custom property name (key) and value.


GetCustomByKey method [ActiveX and VBA Reference: AAR]

GetCustomByKey Method

Returns the custom property value that corresponds to a name (key) value.

See Also | Example

Signature

RetVal = object.GetCustomByKey(key, pValue)

Object

SummaryInfo
The object or objects this method applies to.

key

String; the name of the custom property.

pValue

String; output-only. The custom property value that corresponds to the custom property name.

RetVal

String; the custom property value.


GetCustomData method [ActiveX and VBA Reference: AAR]

GetCustomData Method

Gets the custom data associated to a cell.

See Also | Example

Signature

RetVal = object.GetCustomData nRow, nCol, szKey

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

szKey

String; Input-only
The input key of the AcDbEvalContextPair

RetVal

VARIANT
The custom data.


GetCustomScale method [ActiveX and VBA Reference: AAR]

GetCustomScale Method

Gets the custom scale for a layout or plot configuration.

See Also | Example

Signature

object.GetCustomScale(Numerator, Denominator)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

Numerator

Double; output-only
The numerator in the scale ratio. This value represents the number of inches or mm for the scale.

Denominator

Double; output-only
The denominator in the scale ratio. This value represents the number of drawing units for the scale.

Remarks

The Numerator parameter depends upon the setting of the PaperUnits property.


GetDataFormat method [ActiveX and VBA Reference: AAR]

GetDataFormat Method

Gets a cell's format.

See Also | Example

Signature

RetVal = object.GetDataFormat nRow, nCol, nContent, pValue

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

RetVal

String
The format of the cell.


GetDataLink method [ActiveX and VBA Reference: AAR]

GetDataLink Method

Gets the data link for the specified cell.

See Also | Example

Signature

RetVal = object.GetDataLink nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

RetVal

Long_PTR
The data link.


GetDataLink32 method [ActiveX and VBA Reference: AAR]

GetDataLink32 Method

For a 64-Bit system, gets the data link for a cell.

See Also | Example

Signature

RetVal = object.GetDataLink32 nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

pacDbObjId

Long
The data link.


GetDataType method [ActiveX and VBA Reference: AAR]

GetDataType method

Returns the data type and unit type for the specifed row type.

See Also | Example

Signature

object.GetDataType rowType, pDataType, pUnitType

object

TableStyle
The object or objects to which this method applies.

rowType

AcRowType; input-only
Can be one of the following values:

acUnknownRow

acDataRow

acTitleRow

acHeaderRow

pDataType

AcValueDataType; output-only
Can be one of the following values:

acUnknownDataType

acLong

acDouble

acString

acDate

acPoint2d

acPoint3d

acObjectId

acBuffer

acResbuf

acGeneral

pUnitType

AcValueUnitType; output-only
Can be one of the following values:

acUnitless

acUnitDistance

acUnitAngle

acUnitArea

acUnitVolume


GetDataType2 method [ActiveX and VBA Reference: AAR]

GetDataType2 Method

Gets the row data type and unit type for the specified row type and nContent.

See Also | Example

Signature

object.GetDataType2 nRow, nCol, nContent, pDataType, pUnitType

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

pDataType

AcValueDataType; Output-only
The data type.

pUnitType

AcValueUnitType; Output-only
The unit type.


GetDistance method [ActiveX and VBA Reference: AAR]

GetDistance Method

Gets the distance from the prompt line or a selected set of points on the screen.

See Also | Example

Signature

RetVal = GetDistance([Point][, Prompt])

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying the base point. If this point is not provided, the user must input two points.

Prompt

Variant (string); input-only; optional
The text to display to prompt the user for input.

RetVal

Variant (double or array of doubles)
The distance from the prompt line or a selected set of points on the screen.

Remarks

AutoCAD pauses for user input of a linear distance and sets the return value to the value of the selected distance. The Point parameter specifies a base point in WCS coordinates. The Prompt parameter specifies a string that AutoCAD displays before it pauses. Both Point and Prompt are optional.

The AutoCAD user can specify the distance by entering a number in the current units format. The user can also set the distance by specifying two locations on the graphics screen. AutoCAD draws a rubber-band line from the first point to the current crosshair position to help the user visualize the distance. If the Point parameter is provided, AutoCAD uses this value as the first of the two points.

By default, GetDistance treats Point and the return value as three-dimensional points. A prior call to the InitializeUserInput method can force Point to be two-dimensional, ensuring that this method returns a planar distance.

Regardless of the method used to specify the distance or the current linear units (for example, feet and inches), this method always sets the return value to a double-precision floating-point value.


GetDynamicBlockProperties method [ActiveX and VBA Reference: AAR]

GetDynamicBlockProperties Method

Gets the properties of the dynamic block.

Signature

object.GetDynamicBlockProperties

object

BlockRef, MInsertBlock
The object or objects this method applies to.

Remarks

BlockRef.GetDynamicBlockProperties returns a collection of DynamicBlockReferenceProperty objects if the block reference is a dynamic block containing custom properties.

Note To access this method, use the IAcadBlockReference2 or IAcadMInsertBlock2 interface.


GetEntity method [ActiveX and VBA Reference: AAR]

GetEntity Method

Gets an object interactively.

See Also | Example

Signature

object.GetEntity Object, PickedPoint[, Prompt]

Object

Utility
The object or objects this method applies to.

Object

Object; output-only
The picked object. Can be one of any of the Drawing Objects.

PickedPoint

Variant (three-element array of doubles); output-only
A 3D WCS coordinate specifying the point that was selected.

Prompt

Variant (string); input-only; optional
The text to display that prompts the user for input.

Remarks

This method requires the AutoCAD user to select an object by picking a point on the graphics screen. If an object is picked, it is returned in the first parameter and the second parameter will contain the point picked in WCS coordinates. If the pick point is not on an object the call will fail.

The pick point returned by GetEntity does not necessarily lie on the selected object. The returned point represents the location of the crosshairs at the time of selection. The relationship between this point and the object varies depending on the size of the pickbox and the current zoom scale.

This method can retrieve an object even if it is not visible on the screen or if it is on a frozen layer.


GetExtensionDictionary method [ActiveX and VBA Reference: AAR]

GetExtensionDictionary Method

Gets the extension dictionary associated with an object.

See Also | Example

Signature

RetVal = object.GetExtensionDictionary

Object

All Drawing Objects, AttributeReference, Block, Dictionary, DimStyle, Group, Layer, Linetype, PlotConfigurations, RegisteredApplication, TextStyle, UCS, View, Viewport; XRecord
The object or objects this method applies to.

RetVal

Dictionary; output-only
The extension dictionary for the object.

Remarks

If an object does not have an extension dictionary, this method will create a new extension dictionary for that object and return it in the return value.

You can query an object to see if it has an extension dictionary by using the HasExtensionDictionary property.


GetFieldId method [ActiveX and VBA Reference: AAR]

GetFieldId Method

Returns the field object ID of the specified cell.

See Also | Example

Signature

RetVal = object.GetFieldId(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

Long


GetFieldId2 method [ActiveX and VBA Reference: AAR]

GetFieldId2 Method

Gets the field object id associated to the specifed cell.

See Also | Example

Signature

RetVal = object.GetFieldId2 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

RetVal

Long_PTR
The field object id.


GetFieldId232 method [ActiveX and VBA Reference: AAR]

GetFieldId232 Method

For a 64-Bit system, gets a cell's field object id.

See Also | Example

Signature

RetVal = object.GetFieldId232 nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

RetVal

Long
The object id.


GetFieldId32 method [ActiveX and VBA Reference: AAR]

GetFieldId32 Method

Returns the field object ID of the specified cell for a 64-bit system.

See Also | Example

Signature

RetVal = object.GetFieldId32(row, col)

Object

Table
The object or objects this method applies to.

row

Integer; the zero-based row index for the cell

col

Integer; the zero-based column index for the cell

RetVal

Long_PTR


GetFitPoint method [ActiveX and VBA Reference: AAR]

GetFitPoint Method

Gets the fit point of a spline at a given index.

See Also | Example

Signature

RetVal = object.GetFitPoint(Index)

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The position in the fit point list at which to query the fit point. The index must be a positive integer beginning with 0.

RetVal

Variant (three-element array of doubles)
The 3D WCS coordinates of the fit point at the given index location.


GetFont method [ActiveX and VBA Reference: AAR]

GetFont Method

Gets the definition data of the font for the TextStyle.

See Also | Example

Signature

object.GetFont Typeface, Bold, Italic, CharSet, PitchAndFamily

Object

TextStyle
The object or objects this method applies to.

Typeface

String; output-only
The typeface (font name) of the TextStyle you queried.

Bold

Boolean; output-only
Specifies if the TextStyle is bold.

TRUE: The TextStyle is bold.

FALSE: The TextStyle is not bold.

Italic

Boolean; output-only
Specifies if the TextStyle is italic.

TRUE: The TextStyle is italic.

FALSE: The TextStyle is not italic.

CharSet

Long; output-only
The character set for the font. (See the available values in the Remarks section.)

PitchAndFamily

Long; output-only
The pitch and family definitions for the font. (See the available values in the Remarks section.)

Remarks

This section provides definitions for constants to use with this method. To use these constants, copy the definitions you need and paste them into the Declarations section of your application. A complete list of the constants that are available from Microsoft can be found in the file win32api.txt, which is provided with the Visual Basic Development Environment.

The CharSet parameter specifies the character set for the font. To use the following constants in your VB or VBA application, copy the definitions into the Declaration section of your code.

Public Const ANSI_CHARSET = 0
Public Const DEFAULT_CHARSET = 1
Public Const SYMBOL_CHARSET = 2
Public Const SHIFTJIS_CHARSET = 128
Public Const OEM_CHARSET = 255

The PitchAndFamily parameter specifies the pitch and family values for the font. The value is determined by a combination of three different settings. By choosing a setting from each of the three categories and using the Boolean operator OR to combine them, you achieve the PitchAndFamily value. A setting is required from the first two categories: the pitch and the family. The third category, the TrueType Flag, is used only when you are specifying a TrueType font.

' Pitch Values
Public Const DEFAULT_PITCH = 0
Public Const FIXED_PITCH = 1
Public Const VARIABLE_PITCH = 2

' Family Values
Public Const FF_DONTCARE = 0    '  Don't care or don't know.
Public Const FF_ROMAN = 16      '  Variable stroke width, serifed.
Public Const FF_SWISS = 32      '  Variable stroke width, sans-serifed.
Public Const FF_MODERN = 48     '  Constant stroke width, serifed or sans-serifed.
Public Const FF_SCRIPT = 64     '  Cursive, etc.
Public Const FF_DECORATIVE = 80 '  Old English, etc.

' TrueType Flag
Public Const TMPF_TRUETYPE = &H4


GetFormat method [ActiveX and VBA Reference: AAR]

GetFormat method

Returns the format for the specifed row type.

See Also | Example

object

TableStyle
The object or objects to which this method applies.

rowType

AcRowType; input-only
Can be on of the following values:

acUnknownRow

acDataRow

acTitleRow

acHeaderRow


GetFormat method [ActiveX and VBA Reference: AAR]

GetFormat Method

Gets the format for the specified row type.

See Also | Example

Signature

RetVal = object.GetFormat rowType, pFormat

Object

Table, TableStyle
The objects this method applies to.

rowType

AcRowType; Input-only
The row type to check.

RetVal

String
The format for the row.


GetFormat2 method [ActiveX and VBA Reference: AAR]

GetFormat2 Method

Gets the format of a cell style.

See Also | Example

Signature

RetVal = object.GetFormat2 (StringCellStyle, pbstrFormat)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

pbstrFormat

String; Output
Cell style format.


GetFormula method [ActiveX and VBA Reference: AAR]

GetFormula Method

Get a cell's formula.

See Also | Example

Signature

RetVal = object.GetFormula nRow, nCol, nContent, pszFormula

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nContent

Integer; Input-only
The value of the content.

RetVal

String
The formula within the cell.


GetFullDrawOrder method [ActiveX and VBA Reference: AAR]

GetFullDrawOrder Method

Returns all of the objects in a block, sorted by draw order with the bottom object first.

See Also | Example

Signature

object.GetFullDrawOrder (Objects, honorSortentsSysvar)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects in the block.

honorSortentsSysvar

Boolean; true uses the setting in the DRAWORDERCTL system variable; false ignores the setting.


GetGridColor method [ActiveX and VBA Reference: AAR]

GetGridColor Method

Returns the grid color value for a grid linetype and row type.

See Also | Example

Signature

RetVal = object.GetGridColor(gridLineType, rowType)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineType

AcGridLineType enum; the type of the grid line

acHorzBottom | Top or bottom horizontal grid line, based on the flow direction.
acHorzInside | All horizontal grid lines, excluding the top and bottom lines.
acHorzTop | Top or bottom horizontal grid line, based on the flow direction.
acInvalidGridLine | An invalid grid line.
acVertInside | All the vertical grid lines, excluding the farthest left and farthest right grid lines.
acVertLeft | Farthest left grid line.
acVertRight | Farthest right grid line.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

AcCmColor object
AutoCAD true color object.


GetGridColor2 method [ActiveX and VBA Reference: AAR]

GetGridColor2 Method

Gets the gridColor for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridColor2 nRow, nCol, nGridLineType

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

RetVal

AcCmColor object
The pointer which stores a reference to the color.


GetGridDoubleLineSpacing method [ActiveX and VBA Reference: AAR]

GetGridDoubleLineSpacing Method

Gets the lineSpacing value for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridDoubleLineSpacing nRow, nCol, nGridLineType, pValue

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

RetVal

Double
The line spacing value.


GetGridLineStyle method [ActiveX and VBA Reference: AAR]

GetGridLineStyle Method

Get a cell's gridLineStyle.

See Also | Example

Signature

RetVal = object.GetGridLineStyle nRow, nCol, nGridLineType

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nGridLineType

AcGridLineType; Input-only
The cell's gridLineType.

RetVal

AcGridLineStyle
The cell's gridLineStyle.


GetGridLinetype method [ActiveX and VBA Reference: AAR]

GetGridLinetype Method

Gets the idLinetype with the gridLinetype value for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridLinetype nRow, nCol, nGridLineType

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

RetVal

Long_PTR
The idLinetype from the cell.


GetGridLinetype32 method [ActiveX and VBA Reference: AAR]

GetGridLinetype32 Method

For a 64-Bit system, gets the idLinetype with the gridLinetype value for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridLinetype32 nRow, nCol, nGridLineType

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nGridLineType

AcGridLineType; Input-only
The value of the gridLineType.

RetVal

Long
The idLinetype from the cell.


GetGridLineWeight method [ActiveX and VBA Reference: AAR]

GetGridLineWeight Method

Returns a grid lineweight value for a grid linetype and row type.

See Also | Example

Signature

RetVal = object.GetGridLineWeight(gridLineType, rowType)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineType

AcGridLineType enum; the type of the grid line

acHorzBottom | Top or bottom horizontal grid line, based on the flow direction.
acHorzInside | All horizontal grid lines, excluding the top and bottom lines.
acHorzTop | Top or bottom horizontal grid line, based on the flow direction.
acInvalidGridLine | An invalid grid line.
acVertInside | All the vertical grid lines, excluding the farthest left and farthest right grid lines.
acVertLeft | Farthest left grid line.
acVertRight | Farthest right grid line.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

ACAD_LWEIGHT enum

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault


GetGridLineWeight2 method [ActiveX and VBA Reference: AAR]

GetGridLineWeight2 Method

Gets the gridLineWeight value for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridLineWeight2 nRow, nCol, nGridLineType

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

RetVal

ACAD_LWEIGHT
The point to store the weight.


GetGridSpacing method [ActiveX and VBA Reference: AAR]

GetGridSpacing Method

Gets the grid spacing for the viewport.

See Also | Example

Signature

object.GetGridSpacing XSpacing, YSpacing

Object

Viewport, PViewport
The object or objects this method applies to.

XSpacing

Double; output-only

YSpacing

Double; output-only


GetGridVisibility method [ActiveX and VBA Reference: AAR]

GetGridVisibility Method

Returns a grid visibility value for the specifed grid linetype and row type.

See Also | Example

Signature

RetVal = object.GetGridVisibility(gridLineType, rowType)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineType

AcGridLineType enum; the type of the grid line

acHorzBottom | Top or bottom horizontal grid line, based on the flow direction.
acHorzInside | All horizontal grid lines, excluding the top and bottom lines.
acHorzTop | Top or bottom horizontal grid line, based on the flow direction.
acInvalidGridLine | An invalid grid line.
acVertInside | All the vertical grid lines, excluding the farthest left and farthest right grid lines.
acVertLeft | Farthest left grid line.
acVertRight | Farthest right grid line.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

Boolean; the value specifying the grid visibility value for the specifed grid linetype and row type.


GetGridVisibility2 method [ActiveX and VBA Reference: AAR]

GetGridVisibility2 Method

Returns the gridVisibility value for the specified cell.

See Also | Example

Signature

RetVal = object.GetGridVisibility2 nRow, nCol, nGridLineType

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

RetVal

Boolean
The flag value.


GetHasDataLink method [ActiveX and VBA Reference: AAR]

GetHasDataLink Method

Check if a cell has a data link.

See Also | Example

Signature

RetVal = object.GetHasDataLink nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

Boolean
The Boolean flag indicating the data link status.


GetHasFormula method [ActiveX and VBA Reference: AAR]

GetHasFormula Method

Check if a cell has a formula.

See Also | Example

Signature

RetVal = object.GetHasFormula nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nContent

Integer; Input-only
The value of the content.

RetVal

Boolean
The Boolean flag for the formula status.


GetInput method [ActiveX and VBA Reference: AAR]

GetInput Method

Converts a user's input string into a keyword index.

See Also | Example

Signature

RetVal = GetInput()

Object

Utility
The object or objects this method applies to.

RetVal

String
The index specifying which keyword was entered.

Remarks

This method retrieves a keyword entered by the AutoCAD user during a call to one of the user-input functions (Get* methods).

The maximum length of the keyword is 511 characters (with the 512th character reserved for the NULL character).

A call to GetInput is meaningless and will fail unless it immediately follows a call to one of the user-input functions. Even then, the call will be successful only if the user-input function has returned the error description "User input is a keyword."

It isn't necessary to call GetInput after a call to the GetKeyword method.

The keywords recognized by the application are specified by a prior call to the InitializeUserInput method. The interpretation of the keywords is entirely up to the application. Keywords should not duplicate the names of AutoCAD commands.

The user can abbreviate a keyword, but GetInput always returns the full keyword as it was defined in the InitializeUserInput call with the original capitalization, so the application needs to do only one string comparison for each keyword it defines.


GetInteger method [ActiveX and VBA Reference: AAR]

GetInteger Method

Gets an integer value from the user.

See Also | Example

Signature

RetVal = GetInteger([Prompt])

Object

Utility
The object or objects this method applies to.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Integer
The integer value returned by the user.

Remarks

AutoCAD pauses for user input of an integer and sets the return value to the selected value. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The Prompt is optional.

The AutoCAD user can enter any valid (short) integer in the range of -32,768 to +32,767.

If a keyword is returned instead of an integer, or if the user presses ENTER without entering a value, AutoCAD generates error number -2145320928 (and the error message, "User input is a keyword"). Use the GetInput method to obtain the keyword from the return value.


GetInterfaceObject method [ActiveX and VBA Reference: AAR]

GetInterfaceObject Method

Accepts a program ID and attempts to load it into AutoCAD as an in-process server.

See Also | Example

Signature

RetVal = object.GetInterfaceObject(ProgID)

Object

Application
The object or objects this method applies to.

ProgID

String; input-only
The program ID of the interface object to return.

RetVal

Object
The interface object matching the program ID.

Remarks

Although the object will be loaded into AutoCAD, it will not show up in its type library. The object will have its own type library. This method lets you connect to an ActiveX Automation server.

If possible, use version-dependent ProgIDs. If a GetInterfaceObject method uses a version-independent ProgID, change the method to use a version-dependent ProgID. For example, you would change AutoCAD.AcadLayerStateManager to AutoCAD.AcadLayerStateManager.16.


GetInvisibleEdge method [ActiveX and VBA Reference: AAR]

GetInvisibleEdge Method

Gets the visibility setting for an edge of a 3DFace object at a given index.

See Also | Example

Signature

RetVal = object.GetInvisibleEdge(Index)

Object

3DFace
The object or objects this method applies to.

Index

Integer
The index of the edge to query. The index must be between 0 and 3 inclusive.

RetVal

Boolean

TRUE: The edge is invisible.

FALSE: The edge is visible.


GetIsCellStyleInUse method [ActiveX and VBA Reference: AAR]

GetIsCellStyleInUse Method

Gets the usage status of a cell style.

See Also | Example

Signature

RetVal = object.GetIsCellStyleInUse (pszCellStyle)

Object

TableStyle
The object or objects this method applies to.

pszCellStyle

String; Input
Cell style name.

RetVal

Boolean
Cell style status; true if in use.


GetIsMergeAllEnabled method [ActiveX and VBA Reference: AAR]

GetIsMergeAllEnabled Method

Gets value of the "merge all" property.

See Also | Example

Signature

RetVal = object.GetIsMergeAllEnabled (StringCellStyle)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

RetVal

Boolean
Cell style "merge all" property status.


GetKeyword Method [ActiveX and VBA Reference: AAR]

GetKeyword Method

Gets a keyword string from the user.

See Also | Example

Signature

RetVal = GetKeyword([Prompt])

Object

Utility
The object or objects this method applies to.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

String
The keyword returned from the user.

Remarks

AutoCAD pauses for user input of a keyword and sets the return value to the keyword that was entered. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The prompt is optional. The maximum length of the return value is 511 characters.

The AutoCAD user can enter the keyword from the keyboard. The list of keywords that this method will accept is set by a prior call to the InitializeUserInput method. If the user enters a string not specified in the call to InitializeUserInput, AutoCAD displays an error message and tries again (and redisplays the prompt, if one was specified). If the user doesn't enter anything but presses the ENTER key, GetKeyword returns an empty string ("") unless the call to InitializeUserInput also disallowed NULL input.


GetLiveSection method [ActiveX and VBA Reference: AAR]

GetLiveSection method

Gets the live section plane that is currently enabled in the database.

See Also | Example

Signature

object.GetLiveSection

object

SectionManager
The object or objects to which this method applies.

Remarks

Live sectioning is either enabled or disabled individually per section object. Live sectioning can be active for no more than one section object at a time.Note: The section manager object is not created until a section plane is created.


GetLocaleMediaName method [ActiveX and VBA Reference: AAR]

GetLocaleMediaName Method

Gets the localized version of the canonical media name.

See Also | Example

Signature

RetVal = object.GetLocaleMediaName(Name)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

Name

String; input-only
The canonical media name to find the localized version of.

RetVal

String
The localized version of the specified canonical media name.


GetLoopAt method [ActiveX and VBA Reference: AAR]

GetLoopAt Method

Gets the hatch loop at a given index.

See Also | Example

Signature

object.GetLoopAt Index, Loop

Object

Hatch
The object or objects this method applies to.

Index

Integer; input-only
A positive integer beginning with 0.

Loop

Variant (object or array of objects); output-only
An object or array of objects that makes up the loop.


GetMargin method [ActiveX and VBA Reference: AAR]

GetMargin Method

Get a cell's margin value.

See Also | Example

Signature

RetVal = object.GetMargin nRow, nCol, nMargin

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nMargins

AcCellMargin; Input-only
The value of the margins.

RetVal

Double
The cell's margin value.


GetMinimumColumnWidth method [ActiveX and VBA Reference: AAR]

GetMinimumColumnWidth Method

Gets the minimum column width for the column at the specified column index in the table.

See Also | Example

Signature

RetVal = object.GetMinimumColumnWidth(col)

Object

Table
The object or objects this method applies to.

col

Long; the column

RetVal

Double


GetMinimumRowHeight method [ActiveX and VBA Reference: AAR]

GetMinimumRowHeight Method

Returns the minimum row height for the specified row.

See Also | Example

Signature

RetVal = object.GetMinimumRowHeight(row)

Object

Table
The object or objects this method applies to.

row

Long; the row

RetVal

Double


GetName method [ActiveX and VBA Reference: AAR]

GetName Method

Gets the name (keyword) of an object in a dictionary.

See Also | Example

Signature

RetVal = object.GetName(Object)

Object

Dictionary
The object or objects this method applies to.

Object

Object
The object to query.

RetVal

String
The name (keyword) of the object.

Remarks

For example, querying the object "Object2" in the following dictionary would return the name "SecondKeyword":

MyDictionary

Keyword Object

FirstKeyword Object1

SecondKeyword Object2


GetObject method [ActiveX and VBA Reference: AAR]

GetObject Method

Gets the object in a dictionary, given the name (keyword) of the object.

See Also | Example

Signature

RetVal = object.GetObject(Name)

Object

Dictionary
The object or objects this method applies to.

Name

String; input-only
The name (keyword) of the object in the dictionary.

RetVal

Object
The object corresponding to the given name (keyword).

Remarks

For example, querying the name "SecondKeyword" in the following dictionary would return the object "Object2":

MyDictionary

Keyword Object

FirstKeyword Object1

SecondKeyword Object2


GetOrientation method [ActiveX and VBA Reference: AAR]

GetOrientation Method

Gets the angle specified. Ignores the setting of the ANGBASE system variable.

See Also | Example

Signature

RetVal = GetOrientation([Point][, Prompt])

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying the base point.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Double
The specified angle.

Remarks

AutoCAD pauses for user input of an angle, and sets the return value to the value of the selected angle. The Point parameter specifies an angle base point in the WCS. The Prompt parameter specifies a string that AutoCAD displays before it pauses. Both Point and Prompt are optional.

The AutoCAD user can specify the angle by entering a number in the current angular units format. The user can also specify the angle by specifying two 2D locations on the graphics screen. AutoCAD draws a rubber-band line from the first point to the current crosshairs position to help the user visualize the angle. If the Point parameter is provided, AutoCAD uses this value as the first of the two points. The angle is measured in the XY plane of the WCS (this method ignores the Z field of Point). The direction of angular increase is always counterclockwise.

Regardless of the method used to specify the angle, GetOrientation always sets the return value to a value expressed in radians.

This method is similar to the GetAngle method, but it ignores the current direction of angle 0, which is stored in the ANGBASE system variable. The 0 angle employed by GetOrientation is always to the right: "east" or "three o'clock."

If a keyword is returned instead of an angle, AutoCAD will generate the error message "User input keyword." Use the GetInput method to obtain the keyword from the return value.


GetOverride method [ActiveX and VBA Reference: AAR]

GetOverride Method

Get a cell's overrides.

See Also | Example

Signature

RetVal = object.GetOverride nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nContent

Integer; Input-only
The value of the cell's content.

RetVal

AcCellProperty
The cell's overrides.


GetPaperMargins method [ActiveX and VBA Reference: AAR]

GetPaperMargins Method

Gets the margins for the layout or plot configuration.

See Also | Example

Signature

object.GetPaperMargins(LowerLeft, UpperRight)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

LowerLeft

Variant (two-element array of doubles); output-only
The X and Y values for the lower-left margin.

UpperRight

Variant (two-element array of doubles); output-only
The X and Y values for the upper-right margin.

Remarks

The print origin is offset from the edge of the paper by the margin specified here.

The units for these values are specified by the PaperUnits property.


GetPaperSize method [ActiveX and VBA Reference: AAR]

GetPaperSize Method

Gets the width and height of the configured paper.

See Also | Example

Signature

object.GetPaperSize(Width, Height)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

Width

Double; output-only
The width of the paper.

Height

Double; output-only
The height of the paper.

Remarks

The units for the width and height values are specified by the PaperUnits property.

To set the paper size, use the CanonicalMediaName property.


GetPlotDeviceNames method [ActiveX and VBA Reference: AAR]

GetPlotDeviceNames Method

Gets all available plot device names.

See Also | Example

Signature

RetVal = object.GetPlotDeviceNames()

Object

Layout, PlotConfiguration
The object or objects this method applies to.

RetVal

Variant (array of strings)
The array of available device names for the system.

Remarks

You should call RefreshPlotDeviceInfo before the first time you use this method. Once you have called RefreshPlotDeviceInfo, you don't need to call it again unless your plot device information changes during the session.


GetPlotStyleTableNames method [ActiveX and VBA Reference: AAR]

GetPlotStyleTableNames Method

Gets all available plot style table names.

See Also | Example

Signature

RetVal = object.GetPlotStyleTableNames()

Object

Layout, PlotConfiguration
The object or objects this method applies to.

RetVal

Variant (array of strings)
The array of available plot style table names for the system.

Remarks

You should call RefreshPlotDeviceInfo before the first time you use this method. Once you have called RefreshPlotDeviceInfo, you don't need to call it again unless your plot device information changes during the session.

GetPlotStyleTableNames returns all available plot style tables found on the system, including both CTB and STB files. To filter the results for one type of plot style table, use the PSTYLEMODE system variable.


GetPoint method [ActiveX and VBA Reference: AAR]

GetPoint Method

Gets the point selected in AutoCAD.

See Also | Example

Signature

RetVal = GetPoint([Point][, Prompt])

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying the relative base point.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Variant (three-element array of doubles)
The 3D WCS coordinates of the point the AutoCAD user has selected.

Remarks

AutoCAD pauses for user input of a point, and sets the return value to the value of the selected point. The Point parameter specifies a relative base point in the WCS. The Prompt parameter specifies a string that AutoCAD displays before it pauses. Both Point and Prompt are optional.

The AutoCAD user can specify the point by entering a coordinate in the current units format; GetPoint treats the Point parameter and the return value as three-dimensional points. The user can specify the point also by specifying a location on the graphics screen. If the Point parameter is provided, AutoCAD draws a rubber-band line from Point to the current crosshair position.

The coordinates of the point stored in the return value are expressed in terms of the WCS.

If a keyword is returned instead of a point, AutoCAD will generate the error message "User input keyword." Use the GetInput method to obtain the keyword from the return value.


GetProjectFilePath method [ActiveX and VBA Reference: AAR]

GetProjectFilePath Method

Gets the directory in which AutoCAD looks for external reference files.

See Also | Example

Signature

RetVal = object.GetProjectFilePath(ProjectName)

Object

PreferencesFiles
The object or objects this method applies to.

ProjectName

String; input-only
The name of the project. This name is also controlled by the PROJECTNAME system variable.

RetVal

String
The directory in which AutoCAD looks for external reference files.


GetReal method [ActiveX and VBA Reference: AAR]

GetReal Method

Gets a real (double) value from the user.

See Also | Example

Signature

RetVal = GetReal([Prompt])

Object

Utility
The object or objects this method applies to.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

Double
The value returned from the user.

Remarks

AutoCAD pauses for user input of a real value, and sets the return value to the value that the user enters. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The prompt is optional.

If a keyword is returned instead of a double, AutoCAD will generate the error message "User input keyword." Use the GetInput method to obtain the keyword from the return value.


GetRelativeDrawOrder method [ActiveX and VBA Reference: AAR]

GetRelativeDrawOrder Method

Returns the objects specified, sorted by the draw order, with the bottom object first.

See Also | Example

Signature

object.GetRelativeDrawOrder (Objects, honorSortentsSysvar)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects specified.

honorSortentsSysvar

Boolean; true uses the setting in the DRAWORDERCTL system variable; false ignores the setting.


GetRemoteFile method [ActiveX and VBA Reference: AAR]

GetRemoteFile Method

Downloads the file specified by a URL.

See Also | Example

Signature

object.GetRemoteFile URL, LocalFile, IgnoreCache

Object

Utility
The object or objects this method applies to.

URL

String; input-only
The URL of the file to download.

LocalFile

String; output-only
The file at the specified URL.

IgnoreCache

Boolean

TRUE: Download even if the file has already been transferred in this session.

FALSE: Do not download if the file has already been transferred in this session.

Remarks

If you maintain a list of files that have already been downloaded in the current or a previous session (a cache), it may be more efficient to avoid a duplicate transfer and make a copy of the locally available file instead. You can explicitly force a download by setting the IgnoreCache parameter to TRUE, in which case the cache will be bypassed altogether.

When accessing a secure URL, a dialog box will be posted prompting the user for the necessary password information. Message boxes will also appear if the user has not suppressed this activity in the browser.

When downloading a file, AutoCAD creates a temporary file for internal processing. Do not attempt to access this temporary file. Information in this file is deleted at the end of the AutoCAD session.


GetRotation method [ActiveX and VBA Reference: AAR]

GetRotation Method

Gets the rotation value for a cell.

See Also | Example

Signature

RetVal = object.GetRotation nRow, nCol, nContent, pValue

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

Double
The rotation value for the cell.


GetRotation method [ActiveX and VBA Reference: AAR]

GetRotation Method

Gets the rotation of a cell style.

See Also | Example

Signature

RetVal = object.GetRotation (StringCellStyle, rotation)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

RetVal

Double
Cell style rotation.


GetRowHeight method [ActiveX and VBA Reference: AAR]

GetRowHeight Method

Returns the row height for the row at the specified row index in the table.

See Also | Example

Signature

RetVal = object.GetRowHeight(row)

Object

Table
The object or objects this method applies to.

row

Long; the row

RetVal

Double


GetRowType method [ActiveX and VBA Reference: AAR]

GetRowType Method

Returns the row type for the specified row.

See Also | Example

Signature

RetVal = object.GetRowType(row)

Object

Table
The object or objects this method applies to.

row

Long; the row

RetVal

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow


GetScale method [ActiveX and VBA Reference: AAR]

GetScale Method

Gets the scale value for a cell.

See Also | Example

Signature

RetVal = object.GetScale nRow, nCol, nContent, pScale

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

Double
The scale value.


GetSectionTypeSettings method [ActiveX and VBA Reference: AAR]

GetSectionTypeSettings method

Gets the section type settings object.

See Also | Example

Signature

object

SectionSettings
The object or objects to which this method applies.

secType

AcSectionType enum; input-only
Can be on of the following values:

acSectionTypeLiveSection

acSectionType2dSection

acSectionType3dSection


GetSettings method [ActiveX and VBA Reference: AAR]

GetSettings method

Gets the section settings object.

See Also | Example

Signature

object.GetSetting pUnk

object

Section
The object or objects to which this method applies.

pUnk

IUnknown; input-only


GetSnapSpacing method [ActiveX and VBA Reference: AAR]

GetSnapSpacing Method

Gets the snap spacing for the viewport.

See Also | Example

Signature

object.GetSnapSpacing XSpacing, YSpacing

Object

Viewport, PViewport
The object or objects this method applies to.

XSpacing

Double; output-only
The snap spacing for the X axis.

YSpacing

Double; output-only
The snap spacing for the Y axis.


GetString method [ActiveX and VBA Reference: AAR]

GetString Method

Gets a string from the user.

See Also | Example

Signature

RetVal = GetString(HasSpaces[, Prompt])

Object

Utility

HasSpaces

Integer; input-only

TRUE: The return string can contain spaces. It is terminated by a carriage return only.

FALSE: The return string cannot contain spaces. It is terminated by a carriage return or space.

Prompt

Variant (string); input-only; optional
The text used to prompt the user for input.

RetVal

String
The string returned from the user.

Remarks

AutoCAD pauses for user input of the string, and sets the result to the string that the user enters. The HasSpaces parameter specifies whether the string can contain spaces. The Prompt parameter specifies a string that this method displays before AutoCAD pauses.

The AutoCAD user can enter the string from the keyboard. If the HasSpaces parameter is TRUE, the string can contain blanks and the user must terminate it by entering [Return]. If HasSpaces is False, entering either a blank or [Return] terminates the string. If the user enters more than 132 characters, string entry continues until the user enters a blank or carriage return (according to HasSpaces), but GetString places only the first 132 characters into the return value.


GetSubEntity method [ActiveX and VBA Reference: AAR]

GetSubEntity Method

Gets an object or subentity interactively.

See Also | Example

Signature

object.GetSubEntity Object, PickedPoint, TransMatrix, ContextData[, Prompt]

Object

Utility
The object or objects this method applies to.

Object

Object; output-only
The picked object or subentity. Can be one of any of the Drawing Objects.

PickedPoint

Variant (three-element array of doubles); output-only
A 3D WCS coordinate specifying the point that was selected.

TransMatrix

Variant (4x4 array of doubles); output-only
The translation matrix applied to this entity.

ContextData

Variant (array of longs); output-only
An array of object IDs for any nested objects in the selected object.

Prompt

Variant (string); input-only; optional
The text to display to prompt the user for input.

Remarks

This method requires the AutoCAD user to select an object by picking a point on the graphics screen. If an object or subentity is picked, it is returned in the first parameter, and the second parameter will contain the point picked in WCS coordinates. If the pick point is not on an object the method will fail.

This method can retrieve an object even if it is not visible on the screen or if it is on a frozen layer.


GetSubSelection method [ActiveX and VBA Reference: AAR]

GetSubSelection Method

Returns the row and column indexes of the cells in a subselection set.

See Also | Example

Signature

object.GetSubSelection(rowMin, rowMax, colMin, colMax)

Object

Table
The object or objects this method applies to.

rowMin

Long; zero-based minimum row index for the subselection set of cells in the table

rowMax

Long; zero-based maximum row index for the subselection set of cells in the table

colMin

Long; zero-based minimum column index for the subselection set of cells in the table

colMax

Long; zero-based maximum column index for the subselection set of cells in the table

Remarks

This method gets the row and column indices of the cells in the subselection set. The total number of selected cells is equal to (rowMax - rowMin + 1) * (colMax - colMin + 1).


GetText method [ActiveX and VBA Reference: AAR]

GetText Method

Returns the text value for the specified row and column.

See Also | Example

Signature

RetVal = object.GetText(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

RetVal

String


GetTextHeight method [ActiveX and VBA Reference: AAR]

GetTextHeight Method

Returns the text height for the specified row type.

See Also | Example

Signature

RetVal = object.GetTextHeight(rowType)

Object

Table, TableStyle
The object or objects this method applies to.

rowType

AcRowType enum; the row type

acDataRow

acHeaderRow

acTitleRow

acUnknownRow

RetVal

Double; the text height for the specified row type.


GetTextHeight2 method [ActiveX and VBA Reference: AAR]

GetTextHeight2 Method

Gets the text height for a cell.

See Also | Example

Signature

RetVal = object.GetTextHeight2 nRow, nCol, nContent, pHeight

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

Double
The height value.


GetTextRotation method [ActiveX and VBA Reference: AAR]

GetTextRotation Method

Returns the text rotation for the specified row and column.

See Also | Example

Signature

RetVal = object.GetTextRotation(row, col)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

RetVal

AcRotationAngle enum

acDegrees000

acDegrees090

acDegrees180

acDegrees270

acDegreesUnknown


GetTextString method [ActiveX and VBA Reference: AAR]

GetTextString Method

Gets the text value of a cell.

See Also | Example

Signature

RetVal = object.GetTextString nRow, nCol, nContent, pTextString

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

RetVal

String
The string value of the cell.


GetTextStyle method [ActiveX and VBA Reference: AAR]

GetTextStyle Method

Gets the text style name for the specified row types.

See Also | Example

Signature

RetVal = object.GetTextStyle(rowTypes)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; input-only
The row types to change.

RetVal

String
The text style name to use for the specified row types.


GetTextStyle2 method [ActiveX and VBA Reference: AAR]

GetTextStyle2 Method

Gets the text style name for a cell.

See Also | Example

Signature

RetVal =object.GetTextStyle2 nRow, nCol, nContent, pStringStyleName

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

RetVal

String
The String value of the name.


GetUCSMatrix method [ActiveX and VBA Reference: AAR]

GetUCSMatrix Method

Gets the transformation matrix consisting of UCS coordinate system data.

See Also | Example

Signature

RetVal = object.GetUCSMatrix()

Object

UCS
The object or objects this method applies to.

RetVal

Variant (4x4 array of doubles)
The UCS matrix.

Remarks

To transform an entity into a given UCS, use the TransformBy method, using the matrix returned by this method as the input for that method.


GetUniqueCellStyleName method [ActiveX and VBA Reference: AAR]

GetUniqueCellStyleName Method

Gets a unique cell style name with the base name that is passed as the prefix.

See Also | Example

Signature

RetVal = object.GetUniqueCellStyleName (pszBaseName)

Object

TableStyle
The object or objects this method applies to.

pszBaseName

String; Input
Base cell style name.

RetVal

String
Cell style name.


GetUniqueSectionName method [ActiveX and VBA Reference: AAR]

GetUniqueSectionName method

Finds a unique section plane name.

See Also | Example

Signature

Retval = object.GetUniqueSectionName(pBaseName)

object

SectionManager
The object or objects to which this method applies.

BaseName

String; input-only
The base name from which the unique section plane name is coined. The base name can be any arbitrary string.


GetValue method [ActiveX and VBA Reference: AAR]

GetValue Method

Gets the value of a cell.

See Also | Example

Signature

RetVal = object.GetValue nRow, nCol, nContent

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to delete.

nCol

Integer; Input-only
The column number of the cell to delete.

nContent

Integer; Input-only
The content value of the cell.

RetVal

VARIANT
The cell's value.


GetVariable method [ActiveX and VBA Reference: AAR]

GetVariable Method

Gets the current setting of an AutoCAD system variable.

See Also | Example

Signature

RetVal = object.GetVariable(Name)

Object

Document
The object or objects this method applies to.

Name

String; input-only
The name of the variable to return. Must contain a valid system variable name (the case of the characters is not significant).

RetVal

Variant
The value of the specified system variable.

Remarks

For a list of all the AutoCAD system variables and their types, please refer to "System Variables" in the AutoCAD Command Reference.


GetWeight method [ActiveX and VBA Reference: AAR]

GetWeight Method

Gets the weight of the control point at a given index.

See Also | Example

Signature

RetVal = object.GetWeight(Index)

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The index location in the array of points that make up the spline. A positive integer beginning with 0.

RetVal

Double
The weight of the specified control point.

Remarks

Control points fine-tune a spline definition by adding weight to a portion of the spline curve.


GetWidth method [ActiveX and VBA Reference: AAR]

GetWidth Method

Gets the start and end width for a polyline.

See Also | Example

Signature

object.GetWidth Index, StartWidth, EndWidth

Object

LightweightPolyline, Polyline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the polyline for which the width is returned. The index must be a positive integer beginning with 0.

StartWidth

Double; output-only
The start width of the polyline at the given index.

EndWidth

Double; output-only
The end width of the polyline at the given index.

Remarks

Polyline: this method will fail if the polyline Type property is acCubicSplinePoly or acQuadSplinePoly.


GetWindowToPlot method [ActiveX and VBA Reference: AAR]

GetWindowToPlot Method

Gets the coordinates that define the portion of the layout to plot.

See Also | Example

Signature

object.GetWindowToPlot(LowerLeft, UpperRight)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

LowerLeft

Variant (two-element array of doubles); output-only
The X and Y values for the lower-left window.

UpperRight

Variant (two-element array of doubles); output-only
The X and Y values for the upper-right window.

Remarks

The window coordinates are taken from the origin.

The units for these values are specified by the PaperUnits property.

The PlotType property must be set to acWindow for these coordinates to be used for the plot.


GetXdata method [ActiveX and VBA Reference: AAR]

GetXData Method

Gets the extended data (XData) associated with an object.

See Also | Example

Signature

object.GetXData AppName, XDataType, XDataValue

Object

All Drawing Objects , AttributeReference, Block, Dictionary, DimStyle, Group, Layer, Linetype, PlotConfigurations, RegisteredApplication, TextStyle, UCS, View, Viewport; XRecord
The object or objects this method applies to.

AppName

String; input-only
A NULL string will return all the data attached to the object, regardless of the application that created it. Supplying an application name will return only the data that was created by the specified application.

XDataType

Variant (array of shorts); output-only

XDataValue

Variant (array of variants); output-only

Remarks

Extended data is an example of instance-specific data created by applications written with ObjectARX or AutoLISP. This data can be added to any object. This data follows the object's definition data, and is maintained in the order that it was saved into the document. (AutoCAD maintains this information, but doesn't use it.)


GetXRecordData method [ActiveX and VBA Reference: AAR]

GetXRecordData Method

Gets the extended record data (XRecordData) associated with a dictionary.

See Also | Example

Signature

object.GetXRecordData XRecordDataType, XRecordDataValue

Object

Dictionary; XRecord
The object or objects this method applies to.

XRecordDataType

Variant (array of shorts); output-only

XRecordDataValue

Variant (array of variants); output-only

Remarks

XRecord objects are used to store and manage arbitrary data. This object is similar in concept to XData but is not limited by size or order.

Unlike XData, XRecords work with the standard AutoCAD group codes which are all below 1000 in value. All the standard AutoCAD group codes are supported. This means that, in addition to all the normally used data types, an XRecord is capable of storing object IDs, which allows XRecords to own other objects including other XRecords.

The following group codes are common to all XRecord objects:
Group codes | Description
100 | Subclass marker (AcDbXrecord)
1-369 (except 5 and 105) | These values can be used by an application in any way.


HandleToObject method [ActiveX and VBA Reference: AAR]

HandleToObject Method

Gets the object that corresponds to the given handle.

See Also | Example

Signature

RetVal = object.HandleToObject(Handle)

Object

Document
The object or objects this method applies to.

Handle

String; input-only
The handle of the object to return.

RetVal

Object
The object that corresponds to the given handle.

Remarks

This method can return only objects in the current document.


Highlight method [ActiveX and VBA Reference: AAR]

Highlight Method

Sets the highlight status for the given object, or for all objects in a given selection set.

See Also | Example

Signature

object.Highlight HighlightFlag

Object

All Drawing Objects, SelectionSet, AttributeReference, Group
The object or objects this method applies to.

HighlightFlag

Boolean; input-only

TRUE: The object is highlighted.

FALSE: The existing highlight is removed from the object.

Remarks

Once the highlight flag for an object has been set, a call to the Update or Regen method is required to view the change.

Note that this function does not return the current highlight status of an object.


HitTest method [ActiveX and VBA Reference: AAR]

HitTest method

Performs a hit test on the section plane.

See Also | Example

Signature

object.HitTest(varPtHit, pHit As Boolean, pSegmentIndex As Long, pPtOnSegment, pSubItem As AcSectionSubItem)

object

Section
The object or objects to which this method applies.

varPtHit

Variant; input-only
Point at which to perfom the hit test.

pHit

Boolean; output-only
True if the given point lies on the section plane.

pSegmentIndex

Integer; output-only
Index of segment on the section line that passes near or through the hit point.

pPtOnSegment

Variant; output-only
The actual point on the section plane geometry. This parameter may return nothing if this data is not required.

pSubItem

AcSectionSubItem; output-only
One or more of the SubItem enum values. This parameter may return nothing if this data is not required.


HitTest method [ActiveX and VBA Reference: AAR]

HitTest Method

Returns the cell at the specified location.

See Also | Example

Signature

object.HitTest(wpt, wviewVec, resultRowIndex, resultColumnIndex)

Object

Table
The object or objects this method applies to.

wpt

Variant
3D point in WCS specifying the input pick point.

wviewVec

Variant
3D vector in WCS specifying the view direction for the hit test.

resultRowIndex

Long
Row index of the selected cell.

resultColumnIndex

Long
Column index of the selected cell.

RetVal

Boolean

Remarks

This function performs a hit test by specifying a point and viewing direction. The cell hit by the ray is returned.


Import method [ActiveX and VBA Reference: AAR]

Import Method

Imports a drawing or a group of saved layer settings from a file.

See Also | Example

Signatures: Overview

Drawing

RetVal = object.Import(FileName, InsertionPoint, ScaleFactor)

Layer Settings

object.Import FileName

Signatures: Detail

RetVal = object.Import(FileName, InsertionPoint, ScaleFactor)

Object

Document
The object or objects this method applies to.

FileName

String; input-only
The name of the file to be imported.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates location in the current drawing where the imported file is placed.

ScaleFactor

Double; input-only
The scale used to place the imported file.

RetVal

Object
In the case of importing a WMF file, a BlockReference object is returned. In all other cases, the return value is NULL.

object.Import FileName

Object

LayerStateManager
A LayerStateManager object.

FileName

String; input-only
The name of the file you are importing layer settings from.


ImportProfile method [ActiveX and VBA Reference: AAR]

ImportProfile Method

Imports a profile created by another user.

See Also | Example

Signature

object.ImportProfile Profile, RegFile, IncludePathInfo

Object

PreferencesProfiles
The object or objects this method applies to.

Profile

String; input-only
The name of the profile to import.

RegFile

String; input-only
The registry file that the profile should be imported from. The file should have an .arg extension.

IncludePathInfo

Boolean; input-only

TRUE: The path information in the registry file will be preserved.

FALSE: The path information in the registry file will not be preserved.


IndexOf method [ActiveX and VBA Reference: AAR]

IndexOf Method

Provides the index of an entry in the File Dependency List.

See Also | Example

Signature

RetVal = object.IndexOf (Feature, FullFileName)

object

FileDependencies
The object or objects this method applies to.

Feature

String; feature name.

FullFileName

String; full path.

RetVal

Long
Index of the entry.


InitializeUserInput method [ActiveX and VBA Reference: AAR]

InitializeUserInput Method

Initializes the GetKeyword method.

See Also | Example

Signature

object.InitializeUserInput Bits[, Keyword]

Object

Utility
The object or objects this method applies to.

Bits

Integer; input-only
To set more than one condition at a time, add the values together in any combination. If this value is not included or is set to 0, none of the control conditions apply.

1 | Disallows NULL input. This prevents the user from responding to the request by entering only [Return] or a space.
2 | Disallows input of zero (0). This prevents the user from responding to the request by entering 0.
4 | Disallows negative values. This prevents the user from responding to the request by entering a negative value.
8 | Does not check drawing limits, even if the LIMCHECK system variable is on. This enables the user to enter a point outside the current drawing limits. This condition applies to the next user-input function even if the AutoCAD LIMCHECK system variable is currently set.
16 | Not currently used.
32 | Uses dashed lines when drawing rubber-band lines or boxes. This causes the rubber-band line or box that AutoCAD displays to be dashed instead of solid, for those methods that let the user specify a point by selecting a location on the graphics screen. (Some display drivers use a distinctive color instead of dashed lines.) If the POPUPS system variable is 0, AutoCAD ignores this bit.
64 | Ignores Z coordinate of 3D points (GetDistance method only). This option ignores the Z coordinate of 3D points returned by the GetDistance method, so an application can ensure this function returns a 2D distance.
128 | Allows arbitrary input—whatever the user types.

Keyword

Variant (array of strings); input-only; optional
The keywords that the following user-input method will recognize.

Remarks

Keywords must be defined with this method before the call to GetKeyword. Certain user-input methods can accept keyword values in addition to the values they normally return, provided that this method has been called to define the keyword. The user-input methods that can accept keywords are: GetKeyword, GetInteger, GetReal, GetDistance, GetAngle, GetOrientation, GetPoint, and GetCorner.


InsertBlock method [ActiveX and VBA Reference: AAR]

InsertBlock Method

Inserts a drawing file or a named block that has been defined in the current drawing.

See Also | Example

Signature

RetVal = object.InsertBlock(InsertionPoint, Name, Xscale, Yscale, ZScale, Rotation [, Password])

Object

ModelSpace, PaperSpace, Block
The object or objects this method applies to.

InsertionPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the location in the drawing to insert the block.

Name

String; input-only
The name of the AutoCAD drawing file or the name of the block to insert. If it is a file name, include the .dwg extension and any path information necessary for AutoCAD to find the file.

Xscale

Double; input-only; optional
The default equals 1.0. Must be a positive number.

Yscale

Double; input-only; optional
The default equals 1.0. Must be a positive number.

Zscale

Double; input-only; optional
The default equals 1.0. Must be a positive number.

Rotation

Double; input-only; optional
The default equals 0.0 radians.

Password

Variant; input-only; optional

RetVal

BlockRef object
The placed block as a Block Reference object.

Remarks

Inserting a block into another block will create nested blocks.

Attempting to call the InsertBlock method with an uninitialized Name parameter results in unexpected behavior.


InsertColumns method [ActiveX and VBA Reference: AAR]

InsertColumns Method

Inserts columns in a table.

See Also | Example

Signature

object.InsertColumns(col, Width, cols)

Object

Table
The object or objects this method applies to.

col

Long; zero-based column index

Width

Double; column width

cols

Long; the number of columns to insert


InsertColumnsAndInherit method [ActiveX and VBA Reference: AAR]

InsertColumnsAndInherit Method

Insert columns into a table from another table.

See Also | Example

Signature

object.InsertColumnsAndInherit col, nInheritFrom, nNumCols

Object

Table
The object this method applies to.

col

Integer; Input-only
The col index to insert to.

nInheritFrom

Integer; Input-only
The table index to grab from.

nNumCols

Integer; Input-only
The number of columns to grab.


InsertInMenuBar method [ActiveX and VBA Reference: AAR]

InsertInMenuBar Method

Inserts the popup menu into the AutoCAD menu bar at a specified location.

See Also | Example

Signature

object.InsertInMenuBar(Index)

Object

PopupMenu
The object or objects this method applies to.

Index

Variant; input-only
The index location in the menu bar where the popup menu is to be added.
The index must be either an integer or a string. If an integer, the index must be between 0 and N-1, where N is the number of objects in the menu bar. The new item will be added immediately before the specified index location.


InsertLoopAt method [ActiveX and VBA Reference: AAR]

InsertLoopAt Method

Inserts a loop at a given index of a hatch.

See Also | Example

Signature

object.InsertLoopAt Index, LoopType, Loop

Object

Hatch
The object or objects this method applies to.

Index

Integer; input-only
The index location in the array of vertices that make up the hatch boundary. The index must be a positive integer beginning with 0.

LoopType

AcLoopType enum; input-only

acHatchLoopTypeDefault

acHatchLoopTypeExternal

acHatchLoopTypePolyline

acHatchLoopTypeDerived

acHatchLoopTypeTextbox

Loop

Variant (object or array of objects); input-only
An object or array of objects forming a closed boundary. If an array of objects is used, their endpoints must coincide for the loop to be created properly. The loop, or the array defining the loop, can consist of the following types of objects:
Line, Polyline, Circle, Ellipse, Spline, Region.


InsertMenuInMenuBar method [ActiveX and VBA Reference: AAR]

InsertMenuInMenuBar Method

Inserts a menu into the AutoCAD menu bar.

See Also | Example

Signature

object.InsertMenuInMenuBar MenuName, Index

Object

PopupMenus
The object or objects this method applies to.

MenuName

String; input-only
The name of the popup menu to insert into the menu bar.

Index

Variant; input-only
The index in the menu bar to place the popup menu. The index must be either an integer or a string.

If an integer, the index must be between 0 and N-1, where N is the number of popup menus in the menu bar.

If a string, the name of the popup menu must contain any underscore that appears in the menu.

Remarks

The menu is inserted immediately before the index position specified.


InsertRows method [ActiveX and VBA Reference: AAR]

InsertRows Method

Inserts rows in a table.

See Also | Example

Signature

object.InsertRows(row, Height, Rows)

Object

Table
The object or objects this method applies to.

row

Long; zero-based row index

Height

Double; row height

Rows

Long; the number of rows to insert


InsertRowsAndInherit method [ActiveX and VBA Reference: AAR]

InsertRowsAndInherit Method

Insert rows into a table from another table.

See Also | Example

Signature

object.InsertRowsAndInherit nIndex, nInheritFrom, nNumRows

Object

Table
The object this method applies to.

nIndex

Integer; Input-only
The row index to insert to.

nInheritFrom

Integer; Input-only
The table index to grab from.

nNumRows

Integer; Input-only
The number of rows to grab.


IntersectWith method [ActiveX and VBA Reference: AAR]

IntersectWith Method

Gets the points where one object intersects another object in the drawing.

See Also | Example

Signature

RetVal = object.IntersectWith(IntersectObject, ExtendOption)

Object

All Drawing Objects (Except Pviewport and PolygonMesh)
The object or objects this method applies to.

IntersectObject

Object, input-only;
The object can be one of All Drawing Objects.

ExtendOption

AcExtendOption enum; input-only
This option specifies if none, one or both, of the objects are to be extended in order to attempt an intersection.

acExtendNone | Does not extend either object.
acExtendThisEntity | Extends the base object.
acExtendOtherEntity | Extends the object passed as an argument.
acExtendBoth | Extends both objects.

RetVal

Variant (array of doubles)
The array of points where one object intersects another object in the drawing.

Remarks

If the two objects do not intersect, no data is returned. You can request the point of intersection that would occur if one or both of the objects were extended to meet the other. For example, in the following illustration, Line1 is the base object from which this method was called and line3 is the object passed as a parameter. If the ExtendOption passed is acExtendThisEntity, point A is returned as the point where line1 would intersect line3 if line1 were extended. If the ExtendOption is acExtendOtherEntity, no data is returned because even if line3 were extended, it would not intersect line1.

If the intersection type is acExtendBothEntities and line2 is passed as the parameter entity, point B is returned. If the ExtendOption is acExtendNone and line2 is the parameter entity, no data is returned.

 | line3 line2
line1 |


IsContentEditable method [ActiveX and VBA Reference: AAR]

IsContentEditable Method

Check if a cell has editable content.

See Also | Example

Signature

RetVal = object.IsContentEditable nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

Boolean
The Boolean flag for the status.


IsEmpty method [ActiveX and VBA Reference: AAR]

IsEmpty Method

Determines if a cell is empty based on its row and column position

See Also | Example

Signature

RetVal = object.IsEmpty nRow, nCol

Object

Table
The object this method applies to.

nRow

Long; Input-only
The row number of the cell to check.

nCol

Long; Input-only
The column number of the cell to check.

RetVal

Boolean
The value of the return; TRUE if the cell is empty.


IsFormatEditable method [ActiveX and VBA Reference: AAR]

IsFormatEditable Method

Check if a cell has editable format.

See Also | Example

Signature

RetVal = object.IsFormatEditable nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

Boolean
Tthe Boolean flag for the status of the cell.


IsMergeAllEnabled method [ActiveX and VBA Reference: AAR]

IsMergeAllEnabled Method

Checks if cell merging is on.

See Also | Example

Signature

RetVal = object.IsMergeAllEnabled nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

RetVal

Boolean
The status of cell merging.


IsMergedCell method [ActiveX and VBA Reference: AAR]

IsMergedCell Method

Returns the merge status of a cell.

See Also | Example

Signature

RetVal = object.IsMergedCell(row, col, minRow, maxRow, minCol, maxCol)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

minRow

Long; zero-based lower bound of a row index

maxRow

Long; zero-based upper bound of a row index

minCol

Long; zero-based lower bound of a column index

maxCol

Long; zero-based upper bound of a column index

RetVal

Boolean


IsRemoteFile method [ActiveX and VBA Reference: AAR]

IsRemoteFile Method

Returns the URL from which a remote file was downloaded.

See Also | Example

Signature

RetVal = object.IsRemoteFile(LocalFile, URL)

Object

Utility
The object or objects this method applies to.

LocalFile

String; input-only
The downloaded file.

URL

String; output-only
The URL from which the file was downloaded, if any.

RetVal

Boolean

TRUE: The file was downloaded from a remote location.

FALSE: The file was not downloaded from a remote location.

Remarks

This method is the inverse of the IsURL method and provides a mapping from a local file to the corresponding URL from which the file was downloaded.


IsURL method [ActiveX and VBA Reference: AAR]

IsURL Method

Validates a given URL.

See Also | Example

Signature

RetVal = object.IsURL(URL)

Object

Utility
The object or objects this method applies to.

LocalFile

String; input-only
The URL to validate.

RetVal

Boolean

TRUE: The string represents a valid URL.

FALSE: The string is not a valid URL.

Remarks

The definition of a "valid" URL is application-dependent, in that a given third-party application may not be interested in supporting all Internet protocols. For instance, an application that attempts to connect users to websites would probably not need to provide access to FTP sites. In this hypothetical application, a FALSE value would be returned if a URL that begins with something other than "http://" was entered.

The default functionality of this method for AutoCAD supports FTP, HTTP, HTTPS, and FILE protocols.


Item method [ActiveX and VBA Reference: AAR]

Item Method

Gets the member object at a given index in a collection, group, or selection set.

See Also | Example

Signature

RetVal = object.Item(Index)

Object

All Collections, Group, SelectionSet
The object or objects this method applies to.

Index

Variant; input-only
The index location in the collection for the member item to query.
The index must be either an integer or a string. If an integer, the index must be between 0 and N-1, where N is the number of objects in the collection or selection set.

RetVal

Object
The object at the given index location in the collection or selection set.

Remarks

This method supports string-based iteration. For example, if a block named BLOCK1 was created with the following statement:

Set block1 = Blocks.Add("BLOCK1")

you could reference the object through the following statement:

Set whichblock = Blocks.Item("BLOCK1")

NOTE The Item method is case-sensitive when used with the SelectionSets collection; it is not case-sensitive for other collections.

Dictionaries: The return value type for this method is IAcadObject. This allows you to retrieve named objects from the dictionaries collection that are not of the type AcadDictionary.


LaunchBrowserDialog method [ActiveX and VBA Reference: AAR]

LaunchBrowserDialog Method

Launches a dialog box in which a user can enter a URL.

See Also | Example

Signature

RetVal = object.LaunchBrowserDialog (SelectedURL,

DialogTitle, OpenButtonCaption, StartPageURL, RegistryRootKey, OpenButtonAlwaysEnabled)

Object

Utility
The object or objects this method applies to.

SelectedURL

String; output-only
The URL selected.

DialogTitle

String; input-only
The title to be displayed in the dialog box.

OpenButtonCaption

String; input-only
The caption for the OK/Open button.

StartPageURL

String; input-only
An initial URL to be displayed.

ReigstryRootKey

String; input-only
Product root key for storing persistent dialog box information. This key specifies where information about the size, position, and other preferences information of the dialog box can be stored across sessions. Input an empty string to disregard this functionality.

OpenButtonAlwaysEnabled

Boolean; input-only

TRUE: The Open button is enabled, allowing a file or link to be selected.

FALSE: The Open button is disabled and is only enabled when the user selects a file for download.

RetVal

Boolean

TRUE: The dialog box was opened successfully.

FALSE: The dialog box did not open successfully.

Remarks

The last parameter, OpenButtonAlwaysEnabled, determines whether the user can select HTML links in addition to files that can be downloaded.


LayerPropertyOverrides method [ActiveX and VBA Reference: AAR]

LayerPropertyOverrides Method

Specifies whether the viewport has layer property overrides.

See Also | Example

Signature

RetVal = object.LayerPropertyOverrides

Object

PViewport The object this method applies to.

RetVal

Boolean
A return referencing the status of layer property overrides


ListARX method [ActiveX and VBA Reference: AAR]

ListARX Method

Gets the currently loaded ObjectARX applications.

See Also | Example

Signature

RetVal = object.ListArx()

Object

Application
The object or objects this method applies to.

RetVal

Variant
An array of ObjectARX applications currently loaded. Returns empty if no applications are currently loaded.


Load method [ActiveX and VBA Reference: AAR]

Load Method

Loads a menu group from a customization (CUI) file or the definition of a linetype from a library (LIN) file.

See Also | Example

Signatures: Overview

Linetypes

object.Load LinetypeName, Filename

MenuGroups

object.Load MenuFilename [,BaseMenu]

Signatures: Detail

object.Load LineTypeName, FileName

Object

Linetypes
The object or objects this method applies to.

LineTypeName

String; input-only
The name of the linetype to load.

FileName

String; input-only
The name of the file the linetype is in.

RetVal = object.Load (MenuFileName [,BaseMenu])

Object

MenuGroups
The object or objects this method applies to.

MenuFileName

String; input-only
The name of the customization (CUI) file to load.

BaseMenu

Variant; input-only; optional
If this parameter is set to TRUE, then the menu group will be loaded as a base menu (similar to the MENU command in AutoCAD). If this parameter is omitted, the menu group will be loaded as a partial menu (similar to the MENULOAD command in AutoCAD).

RetVal

MenuGroup object

Remarks

Linetypes: Although you can create a linetype and add it to the Linetypes Collection object using the Add method, it will be created with the default properties only. Because you cannot edit linetype properties with this release of ActiveX Automation, use this method to load existing linetypes into your drawing.

Menu groups: AutoCAD searches for customization files with the specified MenuFileName and a .cui extension.


LoadARX method [ActiveX and VBA Reference: AAR]

LoadARX Method

Loads the specified ObjectARX application.

See Also | Example

Signature

object.LoadARX Name

Object

Application
The object or objects this method applies to.

Name

String; input-only
The full path name of the application to load.


LoadDVB method [ActiveX and VBA Reference: AAR]

LoadDVB Method

Loads the specified AutoCAD VBA project file.

See Also | Example

Signature

object.LoadDVB Name

Object

Application
The object or objects this method applies to.

Name

String; input-only
The full path name of the .dvb project to load.


LoadShapeFile method [ActiveX and VBA Reference: AAR]

LoadShapeFile Method

Loads a shape file (SHX).

See Also | Example

Signature

object.LoadShapeFile FullName

Object

Document
The object or objects this method applies to.

FullName

String
The full path and name of the shape file to load.

Remarks

This method makes all the shapes in the shape file available to the current drawing. To add a shape into the drawing, use the AddShape method.

You must load a shape file the first time you need it. AutoCAD loads it thereafter. The shape file must be available each time you edit the drawing.


MergeCells method [ActiveX and VBA Reference: AAR]

MergeCells Method

Merges cells in a table.

See Also | Example

Signature

object.MergeCells(minRow, maxRow, minCol, maxCol)

Object

Table
The object or objects this method applies to.

minRow

Long; zero-based lower bound of a row index

maxRow

Long; zero-based upper bound of a row index

minCol

Long; zero-based lower bound of a column index

maxCol

Long; zero-based upper bound of a column index

Remarks

This method merges a rectangular region of cells. The total number of cells to be merged is equal to (maxRow - minRow + 1) * (maxCol - minCol + 1).


Mirror method [ActiveX and VBA Reference: AAR]

Mirror Method

Creates a mirror-image copy of a planar object around an axis.

See Also | Example

Signature

RetVal = object.Mirror(Point1, Point2)

Object

All Drawing Objects
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the mirror axis.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the mirror axis.

RetVal

Mirrored object
This object can be one of any Drawing Objects.

System Variables

To manage the reflection properties of text objects, use the MIRRTEXT system variable. The default setting of MIRRTEXT is On (1), which causes text objects to be mirrored just like any other object. When MIRRTEXT is off (0), text is not mirrored.

Before mirroring | After mirroring (MIRRTEXT = 1) | After mirroring (MIRRTEXT = 0)

Remarks

The two points specified as parameters become the endpoints of a line around which the base object is reflected.

Selected object

Point1 and Point2 specifying the mirror axis

Mirrored object

This method places the reflected image into the drawing and retains the original object. To remove the original object, use the Delete method.

You can mirror a Viewport object in paper space, although doing so has no effect on its model space view or on model space objects.

AutoCAD checks to see if the object to be copied owns any other object. If it does, it performs a copy on those objects as well. The process continues until all owned objects have been copied.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.

AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference.


Mirror3d method [ActiveX and VBA Reference: AAR]

Mirror3D Method

Creates a mirror image of the given object about a plane.

See Also | Example

Signature

RetVal = object.Mirror3D(Point1, Point2, Point3)

Object

All Drawing Objects
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the mirror plane.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the mirror plane.

Point3

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the third point of the mirror plane.

RetVal

Mirrored object
This object can be one of any Drawing Objects.

Remarks

Object mirrored about a plane defined by three points

AutoCAD checks to see if the object to be copied owns any other object. If it does, it performs a copy on those objects as well. The process continues until all owned objects have been copied.

NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method.

AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference.


Move method [ActiveX and VBA Reference: AAR]

Move Method

Moves an object along a vector.

See Also | Example

Signature

object.Move Point1, Point2

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the move vector.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the move vector.

Remarks

The two points you specify define a displacement vector indicating how far the given object is to be moved and in what direction.

Given object with two points indicated | Moved object


MoveAbove method [ActiveX and VBA Reference: AAR]

MoveAbove Method

Moves objects above the target in the draw order.

See Also | Example

Signature

object.MoveAbove (Objects, Target)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects to move.

Target

AcadEntity; the target of the draw order.


MoveBelow method [ActiveX and VBA Reference: AAR]

MoveBelow Method

Moves objects below the target in the draw order.

See Also | Example

Signature

object.MoveBelow (Objects, Target)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects to move.

Target

AcadEntity; the target of the draw order.


MoveContent method [ActiveX and VBA Reference: AAR]

MoveContent Method

Moves the index content of a cell.

See Also | Example

Signature

object.MoveContent nRow, nCol, nFromIndex, nToIndex

Object

Table
The object this method applies to.

nRow

Long; Input-only
The row number of the cell to check.

nCol

Long; Input-only
The column number of the cell to check.

nFromIndex

Long; Input-only
The index of the content to be moved.

nToindex

Long; Input-only
The index of the content to be placed at.


MoveToBottom method [ActiveX and VBA Reference: AAR]

MoveToBottom Method

Moves objects to the bottom of the draw order.

See Also | Example

Signature

object.MoveToBottom (Objects)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects to move.


MoveToTop method [ActiveX and VBA Reference: AAR]

MoveToTop Method

Moves objects to the top of the draw order.

See Also | Example

Signature

object.MoveToTop (Objects)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects to move.


New method [ActiveX and VBA Reference: AAR]

New Method

Creates a new document in SDI mode.

See Also | Example

Signature

RetVal = object.New(TemplateFileName)

Object

Document
The object or objects this method applies to.

TemplateFileName

String; input-only
The full path and file name of the template file.

RetVal

Document object
The newly created Document object.

Remarks

You should call the New method from the Document object only when working in SDI mode. When working in MDI mode, use the Add method on the Documents collection to create a new drawing.


NumCustomInfo method [ActiveX and VBA Reference: AAR]

NumCustomInfo Method

Returns the number of custom property fields that have been set.

See Also | Example

Signature

RetVal = object.NumCustomInfo()

Object

SummaryInfo
The object or objects this method applies to.

RetVal

Long; the number of custom property fields that have been set for the drawing.


ObjectIDToObject method [ActiveX and VBA Reference: AAR]

ObjectIDToObject Method

Gets the object that corresponds to the given object ID.

See Also | Example

Signature

RetVal = object.ObjectIDToObject(ID)

Object

Document
The object or objects this method applies to.

ID

Long_ptr; input-only
The object ID of the object to return.

RetVal

Object
The object that corresponds to the given object ID.

Remarks

This method can return only objects that are in the current document.


ObjectIDToObject32 method [ActiveX and VBA Reference: AAR]

ObjectIDToObject32 Method

Gets the object that corresponds to the given object ID for a 64-bit system.

See Also | Example

Signature

RetVal = object.ObjectIDToObject32(ID)

Object

Document
The object or objects this method applies to.

ID

Long; input-only
The object ID of the object to return.

RetVal

Object
The object that corresponds to the given object ID.

Remarks

This method can return only objects that are in the current document.


Offset method [ActiveX and VBA Reference: AAR]

Offset Method

Creates a new object at a specified offset distance from an existing object.

See Also | Example

Signature

RetVal = object.Offset(Distance)

Object

Arc, Circle, Ellipse, Line, LightweightPolyline, Polyline, Spline, XLine
The object or objects this method applies to.

Distance

Double; input-only
The distance to offset the object. The offset can be a positive or negative number, but it cannot equal zero. If the offset is negative, this is interpreted as being an offset to make a "smaller" curve (that is, for an arc it would offset to a radius that is "Distance less" than the starting curve's radius). If "smaller" has no meaning, then it would offset in the direction of smaller X, Y, and Z WCS coordinates.

RetVal

Variant (array of objects)
An array of the newly created objects resulting from the offset.

Remarks

For many curves, the result of this operation will be a single new curve (which may not be of the same type as the original curve). For example, offsetting an ellipse will result in a spline because the result does fit the equation of an ellipse. In some cases it may be necessary for the offset result to be several curves.

An original object and the object with an offset in red.


Open method [ActiveX and VBA Reference: AAR]

Open Method

Opens an existing drawing file (DWG) and makes it the active document.

See Also | Example

Signature

object.Open Name[, ReadOnly][, Password]

Object

Documents, Document
The object or objects this method applies to.

Name

String
The full path and file name, or a valid URL address, of the drawing file to open. If the drawing is in the folder specified by the SupportPath property, then the path is not needed and the file name is sufficient.

ReadOnly

Variant; input-only; optional; Documents collection only
Default setting: FALSE

TRUE: Opens the drawing as a read-only drawing.

FALSE: Opens the drawing as a read-write drawing.

Password

Variant; optional
Password to open an encrypted drawing.

Remarks

It is recommended that you save the current drawing before calling this method.

This method opens AutoCAD drawing files only. Use the Import method to open SAT, EPS, DXF, WMF, or BMP format files.

When working in MDI mode, you should always use the Open method from the Documents collection.

When accessing a secure URL, a dialog box prompts the user for the necessary password information. Message boxes appear if the user has not suppressed this activity in the browser.

When downloading a file, AutoCAD creates a temporary file for internal processing. Do not attempt to access this temporary file. Information in this file is deleted at the end of the AutoCAD session.


OverwritePropChanged method [ActiveX and VBA Reference: AAR]

OverwritePropChanged Method

Indicates whether properties were changed.

See Also | Example

Signature

RetVal = object.OverwritePropChanged

Object

MLeaderStyle
The object this property applies to.

RetVal

Boolean
True if properties were changed.


PlotToDevice method [ActiveX and VBA Reference: AAR]

PlotToDevice Method

Plots a layout to a device.

See Also | Example

Signature

RetVal = object.PlotToDevice [plotConfig]

Object

Plot
The object or objects this method applies to.

plotConfig

String; input-only; optional
The full path and file name of the PC3 file to use instead of the current configuration. If this parameter is not provided, the current configuration will be used. If the configuration file is not found at the specified path, AutoCAD will search the printer configuration path for the file before it defaults to the current configuration.

RetVal

Boolean

TRUE: The plot was successfully sent to the device.

FALSE: The plot was not sent to the device. There was either a plot process failure or the plot was cancelled.

Remarks

The drawing from which the plot is initiated must be active for the plot to succeed.

To plot in the foreground using VBA, you must set the BACKGROUNDPLOT system variable to 0. Otherwise, plotting occurs in the background.

The plot device is specified using the ConfigName property for the layout or plot configuration.

If the PC3 file specified or the current plot configuration contains plot-to-file information, this method may actually send the plot to a file instead of to a device. Be careful to review all current plot configuration information for the specified layout. To plot several layouts, you can use the SetLayoutsToPlot method before invoking the PlotToDevice method.

To create a new configured plotter (PC3) file, use the Add-a-Plotter wizard in AutoCAD. For more information about PC3 files, see "Set Up Plotters and Printers" in the AutoCAD Driver and Peripheral Guide.


PlotToFile method [ActiveX and VBA Reference: AAR]

PlotToFile Method

Plots a layout to the specified file.

See Also | Example

Signature

RetVal = object.PlotToFile (plotFile[, plotConfig])

Object

Plot
The object or objects this method applies to.

plotFile

String; input-only
The name of the file to plot the active layout to. If you plot multiple layouts, the file name for each plot will be generated from the drawing and layout names.

plotConfig

String; input-only; optional
The full path and file name of the PC3 file to use instead of the current configuration. If this parameter is not provided, the current configuration will be used.

RetVal

Boolean

TRUE: The plot was successfully sent to the file.

FALSE: The plot was not sent to the file. There was either a plot process failure or the plot was cancelled.

Remarks

The drawing from which the plot is initiated must be active for the plot to succeed.

To plot in the foreground using VBA, you must set the BACKGROUNDPLOT system variable to 0. Otherwise, plotting occurs in the background.

If you plot the active layout (that is, you have not called SetLayoutsToPlot before this method), the plotFile parameter specifies the name for the output plot file. If you plot multiple layouts using the SetLayoutsToPlot method, the output plot files are automatically named using the drawing name, layout name, and any path information provided in the plotFile parameter.

If a file extension is provided in the plotFile parameter, that extension will almost always be used for the output plot file. The specified extension will be overwritten only for certain raster output drivers that replace user-provided extensions with .gif.

If a file extension is not provided in the plotFile parameter, an extension is automatically generated for the output plot file based on the default extension for the specified driver or device.

For some plotters, the output format you choose determines the file extension and whether the plot is written to a file. Also, some plotters might not be able to plot to a file. For further information, see "Set Up Plotters and Printers" in the AutoCAD Driver and Peripheral Guide, or the plotter manufacturer's instructions.


PolarPoint method [ActiveX and VBA Reference: AAR]

PolarPoint Method

Gets the point at a specified angle and distance from a given point.

See Also | Example

Signature

RetVal = PolarPoint(Point, Angle, Distance)

Object

Utility
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the start point.

Angle

Double; input-only
The angle in radians.

Distance

Double; input-only
The distance in current units.

RetVal

Variant (three-element array of doubles)
The 3D WCS coordinates at the specified angle and distance from a given point.


Prompt method [ActiveX and VBA Reference: AAR]

Prompt Method

Displays a prompt on the command line.

See Also | Example

Signature

object.Prompt Message

Object

Utility
The object or objects this method applies to.

Message

String; input-only
The prompt to display.


PurgeAll method [ActiveX and VBA Reference: AAR]

PurgeAll Method

Removes unused named references such as unused blocks or layers from the document.

See Also | Example

Signature

object.PurgeAll

Object

Document
The object or objects this method applies to.

Remarks

This method is the equivalent of entering PURGE on the command line, selecting the All option, and then choosing Yes to the Purge Everything? prompt.

Deleted objects remain in the document until they are purged using this method.


PurgeFitData method [ActiveX and VBA Reference: AAR]

PurgeFitData Method

Purges the fit data of a spline.

See Also | Example

Signature

object.PurgeFitData

object

Spline
The object or objects this method applies to.

PurgeFitData

Removes the fit data of a spline.


PutRemoteFile method [ActiveX and VBA Reference: AAR]

PutRemoteFile Method

Uploads a file to a remote FTP location specified by a URL known to AutoCAD.

See Also | Example

Signature

object.PutRemoteFile URL, LocalFile

Object

Utility
The object or objects this method applies to.

URL

String; input-only
The URL location to upload the file to.

LocalFile

String; input-only
The file to upload.

Remarks

This method is designed to complement the GetRemoteFile method.

When a secure URL is accessed, a dialog box prompts the user for the necessary password information. Message boxes appear if the user has not suppressed this activity in their browser.


Quit method [ActiveX and VBA Reference: AAR]

Quit Method

Closes the drawing file and exits the AutoCAD application.

See Also | Example

Signature

object.Quit

Object

Application
The object or objects this method applies to.

Remarks

If AutoCAD is in the middle of a command, an "AutoCAD unable to service automation request" error message will be generated. If the document has not been saved, you will be prompted to save the drawing.


RealToString method [ActiveX and VBA Reference: AAR]

RealToString Method

Converts a real (double) value to a string.

See Also | Example

Signature

RetVal = RealToString(Value, Unit, Precision)

Object

Utility
The object or objects this method applies to.

Value

Double; input-only
The value to be converted.

Unit

AcUnits enum; input-only

acDefaultUnits

acScientific

acDecimal

acEngineering

acArchitectural

acFractional

Precision

Integer; input-only
The precision of the value. An integer between 0 and 8.

RetVal

String
The value as a properly formatted string.


RecomputeTableBlock method [ActiveX and VBA Reference: AAR]

RecomputeTableBlock Method

Updates a table block.

See Also | Example

Signature

object.RecomputeTableBlock(bForceUpdate)

Object

Table
The object or objects this method applies to.

bForceUpdate

Boolean

TRUE: Table block is updated.

FALSE: Table block is not updated.

Remarks

This function updates the table block record that the Table object references to match changes made to the Table object since the most recent update of the table block record.


RefreshPlotDeviceInfo method [ActiveX and VBA Reference: AAR]

RefreshPlotDeviceInfo Method

Updates the plot, canonical media, and plot style table information to reflect the current system state.

See Also | Example

Signature

object.RefreshPlotDeviceInfo()

Object

Layout, PlotConfiguration
The object or objects this method applies to.

Remarks

It is recommended that you refresh your plot device information before you use GetCanonicalMediaNames, GetPlotDeviceNames, or GetPlotStyleTableNames methods for a given AutoCAD session. After that, you need only refresh the information if some part of the device setup changes during the course of the session.


Regen method [ActiveX and VBA Reference: AAR]

Regen Method

Regenerates the entire drawing and recomputes the screen coordinates and view resolution for all objects.

See Also | Example

Signature

object.Regen WhichViewports

Object

Document
The object or objects this method applies to.

WhichViewports

Integer; input-only

acActiveViewport | Regenerates only the active viewport.
acAllViewports | Regenerates all viewports on the document.

Remarks

Regen also reindexes the drawing database for optimum display and better object selection performance.


Reload method [ActiveX and VBA Reference: AAR]

Reload Method

Reloads the external reference (xref).

See Also | Example

Signature

object.Reload

Object

Block
The object or objects this method applies to.

Remarks

When you reload an xref, the most recently saved version of the referenced drawing is loaded into the current drawing.


Remove method [ActiveX and VBA Reference: AAR]

Remove Method

Removes a named object from the dictionary.

See Also | Example

Signature

object.Remove Name

Object

Dictionary
The object or objects this method applies to.

Name

String; input-only
The name (keyword) of the object to be removed from the dictionary.

Remarks

For example, removing the object with the name "FirstKeyword" from the following dictionary:

MyDictionary

Keyword Object

FirstKeyword Object1

SecondKeyword Object2

results in the following dictionary:

MyDictionary

Keyword Object

SecondKeyword Object2


RemoveAllOverrides method [ActiveX and VBA Reference: AAR]

RemoveAllOverrides Method

Removes all the overrides for a cell.

See Also | Example

Signature

object.RemoveAllOverrides nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.


RemoveCustomByIndex method [ActiveX and VBA Reference: AAR]

RemoveCustomByIndex Method

Deletes the custom property name (key) and value that correspond to an index value.

See Also | Example

Signature

object.RemoveCustomByIndex(Index)

Object

SummaryInfo
The object or objects this method applies to.

Index

Long; the index value of the property you want to delete. The index range is from zero to one less than the number of custom properties.


RemoveCustomByKey method [ActiveX and VBA Reference: AAR]

RemoveCustomByKey Method

Deletes the custom property value that corresponds to a name (key) value.

See Also | Example

Signature

object.RemoveCustomByKey(key)

Object

SummaryInfo
The object or objects this method applies to.

key

String; the name of the custom property that you want to delete.


RemoveDataLink method [ActiveX and VBA Reference: AAR]

RemoveDataLink Method

Removes the data link for the specified cell.

See Also | Example

Signature

object.RemoveDataLink nRow, nCol

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.


RemoveEntry method [ActiveX and VBA Reference: AAR]

RemoveEntry Method

Removes an identified entry from the File Dependency List.

See Also | Example

Signature

object.RemoveEntry (Index, forceRemove)

object

FileDependencies
The object or objects this method applies to.

Index

Long; index of the entry to remove.

forceRemove

Boolean; true removes an entry with multiple references regardless of its reference count; false removes it only if the reference count is zero.


RemoveFromMenuBar method [ActiveX and VBA Reference: AAR]

RemoveFromMenuBar Method

Removes the popup menu from the AutoCAD menu bar.

See Also | Example

Signature

object.RemoveFromMenuBar

Object

PopupMenu
The object or objects this method applies to.


RemoveItems method [ActiveX and VBA Reference: AAR]

RemoveItems Method

Removes specified items from the group or selection set.

See Also | Example

Signature

object.RemoveItems Objects

Object

Group, SelectionSet
The object or objects this method applies to.

Objects

Variant (array of objects); input-only
An array of objects to be removed.

Remarks

Items removed from a group or selection set remain in the drawing; they are simply no longer associated to the group or selection set. This functionality mimics the functionality found in the Clear method, except that RemoveItems allows you to specify individual items to be removed instead of the entire selection set.

This method differs from the Delete and Erase methods in that it does not remove objects from the drawing.


RemoveMenuFromMenuBar method [ActiveX and VBA Reference: AAR]

RemoveMenuFromMenuBar Method

Removes the popup menu, as specified from the collection, from the AutoCAD menu bar.

See Also | Example

Signature

object.RemoveMenuFromMenuBar Index

Object

PopupMenus
The object or objects this method applies to.

Index

Variant; input-only
The index in the menu bar of the popup menu to remove. The index must be either an integer or a string. If an integer, the index must be between 0 and N-1, where N is the number of popup menus in the menu bar. If a string, the name of the popup menu must contain any underscore that appears in the menu.


RemoveVertex method [ActiveX and VBA Reference: AAR]

RemoveVertex method

Removes a vertex in the section line.

See Also | Example

Signature

object.RemoveVertex nIndex

object

Section
The object or objects to which this method applies.

nIndex

Integer; input-only
The index of the vertex to be removed.


Rename method [ActiveX and VBA Reference: AAR]

Rename Method

Renames an item in a dictionary or a set of saved layer settings.

See Also | Example

Signature

object.Rename OldName, NewName

Object

Dictionary or LayerStateManager
The object or objects this method applies to.

OldName

String; input-only
The current name (keyword) of the object in the dictionary, or the name of a set of saved layer settings.

NewName

String; input-only
The new name (keyword) for the object in the dictionary, or the new name of the saved layer settings.


RenameCellStyle method [ActiveX and VBA Reference: AAR]

RenameCellStyle Method

Renames a cell style.

See Also | Example

Signature

object.RenameCellStyle(StringOldName, StringNewName)

Object

TableStyle
The object or objects this method applies to.

StringOldName

String; Input
Old cell style name.

StringNewName

String; Input
New cell style name.


RenameProfile method [ActiveX and VBA Reference: AAR]

RenameProfile Method

Renames the specified profile.

See Also | Example

Signature

object.RenameProfile origProfileName, newProfileName

Object

PreferencesProfiles
The object or objects this method applies to.

origProfileName

String; input-only
The current profile name.

newProfileName

String; input-only
The new name for the profile.


Replace method [ActiveX and VBA Reference: AAR]

Replace Method

Replaces an item in the dictionary by a given item.

See Also | Example

Signature

object.Replace Name, NewObject

Object

Dictionary
The object or objects this method applies to.

Name

String; input-only
The name (keyword) of the object to be replaced.

NewObject

Object; input-only
The new object.

Remarks

For example, "FirstKeyword," in the following dictionary:

MyDictionary

Keyword Object

FirstKeyword Object1

SecondKeyword Object2

has a new object, "NewObject," attached to it:

MyDictionary

Keyword Object

FirstKeyword NewObject

SecondKeyword Object2


ReselectSubRegion method [ActiveX and VBA Reference: AAR]

ReselectSubRegion Method

Returns subentities of a selection set in a table.

See Also | Example

Signature

object.ReselectSubRegion()

Object

Table
The object or objects this method applies to.

Remarks

This method reselects the current subselection (if any).


ResetBlock method [ActiveX and VBA Reference: AAR]

ResetBlock Method

Resets the dynamic block to the default state.

Signature

object.ResetBlock

object

BlockRef, MInsertBlock
The object or objects this method applies to.

Remarks

Note To access this method, use the IAcadBlockReference2 or IAcadMInsertBlock2 interface.


ResetCellValue method [ActiveX and VBA Reference: AAR]

ResetCellValue Method

Reset the cell value for the given row and column.

See Also | Example

Signature

object.ResetCellValue row, col

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.


ResetProfile method [ActiveX and VBA Reference: AAR]

ResetProfile Method

Resets the value in the specified profile to its default values.

See Also | Example

Signature

object.ResetProfile Profile

Object

PreferencesProfiles
The object or objects this property applies to.

Profile

String; input-only
The profile to reset.

Remarks

The specified profile must be the current active profile. To set a profile as the current active profile, use the ActiveProfile property.


Restore method [ActiveX and VBA Reference: AAR]

Restore Method

Restores a group of layer property settings.

See Also | Example

Signature

object.Restore Name

Object

LayerStateManager
A LayerStateManager object.

Name

String; input-only
The name of the saved layer settings to be restored.

Remarks

The LayerStateManager Restore method uses the Mask property associated with the saved settings to identify which layer properties are to be restored.


Reverse method [ActiveX and VBA Reference: AAR]

Reverse Method

Reverses the direction of a spline.

See Also | Example

Signature

object.Reverse

Object

Spline
The object or objects this method applies to.


Rotate method [ActiveX and VBA Reference: AAR]

Rotate Method

Rotates an object around a base point.

See Also | Example

Signature

object.Rotate BasePoint, RotationAngle

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

BasePoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the point through which the axis of rotation is defined as parallel to the Z axis of the UCS.

RotationAngle

Double; input-only
The angle in radians to rotate the object. This angle determines how far an object rotates around the base point relative to its current location.

Remarks


Rotate3d method [ActiveX and VBA Reference: AAR]

Rotate3D Method

Rotates an object around a 3D axis. Point1 and Point2 define the line that becomes the axis of rotation.

See Also | Example

Signature

object.Rotate3D Point1, Point2, RotationAngle

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the axis line.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the axis line.

RotationAngle

Double; input-only
The angle in radians to rotate the object about the selected axis.

Remarks


RunMacro method [ActiveX and VBA Reference: AAR]

RunMacro Method

Runs a VBA macro from the Application object.

See Also | Example

Signature

object.RunMacro(MacroPath)

Object

Application
The object or objects this method applies to.

MacroPath

String; input-only
A string representing the calling sequence of the macro to run. The calling sequence must have the following syntax, where [] represent optional parameters:

[Filename.dvb.][ProjectName.][ModuleName.]MacroName

NOTE: If Filename.dvb is followed by ProjectName, separate the names with an exclamation point instead of a period, as in the following example:

Filename.dvb!ProjectName

The Filename.dvb specified will be loaded if it is not already loaded. If the path to the Filename.dvb is not specified, the AutoCAD search path is searched to locate the file. If ProjectName is not specified, all currently loaded projects are searched to locate the macro.

Remarks

To associate a macro with a popup menu or toolbar item, use the Macro property.


Save method [ActiveX and VBA Reference: AAR]

Save Method

Saves a document or group of layer property settings; no longer supported for menu groups.

See Also | Example

Signatures: Overview

Document:

object.Save

MenuGroup:

no op

Layer Settings:

object.Save Name, Mask

Signatures: Detail

object.Save

Object

Document
Saves the specified document.

object.Save MenuFileType

Object

MenuGroup
The object or objects this method applies to.

Note This method has no effect for menu groups.

object.Save Name, Mask

Object

LayerStateManager
A LayerStateManager object.

Name

String; input-only
The name to be assigned to the saved layer settings.

Mask

enum; input-only
A number representing the layer properties to be saved and restored. Use the following constants to identify layer properties:

acLsAll | All layer properties
acLsColor | Color
acLsFrozen | Frozen or thawed
acLsLineType | Linetype
acLsLineWeight | Lineweight
acLsLocked | Locked or unlocked
acLsNewViewport | New viewport layers frozen or thawed
acLsNone | None
acLsOn | On or off
acLsPlot | Plotting on or off
acLsPlotStyle | Plot style

Remarks

When you save a document to a secure URL, a dialog box prompts the user for the necessary password information.

Menu groups cannot be saved in AutoCAD 2006. This method will be removed from the MenuGroup object in a future release.


SaveAs method [ActiveX and VBA Reference: AAR]

SaveAs Method

Saves the document to a specified file; no longer supported for menu groups.

See Also | Example

Signatures

object.SaveAs FileName, FileType [, SecurityParams]

Object

Document, MenuGroup
The object or objects this method applies to.

Note This method has no effect for menu groups.

FileName

String; input-only
The full path and file name, or valid URL address, for the file. The active document takes on the new name.

FileType

AcSaveAsType enum; input-only; optional for Document objects

acR14_dwg | AutoCAD R14 DWG (*.dwg)
ac2000_dwg | AutoCAD 2000 DWG (*.dwg)
ac2000_dxf | AutoCAD 2000 DXF (*.dxf)
ac2000_Template | AutoCAD 2000 Drawing Template File (*.dwt)
ac2004_dwg | AutoCAD 2004 DWG (*.dwg)
ac2004_dxf | AutoCAD 2004 DXF (*.dxf)
ac2004_Template | AutoCAD 2004 Drawing Template File (*.dwt)
ac2007_dwg | AutoCAD 2007 DWG (*.dwg)
ac2007_dxf | AutoCAD 2007 DXF (*.dxf)
ac2007_Template | AutoCAD 2007 Drawing Template File (*.dwt)
acNative | A synonym for the latest drawing release. In this release, this value equals ac2007_dwg.

SecurityParams

SecurityParams object; variant; optional for Document objects
Security settings for an encrypted drawing.

Remarks

The default file type for documents is ac2007_dwg. The value acR14_dxf is obsolete.

Documents can be saved only as files with the extensions indicated above. To save a document in a different file type, use the Export method.

When saving to a secure URL, a dialog box prompts the user for the necessary password information. Message boxes appear if the user has not suppressed this activity in the browser.

Menu groups cannot be saved in AutoCAD 2006 and later releases. This method will be removed from the MenuGroup object in a future release.


ScaleEntity method [ActiveX and VBA Reference: AAR]

ScaleEntity Method

Scales an object equally in the X, Y, and Z directions.

See Also | Example

Signature

object.ScaleEntity BasePoint, ScaleFactor

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

BasePoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the base point.

ScaleFactor

Double; input-only
The factor by which to scale the object. The dimensions of the object are multiplied by the scale factor. A scale factor greater than 1 enlarges the object. A scale factor between 0 and 1 reduces the object. The scale factor must be greater than 0.0.

Remarks

BasePoint |
 | ScaleFactor = 0.5 and ScaleFactor = 2


SectionSolid method [ActiveX and VBA Reference: AAR]

SectionSolid Method

Creates a region that represents the intersection of a plane defined by three points and the solid.

See Also | Example

Signature

RetVal = object.SectionSolid (Point1, Point2, Point3)

Object

3DSolid
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point.

Point3

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the third point.

RetVal

Region object
The resulting section as a region.

Remarks


Select method [ActiveX and VBA Reference: AAR]

Select Method

Selects objects and places them into a selection set.

See Also | Example

Signature

object.Select Mode[, Point1][, Point2][, FilterType][, FilterData]

Object

SelectionSet
The object or objects this method applies to.

Mode

AcSelect enum; input-only

acSelectionSetWindow

acSelectionSetCrossing

acSelectionSetPrevious

acSelectionSetLast

acSelectionSetAll

Point1

Variant (array of doubles); input-only; optional
The 3D WCS coordinates, or array of coordinates, specifying Point1. See the mode definitions for the proper use of Point1.

Point2

Variant (three-element array of doubles); input-only; optional
The 3D WCS coordinates specifying Point2. See the mode definitions for the proper use of Point2.

FilterType

Integer; input-only; optional
A DXF group code specifying the type of filter to use.

FilterData

Variant; input-only; optional
The value to filter on.

Remarks

This method supports the filtering mechanism.

The following selection modes are available:

Window

Selects all objects completely inside a rectangular area whose corners are defined by Point1 and Point2.

Crossing

Selects objects within and crossing a rectangular area whose corners are defined by Point1 and Point2.

Previous

Selects the most recent selection set. This mode is ignored if you switch between paper space and model space and attempt to use the selection set.

Last

Selects the most recently created visible objects.

All

Selects all objects.

For more selection mode options, see the SelectByPolygon, SelectAtPoint, and SelectOnScreen methods.


Select method [ActiveX and VBA Reference: AAR]

Select Method

Selects a cell in a table.

See Also | Example

Signature

object.Select(wpt, wvwVec, wvwxvec, wxaper, wyaper, allowOutside, resultRowIndex, resultColumnIndex)

Object

Table
The object or objects this method applies to.

wpt

Variant
3D point in WCS specifying the input pick point.

wvwVec

Variant
3D vector in WCS specifying the view direction for the hit test.

wvwxvec

Variant
3D vector in WCS specifying the view orientation for the hit test.

wxaper

Double
Width of aperture box centered at the hit point for the hit test; reserved for future use.

wyaper

Double
Height of aperture box centered at the hit point for the hit test; reserved for future use.

allowOutside

Boolean
Indicates whether a pick point outside the table will select a cell.

resultRowIndex

Long
Row index of the selected cell.

resultColumnIndex

Long
Column index of the selected cell.

Remarks

This function selects a cell in the table by specifying a point, viewing direction, and orientation. The row and column index of the selected cell are returned in resultRowIndex and resultColumnIndex.


SelectAtPoint method [ActiveX and VBA Reference: AAR]

SelectAtPoint Method

Selects an object passing through a given point and places it into a selection set.

See Also | Example

Signature

object.SelectAtPoint Point, FilterType, FilterData

Object

SelectionSet
The object or objects this method applies to.

Point

Variant (three-element array of doubles); input-only
The 3D UCS coordinates specifying the point to use for the selection.

FilterType

Integer; input-only; optional
A DXF group code specifying the type of filter to use.

FilterData

Variant; input-only; optional
The value to filter on.

Remarks

This method supports the filtering mechanism.

The PICKBOX system variable affects object selection.

For more selection mode options, see the Select, SelectByPolygon, and SelectOnScreen methods.


SelectByPolygon method [ActiveX and VBA Reference: AAR]

SelectByPolygon Method

Selects objects within a fence and adds them to the selection set.

See Also | Example

Signature

object.SelectByPolygon Mode, PointsList, FilterType, FilterData

Object

SelectionSet
The object or objects this method applies to.

Mode

AcSelect enum; input-only

acSelectionSetFence

acSelectionSetWindowPolygon

acSelectionSetCrossingPolygon

PointsList

Variant (array of doubles); input-only
An array of 3D WCS coordinates specifying the selection fence.

FilterType

Integer; input-only; optional
A DXF group code specifying the type of filter to use.

FilterData

Variant; input-only; optional
The value to filter on.

Remarks

The following selection modes are available:

Fence

Selects all objects crossing a selection fence. The fence is defined by coordinates in Point1.

WindowPolygon

Selects objects within a polygon defined by Point1.

CrossingPolygon

Selects objects within and crossing an area defined by a polygon. Use Point1 to define the coordinates of the polygon. AutoCAD will close the last vector of the polygon. A polygon definition cannot cross itself.

This method supports the filtering mechanism.

For more selection mode options, see the Select, SelectAtPoint, and SelectOnScreen methods.


SelectOnScreen method [ActiveX and VBA Reference: AAR]

SelectOnScreen Method

Prompts the user to pick an object from the screen.

See Also | Example

Signature

object.SelectOnScreen [FilterType][, FilterData]

Object

SelectionSet
The object or objects this method applies to.

FilterType

Integer; input-only; optional
A DXF group code specifying the type of filter to use.

FilterData

Variant; input-only; optional
The value to filter on.

Remarks

This method supports the filtering mechanism.

AutoCAD's default prompt for picking an object will be used automatically.

For more selection mode options, see the Select, SelectByPolygon, and SelectAtPoint methods.


SelectSubRegion method [ActiveX and VBA Reference: AAR]

SelectSubRegion Method

Selects a set of cells in a table.

See Also | Example

Signature

object.SelectSubRegion(wpt1, wpt2, wvwVec, wvwxVec, seltype, bIncludeCurrentSelection, rowMin, rowMax, colMin, colMax)

Object

Table
The object or objects this method applies to.

wpt1

Variant
3D point in WCS specifying the first corner point of the window box selection.

wpt2

Variant
3D point in WCS specifying the second corner point of the window box selection.

wvwvec

Variant
3D vector in WCS specifying the view direction of the selection.

wvwxvec

Variant
3D vector in WCS specifying the view orientation of the hit test.

seltype

AcSelectType enum; the selection type

acCrossing | Cross-selection type.
acWindow | Window-selection type.

bincludecurrentselection

Boolean
Indicates whether the selected cells returned will include currently selected cells and newly selected cells or only newly selected cells.

rowMin

Long
Zero-based lower bound of row index.

rowMax

Long
Zero-based upper bound of row index.

colMin

Long
Zero-based lower bound of column index.

colMax

Long
Zero-based upper bound of column index.

Remarks

The row and column index of the upper and lower bounds of the selected region are returned in rowMin, rowMax, colMin, and colMax.


SendCommand method [ActiveX and VBA Reference: AAR]

SendCommand Method

Sends a command string from a VB or VBA application to the document for processing.

See Also | Example

Signature

object.SendCommand(Command)

Object

Document
The object or objects this method applies to.

Command

String; input-only
The command to send to the document.

Remarks

Use a space or the ASCII carriage return character (vbCr) at the end of the command string to end the command; this is equivalent to pressing ENTER on the keyboard.

This method processes any AutoCAD command-line function, including LISP expressions.

If the drawing specified is not active, it will be made active.

This method is generally synchronous. However, if the command sent with this method requires any user interaction (such as picking a point on the screen) then this method will continue as soon as the user input begins. The command will then continue to be processed asynchronously.

When this method is called from an event handler it is processed asynchronously.

You should never use this method to issue a command for which there is an ActiveX method available. For example, do not use SendCommand "VBALOAD ". Instead, use the LoadDVB method.


SendModelessOperationEnded method [ActiveX and VBA Reference: AAR]

SendModelessOperationEnded Method

Indicates a modeless operation has ended.

Signature

object.SendModelessOperationEnded(Context)

object

Utility
The object or objects this method applies to.

Context

String

Remarks

Note To access this method, use the IAcadUtility2 interface.


SendModelessOperationStart method [ActiveX and VBA Reference: AAR]

SendModelessOperationStart Method

Indicates a modeless operation will start.

Signature

object.SendModelessOperationStart(Context)

object

Utility
The object or objects this method applies to.

Context

String

Remarks

Note To access this method, use the IAcadUtility2 interface.


SetAlignment method [ActiveX and VBA Reference: AAR]

SetAlignment Method

Sets a cell alignment for the specified row types.

See Also | Example

Signature

object.SetAlignment(rowTypes, cellAlignment)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change

cellAlignment

AcCellAlignment enum; the alignment to use for the row types

acBottomCenter | Centers text at a point based on the bottom of the text.
acBottomLeft | Left-justifies text at a point based on the bottom of the text.
acBottomRight | Right-justifies text at a point based on the bottom of the text.
acMiddleCenter | Centers text at a point based on the middle of the text.
acMiddleLeft | Left-justifies text at a point based on the middle of the text.
acMiddleRight | Right-justifies text at a point based on the middle of the text.
acTopCenter | Centers text at a point based on the top of the text.
acTopLeft | Left-justifies text at a point based on the top of the text.
acTopRight | Right-justifies text at a point based on the top of the text.


SetAlignment2 method [ActiveX and VBA Reference: AAR]

SetAlignment2 Method

Sets the cell alignment.

See Also | Example

Signature

object.SetAlignment2 bstrCellStyle, cellAlignment

Object

Table, TableStyle
The objects this method applies to.

bstrCellStyle

String; Input-only
The cell style which needs an aligment change.

cellAlignment

AcCellAlignment; Input-only
The new cell alignment.


SetAutoScale method [ActiveX and VBA Reference: AAR]

SetAutoScale Method

Sets the value specifying whether auto scale is used in the specified row and column.

See Also | Example

Signature

object.SetAutoScale(row, col, vValue)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

bValue

Boolean; indicates whether auto scale is used


SetAutoScale2 method [ActiveX and VBA Reference: AAR]

SetAutoScale2 Method

Sets the auto-scale flag value for a cell.

See Also | Example

Signature

object.SetAutoScale2 nRow, nCol, nContent, bAutoFit

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

bAutoFit

VARIANT_BOOL; Input-only
The new flag value.


SetBackgroundColor method [ActiveX and VBA Reference: AAR]

SetBackgroundColor Method

Sets a background color value for the specifed row types.

See Also | Example

Signature

object.SetBackgroundColor(rowTypes, pColor)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change.

pColor

AcCmColor object
AutoCAD true color object.


SetBackgroundColorNone method [ActiveX and VBA Reference: AAR]

SetBackgroundColorNone Method

Sets the value specifying whether there is no background color for the specified row types.

See Also | Example

Signature

object.SetBackgroundColorNone(rowTypes, bValue)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change.

bValue

Boolean; the value specifying whether there is no background color for the specified row types.


SetBitmaps method [ActiveX and VBA Reference: AAR]

SetBitmaps Method

Sets the large and small bitmaps used as icons for the toolbar item.

See Also | Example

Signature

object.SetBitmaps(SmallIconName, LargeIconName)

object

ToolbarItem
The object or objects this method applies to.

SmallIconName

String; input-only
The path and file name for the small bitmap.

LargeIconName

String; input-only
The path and file name for the large bitmap.


SetBlockAttributeValue method [ActiveX and VBA Reference: AAR]

SetBlockAttributeValue Method

Sets the attribute value in block content with attribute definition id.

See Also | Example

Signature

object.SetBlockAttributeValue attdefId, value

Object

MLeader
The object or objects this method applies to.

attdefID

Long; Input-only
The attribute definition ID.

value

String; Input-only
The new attribute value.


SetBlockAttributeValue method [ActiveX and VBA Reference: AAR]

SetBlockAttributeValue Method

Sets the attribute value of the specified cell for the attribute definition object that is contained in the block.

See Also | Example

Signature

object.SetBlockAttributeValue(row, col, attdefId, StringValue)

Object

Table
The object or objects this method applies to.

row

Integer; the row

col

Integer; the column

attdefId

Long_PTR; the object ID

StringValue

String; the attribute value


SetBlockAttributeValue2 method [ActiveX and VBA Reference: AAR]

SetBlockAttributeValue2 Method

Sets the attribute value associated to a specifed block cell.

See Also | Example

Signature

object.SetBlockAttributeValue2 nRow, nCol, nContent, blkId, value

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

blkId

Long_PTR; Input-only
The block table record object id to check.

value

String; Input-only
The attribute value to set.


SetBlockAttributeValue32 method [ActiveX and VBA Reference: AAR]

SetBlockAttributeValue32 Method

For a 64-Bit system, sets a block cell's attribute value.

See Also | Example

Signature

object.SetBlockAttributeValue32 nRow, nCol, nContent, blkId, value

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

blkId

Long; Input-only
The value of the block table record.

value

String; Input-only
The new attribute.


SetBlockAttributeValue32 method [ActiveX and VBA Reference: AAR]

SetBlockAttributeValue32 Method

For a 64-Bit system, sets the attribute value in block content with attribute definition id.

See Also | Example

Signature

object.SetBlockAttributeValue32 attdefId, value

Object

MLeader
The object this method applies to.

attdefID

Long; Input-only
The attribute definition ID.

value

String; Input-only
The new attribute value.


SetBlockRotation method [ActiveX and VBA Reference: AAR]

SetBlockRotation Method

Sets the block rotation angle for the specified row and column.

See Also | Example

Signature

object.SetBlockRotation(row, col, blkRotation)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

blkRotation

Double; the block rotation angle


SetBlockScale method [ActiveX and VBA Reference: AAR]

SetBlockScale Method

Sets the block scale value for the specified row and column.

See Also | Example

Signature

object.SetBlockScale(row, col, blkScale)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

blkScale

Double; the block scale


SetBlockTableRecordId method [ActiveX and VBA Reference: AAR]

SetBlockTableRecordId Method

Sets the block table record ID of the cell.

See Also | Example

Signature

object.SetBlockTableRecordId(row, col, blkId, bAutoFit)

Object

Table
The object or objects this method applies to.

row

Integer; the row

col

Integer; the column

blkId

Long_PTR; the block ID

bAutoFit

Boolean; indicates whether auto fit is used


SetBlockTableRecordId2 method [ActiveX and VBA Reference: AAR]

SetBlockTableRecordId2 Method

Sets the block table record object id associated to a specifed cell.

See Also | Example

Signature

object.SetBlockTableRecordId2 nRow, nCol, nContent, blkId, autoFit

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

blkId

Long_PTR; Input-only
The block table record object id to set.

autoFit

VARIANT_BOOL; Input-only
The flag which indicates whether to auto fit the block at the specified cell.


SetBlockTableRecordId32 method [ActiveX and VBA Reference: AAR]

SetBlockTableRecordId32 Method

For a 64-Bit system, sets a cell's block table record id.

See Also | Example

Signature

object.SetBlockTableRecordId32 nRow, nCol, nContent, blkId, autoFit

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

blkId

Long; Input-only
The new block table record.

autoFit

VARIANT_BOOL; Input-only
The flag indicating whether to auto fit the block Integero the specified cell.


SetBreakHeight method [ActiveX and VBA Reference: AAR]

SetBreakHeight Method

Set a table's break height.

See Also | Example

Signature

object.SetBreakHeight nIndex, pHeight

Object

Table
The object this method applies to.

nIndex

Integer; Input-only
The index of the table.

height

Double; Input-only
The new height value.


SetBulge method [ActiveX and VBA Reference: AAR]

SetBulge Method

Sets the bulge for the polyline at the given index.

See Also | Example

Signature

object.SetBulge Index, Value

Object

LightweightPolyline, Polyline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the vertex you wish to set. The first vertex is index 0.

Value

Double
The bulge value for the vertex at the given index.

Remarks

Polyline: this method will fail if the polyline Type property is not acSimplePoly.

The bulge is the tangent of 1/4 of the included angle for the arc between the selected vertex and the next vertex in the polyline's vertex list. A negative bulge value indicates that the arc goes clockwise from the selected vertex to the next vertex. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.


SetCellAlignment method [ActiveX and VBA Reference: AAR]

SetCellAlignment Method

Sets the cell alignment for the specified row and column.

See Also | Example

Signature

object.SetCellAlignment(row, col, cellAlignment)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

cellAlignment

AcCellAlignment enum; the cell alignment

acBottomCenter

acBottomLeft

acBottomRight

acMiddleCenter

acMiddleLeft

acMiddleRight

acTopCenter

acTopLeft

acTopRight


SetCellBackgroundColor method [ActiveX and VBA Reference: AAR]

SetCellBackgroundColor Method

Sets the background true color value for the specified row and column.

See Also | Example

Signature

object.SetCellBackgroundColor(row, col, pColor)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

pColor

AcCmColor object
AutoCAD true color object.


SetCellBackgroundColorNone method [ActiveX and VBA Reference: AAR]

SetCellBackgroundColorNone Method

Sets the value specifying that there is no background color for the specified row and column.

See Also | Example

Signature

object.SetCellBackgroundColorNone(row, col, bValue)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

bValue

Boolean
Indicates whether there is a background color.


SetCellClass method [ActiveX and VBA Reference: AAR]

SetCellClass Method

Sets the class of a cell style.

See Also | Example

Signature

object.SetCellClass (StringCellStyle, cellClass)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

cellClass

Integer; Input
Cell style class.


SetCellContentColor method [ActiveX and VBA Reference: AAR]

SetCellContentColor Method

Sets the true color value for the content of the specified row and column.

See Also | Example

Signature

object.SetCellContentColor(row, col, pColor)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

pColor

AcCmColor object
AutoCAD true color object.


SetCellContentColor2 method [ActiveX and VBA Reference: AAR]

SetCellContentColor2 Method

Sets the true color vlaue for a cell.

See Also | Example

Signature

object.SetCellContentColor2 nRow, nCol, nContent, pColor

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

pColor

AcCmColor object
The new color value.


SetCellDataType method [ActiveX and VBA Reference: AAR]

SetCellDataType Method

Sets the cell data and unit type for the given row and column.

See Also | Example

Signature

object.SetCellDataType row, col, dataType, unitType

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

pDataType

AcValueDataType; Input-only
The new cell data type.

pUnitType

AcValueUnitType; Input-only
The new cell unit type.


SetCellFormat method [ActiveX and VBA Reference: AAR]

SetCellFormat Method

Sets the cell format for the given row and column.

See Also | Example

Signature

object.SetCellFormat row, col, pFormat

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

pFormat

String; Input-only
The new cell format.


SetCellGridColor method [ActiveX and VBA Reference: AAR]

SetCellGridColor Method

Sets the grid color value for an edge of the specified row and column.

See Also | Example

Signature

object.SetCellGridColor(row, col, edges, pColor)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

edges

Long; the edges

pColor

AcCmColor object
AutoCAD true color object.


SetCellGridLineWeight method [ActiveX and VBA Reference: AAR]

SetCellGridLineWeight Method

Sets the grid lineweight value for an edge of the specified row and column.

See Also | Example

Signature

object.SetCellGridLineWeight(row, col, edges, Lineweight)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

edges

Long; the edges

Lineweight

ACAD_LWEIGHT enum

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault


SetCellGridVisibility method [ActiveX and VBA Reference: AAR]

SetCellGridVisibility Method

Sets the grid visibility value for an edge of the specified row and column.

See Also | Example

Signature

object.SetCellGridVisibility(gridLineTypes, rowTypes, bValue)

Object

Table
The object or objects this method applies to.

gridLineTypes

Long; the line types

rowTypes

Long; the row types

bValue

Boolean; indicates whether the grid is visible


SetCellState method [ActiveX and VBA Reference: AAR]

SetCellState Method

Set a cell's state.

See Also | Example

Signature

object.SetCellState nRow, nCol, nLock

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nLock

AcCellState; Input-only
The new cell state.


SetCellStyle method [ActiveX and VBA Reference: AAR]

SetCellStyle Method

Sets the cell style.

See Also | Example

Signature

object.SetCellStyle nRow, nCol, szCellStyle

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

szCellStyle

String; Input-only
The cell style to set.


SetCellTextHeight method [ActiveX and VBA Reference: AAR]

SetCellTextHeight Method

Sets the text height for the specified row and column.

See Also | Example

Signature

object.SetCellTextHeight(row, col, TextHeight)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

TextHeight

Double; the text height


SetCellTextStyle method [ActiveX and VBA Reference: AAR]

SetCellTextStyle Method

Sets the text style name for the specified row and column.

See Also | Example

Signature

object.SetCellTextStyle(row, col, bstrName)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

bstrName

String; the text style


SetCellType method [ActiveX and VBA Reference: AAR]

SetCellType Method

Sets the cell type for the specified row and column.

See Also | Example

Signature

object.SetCellType(row, col, CellType)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

CellType

AcCellType enum; the cell type

acBlockCell

acTextCell

acUnknownCell


SetCellValue method [ActiveX and VBA Reference: AAR]

SetCellValue Method

Sets the cell value for the given row and column.

See Also | Example

Signature

object.SetCellValue row, col, val

Object

Table
The object this method applies to.

row

Integer; Input-only
The row number of the cell to set.

col

Integer; Input-only
The column number of the cell to set.

val

VARIANT; Output-only
The new cell value.


SetColor method [ActiveX and VBA Reference: AAR]

SetColor Method

Sets the true color value for the specified row types.

See Also | Example

Signature

object.SetColor(rowTypes, pColor)

Object

TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change.

pColor

AcCmColor object
AutoCAD true color object.


SetColorBookColor method [ActiveX and VBA Reference: AAR]

SetColorBookColor Method

Specifies the color name from an existing color book.

See Also | Example

Signature

object.SetColorBookColor (ColorName, ColorBook)

object

AcCmColor
The object or objects this method applies to.

ColorName

String; the name of the color.

ColorBook

String; the file name of the color book.


SetColumnName method [ActiveX and VBA Reference: AAR]

SetColumnName Method

Sets a column's name.

See Also | Example

Signature

object.SetColumnName nIndex, name

Object

Table
The object this method applies to.

nIndex

Integer; Input-only
The index of the column.

name

String; Input-only
The new name.


SetColumnWidth method [ActiveX and VBA Reference: AAR]

SetColumnWidth Method

Sets the column width for the column at the specified column index in the table.

See Also | Example

Signature

object.SetColumnWidth(col, Width)

Object

Table
The object or objects this method applies to.

col

Long; the column

Width

Double; the width


SetContentColor method [ActiveX and VBA Reference: AAR]

SetContentColor Method

Sets the true color value for the specified row types.

See Also | Example

Signature

object.SetContentColor(rowTypes, pColor)

Object

Table
The object or objects this method applies to.

rowTypes

Long; the row types

pColor

AcCmColor object
AutoCAD true color object.


SetContentLayout method [ActiveX and VBA Reference: AAR]

SetContentLayout Method

Set a cell's content layout.

See Also | Example

Signature

object.SetContentLayout nRow, nCol, nLayout

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nLayout

AcCellContentLayout; Input-only
The new layout value.


SetControlPoint method [ActiveX and VBA Reference: AAR]

SetControlPoint Method

Sets the control point of the spline at a given index.

See Also | Example

Signature

object.SetControlPoint Index, Value

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the control point you wish to set. The first control point is index 0.

Value

Variant (three-element array of doubles)
The 3D WCS coordinates specifying the control point for the spline at the given index location.


SetCustomByIndex method [ActiveX and VBA Reference: AAR]

SetCustomByIndex Method

Sets the custom property name (key) and value that correspond to an index value.

See Also | Example

Signature

object.SetCustomByIndex(Index, key, Value)

Object

SummaryInfo
The object or objects this method applies to.

Index

Long; the index value of the property. The index range is from zero to one less than the number of custom properties.

key

String; the custom property name for the index value.

Value

String; the custom property value for the index value.


SetCustomByKey method [ActiveX and VBA Reference: AAR]

SetCustomByKey Method

Sets the custom property value that corresponds to a name (key) value.

See Also | Example

Signature

object.SetCustomByKey(key, pValue)

Object

SummaryInfo
The object or objects this method applies to.

key

String; the name of the custom property.

pValue

String; the value for the custom property name.


SetCustomData method [ActiveX and VBA Reference: AAR]

SetCustomData Method

Sets the custom data associated to a cell.

See Also | Example

Signature

object.SetCustomData nRow, nCol, szKey, data

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

szKey

String; Input-only
The input key of the AcDbEvalContextPair

data

VARIANT; Input-only
The custom data to store.


SetCustomScale method [ActiveX and VBA Reference: AAR]

SetCustomScale Method

Sets the custom scale for a layout or plot configuration.

See Also | Example

Signature

object.SetCustomScale(Numerator, Denominator)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

Numerator

Double; input-only
A positive number representing the numerator in the scale ratio. This value represents the number of inches or mm for the scale.

Denominator

Double; input-only
A positive number representing the denominator in the scale ratio. This value represents the number of drawing units for the scale.

Remarks

The units for the Numerator parameter can be found in the PaperUnits property.

The Numerator and Denominator values must be greater than zero.

Changes made by this method will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


SetDatabase method [ActiveX and VBA Reference: AAR]

SetDatabase Method

Associates an AutoCAD database with the LayerStateManager object.

See Also | Example

Signature

object.SetDatabase Database

Object

LayerStateManager
A LayerStateManager object.

Database

Database object; read-only
The Database object to be associated with the LayerStateManager object.


SetDataFormat method [ActiveX and VBA Reference: AAR]

SetDataFormat Method

Sets a cell's format.

See Also | Example

Signature

object.SetDataFormat nRow, nCol, nContent, szFormat

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

szFormat

String; Input-only
A string holding the value.


SetDataLink method [ActiveX and VBA Reference: AAR]

SetDataLink Method

Sets the data link for the specified cell.

See Also | Example

Signature

object.SetDataLink nRow, nCol, idDataLink, bUpdate

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

idDataLink

Long_PTR; Input-only
The data link to set.

bUpdate

VARIANT_BOOL; Input-only
The update flag; set to true if the data link is to be updated after setting it.


SetDataLink32 method [ActiveX and VBA Reference: AAR]

SetDataLink32 Method

For a 64-Bit system, sets the data link for a cell.

See Also | Example

Signature

object.SetDataLink32 nRow, nCol, idDataLink, bUpdate

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

idDataLink

Long; Input-only
The new data link.

bUpdate

VARIANT_BOOL; Input-only
The flag indicating if the data link has is to be updated after setting it.


SetDataType method [ActiveX and VBA Reference: AAR]

SetDataType method

Sets the data type and unit type for the specifed row type.

See Also | Example

Signature

object.SetDataType rowTypes, nDataType, nUnitType

object

TableStyle
The object or objects to which this method applies.

rowTypes

Integer; input-only

nDataType

AcValueDataType; input-only

acUnknownDataType

acLong

acDouble

acString

acDate

acPoint2d

acPoint3d

acObjectId

acBuffer

acResbuf

acGeneral

nUnitType

AcValueUnitType; input-only
Can be one of the following values:

acUnitless

acUnitDistance

acUnitAngle

acUnitArea

acUnitVolume


SetDataType2 method [ActiveX and VBA Reference: AAR]

SetDataType2 Method

Sets the row data type and unit type for the specified row type and nContent.

See Also | Example

Signature

object.SetDataType2 nRow, nCol, nContent, dataType, unitType

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

dataType

AcValueDataType; Input-only
The new data type.

unitType

AcValueUnitType; Input-only
The new unit type.


SetFieldId method [ActiveX and VBA Reference: AAR]

SetFieldId Method

Sets the field object ID of the specified cell.

See Also | Example

Signature

object.SetFieldId(row, col, fieldId)

Object

Table
The object or objects this method applies to.

row

int; the zero-based row index for the cell

col

int; the zero-based column index for the cell

fieldId

LONG_PTR; the field object ID.


SetFieldId2 method [ActiveX and VBA Reference: AAR]

SetFieldId2 Method

Sets the field object id associated to a specifed cell.

See Also | Example

Signature

object.SetFieldId2 nRow, nCol, nContent, acDbObjectId, nflag

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

acDbObjectId

Long_PTR; Input-only
The field object id to set.

nflag

AcCellOption; Input-only
An exciting range of input values you can set.


SetFieldId232 method [ActiveX and VBA Reference: AAR]

SetFieldId232 Method

For a 64-Bit system, Sets a cell's field object id.

See Also | Example

Signature

object.SetFieldId232 nRow, nCol, nContent, acDbObjectId, nflag

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nContent

Integer; Input-only
The value of the content.

acDbObjectId

Long; Input-only
The new object id.

nflag

AcCellOption; Input-only
The update option flags.


SetFieldId32 method [ActiveX and VBA Reference: AAR]

SetFieldId32 Method

Sets the field object ID of the specified cell for a 64-bit system.

See Also | Example

Signature

object.SetFieldId32(row, col, fieldId)

Object

Table
The object or objects this method applies to.

row

Integer; the zero-based row index for the cell

col

Integer; the zero-based column index for the cell

fieldId

Long_PTR; the field object ID.


SetFitPoint method [ActiveX and VBA Reference: AAR]

SetFitPoint Method

Sets a fit point for the spline.

See Also | Example

Signature

object.SetFitPoint Index, Value

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The index location of the fit point you wish to set. The first fit point is index 0.

Value

Variant (three-element array of doubles)
The 3D WCS coordinates specifying the fit point for the spline at the given index location.


SetFont method [ActiveX and VBA Reference: AAR]

SetFont Method

Sets the definition data of the font for the TextStyle.

See Also | Example

Signature

RetVal = object.SetFont(Typeface, Bold, Italic, CharSet, PitchAndFamily)

Object

TextStyle
The object or objects this method applies to.

Typeface

String; input-only
The typeface (font name).

Bold

Boolean; input-only
Sets the TextStyle to bold.

TRUE: The TextStyle is bold.

FALSE: The TextStyle is not bold.

Italic

Boolean; input-only
Sets the TextStyle to italic.

TRUE: The TextStyle is italic.

FALSE: The TextStyle is not italic.

CharSet

Long; input-only
The character set for the font. (See the available values in the Remarks section.)

PitchAndFamily

Long; input-only
The pitch and family definitions for the font. (See the available values in the Remarks section.)

Remarks

The following section provides definitions for constants to use with this method. To use these constants, copy the definitions you need and paste them into the Declarations section of your application. A complete list of the constants that are available from Microsoft can be found in the file win32api.txt, which is provided with the Visual Basic Development Environment.

The CharSet parameter specifies the character set for the font. To use the following constants in your VB or VBA application, copy the definitions into the Declaration section of your code.

Public Const ANSI_CHARSET = 0
Public Const DEFAULT_CHARSET = 1
Public Const SYMBOL_CHARSET = 2
Public Const SHIFTJIS_CHARSET = 128
Public Const OEM_CHARSET = 255

The PitchAndFamily parameter specifies the pitch and family values for the font. The value is determined by a combination of three different settings. To provide the PitchAndFamily value, choose a setting from each of the categories, and then use the OR operator to combine them. A setting is required from the first two categories; the pitch and the family. The third category, the TrueType Flag, is only used when you are specifying a TrueType font.

To use the following constants in your VB or VBA application, copy the definitions into the Declaration section of your code.

' Pitch Values
Public Const DEFAULT_PITCH = 0
Public Const FIXED_PITCH = 1
Public Const VARIABLE_PITCH = 2
' Family Values
Public Const FF_DONTCARE = 0    '  Don't care or don't know.
Public Const FF_ROMAN = 16      '  Variable stroke width, serifed.
Public Const FF_SWISS = 32      '  Variable stroke width, sans-serifed.
Public Const FF_MODERN = 48     '  Constant stroke width, serifed or sans-serifed.
Public Const FF_SCRIPT = 64     '  Cursive, etc.
Public Const FF_DECORATIVE = 80 '  Old English, etc.
' TrueType Flag
Public Const TMPF_TRUETYPE = &H4


SetFormat method [ActiveX and VBA Reference: AAR]

SetFormat method

For internal use only.

See Also | Example

Signature

object.SetFormat rowTypes, val

object

TableStyle
The object or objects to which this method applies.

rowTypes

Long; input-only

val

String; input-only


SetFormat method [ActiveX and VBA Reference: AAR]

SetFormat Method

Sets the format for the specified row type.

See Also | Example

Signature

object.SetFormat rowTypes, pFormat

Object

Table, TableStyle
The objects this method applies to.

rowType

AcRowType; Input-only
The row type to check.

pFormat

String; Output-only
The format for the row.


SetFormat2 method [ActiveX and VBA Reference: AAR]

SetFormat2 Method

Sets the format of a cell style.

See Also | Example

Signature

object.SetFormat2 (StringCellStyle, StringFormat)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

pVal

String; Input
Cell style format.


SetFormula method [ActiveX and VBA Reference: AAR]

SetFormula Method

Set a cell's formula.

See Also | Example

Signature

object.SetFormula nRow, nCol, nContent, pszFormula

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nContent

Integer; Input-only
The value of the content.

pszFormula

String; Input-only
The new formula.


SetGridColor method [ActiveX and VBA Reference: AAR]

SetGridColor Method

Sets the grid color value for the specified grid linetypes and row types.

See Also | Example

Signature

object.SetGridColor(gridLineTypes, rowTypes, pColor)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineTypes

Long; the grid linetypes to change.
A combination of AcGridLineType enum values.

rowTypes

Long; the row types to change.
A combination of AcRowType enum values.

pColor

AcCmColor object
AutoCAD true color object.


SetGridColor2 method [ActiveX and VBA Reference: AAR]

SetGridColor2 Method

Sets the gridColor for the specified cell.

See Also | Example

Signature

object.SetGridColor2 nRow, nCol, nGridLineType, pColor

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

pColor

AcCmColor object
The new color.


SetGridDoubleLineSpacing method [ActiveX and VBA Reference: AAR]

SetGridDoubleLineSpacing Method

Sets the lineSpacing value for the specified cell.

See Also | Example

Signature

object.SetGridDoubleLineSpacing nRow, nCol, nGridLineType, fSpacing

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

fSpacing

Double; Input-only
The new spacing value.


SetGridLineStyle method [ActiveX and VBA Reference: AAR]

SetGridLineStyle Method

Set a cell's gridLineStyle.

See Also | Example

Signature

object.SetGridLineStyle nRow, nCol, nGridLineTypes, nLineStyle

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nGridLineType

AcGridLineType; Input-only
The cell's gridLineType.

nLineStyle

AcGridLineStyle; Input-only
The new gridLineStyle.


SetGridLinetype method [ActiveX and VBA Reference: AAR]

SetGridLinetype Method

Sets the object with the gridLinetype value for the specified cell.

See Also | Example

Signature

object.SetGridLinetype nRow, nCol, nGridLineType, idLinetype

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

idLinetype

Long_PTR; Input-only
The point which references to the object.


SetGridLinetype32 method [ActiveX and VBA Reference: AAR]

SetGridLinetype32 Method

For a 64-Bit system, sets an ojbect from a cell with a specific gridLineType.

See Also | Example

Signature

object.SetGridLinetype32 nRow, nCol, nGridLineType, idLinetype

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

nGridLineType

AcGridLineType; Input-only
The value of the gridLineType.

idLinetype

Long; Input-only
The new line type.


SetGridLineWeight method [ActiveX and VBA Reference: AAR]

SetGridLineWeight Method

Sets the grid lineweight value for the specified grid linetypes and row types.

See Also | Example

Signature

object.SetGridLineWeight(gridLineTypes, rowTypes, Lineweight)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineTypes

Long; the grid linetypes to change.
This parameter is a combination of AcGridLineType enum values.

rowTypes

Long; the row types to change.
This parameter is a combination of AcRowType enum values.

Lineweight

ACAD_LWEIGHT enum

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault


SetGridLineWeight2 method [ActiveX and VBA Reference: AAR]

SetGridLineWeight2 Method

Sets the gridLineWeight value for the specified cell.

See Also | Example

Signature

object.SetGridLineWeight2 nRow, nCol, nGridLineType, lineWeight

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

lineWeight

ACAD_LWEIGHT; Input-only
The new line weight.


SetGridSpacing method [ActiveX and VBA Reference: AAR]

SetGridSpacing Method

Sets the grid spacing for the viewport.

See Also | Example

Signature

object.SetGridSpacing XSpacing, YSpacing

Object

Viewport, PViewport
The object or objects this method applies to.

XSpacing

Double; input-only

YSpacing

Double; input-only


SetGridVisibility method [ActiveX and VBA Reference: AAR]

SetGridVisibility Method

Sets the grid visibility value for the specified grid linetype and row types.

See Also | Example

Signature

object.SetGridVisibility(gridLineTypes, rowTypes, bValue)

Object

Table, TableStyle
The object or objects this method applies to.

gridLineTypes

Long; the grid linetypes to change.
This parameter is a combination of AcGridLineType enum values.

rowTypes

Long; the row types to change.
This parameter is a combination of AcRowType enum values.

bValue

Boolean; the grid visibility value.


SetGridVisibility2 method [ActiveX and VBA Reference: AAR]

SetGridVisibility2 Method

Sets the gridVisibility value for the specified cell.

See Also | Example

Signature

object.SetGridVisibility2 nRow, nCol, nGridLineType, bVisible

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nGridLineType

AcGridLineType; Input-only
The grid line type to check.

bVisible

VARIANT_BOOL; Input-only
The new flag value.


SetInvisibleEdge method [ActiveX and VBA Reference: AAR]

SetInvisibleEdge Method

Sets the visibility state of an edge at a given index.

See Also | Example

Signature

object.SetInvisibleEdge Index, State

Object

3DFace
The object or objects this method applies to.

Index

Integer; input-only
An index specifying the edge to set. The index must be between 0 and 3 inclusive.

State

Boolean; input-only

TRUE: Sets the edge to invisible.

FALSE: Sets the edge to visible.

Remarks

You can create a 3DFace object in which all edges are invisible. It does not appear in wireframe presentations, but can hide material in line drawings. It does not appear in shaded renderings.

The Regen method must be called for any visibility changes to appear in the drawing.


SetLayoutsToPlot method [ActiveX and VBA Reference: AAR]

SetLayoutsToPlot Method

Specifies the layout or layouts to plot.

See Also | Example

Signature

object.SetLayoutsToPlot (layoutList)

Object

Plot
The object or objects this method applies to.

layoutList

Variant; input-only
An array of layout names representing the layouts to plot.

Remarks

This method may become obsolete and may be removed in a future version of AutoCAD.

If the layoutList parameter is NULL or this method is not called at all, the active layout is sent to the plot.

After each call to the PlotToFile or PlotToDevice method, the default layout to plot is reset to the active layout. To specify any layout other than the active layout, you must call the SetLayoutsToPlot method before each plot.


SetMargin method [ActiveX and VBA Reference: AAR]

SetMargin Method

Set a cell's margin value.

See Also | Example

Signature

object.SetMargin nRow, nCol, nMargins, fMargin

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nMargins

AcCellMargin; Input-only
The value of the margins.

pValue

Double; Input-only
The new margin value.


SetNames method [ActiveX and VBA Reference: AAR]

SetNames Method

Specifies the color name and book name of the color.

See Also | Example

Signature

object.SetNames (ColorName, ColorBook)

object

AcCmColor
The object or objects this method applies to.

ColorName

String; the name of the color.

BookName

String; the color book name of the color.


SetOverride method [ActiveX and VBA Reference: AAR]

SetOverride Method

Set a cell's override.

See Also | Example

Signature

object.SetOverride nRow, nCol, nContent, nProp

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The value of the row.

nCol

Integer; Input-only
The value of the column.

nContent

Integer; Input-only
The value of the cell's content.

nProp

AcCellProperty; Input-only
The new cell override.


SetPattern method [ActiveX and VBA Reference: AAR]

SetPattern Method

Sets the pattern name and pattern type for the hatch.

See Also | Example

Signature

object.SetPattern PatternType, PatternName

Object

Hatch
The object or objects this method applies to.

PatternType

AcPatternType enum; input-only

acHatchPatternTypePreDefined | Selects the pattern name from those defined in the acad.pat file.
acHatchPatternTypeUserDefined | Defines a pattern of lines using the current linetype.
acHatchPatternTypeCustomDefined | Selects the pattern name from a PAT file other than the acad.pat file.

PatternName

String; input-only
The name of the pattern. Sets a default hatch pattern name of up to 34 characters, no spaces allowed. Returns "" if there is no default. Enter a period (.) to set no default.

Remarks

The hatch pattern can be defined by one of the following options:

PreDefined: Selects the pattern name from those defined in the acad.pat file.

UserDefined: Defines a pattern of lines using the current linetype.

CustomDefined: Selects the pattern name from a PAT file other than the acad.pat file.

NOTE The SetPattern method should only be used for the active document.


SetProjectFilePath method [ActiveX and VBA Reference: AAR]

SetProjectFilePath Method

Sets the directory in which AutoCAD looks for external reference files.

See Also | Example

Signature

object.SetProjectFilePath ProjectName, ProjectFilePath

Object

PreferencesFiles
The object or objects this method applies to.

ProjectName

String; input-only
The name of the project. This name is also controlled by the PROJECTNAME system variable.

ProjectFilePath

String; input-only
The directory in which AutoCAD looks for external reference files.


SetRelativeDrawOrder method [ActiveX and VBA Reference: AAR]

SetRelativeDrawOrder Method

Sets the relative draw order specified, with the bottom objects first.

See Also | Example

Signature

object.SetRelativeDrawOrder (Objects)

object

SortentsTable
The object or objects this method applies to.

Objects

Variant; the objects for which to set the draw order.


SetRGB Method [ActiveX and VBA Reference: AAR]

SetRGB Method

Specifies the RGB values of the True Color.

See Also | Example

Signature

object.SetRGB (Red, Green, Blue)

object

AcCmColor
The object or objects this method applies to.

Red

Long; red value.

Green

Long; green value.

Blue

Long; blue value.


SetRotation method [ActiveX and VBA Reference: AAR]

SetRotation Method

Sets the rotation value for a cell.

See Also | Example

Signature

object.SetRotation nRow, nCol, nContent, pValue

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

value

Double; Input-only
The new value for the rotation.


SetRotation method [ActiveX and VBA Reference: AAR]

SetRotation Method

Sets the rotation of a cell style.

See Also | Example

Signature

object.SetRotation (StringCellStyle, rotation)

Object

TableStyle
The object or objects this method applies to.

StringCellStyle

String; Input
Cell style name.

rotation

Double; Input
Cell style rotation.


SetRowHeight method [ActiveX and VBA Reference: AAR]

SetRowHeight Method

Sets the height for the row at the specified row index in the table.

See Also | Example

Signature

object.SetRowHeight(row, Height)

Object

Table
The object or objects this method applies to.

row

Long; the row index

Height

Double; the height for the row


SetScale method [ActiveX and VBA Reference: AAR]

SetScale Method

Sets the scale value for a cell.

See Also | Example

Signature

object.SetScale nRow, nCol, nContent, scale

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

scale

Double; Input-only
The new sscale value.


SetSnapSpacing method [ActiveX and VBA Reference: AAR]

SetSnapSpacing Method

Sets the snap spacing for the viewport.

See Also | Example

Signature

object.SetSnapSpacing XSpacing, YSpacing

Object

Viewport, PViewport
The object or objects this method applies to.

XSpacing

Double; input-only

YSpacing

Double; input-only

Remarks

The initial value for the X and Y spacing is 1.0000.

This value is also controlled by the SNAPUNIT system variable.


SetSubSelection method [ActiveX and VBA Reference: AAR]

SetSubSelection Method

Sets the row and column indices of the cells in a subselection set.

See Also | Example

Signature

object.SetSubSelection(rowMin, rowMax, colMin, colMax)

Object

Table
The object or objects this method applies to.

rowMin

Long; zero-based lower bound of row index

rowMax

Long; zero-based upper bound of row index

colMin

Long; zero-based lower bound of column index

colMax

Long; zero-based upper bound of column index

Remarks

This method sets the row and column indices of the cells in the subselection set. The total number of selected cells is equal to (rowMax - rowMin + 1) * (colMax - colMin + 1).


SetText method [ActiveX and VBA Reference: AAR]

SetText Method

Sets the text value for the specified row and column.

See Also | Example

Signature

object.SetText(row, col, pStr)

Object

Table
The object or objects this method applies to.

row

Long; the zero-based row index for the cell

col

Long; the zero-based column index for the cell

pStr

String; the text value


SetTextHeight method [ActiveX and VBA Reference: AAR]

SetTextHeight Method

Sets the text height for the specified row types.

See Also | Example

Signature

object.SetTextHeight(rowTypes, TextHeight)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change.

TextHeight

Double; the text height to use for the specified row types.


SetTextHeight2 method [ActiveX and VBA Reference: AAR]

SetTextHeight2 Method

Sets the text height for a cell.

See Also | Example

Signature

object.GetTextHeight2 nRow, nCol, nContent, height

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

height

Double; Input-only
The new height value.


SetTextRotation method [ActiveX and VBA Reference: AAR]

SetTextRotation Method

Sets the text rotation for the specified row and column.

See Also | Example

Signature

object.SetTextRotation(row, col, TextRotation)

Object

Table
The object or objects this method applies to.

row

Long; the row

col

Long; the column

TextRotation

AcRotationAngle enum; the text rotation

acDegrees000

acDegrees090

acDegrees180

acDegrees270

acDegreesUnknown


SetTextString method [ActiveX and VBA Reference: AAR]

SetTextString Method

Sets the text value of a cell.

See Also | Example

Signature

object.SetTextString nRow, nCol, nContent, text

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

text

String; Input-only
The string value to store.


SetTextStyle method [ActiveX and VBA Reference: AAR]

SetTextStyle Method

Sets the text style name for the specified row types.

See Also | Example

Signature

object.SetTextStyle(rowTypes, bstrName)

Object

Table, TableStyle
The object or objects this method applies to.

rowTypes

Long; the row types to change.

bstrName

String; the text style name to use for the specified row types.


SetTextStyle2 method [ActiveX and VBA Reference: AAR]

SetTextStyle2 Method

Sets the text style name for a cell.

See Also | Example

Signature

object.SetTextStyle2 nRow, nCol, nContent, StringStyleName

Object

Table, TableStyle
The objects this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value for the cell.

StringStyleName

String; Input-only
The new style name to set.


SetToolTip method [ActiveX and VBA Reference: AAR]

SetToolTip Method

Sets a cell's tool tip.

See Also | Example

Signature

object.SetToolTip nRow, nCol, tip

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The index of the column.

nCol

Integer; Input-only
The index of the column.

tip

String; Input-only
The new tool tip.


SetValue method [ActiveX and VBA Reference: AAR]

SetValue Method

Sets the value of a cell.

See Also | Example

Signature

object.SetValue nRow, nCol, nContent, acValue

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

acValue

VARIANT; Input-only
The cell value to set.


SetValueFromText method [ActiveX and VBA Reference: AAR]

SetValueFromText Method

Sets the value of a cell by parsing the text.

See Also | Example

Signature

object.SetValueFromText nRow, nCol, nContent, szText, nOption

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row number of the cell to set.

nCol

Integer; Input-only
The column number of the cell to set.

nContent

Integer; Input-only
The content value of the cell.

szText

String; Input-only
The text string to set as a value.

nOption

AcParseOption; Input-only
Special input option flags.


SetVariable method [ActiveX and VBA Reference: AAR]

SetVariable Method

Sets the value of an AutoCAD system variable.

See Also | Example

Signature

object.SetVariable Name, Value

Object

Document
The object or objects this method applies to.

Name

String; input-only
The name of the system variable to set.

Value

Variant; input-only
The new value for the specified system variable.

Remarks

When setting system variables, AutoCAD may require integers, text, or double values. Passing the wrong data type (for example, passing a variant of type double when an integer is required) will generate an error. The easiest way to avoid this is to use one of the Cxxx functions, such as CInt(), to explicitly type your data before passing it.

For a list of all AutoCAD system variables and their types, please refer to "System Variables" in the AutoCAD Command Reference.


SetView method [ActiveX and VBA Reference: AAR]

SetView Method

Sets the view in a viewport to a saved view in the Views Collection object.

See Also | Example

Signature

object.SetView View

Object

Viewport
The object or objects this method applies to.

View

View object; input-only
The view to set.


SetWeight method [ActiveX and VBA Reference: AAR]

SetWeight Method

Sets the weight of the control point at a given index.

See Also | Example

Signature

object.SetWeight Index, Weight

Object

Spline
The object or objects this method applies to.

Index

Integer; input-only
The position in the control point list to set the weight. The first control point is index 0.

Weight

Double; input-only
The new weight of the point.


SetWidth method [ActiveX and VBA Reference: AAR]

SetWidth Method

Sets the start and end width of a polyline, given the segment index.

See Also | Example

Signature

object.SetWidth SegmentIndex, StartWidth, EndWidth

Object

LightweightPolyline, Polyline
The object or objects this method applies to.

SegmentIndex

Integer; input-only
An index specifying the segment whose width is to be set. The first segment is index 0.

StartWidth

Double; input-only
The start width for the specified segment.

EndWidth

Double; input-only
The end width for the specified segment.

Remarks

The segment index is the index of a particular segment of the polyline. For example, a polyline with three segments has segment indexes 0, 1, and 2.

Polyline: this method will fail if the polyline Type property is acCubicSplinePoly or acQuadSplinePoly.


SetWindowToPlot method [ActiveX and VBA Reference: AAR]

SetWindowToPlot Method

Sets the coordinates that define the portion of the layout to plot.

See Also | Example

Signature

object.SetWindowToPlot(LowerLeft, UpperRight)

Object

Layout, PlotConfiguration
The object or objects this method applies to.

LowerLeft

Variant (two-element array of doubles); input-only
The X and Y values for the lower-left window.

UpperRight

Variant (two-element array of doubles); input-only
The X and Y values for the upper-right window.

Remarks

The window coordinates are taken from the origin.

The units for these values are specified by the PaperUnits property.

The PlotType property must be set to acWindow for these coordinates to be used for the plot.


SetXdata method [ActiveX and VBA Reference: AAR]

SetXData Method

Sets the extended data (XData) associated with an object.

See Also | Example

Signature

object.SetXData XDataType, XData

Object

All Drawing Objects , AttributeReference, Block, Dictionary, DimStyle, Group, Layer, Linetype, PlotConfigurations, RegisteredApplication, TextStyle, UCS, View, Viewport; XRecord
The object or objects this method applies to.

XDataType

Variant (array of short); input-only

XData

Array of Variant; input-only

Remarks

Extended data is an example of instance-specific data created by applications written with ObjectARX or AutoLISP. This data can be added to any entity. This data follows the entity's definition data and is maintained in the order in which it was saved into the document. (AutoCAD maintains this information but doesn't use it.)


SetXRecordData method [ActiveX and VBA Reference: AAR]

SetXRecordData Method

Sets the extended record data (XRecordData) associated with a dictionary.

See Also | Example

Signature

object.SetXRecordData XRecordDataType, XRecordData

Object

Dictionary; XRecord
The object or objects this method applies to.

XRecordDataType

Variant (array of short); input-only

XRecordData

Variant (array of variants); input-only

Remarks

XRecord objects are used to store and manage arbitrary data. This object is similar in concept to XData, but is not limited by size or order.

Unlike XData, XRecords work with the standard AutoCAD group codes, which are all below 1000 in value. All the standard AutoCAD group codes are supported. This means that, in addition to all the normally used data types, an XRecord is capable of storing object IDs, which allows XRecords to own other objects including other XRecords.

The following group codes are common to all XRecord objects:
Group codes | Description
100 | Subclass marker (AcDbXrecord)
1-369 (except 5 and 105) | These values can be used by an application in any way.


SliceSolid method [ActiveX and VBA Reference: AAR]

SliceSolid Method

Creates a slice of the 3DSolid object given three points that define the plane.

See Also | Example

Signature

RetVal = object.SliceSolid(Point1, Point2, Point3, Negative)

Object

3DSolid
The object or objects this method applies to.

Point1

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point.

Point2

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point.

Point3

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the third point.

Negative

Boolean; input-only
This specifies whether to return the part of the solid that is on the negative side of the plane. If TRUE, then AutoCAD creates a new Acad3DSolid object that contains the portion of the original solid that is on the negative normal side of the plane.

RetVal

3DSolid object
The resulting slice as a 3DSolid object.


Split method [ActiveX and VBA Reference: AAR]

Split Method

Splits a viewport into the given number of views.

See Also | Example

Signature

object.Split NumWins

Object

Viewport
The object or objects this method applies to.

NumWins

AcViewportSplitType enum; input-only

acViewport2Horizontal

acViewport2Vertical

acViewport3Left

acViewport3Right

acViewport3Horizontal

acViewport3Vertical

acViewport3Above

acViewport3Below

acViewport4

Remarks

Although the Split method has been called, the changes will not appear until the ActiveViewport property has been used to make the viewport active. This is required even if the viewport was active before the call to Split.

A viewport does not have to be active for this method to work, however, it must be reset to active to see the results of this method.


StartBatchMode method [ActiveX and VBA Reference: AAR]

StartBatchMode Method

Starts printing in batch mode.

See Also | Example

Signature

object.StartBatchMode entryCount

Object

Plot
The object or objects this method applies to.

entryCount

Long; input-only;
The number of entries to plot in the batch.

Remarks

This method is obsolete and may be removed in a future version of AutoCAD.


StartUndoMark method [ActiveX and VBA Reference: AAR]

StartUndoMark Method

Marks the beginning of a block of operations.

See Also | Example

Signature

object.StartUndoMark

Object

Document
The object or objects this method applies to.

Remarks

This method allows AutoCAD to set up the necessary environment so operations done between this call and a call to EndUndoMark can be treated as a group of operations.


SwapOrder method [ActiveX and VBA Reference: AAR]

SwapOrder Method

Swaps the draw order positions of two objects.

See Also | Example

Signature

object.SwapOrder (Object1, Object2)

object

SortentsTable
The object or objects this method applies to.

Object1

AcadEntity; the first object.

Object2

AcadEntity; the second object.


SyncModelView method [ActiveX and VBA Reference: AAR]

SyncModelView Method

Updates the viewport parameters with the parameters in the associated model view.

Signature

object.SyncModelView

object

PViewport
The object or objects this method applies to.

Remarks

Note To access this property, use the IAcadPViewport2 interface.


TransformBy method [ActiveX and VBA Reference: AAR]

TransformBy Method

Moves, scales, or rotates an object given a 4x4 transformation matrix.

See Also | Example

Signature

object.TransformBy TransformationMatrix

Object

All Drawing Objects, AttributeReference
The object or objects this method applies to.

TransformationMatrix

Variant (4x4 array of doubles); input-only
A 4x4 matrix specifying the transformation to perform.

Remarks

The following table demonstrates the transformation matrix configuration, where R = Rotation, and T = Translation:
R00 | R01 | R02 | T0
R10 | R11 | R12 | T1
R20 | R21 | R22 | T2
0 | 0 | 0 | 1

This method will return an error if the transformation matrix is not correct.

Sample transformation matrices are provided in the example code for this method.


TranslateCoordinates method [ActiveX and VBA Reference: AAR]

TranslateCoordinates Method

Translates a point from one coordinate system to another.

See Also | Example

Signature

RetVal = object.TranslateCoordinates(OriginalPoint, From, To, Disp[, OCSNormal])

Object

Utility
The object or objects this method applies to.

OriginalPoint

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the original coordinates to be translated. This parameter can be treated as a point or a displacement vector depending on the value of Disp.

From

AcCoordinateSystem enum; input-only
The coordinate system from which the point originates.

acWorld

acUCS

acOCS

acDisplayDCS

acPaperSpaceDCS

To

AcCoordinateSystem enum; input-only
The coordinate system to which the point will be converted.

acWorld

acUCS

acOCS

acDisplayDCS

acPaperSpaceDCS

Disp

Integer; input-only
A displacement vector flag.

TRUE: OriginalPoint is treated as a displacement vector.

FALSE: OriginalPoint is treated as a point.

OCSNormal

Variant (three-element array of doubles); input-only;optional
The normal for the OCS.

RetVal

Variant (three-element array of doubles)
The translated 3D coordinate.

Remarks

You cannot directly translate a coordinate from one OCS to another OCS. To do this, first translate the coordinate from one OCS to an intermediary coordinate system such as the WCS. Then translate that coordinate into the second OCS.

To translate a point on a Polyline or LightWeightPolyline object from OCS to WCS:

1. Get the X and Y coordinates of the OCS point from the Coordinate or Coordinates property.

2. Get the Z coordinate of the OCS point from the Elevation property.

3. Get the Normal for the polyline from the Normal property.

4. Call TranslateCoordinates using the X, Y, Z coordinates and the Normal.


Unload method [ActiveX and VBA Reference: AAR]

Unload Method

Unloads the menu group or external reference.

See Also | Example

Signature

object.Unload

Object

Block, MenuGroup
The object or objects this method applies to.

Remarks

ExternalReference block: When an ExternalReference object (xref) is unloaded from the drawing, the drawing opens faster and uses less memory. An unloaded xref is not displayed and the xref-dependent symbol table information does not appear in the drawing. However, all the information can be restored by reloading the xref using the Reload method.

To unload an external reference, you must unload the block that defines the external reference. For example, the following line of VBA code unloads an external reference that is stored in the xrefInserted variable:

ThisDrawing.Blocks.Item(xrefInserted.name).Unload

MenuGroup: When a menu group is unloaded from the drawing, any references to the menus and toolbars within that group become invalid. Always delete or set to NULL any references to toolbars and menus that are in the menu group to be unloaded before you unload the menu group.


UnloadARX method [ActiveX and VBA Reference: AAR]

UnloadARX Method

Unloads the specified AutoCAD ARX application.

See Also | Example

Signature

object.UnloadARX Name

Object

Application
The object or objects this method applies to.

Name

String; input-only
The name of the application to unload.

Remarks

If the specified application is locked when this method is called, the method will fail.

NOTE Do not attempt to unload the file acvba.arx.


UnloadDVB method [ActiveX and VBA Reference: AAR]

UnloadDVB Method

Unloads the specified AutoCAD VBA project file.

See Also | Example

Signature

object.UnloadDVB Name

Object

Application
The object or objects this method applies to.

Name

String; input-only
The name of the .dvb project to unload.


UnmergeCells method [ActiveX and VBA Reference: AAR]

UnmergeCells Method

Splits merged cells in a table.

See Also | Example

Signature

object.UnmergeCells(minRow, maxRow, minCol, maxCol)

Object

Table
The object or objects this method applies to.

minRow

Long; zero-based lower bound of a row index

maxRow

Long; zero-based upper bound of a row index

minCol

Long; zero-based lower bound of a column index

maxCol

Long; zero-based upper bound of a column index


Update method [ActiveX and VBA Reference: AAR]

Update Method

Updates the object to the drawing screen.

See Also | Example

Signature

object.Update

Object

Application, All Drawing Objects, AttributeReference
The object or objects this method applies to.


UpdateAllDataLinks method [ActiveX and VBA Reference: AAR]

UpdateAllDataLinks Method

Updates all of a table's data links.

See Also | Example

Signature

object.UpdateAllDataLinks nDir, nOption

Object

Table
The object this method applies to.

nDir

AcDataLinkUpdateDirection; Input-only
The direction of the update.

nOption

AcDataLinkUpdateDirectOption; Input-only
The option flag for the update.


UpdateDataLink method [ActiveX and VBA Reference: AAR]

UpdateDataLink Method

Updates a cell's data links.

See Also | Example

Signature

object.UpdateDataLink nRow, nCol, nDir, nOption

Object

Table
The object this method applies to.

nRow

Integer; Input-only
The row for the cell.

nCol

Integer; Input-only
The column for the cell.

nDir

AcDataLinkUpdateDirection; Input-only
The direction of the update.

nOption

AcDataLinkUpdateDirectOption; Input-only
The option flag for the update.


UpdateEntry method [ActiveX and VBA Reference: AAR]

UpdateEntry Method

Erases and then recreates an identified entry in the File Dependency List.

See Also | Example

Signature

object.UpdateEntry (Index)

object

FileDependencies
The object or objects this method applies to.

Index

Long; input-only
Index of the entry in the File Dependency List.


UpdateMTextAttribute method [ActiveX and VBA Reference: AAR]

UpdateMTextAttribute Method

Updates attribute from the multi-line mtext (and vice versa!)

See Also | Example

Signature

object.UpdateMTextAttribute

Object

Attribute Object
The object this method applies to.


UpdateMTextAttribute method [ActiveX and VBA Reference: AAR]

UpdateMTextAttribute Method

Updates attribute from the multi-line mtext (and vice versa!)

See Also | Example

Signature

object.UpdateMTextAttribute

Object

Attribute Object, AttributeReference Object
The object this method applies to.


WBlock method [ActiveX and VBA Reference: AAR]

WBlock Method

Writes out the given selection set as a new drawing file.

See Also | Example

Signature

object.WBlock FileName, SelectionSet

Object

Document
The object or objects this method applies to.

FileName

String; input-only
The file name to write the selection set to.

SelectionSet

SelectionSet object; input-only
The name of the selection set.


ZoomAll method [ActiveX and VBA Reference: AAR]

ZoomAll Method

Zooms the current viewport to display the entire drawing.

See Also | Example

Signature

object.ZoomAll ()

Object

Application
The object or objects this method applies to.

Remarks

In a plan view, AutoCAD zooms to the drawing limits or current extents, whichever is greater. In a 3D view, ZoomAll is equivalent to the ZoomExtents method. The display shows all objects even if the drawing extends outside the drawing limits.

This method applies only to the current active viewport (paper space viewport or model space viewport).


ZoomCenter method [ActiveX and VBA Reference: AAR]

ZoomCenter Method

Zooms the current viewport to a specified center point and magnification.

See Also | Example

Signature

object.ZoomCenter Center, Magnify

Object

Application
The object or objects this method applies to.

Center

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the center of the zoom.

Magnify

Double; input-only
The magnification level of the window. A value smaller than the current value increases the magnification. A larger value decreases the magnification.

Remarks

This method applies only to the current active viewport (paper space viewport or model space viewport).


ZoomExtents method [ActiveX and VBA Reference: AAR]

ZoomExtents Method

Zooms the current viewport to the drawing extents.

See Also | Example

Signature

object.ZoomExtents

Object

Application
The object or objects this method applies to.

Remarks

This method applies only to the current active viewport (paper space viewport or model space viewport).


ZoomPickWindow method [ActiveX and VBA Reference: AAR]

ZoomPickWindow Method

Zooms the current viewport to a window defined by points picked on the screen.

See Also | Example

Signature

object.ZoomPickWindow

Object

Application
The object or objects this method applies to.

Remarks

This method applies only to the current active viewport (paper space viewport or model space viewport).


ZoomPrevious method [ActiveX and VBA Reference: AAR]

ZoomPrevious Method

Zooms the current viewport to its previous extents.

See Also | Example

Signature

object.ZoomPrevious

Object

Application
The object or objects this method applies to.

Remarks

This method applies only to the current active viewport (paper space viewport or model space viewport).

This method zooms to display the previous view. You can restore up to 10 previous views.

NOTE If you change the shading with the SHADEMODE command, the view is changed. If you perform a ZoomPrevious after changing the shading, it restores the previous view, which is shaded differently, but not zoomed differently.


ZoomScaled method [ActiveX and VBA Reference: AAR]

ZoomScaled Method

Zooms the current viewport to given scale factor.

See Also | Example

Signature

object.ZoomScaled Scale, ScaleType

Object

Application
The object or objects this method applies to.

Scale

Double; input-only
The zoom factor for the zoom.

ScaleType

AcZoomScaleType enum, input-only; optional

acZoomScaledAbsolute

acZoomScaledRelative

acZoomScaledRelativePSpace

Remarks

The ScaleType value determines how the scale factor is applied:

acZoomScaledAbsolute

Relative to the drawing limits.

acZoomScaledRelative

Relative to the current view.

acZoomScaledRelativePSpace

Relative to paper space units.

This method applies to the current active viewport (paper space viewport or model space viewport).


ZoomWindow method [ActiveX and VBA Reference: AAR]

ZoomWindow Method

Zooms the current viewport to the area specified by two opposite corners of a rectangle.

See Also | Example

Signature

object.ZoomWindow LowerLeft, UpperRight

Object

Application
The object or objects this method applies to.

LowerLeft

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the lower-left corner of the window to display.

UpperRight

Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the upper-right corner of the window to display.

Remarks

This method applies to the current active viewport (paper space viewport or model space viewport).


Properties [ActiveX and VBA Reference: AAR]

Properties

A

Action property Specifies the security-related operations to be performed on a drawing.

Active property Determines if the document is the active document for the session.

ActiveDimStyle property Specifies the active dimension style.

ActiveDocument property Specifies the active document (drawing file).

ActiveLayer property Specifies the active layer.

ActiveLayout property Specifies the active layout.

ActiveLinetype property Specifies the active linetype for the drawing.

ActiveMaterial property Specifies the current default material for this document.

ActiveProfile property Specifies the active profile for the AutoCAD session.

ActivePViewport property Specifies the active paper space viewport for the drawing.

ActiveSelectionSet property Gets the active selection set for the drawing.

ActiveSpace property Toggles the active space between paper space and model space.

ActiveTextStyle property Specifies the active text style for the drawing.

ActiveUCS property Specifies the active UCS for the drawing.

ActiveViewport property Specifies the active viewport for the drawing.

ADCInsertUnitsDefaultSource property Determines the units to use automatically for objects in DesignCenter for a source drawing that does not have assigned insert units.

ADCInsertUnitsDefaultTarget property Determines the units to use automatically for objects in DesignCenter for a target drawing that does not have assigned insert units.

AdjustForBackground property Determines whether the underlay colors are adjusted for the current background color.

AffectsGraphics property Specifies that the entry in the File Dependency List affects graphics.

Algorithm property Specifies the identifier of the encryption algorithm.

Alignment property Specifies both the vertical and horizontal alignments for the attribute, attribute reference, or text.

AlignmentPointAcquisition property Specifies how AutoAlignment points are acquired.

AlignSpace property Specifies the AlignSpace of the mleaderstyle.

AllowedValues property Specifies the allowed values for the property.

AllowLongSymbolNames property Determines if symbol names may include extended character sets, or more than 31 characters.

AllowManualHeights property Toggles the manual heights in a table.

AllowManualPositions property Toggles the manual positions in a table.

AltFontFile property Specifies the location of the font file to use if AutoCAD can't locate the original font and an alternate font is not specified in the font mapping file.

AltRoundDistance property Specifies the rounding of alternate units.

AltSuppressLeadingZeros property Specifies the suppression of leading zeros in alternate dimension values.

AltSuppressTrailingZeros property Specifies the suppression of trailing zeros in alternate dimension values.

AltSuppressZeroFeet property Specifies the suppression of a zero foot measurement in alternate dimension values.

AltSuppressZeroInches property Specifies the suppression of a zero inch measurement in alternate dimension values.

AltTabletMenuFile property Specifies the path for an alternate menu to swap with the standard AutoCAD tablet menu.

AltTextPrefix property Specifies a prefix for the alternate dimension measurement for all dimension types except angular.

AltTextSuffix property Specifies a suffix for the alternate dimension measurement for all dimension types except angular.

AltTolerancePrecision property Specifies the precision of tolerance values in alternate dimensions.

AltToleranceSuppressLeadingZeros property Specifies the suppression of leading zeros in alternate dimension values.

AltToleranceSuppressTrailingZeros property Specifies the suppression of trailing zeros in alternate tolerance values.

AltToleranceSuppressZeroFeet property Specifies the suppression of a zero foot measurement in alternate tolerance values.

AltToleranceSuppressZeroInches property Specifies the suppression of a zero inch measurement in alternate tolerance values.

AltUnits property Enables dimensioning in alternate units.

AltUnitsFormat property Specifies the units format for alternate units of all dimensions except angular.

AltUnitsPrecision property Specifies the number of decimal places in alternate units.

AltUnitsScale property Specifies the scale factor for alternate units.

Angle property Gets the angle of a line.

AngleFormat property Specifies the unit format for angular dimensions.

AngleVertex property Specifies the angle vertex for the three-point angular dimension.

Annotation property Specifies the annotation object for a leader.

Annotative property Specifies the Annotative of the mleaderstyle.

Application property Gets the Application object.

ArcEndParam property Specifies the end parameter of the arc.

ArcLength property Gets the length of the arc.

ArcPoint property Specifies a point on the arc.

ArcSmoothness property Specifies the smoothness of circles, arcs, and ellipses.

ArcStartParam property Specifies the start parameter of the arc.

Area property Specifies the enclosed area of an arc, circle, ellipse, hatch, lightweight polyline, polyline, region, or planar-closed spline.

Arrowhead1Block property Specifies the block to use as the custom arrowhead for the first end of the dimension line.

Arrowhead1Type property Specifies the type of arrowhead for the first end of the dimension line.

Arrowhead2Block property Specifies the block to use as the custom arrowhead for the second end of the dimension line.

Arrowhead2Type property Specifies the type of arrowhead for the second end of the dimension line.

ArrowheadBlock property Specifies the block to use as the custom arrowhead for a radial dimension or leader line.

ArrowheadSize property Specifies the size of dimension line arrowheads, leader line arrowheads, and hook lines.

ArrowheadType property Specifies the type of arrowhead for the radial dimension or leader.

ArrowSize property Specifies the arrowSize of the mleaderstyle.

ArrowSymbol property Specifies the ArrowSymbol of the mleaderstyle.

AssociativeHatch property Specifies whether the hatch is associative.

AttachmentPoint property Specifies the attachment point for an MText object.

Author property Specifies the author of the drawing.

AutoAudit property Specifies whether AutoCAD should perform an audit after you render a DXFIN or DXBIN interchange command.

AutomaticPlotLog property Specifies whether to automatically save a Plot or Publish log.

AutoSaveInterval property Specifies an automatic save interval in minutes.

AutoSavePath property Specifies the path for the file that is created if you enable automatic save using the AutoSaveInterval property.

AutoSnapAperture property Toggles the display of the AutoSnap aperture.

AutoSnapApertureSize property Specifies the size of the AutoSnap aperture.

AutoSnapMagnet property Toggles the AutoSnap magnet.

AutoSnapMarker property Toggles the AutoSnap marker.

AutoSnapMarkerColor property Specifies the color of the AutoSnap marker.

AutoSnapMarkerSize property Specifies the size of the AutoSnap marker.

AutoSnapToolTip property Toggles the AutoSnap tooltips.

AutoTrackingVecColor property Specifies the color of the auto tracking vector.

AutoTrackTooltip property Toggles the display of the AutoTrack tooltips.

AxisDirection property Displays the direction of the axis of revolution.

AxisPosition property Specifies the start point of the axis of revolution.

B

BackgroundFill property Specifies whether multiline text has a background fill.

BackgroundLinesColor property Specifies the color of background lines.

BackgroundLinesHiddenLine property Specifies the hidden line visibility of background lines.

BackgroundLinesLayer property Specifies the layer of background lines.

BackgroundLinesLinetype property Specifies the linetype of background lines.

BackgroundLinesLinetypeScale property Specifies the linetype scale of background lines.

BackgroundLinesLineweight property Specifies the line weight of background lines.

BackgroundLinesPlotStyleName property Specifies the plot style name of background lines.

BackgroundLinesVisible property Specifies the visibility of background lines.

Backward property Specifies the direction of text.

Bank property Specifies whether or not the profile curve twists and rotates along a 3D path.

BasePoint property Specifies the point through which the ray or xline passes.

BaseRadius property Specifies the base radius of the helix.

BatchPlotProgress property Gets the current status of the batch plot, or terminates the batch plot.

BeepOnError property Specifies if AutoCAD should sound an alarm beep when it detects an invalid entry.

BigFontFile property Specifies the name of the Big Font file associated with the text or attribute.

BitFlags property Specifies the bit flag values of a style.

Block property Gets the block associated with the layout.

Block property Specifies the Block of the mleaderstyle.

BlockColor property Specifies the BlockColor of the mleaderstyle.

BlockConnectionType property The types of block connection a multileader can have.

Blocks property Gets the Blocks collection for the drawing.

BlockScale property Specifies the BlockScale of the mleaderstyle.

BlockScaling property Specifies the scaling allowed for the block.

Blue property Specifies the blue component of the True Color.

BookName property Specifies the book name (if any) of the color.

BottomHeight property Specifies elevation of section plane bottom extents relative to the object’s elevation.

BreaksEnabled property Toggles the breaks in a table.

BreakSize property Specifies the BreakSize of the mleaderstyle.

BreakSpacing property Toggles the break spacing in a table.

Brightness property Specifies the current brightness value of an image.

C

CanonicalMediaName property Specifies the paper size by name.

Caption property Gets the text that the user sees displayed for the application or a menu item.

CategoryName property Specifies the category name of a view.

Center property Specifies the center of an arc, circle, ellipse, view, or viewport.

CenterMarkSize property Specifies the size of the center mark for radial and diameter dimensions.

CenterPlot property Specifies the centering of the plot on the media.

CenterPoint property Specifies the center of the arc.

CenterType property Specifies the type of center mark for radial and diameter dimensions.

Centroid property Gets the center of area or mass for a region or solid.

Check property Specifies the check status for the popup menu item.

ChordPoint property Specifies the chord point for the arc.

Circumference property Specifies the circumference of a circle.

Clipped property Determines if the viewport has been clipped.

ClippingEnabled property Enables or disables the clipping boundary.

Closed property Specifies whether the 3D polyline, lightweight polyline, lofted surface, polyline, or spline is open or closed.

Color property Specifies the color of an object or layer.

ColorBookPath property Sets the color book path.

ColorIndex property Specifies the color index.

ColorMethod property Specifies the color method.

ColorName property Specifies the name (if any) of the color.

Columns property Specifies the number of columns in a block array.

Columns property Specifies the number of columns in the table.

ColumnSpacing property Specifies the spacing of the columns in a block array.

ColumnWidth property Specifies the uniform width of all columns in the table.

Comment property Specifies the comment to be included with a digital signature.

Comments property Specifies the comments for the block.

Comments property Specifies the comments you want to use to locate the drawing.

ConfigFile property Gets the location of the configuration file used to store hardware device driver information.

ConfigName property Specifies the plotter configuration name.

Constant property Specifies whether the attribute or attribute reference is constant or not.

ConstantWidth property Specifies a global width for all segments in a polyline.

Constrain property Controls which property is constrained when editing other property values.

ContentBlockName property The name of the content block.

ContentBlockType property The type of the content block.

ContentType property Specifies the content type.

ContinuousPlotLog property Specifies whether to save a continuous Plot log.

ContourlinesPerSurface property Specifies the number of contour lines (isolines) per surface on objects.

Contrast property Specifies the current contrast value of an image or underlay.

ControlPoints property Specifies the control points of a spline.

Coordinate property Specifies the coordinate of a single vertex in the object.

Coordinates property Specifies the coordinates for each vertex in the object.

Count property Gets the number of items in the object.

CreateBackup property Specifies the use of a backup file.

CurrentSectionType property Specifies the current section type.

CursorSize property Specifies the crosshairs size as a percentage of the screen size.

CurveTangencyLinesColor property Specifies the color of curve tangency lines.

CurveTangencyLinesLayer property Specifies the layer of curve tangency lines.

CurveTangencyLinesLinetype property Specifies the linetype of curve tangency lines.

CurveTangencyLinesLinetypeScale property Specifies the linetype scale of curve tangency lines.

CurveTangencyLinesLineweight property Specifies the line weight of curve tangency lines.

CurveTangencyLinesPlotStyleName property Specifies the plot style name of curve tangency lines.

CurveTangencyLinesVisible property Specifies the visibility of curve tangency lines.

CustomDictionary property Specifies a custom dictionary to use if you have one.

CustomIconPath property Specifies the search path for custom icons

CustomScale property Specifies the custom scale factor for the viewport.

D

Database property Gets the database in which the object belongs.

DecimalSeparator property Specifies the character to be used as the decimal separator in decimal dimension and tolerance values.

DefaultInternetURL property Specifies the default Internet address.

DefaultOutputDevice property Specifies the default output device for new layouts and model space.

DefaultPlotStyleForLayer property Specifies the default plot style for Layer 0 for new drawings or drawings created with earlier releases of AutoCAD that have never been saved in AutoCAD 2000 or later format.

DefaultPlotStyleForObjects property Specifies the default plot style name for newly created objects.

DefaultPlotStyleTable property Specifies the default plot style table to attach to new drawings.

DefaultPlotToFilePath property Sets the default location for plot to file operations.

DefaultPlotToFilePath property Specifies the default path for plotting to a file.

Degree property Gets the degree of the spline's polynomial representation.

Delta property Gets the delta of a line.

DemandLoadArxApp property Specifies whether AutoCAD demand-loads a third-party application if a drawing contains custom objects.

Description property Specifies the description of an object.

DestinationBlock property Specifies the destination block for section generation.

DestinationFile property Specifies the destination file for section generation.

Diameter property Specifies the diameter of a circle.

Dictionaries property Gets the Dictionaries collection for the document.

DimensionLineColor property Specifies the color of the dimension line for a dimension, leader, or tolerance object.

DimensionLineExtend property Specifies the distance the dimension line extends beyond the extension line when oblique strokes are drawn instead of arrowheads.

DimensionLinetype property Specifies the linetype of the dimension line (DIMLTYPE system variable).

DimensionLineWeight property Specifies the lineweight for the dimension lines.

DimLine1Suppress property Specifies the suppression of the first dimension line.

DimLine2Suppress property Specifies the suppression of the second dimension line.

DimLineInside property Specifies the display of dimension lines inside the extension lines only.

DimLineSuppress property Specifies the suppression of the dimension line for radial dimensions.

DimStyles property Gets the DimStyles collection for the document.

Direction property Specifies the viewing direction for a 3D visualization of the drawing, or the direction vector of the table.

DirectionVector property Specifies the direction for the ray, tolerance, or xline through a vector.

Display property Gets the PreferencesDisplay object.

DisplayGrips property Controls the display of selection set grips for the Stretch, Move, Rotate, Scale, and Mirror grip modes.

DisplayGripsWithinBlocks property Controls the assignment of grips within blocks.

DisplayLayoutTabs property Specifies whether to display the Model and layout tabs in the drawing editor.

DisplayLocked property Specifies whether the viewport is locked.

DisplayOLEScale property Determines whether the OLE scaling dialog is displayed when OLE objects are inserted into a drawing.

DisplayScreenMenu property Specifies whether to display the screen menu on the right side of the drawing window.

DisplayScrollBars property Specifies whether to display scroll bars at the bottom and right sides of the drawing window.

DisplaySilhouette property Controls whether silhouette curves of solid objects are displayed in Wireframe mode.

DockedVisibleLines property Specifies the number of lines of text to display in the command window.

DockStatus property Specifies whether the toolbar is docked or floating.

Document property Gets the document (drawing) in which the object belongs.

Documents property Gets the Documents collection.

DogLegged property The status of the dog-leg.

DoglegLength property The length of the dog-leg.

Drafting property Gets the PreferencesDrafting object.

DrawingDirection property Specifies the direction in which the mtext paragraph is to be read.

DrawLeaderOrderType property Specifies the drawLeaderOrderType of the mleaderstyle.

DrawMLeaderOrderType property Specifies the drawMLeaderOrderType of the mleaderstyle.

DriversPath property Specifies the directory in which AutoCAD looks for ADI device drivers for the video display, pointing devices, printers, and plotters.

E

EffectiveName property Specifies the original block name.

Elevation property Specifies the current elevation of the hatch, polyline, or section.

ElevationModelSpace property Specifies the elevation setting in model space.

ElevationPaperSpace property Specifies the elevation setting in paper space.

Enable property Enables the popup menu item. Specifies the name of the object.

EnableBlockRotation property Specifies the EnableBlockRotation of the mleaderstyle.

EnableBlockScale property Specifies the EnableBlockScale of the mleaderstyle.

EnableDogleg property Specifies the enableDogleg of the mleaderstyle.

EnableFrameText property Specifies the EnableFrameText of the mleaderstyle.

EnableLanding property Specifies the enableLanding of the mleaderstyle.

EnableShadowDisplay property Specifies whether the shadow display property is enabled for the object.

EnableStartupDialog property Specifies whether a startup dialog box is displayed when AutoCAD is launched or a new drawing is created.

EndAngle property Specifies the end angle of an arc or ellipse.

EndDraftAngle property Specifies the draft angle of the surface for the last cross section.

EndDraftMagnitude property Specifies the draft magnitude of the surface for the last cross section.

EndParameter property Specifies the end parameter for an ellipse.

EndPoint property Specifies the endpoint for the arc, line, or ellipse.

EndSubMenuLevel property Specifies the last item in a submenu.

EndTangent property Specifies the end tangent of the spline as a directional vector.

EnterpriseMenuFile property Specifies the location of the enterprise menu file

EntityColor property Specifies the color value of the true color.

Explodable property Specifies whether the block can be exploded.

ExtensionLineColor property Specifies the color for dimension extension lines.

ExtensionLineExtend property Specifies the distance the extension line extends beyond the dimension line.

ExtensionLineOffset property Specifies the distance the extension lines are offset from the origin points.

ExtensionLineWeight property Specifies the lineweight for the extension lines.

ExtLine1EndPoint property Specifies the endpoint of the first extension line.

ExtLine1Linetype property Specifies the linetype of the first extension line (DIMLTEX1 system variable).

ExtLine1Point property Specifies the origin of extension line 1.

ExtLine1StartPoint property Specifies the start point of the first extension line.

ExtLine1Suppress property Specifies the suppression of the first extension line.

ExtLine2EndPoint property Specifies the endpoint of the second extension line.

ExtLine2Linetype property Specifies the linetype of the second extension line (DIMLTEX2 system variable).

ExtLine2Point property Specifies the origin of extension line 2.

ExtLine2StartPoint property Specifies the start point of the second extension line.

ExtLine2Suppress property Specifies the suppression of the second extension line.

ExtLineFixedLen property Set extension line fixed length (DIMFXL system variable).

ExtLineFixedLenSuppress property Sets suppression of extension line fixed length On or Off (DIMFXLON system variable).

F

Fade property Specifies the current fade value of a raster or underlay image.

Feature property Specifies the feature name of an entry in the File Dependency List.

FieldLength property Specifies the field length of the attribute.

File property Specifies the path to the underlay file.

FileName property Specifies the file name of an entry in the File Dependency List.

Files property Gets the PreferencesFiles object.

FileSize property Specifies the file size of an entry in the File Dependency List.

FingerprintGUID property Specifies the Fingerprint GUID of an entry in the File Dependency List.

FirstSegmentAngleConstraint property Specifies the FirstSegmentAngleConstraint of the mleaderstyle.

Fit property Specifies the placement of text and arrowheads inside or outside extension lines, based on the available space between the extension lines.

FitPoints property Specifies the fit points of a spline.

FitTolerance property Refits the spline to the existing points with new tolerance values.

FloatingRows property Specifies the number of rows for a floating toolbar.

FlowDirection property Specifies whether the title and header rows are at the bottom or the top of the table.

Flyout property Gets the toolbar associated with a flyout toolbar item.

FontFile property Specifies the primary font file name and the path.

FontFileMap property Specifies the location of the file that defines how AutoCAD should convert unfound fonts.

ForceLineInside property Specifies whether a dimension line is drawn between the extension lines even when the text is placed outside the extension lines.

ForegroundLinesColor property Specifies the color of foreground lines.

ForegroundLinesEdgeTransparency property Specifies the edge transparency of foreground lines.

ForegroundLinesFaceTransparency property Specifies the face transparency of foreground lines.

ForegroundLinesHiddenLine property Specifies the hidden line visibility of foreground lines.

ForegroundLinesLayer property Specifies the layer of foreground lines.

ForegroundLinesLinetype property Specifies the linetype of foreground lines.

ForegroundLinesLinetypeScale property Specifies the linetype scale of foreground lines.

ForegroundLinesLineweight property Specifies the line weight of foreground lines.

ForegroundLinesPlotStyleName property Specifies the plot style name of foreground lines.

ForegroundLinesVisible property Specifies the visibility of foreground lines.

FoundPath property Specifies an alternate path of an entry in the File Dependency List.

FractionFormat property Specifies the format of fractional values in dimensions and tolerances.

Freeze property Specifies the freeze status of a layer.

FullCRCValidation property Specifies whether a cyclic redundancy check (CRC) should be performed each time an object is read into the drawing.

FullFileName property Specifies the saved full path name of an entry in the File Dependency List.

FullName property Gets the name of the application or document, including the path.

FullScreenTrackingVector property Toggles the display of full-screen tracking vectors.

G

GenerationOptions property Specifies the section generation options.

GradientAngle property Specifies the gradient angle.

GradientCentered property Specifies whether the gradient is centered.

GradientColor1 property Specifies the start color of the gradient.

GradientColor2 property Specifies the end color of the gradient.

GradientName property Specifies the pattern name of the gradient.

GraphicsWinLayoutBackgrndColor property Specifies the background color for the paper space layouts.

GraphicsWinModelBackgrndColor property Specifies the background color for the model space window.

Green property Specifies the green component of the True Color.

GridOn property Specifies the status of the viewport grid.

GripColorSelected property Specifies the color of selected grips.

GripColorUnselected property Specifies the color of unselected grips.

GripSize property Specifies the size of grips.

Groups property Gets the Groups collection for the document.

H

Handle property Gets the handle of an object.

HasAttributes property Specifies whether the block has any attributes in it.

HasExtensionDictionary property Determines whether the object has an extension dictionary associated with it.

HasLeader property Specifies whether the dimension has a leader.

HasSheetView property Specifies whether the viewport is linked to a corresponding sheet view.

HasSubSelection property Specifies whether the table contains a subselection set.

HasVpAssociation property Specifies whether the view is associated with a paper space viewport.

HatchObjectType property Specifies the type of the hatch, classic or gradient.

HatchStyle property Specifies the hatch style.

HeaderSuppressed property Specifies whether the header of the table is suppressed.

Height property Specifies the height of the extrusion.

Height property Changes the height of the attribute, helix, shape, text, or underlay object, the view toolbar, or the main application window.

Height property Specifies the height of the OLE object box.

Height property Specifies the height of the table.

HelpFilePath property Specifies the location of the AutoCAD Help file.

HelpString property Specifies the Help string for the toolbar, toolbar item, or menu item.

History property Specifies whether history is saved.

HistoryLines property Specifies the number of lines of text in the text window to keep in memory.

HorizontalTextPosition property Specifies the horizontal justification for dimension text.

HorzCellMargin property Specifies the value of the horizontal margin of cells.

HWND property Gets the window handle of the window frame.

HWND32 property Gets the window handle of the window frame for a 64-bit system.

HyperlinkBase property Specifies the base address used for all relative links inserted within the drawing.

HyperlinkDisplayCursor property Toggles the display of the hyperlink cursor and shortcut menu.

HyperlinkDisplayTooltip property Toggles the display of hyperlink tooltips.

Hyperlinks property Gets the Hyperlinks collection for an entity.

I

ImageFile property Specifies the full path and file name of the raster image file.

ImageFrameHighlight property Controls the display of raster images during selection.

ImageHeight property Specifies the height of the raster image.

ImageVisibility property Specifies whether image visibility is on or off.

ImageWidth property Specifies the width of the raster image.

IncrementalSavePercent property Specifies the percentage of wasted space allowed in a drawing file.

Index property Specifies the index of the menu or toolbar item.

Index property - FDL Specifies the index of an entry in the File Dependency List.

IndicatorFillColor property Specifies color of section plane when shading is turned on.

IndicatorTransparency property Specifies transparency of section plane when shading is turned on.

InsertionPoint property Insertion point for a tolerance, text, block, or shape.

InsertionPoint property Specifies the origin coordinates (upper-left corner) of the OLE object.

InsUnits property Specifies the insert units saved with the block.

InsUnitsFactor property Specifies the conversion factor between block units and drawing units.

IntersectionBoundaryColor property Specifies the color of intersection boundary.

IntersectionBoundaryDivisionLines property Specifies whether division lines are shown in intersection boundary.

IntersectionBoundaryLayer property Specifies the layer of intersection boundary.

IntersectionBoundaryLinetype property Specifies the linetype of intersection boundary.

IntersectionBoundaryLinetypeScale property Specifies the linetype scale of intersection boundary.

IntersectionBoundaryLineweight property Specifies the line weight of intersection boundary.

IntersectionBoundaryPlotStyleName property Specifies the plot style name of intersection boundary.

IntersectionFillColor property Specifies the color of intersection fill.

IntersectionFillFaceTransparency property Specifies the face transparency of intersection fill.

IntersectionFillHatchAngle property Specifies the hatch angle for intersection fill.

IntersectionFillHatchPatternName property Specifies the hatch pattern name for intersection fill.

IntersectionFillHatchPatternType property Specifies the hatch pattern type for intersection fill.

IntersectionFillHatchScale property Specifies the hatch scale for intersection fill.

IntersectionFillHatchSpacing property Specifies the hatch spacing for intersection fill.

IntersectionFillLayer property Specifies the layer of intersection fill.

IntersectionFillLinetype property Specifies the linetype of intersection fill.

IntersectionFillLinetypeScale property Specifies the linetype scale of intersection fill.

IntersectionFillLineweight property Specifies the line weight of intersection fill.

IntersectionFillPlotStyleName property Specifies the plot style name of intersection fill.

IntersectionFillVisible property Specifies the visibility of intersection fill.

Invisible property Specifies whether the attribute or attribute reference is invisible.

IsCloned property Determines whether the source object in a CopyObjects operation has been cloned.

IsDynamicBlock property Specifies whether this is a dynamic block.

IsLayout property Determines whether the given block is a layout block.

IsModified property Specifies whether an entry in the File Dependency List was modified.

ISOPenWidth property Specifies the ISO pen width of an ISO hatch pattern.

IsOwnerXlated property Determines whether the owning object in a CopyObjects operation has been translated.

IsPartial property Specifies whether the dimension is for a partial arc.

IsPeriodic property Determines whether the given spline is periodic.

IsPlanar property Determines whether the given spline is planar.

IsPrimary property Determines whether the source object in a CopyObjects operation was part of the primary set of objects being copied, or if it was simply owned by a member in the primary set.

IsQuiescent property Checks whether AutoCAD is idle and ready to accept automation calls from out-of-process applications.

IsRational property Determines whether the given spline is rational.

Issuer property Specifies the issuer name of the digital certificate.

IsXRef property Determines whether the given block is an XRef block.

ItemName property Specifies the item of the underlay file.

J

JogAngle property Specifies the jog angle.

JogLocation property Specifies the jog location or pick point.

Justification property Specifies the justification of the MLine.

K

Key property The object ID of the source object in the CopyObjects operation.

Key32 property The object ID of the source object in the CopyObjects operation for a 64-bit system.

KeyboardAccelerator property Specifies the Windows standard or AutoCAD classic keyboard.

KeyboardPriority property Controls how AutoCAD responds to the input of coordinate data.

KeyLength property Specifies the length of the encryption key.

Keywords property Specifies the keywords you want to use to locate the drawing.

Knots property Gets the knot vector for a spline.

L

Label property Specifies the content and formatting of menu items as they appear to the user.

LabelBlockId property Returns and sets the label block ID associated with the viewport.

LabelBlockId32 property Returns and sets the label block ID associated with the viewport for a 64-bit system.

LandingGap property The text landing gap.

LargeButtons property Specifies whether the toolbar button is large or small.

LastHeight property Specifies the last text height used.

LastSavedBy property Specifies the name of the last person who modified the file.

Layer property Specifies the layer for an object.

LayerOn property Specifies the state of a layer.

Layers property Gets the Layers collection for the document.

LayerState property Specifies the name of the layer state of the view.

Layout property Specifies the layout associated with the model space, paper space, or block object.

LayoutCreateViewport property Toggles the automatic creation of a viewport for new layouts.

LayoutCrosshairColor property Specifies the color of the crosshairs and text for paper space layouts.

LayoutDisplayMargins property Toggles the display of margins in layouts.

LayoutDisplayPaper property Toggles the display of the paper background in layouts.

LayoutDisplayPaperShadow property Toggles the display of the paper background shadow in layouts.

LayoutID property Specifies the layout of the view.

LayoutID32 property Specifies the layout of the view for a 64-bit system.

Layouts property Gets the Layouts collection for the document.

LayoutShowPlotSetup property Toggles the display of the Plot Setup dialog when a new layout is created.

Leader1Point property Specifies the origin of leader 1.

Leader2Point property Specifies the origin of leader 2.

LeaderLength property Specifies the length of the leader on the diameter or radius dimension.

LeaderLineColor property Specifies the color of the leader lines.

LeaderLinetype property Specifies the type of the leader lines.

LeaderLineTypeId property Specifies the linetype of leader lines of the mleaderstyle.

LeaderLineWeight property Specifies the weight of the leader lines.

LeaderType property Specifies the type of the leader.

Left property Specifies the left edge of a toolbar.

Length property Gets the length of an object.

LensLength property Specifies the lens length used in perspective viewing.

Limits property Specifies the drawing limits.

LinearScaleFactor property Specifies a global scale factor for linear dimensioning measurements.

LineSpacingDistance property Specifies the spacing of multiline text.

LineSpacingFactor property Specifies the relative line spacing factor for the MText object.

LineSpacingStyle property Specifies the line spacing style for the MText object.

Linetype property Specifies the linetype of an object.

LinetypeGeneration property Specifies the linetype generation of a 2D polyline or a lightweight polyline.

Linetypes property Gets the Linetypes collection for the document.

LinetypeScale property Specifies the linetype scale of an object.

Lineweight property Specifies the lineweight of an individual object or the default lineweight for the drawing.

LineweightDisplay property Specifies whether lineweights are displayed in model space for the drawing.

LiveSectionEnabled property Turns live section on or off for this section object.

LoadAcadLspInAllDocuments property Specifies whether acad.lsp is loaded at startup or with each drawing.

LocaleID property Gets the locale ID of the current AutoCAD session.

Lock property Locks or unlocks a layer.

LockAspectRatio property Ensures that the width and height of the object stay in proportion.

LockPosition property Specifies whether the attribute or attribute reference may be moved relative to the geometry in the block.

LogFileOn property Specifies whether the contents of the text window are written to a log file.

LogFilePath property Specifies the location for the log file.

LowerLeftCorner property Gets the lower-left corner of the current active viewport.

M

Macro property Specifies the macro for the menu or toolbar item.

MainDictionary property Specifies the current dictionary to use for spell checking.

MajorAxis property Specifies the direction of the major axis of the ellipse.

MajorRadius property Specifies the length of the major axis of the ellipse.

Mask property Specifies the layer properties to be restored.

Material property Specifies the name of the material

Material property Returns the material of a table.

Materials property Returns the materials collection for the database.

MaxActiveViewports property Specifies the maximum number of active viewports.

MaxAutoCADWindow property Specifies whether the AutoCAD window should fill the entire screen area when you start.

MaxLeaderSegmentsPoints property Specifies the maxLeaderSegmentsPoints of the mleaderstyle.

Mclose property Specifies whether the PolygonMesh is closed in the M direction.

Mdensity property Specifies the surface density of a PolygonMesh in the M direction.

Measurement property Gets the measurement for the dimension.

MenuBar property Gets the MenuBar object for the session.

MenuFile property Specifies the location of the AutoCAD customization file for the session.

MenuFileName property Gets the customization file name where the menu group is located.

MenuGroups property Gets the MenuGroups collection for the session.

Menus property Gets the PopupMenus collection.

MinimumTableHeight property Specifies the minimum height of the table.

MinimumTableWidth property Specifies the minimum width of the table.

MinorAxis property Specifies the direction of the minor axis of an ellipse.

MinorRadius property Specifies the length of the minor axis of the ellipse.

MLineScale property Specifies the scale of the MLine

Mode property Specifies the mode of the attribute definition.

ModelCrosshairColor property Specifies the color of the crosshairs and text for model space.

ModelSpace property Gets the ModelSpace collection for the document.

ModelType property Specifies whether a plot configuration applies to model space or to all layouts.

ModelView property Returns and sets the model view associated with the viewport.

MomentOfInertia property Gets the moment of inertia for the solid.

Monochrome property Determines whether underlay is monochrome.

MRUNumber property Specifies the number of most recently used files that is shown in the File menu.

MSpace property Allows editing of the model from floating paper space viewports.

MTextAttribute property Determines if the attribute is multi-line.

MTextAttribute property Determines if the attribute is multi-line.

MTextAttribute property Determines if the attribute is multi-line.

MTextAttributeContent property Gets the multi-line attribute content.

MTextAttributeContent property Gets the multi-line attribute content.

MTextAttributeContent property Gets the multi-line attribute content.

MTextBoundaryWidth property Determines the width of text boundary for the MText.

MTextBoundaryWidth property Determines the width of text boundary for the MText.

MTextDrawingDirection property Determines the drawing direction for the MText.

MTextDrawingDirection property Determines the drawing direction for the MText.

MVertexCount property Gets the vertex count in the M direction for a PolygonMesh.

N

Name property Specifies the name of the object.

NameNoMnemonic property Specifies the name of the popup menu without the underscore mnemonic.

Nclose property Specifies whether the PolygonMesh is closed in the N direction.

NDensity property Specifies the smooth surface density of a PolygonMesh in the N direction.

Normal property Specifies the three-dimensional normal unit vector for the object.

NumberOfControlPoints property Gets the number of control points of the spline.

NumberOfCopies property Specifies the number of copies to plot.

NumberOfFaces property Gets the number of faces for the PolyfaceMesh.

NumberOfFitPoints property Gets the number of fit points of the spline.

NumberOfLoops property Gets the number of loops in the hatch boundary.

NumberOfVertices property Gets the number of vertices for the PolyfaceMesh.

NumCellStyles property The number of cell styles a table has.

NumCrossSections property Displays the number of cross-section curves used.

NumGuidePaths property Displays the number of guide paths used.

NumVertices property Gets the number of vertices in the section line.

NVertexCount property Gets the vertex count in the N direction for a PolygonMesh.

O

ObjectID property Gets the object ID.

ObjectID32 property Gets the object ID for a 64-bit system.

ObjectName property Gets the AutoCAD class name of the object.

ObjectSnapMode property Specifies the setting of the object snap mode.

ObjectSortByPlotting property Toggles sorting of drawing objects by plotting order.

ObjectSortByPSOutput property Toggles sorting of drawing objects by PostScript output order.

ObjectSortByRedraws property Toggles sorting of drawing objects by redraw order.

ObjectSortByRegens property Toggles sorting of drawing objects by regeneration order.

ObjectSortBySelection property Toggles sorting of drawing objects by object selection.

ObjectSortBySnap property Toggles sorting of drawing objects by object snap.

ObliqueAngle property Specifies the oblique angle of the object.

OleItemType property Specifies whether the OLE object is linked to the original pasted file when opening the object for editing.

OLELaunch property Determines whether to launch the parent application when plotting OLE objects.

OlePlotQuality property Controls the plot quality of an OLE object based on the file type selected from the list.

OLEQuality property Specifies the plot quality of OLE objects.

OleSourceApp property Specifies the application for editing the OLE object.

OnMenuBar property Determines if the specified popup menu is on the menu bar.

OpenSave property Gets the PreferencesOpenSave object.

Origin property Specifies the origin of the UCS, block, layout, hatch, or raster image in WCS coordinates.

OrthoOn property Specifies the status of the Isometric snap mode for the viewport.

Output property Gets the PreferencesOutput object.

OverrideCenter property Specifies the override center location or pick point.

OwnerID property Gets the object ID of the owner (parent) object.

OwnerID property Gets the object ID of the owner (parent) object

OwnerID32 property Gets the object ID of the owner (parent) object for 64-bit systems.

P

PageSetupOverridesTemplateFile property Specifies the default template for Page Setup overrides.

PaperSpace property Gets the PaperSpace collection for the document.

PaperUnits property Specifies the units for the display of layout or plot configuration properties.

Parent property Gets the parent of the object.

Password property Specifies the encryption password.

Path property Gets the path of the block, document, application, or external reference.

PatternAngle property Specifies the angle of the hatch pattern.

PatternDouble property Specifies if the user-defined hatch is double-hatched.

PatternName property Specifies the hatch pattern name.

PatternScale property Specifies the hatch pattern scale.

PatternSpace property Specifies the user-defined hatch pattern spacing.

PatternType property Gets the pattern type used for the hatch.

Perimeter property Gets the total length of the inner and outer region loops.

PickAdd property Determines if objects are added to the selection set using the SHIFT key.

PickAuto property Controls automatic windowing at the Select Objects prompt.

PickBoxSize property Specifies the size of the object selection target.

PickDrag property Controls the method of drawing a selection window.

PickFirst property Determines if you select objects before (noun-verb selection) or after you issue a command.

PickfirstSelectionSet property Gets the pickfirst selection set.

PickGroup property Determines if picking a single object in a group selects the entire group.

Plot property Gets the Plot object for the document.

PlotConfigurations property Gets the PlotConfigurations collection for the document.

PlotHidden property Specifies if objects are to be hidden during a plot.

PlotLegacy property Toggles whether legacy plot scripts are allowed to run.

PlotLogFilePath property Specifies the path of the Plot log file.

PlotOrigin property Specifies the origin of the UCS, block, layout, or raster image in WCS coordinates.

PlotPolicy property Determines whether an object's color property is associated with its plot style name when a new drawing is created.

PlotRotation property Specifies the rotation angle for the layout or plot configuration.

PlotStyleName property Specifies the plot style name for an object, group of objects, or layer.

Plottable property Specifies if the layer is plottable.

PlotType property Specifies the type of layout or plot configuration.

PlotViewportBorders property Specifies if the viewport borders are to be plotted.

PlotViewportsFirst property Specifies if all geometry in paper space viewports is plotted first.

PlotWithLineweights property Specifies whether objects plot with the lineweights they're assigned in the plot file, or with the lineweights in the drawing file.

PlotWithPlotStyles property Specifies whether or not to plot using the plot styles that are applied to objects and defined in the plot style table.

PolarTrackingVector property Toggles the display of polar tracking vectors.

Position property Specifies the X, Y, Z coordinate for center of the base or center of the solid, or the origin for the DWF underlay.

PostScriptPrologFile property Specifies a name for a customized prolog section in the acad.psf file.

Preferences property Gets the Preferences object.

Preset property Specifies if the attribute is preset.

PrimaryUnitsPrecision property Specifies the number of decimal places displayed for the primary units of a dimension or tolerance.

PrincipalDirections property Gets the principal directions of the solid or region.

PrincipalMoments property Gets the principal moments property of the solid or region.

PrinterConfigPath property Specifies the location for printer configuration files.

PrinterDescPath property Specifies the location for printer description files.

PrinterPaperSizeAlert property Specifies whether to alert the user when a layout is configured with a paper size that is different than the default setting for the PC3 file.

PrinterSpoolAlert property Specifies whether to alert the user when the output to a device must be spooled through a system printer due to a conflict with the I/O port.

PrinterStyleSheetPath property Specifies the location for printer style sheet files.

PrintFile property Specifies an alternate name to use for the temporary plot file name.

PrintSpoolerPath property Specifies the directory for the print spool files. AutoCAD writes the plot to this location.

PrintSpoolExecutable property Specifies the application to use for print spooling.

ProductOfInertia property Gets the product of inertia of the solid or region.

ProfileRotation property Specifies the rotation of the sweep profile.

Profiles property Gets the PreferencesProfiles object.

PromptString property Specifies the prompt string for an attribute.

PropertyName property Specifies the name for the property.

ProviderName property Specifies the encryption provider name.

ProviderType property Specifies the encryption provider type.

ProxyImage property Controls the display of objects in a drawing that were created in a third-party application.

Q

QNewTemplateFile property Sets the default template file name for the QNEW command.

QuietErrorMode property Toggles the quiet error mode for plot-error reporting.

R

RadiiOfGyration property Gets the radius of gyration of the solid or region.

Radius property Specifies the radius of an arc or circle.

RadiusRatio property Specifies the major to minor axis ratio of an ellipse.

ReadOnly property Specifies if the document or property is read-only or read-write.

Red property Specifies the red component of the True Color.

ReferenceCount property Specifies the reference count of an entry in the File Dependency List.

RegenerateTableSuppressed property Enables or disables regeneration of the table block.

RegisteredApplications property Gets the RegisteredApplications collection for the document.

RemoveHiddenLines property Specifies if hidden lines are to be plotted on a paper space viewport.

RenderSmoothness property Specifies the smoothness of shaded, rendered, and hidden line-removed objects.

RepeatBottomLabels property Determines whether the bottom set of label rows is repeated at the bottom of each broken table part.

RepeatTopLabels property Determines whether the first set of label rows will be repeated at the top of each broken table part.

RevisionNumber property Specifies the revision number.

RevolutionAngle property Specifies the angle of revolution.

Rotation property Specifies the rotation angle of the OLE object.

Rotation property Specifies the rotation angle for the object.

RoundDistance property Specifies the rounding of dimension units.

RowHeight property Specifies a uniform height for all rows in the table.

Rows property Specifies the number of rows in a block array.

Rows property Specifies the number of rows in the table.

RowSpacing property Specifies the spacing of the rows in a block array.

S

SaveAsType property Specifies the drawing type for saving the drawing.

Saved property Specifies if the document has any unsaved changes.

SavePreviewThumbnail property Specifies if BMP preview images are saved with the drawing.

s

scale property Specifies the scale factor from start to the end of the sweep path.

S

ScaleFactor property Specifies the scale factor for the object.

ScaleHeight property Specifies the height of the object as a percentage of its original height.

ScaleLineweights property Specifies if the lineweight is scaled with the rest of the geometry when a layout is printed.

ScaleWidth property Specifies the width of the object as a percentage of its original height.

SCMCommandMode property Determines right-click functionality in the drawing area while in Command mode, which means that a command is currently in progress.

SCMDefaultMode property Determines right-click functionality in the drawing area while in Default mode, which means that no objects are selected and no commands are in progress.

SCMEditMode property Determines right-click functionality in the drawing area while in Edit mode, which means that one or more objects are selected and no commands are in progress.

SCMTimeMode property Controls time-sensitive right-click behavior.

SCMTimeValue property Controls time-sensitive right-click behavior by setting the duration of the long click that displays a shortcut menu.

SecondPoint property Specifies the second point of the ray or xline.

SecondSegmentAngleConstraint property Specifies the SecondSegmentAngleConstraint of the mleaderstyle.

SectionManager property Returns the section manager object.

SegmentPerPolyline property Specifies the number of line segments to be generated for each polyline curve.

Selection property Gets the PreferencesSelection object.

SelectionSets property Gets the SelectionSets collection for the document.

SerialNumber property Specifies the serial number of the digital certificate.

ShadePlot property Specifies the shaded viewport plotting mode of a viewport.

ShadowDisplay property Specifies the shadow display property of the object.

SheetView property Returns and sets the sheet view associated with the viewport.

ShortCutMenu property Determines if the specified popup menu is the shortcut menu.

ShortCutMenuDisplay property Controls whether right-clicking in the drawing area displays a shortcut menu or issues ENTER.

Show property Specifies whether the property is shown in the user interface.

ShowHistory property Specifies whether to show history of the solid.

ShowPlotStyles property Specifies whether or not plot styles and plot style names are displayed in the drawing.

ShowProxyDialogBox property Specifies if AutoCAD displays a warning message when you open a drawing that contains custom objects.

ShowRasterImage property Controls the display of raster images during real-time pan and zooms.

ShowRotation property Determines if a raster image is displayed at its rotation value.

ShowWarningMessages property Resets all dialog boxes that have the "Don't Display This Warning Again" check box so they display again.

SingleDocumentMode property Determines if AutoCAD runs in single- or multiple-document mode.

SnapBasePoint property Specifies the snap base point for the viewport.

SnapOn property Specifies the status of snap.

SnapRotationAngle property Specifies the snap rotation angle of the viewport relative to the current UCS.

SolidFill property Specifies if multilines, traces, solids, all hatches (including solid-fill), and wide polylines are filled in.

SolidType property Indicates the type of solid.

SourceObjects property Specifies the source objects for section generation.

StandardScale property Specifies the standard scale for the layout, viewport, or plot configuration.

StartAngle property Specifies the start angle of an arc or an ellipse.

StartDraftAngle property Specifies the draft angle of the surface for the first cross section.

StartDraftMagnitude property Specifies the draft magnitude of the surface for the first cross section.

StartParameter property Specifies the start parameter for an ellipse.

StartPoint property Specifies the start point for the arc, line, or ellipse.

State property Specifies section object type.

StatusID property Gets the current active status of the viewport.

StoreSQLIndex property Determines if the SQL index is stored in the drawing.

StyleName property Specifies the name of the style used with the object.

StyleName property Specifies the name of the table style.

StyleSheet property Specifies the style sheet for the layout or plot configuration.

Subject property Specifies the subject name of the digital ID (certificate).

Subject property (SummmaryInfo object) Specifies the subject of the drawing.

SubMenu property Gets the popup menu associated with a sub menu.

SummaryInfo property Specifies the properties of a drawing.

SupportPath property Specifies the directories where AutoCAD searches for support files.

SuppressLeadingZeros property Specifies the suppression of leading zeros in dimension values.

SuppressTrailingZeros property Specifies the suppression of trailing zeros in dimension values.

SuppressZeroFeet property Specifies the suppression of a zero foot measurement in dimension values.

SuppressZeroInches property Specifies the suppression of a zero inch measurement in dimension values.

SurfaceNormals property Specifies for which cross-section curves the surface is normal to the cross section.

SurfaceType property Indicates the type of surface.

SymbolPosition property Specifies placement of the arc length dimension symbol.

System property Gets the PreferencesSystem object.

T

TableBreakFlowDirection property Determines the direction that parts of the table flow.

TableBreakHeight property Sets the breaking height for the initial table part and any other table parts that do not have manual heights set.

TablesReadOnly property Determines whether to open database tables in read-only mode.

TableStyleOverrides property Specifies the table style overrides.

TabOrder property Specifies the tab order of a layout.

TagString property Specifies the tag string of the object.

TaperAngle property Specifies the taper angle of the extrusion.

Target property Specifies the target point for the view or viewport.

TempFileExtension property Specifies the extension for temporary files.

TempFilePath property Specifies the directory AutoCAD uses to store temporary files.

TemplateDwgPath property Specifies the path for the template files used by the start-up wizards.

TempXRefPath property Specifies the location of external reference files.

TextAlignmentPoint property Specifies the alignment point for text and attributes.

TextAlignmentType property Specifies the TextAlignmentType of the mleaderstyle.

TextAngleType property Specifies the TextAngleType of the mleaderstyle.

TextAttachmentType property Specify how leaders connect with the text.

TextBackgroundFill property Specifies if Background Mask ought to be used.

TextColor property Specifies the color of the text for dimension and tolerance objects.

TextDirection property Specifies the drawing direction of the Mtext.

TextEditor property Specifies the name of the text editor for the MTEXT command.

TextFill property Sets fill color On or Off (DIMTFILL system variable)

TextFillColor property Sets text fill color (DIMTFILLCLR system variable).

TextFont property Specifies the font for new text.

TextFontSize property Specifies the font size for new text.

TextFontStyle property Specifies the font style for new text.

TextFrameDisplay property Toggles the display of frames for text objects instead of displaying the text itself.

TextGap property Specifies the distance between the dimension text and the dimension line when you break the dimension line to accommodate dimension text.

TextGenerationFlag property Specifies the attribute text generation flag.

TextHeight property Specifies the height for the dimension or tolerance text.

TextInside property Specifies if the dimension text is to be drawn inside the extension lines.

TextInsideAlign property Specifies the position of dimension text inside the extension lines for all dimension types except ordinate.

TextJustify property Specifies the attachment point of the Mtext.

TextLeftAttachmentType property Specify how leaders on the left side connect with the text.

TextLineSpacingDistance property Specifies the line spacing distance of the Mtext.

TextLineSpacingFactor property Specifies the line spacing factor of the Mtext.

TextLineSpacingStyle property Specifies the line spacing style of the Mtext.

TextMovement property Specifies how dimension text is drawn when text is moved.

TextOutsideAlign property Specifies the position of dimension text outside the extension lines for all dimension types except ordinate.

TextOverride property Specifies the text string for the dimension.

TextPosition property Specifies the dimension text position.

TextPrecision property Specifies the precision of angular dimension text.

TextPrefix property Specifies the dimension value prefix.

TextRightAttachmentType property Specify how leaders on the right side connect with the text.

TextRotation property Specifies the rotation angle of the dimension text.

TextString property Specifies the text string for the entity.

TextStyle property Specifies the text style for the dimension or tolerance text.

TextStyleName property Specifies the style name of the Mtext.

TextStyles property Gets the TextStyles collection for the document.

TextSuffix property Specifies the dimension value suffix.

TextureMapPath property Specifies the directory in which AutoCAD searches for rendering texture maps.

TextWidth property Specifies the width of the Mtext.

TextWinBackgrndColor property Specifies the background color for the text window.

TextWinTextColor property Specifies the text color for the text window.

Thickness property Specifies the distance a 2D AutoCAD object is extruded above or below its elevation.

TimeServer property Specifies the name of the time server to be used for a digital signature.

TimeStamp property Specifies the timestamp of an entry in the File Dependency List.

Title property Specifies the title you want to use to locate the drawing.

TitleSuppressed property Specifies whether the title of the table is suppressed.

ToleranceDisplay property Specifies if tolerances are displayed with the dimension text.

ToleranceHeightScale property Specifies a scale factor for the text height of tolerance values relative to the dimension text height.

ToleranceJustification property Specifies the vertical justification of tolerance values relative to the nominal dimension text.

ToleranceLowerLimit property Specifies the minimum tolerance limit for dimension text.

TolerancePrecision property Specifies the precision of tolerance values in primary dimensions.

ToleranceSuppressLeadingZeros property Specifies the suppression of leading zeros in tolerance values.

ToleranceSuppressTrailingZeros property Specifies the suppression of trailing zeros in dimension values.

ToleranceSuppressZeroFeet property Specifies the suppression of a zero foot measurement in tolerance values.

ToleranceSuppressZeroInches property Specifies the suppression of a zero inch measurement in tolerance values.

ToleranceUpperLimit property Specifies the maximum tolerance limit for dimension text.

Toolbars property Gets the Toolbars collection.

ToolPalettePath property Sets the tool palette path.

Top property Specifies the top edge of a toolbar.

TopHeight property Specifies elevation of section plane top extents relative to the object’s elevation.

TopRadius property Specifies the top radius of the helix.

TotalAngle property Gets the total angle for the arc.

TotalLength property Specifies the total length of the helix.

TranslateIDs property Specifies the translation of any contained object IDs during deepClone or wblockClone operations.

Transparency property Specifies if the transparency for a particular bitonal image is on or off.

TrueColor property Specifies the True Color of an object.

TrueColorImages property Determines if raster and render images are displayed at true color or palletized color.

TurnHeight property Specifies the height of one full turn for the helix.

Turns property Specifies the number of turns for the helix.

TurnSlope property Displays the constant incline angle for the helix path.

Twist property Controls the twist direction of the helix.

Twist property Specifies the amount of rotation along the entire length of the sweep path.

TwistAngle property Specifies the twist angle for the viewport.

Type property Specifies type of a Leader, MenuGroup, PopupMenuItem, ToolbarItem, Polyline, or PolygonMesh object.

U

UCSIconAtOrigin property Specifies if the UCS icon is displayed at the origin.

UCSIconOn property Specifies if the UCS icon is on.

UCSPerViewport property Specifies if the UCS is saved with the viewport.

UIsolineDensity property Specifies the number of U isolines that are displayed.

UnderlayLayerOverrideApplied property Determines whether underlay layver overrides are applied or not.

UnderlayName property Specifies the name of the underlay file.

UnderlayVisibility property Specifies the visibility of the underlay file.

Units property Specifies the native units of measure for the block.

UnitsFormat property Specifies the unit format for all dimensions except angular.

UnitsType property Specifies the current display units type for the property.

UpperRightCorner property Gets the upper-right corner of the current active viewport.

UpsideDown property Specifies the direction of text.

URL property Specifies the URL for the Hyperlink object.

URLDescription property Specifies the URL description for the Hyperlink object.

URLNamedLocation property Specifies the named location for the Hyperlink object.

Used property Specifies whether a layer is in use.

UseLastPlotSettings property Applies the plotting settings of the last successful plot.

User property Gets the PreferencesUser object.

UseStandardScale property Specifies if the plot is to use a standard or custom scale.

Utility property Gets the Utility object for the document.

V

Value property Specifies the current value for the property, or the object ID of the newly created cloned object.

Value32 property Specifies the current value for the property, or the object ID of the newly created cloned object, for a 64-bit system.

VBE property Gets the VBAIDE extensibility object.

Verify property Specifies if the attribute is set for verification.

Version property Gets the version of the AutoCAD application you are using.

VersionGUID property Specifies the name of the Version GUID of an entry in the File Dependency List.

VertCellMargin property Specifies the value of the vertical margin of cells.

VerticalDirection property Specifies the vertical direction for the section plane.

VerticalTextPosition property Specifies the vertical position of text in relation to the dimension line.

Vertices property Gets the vertices in the section line.

ViewingDirection property Specifies the viewing direction for the section plane.

ViewportDefault property Specifies if the layer is to be frozen in new viewports.

ViewportOn property Specifies the display status of the viewport.

Viewports property Gets the Viewports collection for the document.

Views property Gets the Views collection for the document.

ViewToPlot property Specifies the name of the view to plot.

VisibilityEdge1 property Specifies the visibility of a 3DFace edge 1.

VisibilityEdge2 property Specifies the visibility of a 3DFace edge 2.

VisibilityEdge3 property Specifies the visibility of a 3DFace edge 3.

VisibilityEdge4 property Specifies the visibility of a 3DFace edge 4.

Visible property Specifies the visibility of an object or the application.

VIsolineDensity property Specifies the number of V isolines that are displayed.

Volume property Gets the volume of the solid.

W

Weights property Gets the weight vector for spline.

Width property Specifies the width of the OLE object box.

Width property Specifies the width of the table.

Width property Specifies the width of the text boundary, view, image, toolbar, or main application window.

WindowLeft property Specifies the left edge of the application window.

WindowState property Specifies the state of the application or document window.

WindowTitle property Gets the title of the document window.

WindowTop property Specifies the top edge of the application window.

WorkspacePath property Specifies the path for the database workspace file.

X

XEffectiveScaleFactor property Specifies the effective XScale factor of the block.

XRefDatabase property Gets the Database object that defines the contents of the block.

XRefDemandLoad property Specifies demand loading of external references.

XRefEdit property Determines if the current drawing can be edited in place when being referenced by another user.

XRefFadeIntensity property Controls the dimming intensity for XRefs.

XRefLayerVisibility property Determines the visibility of xref-dependent layers and specifies if nested xref path changes are saved.

XScaleFactor property Specifies the X scale factor for the block or external reference (xref).

XVector property Specifies the X direction of the given UCS.

Y

YEffectiveScaleFactor property Specifies the effective YScale factor of the block.

YScaleFactor property Specifies the Y scale factor for the block or external reference (xref).

YVector property Specifies the Y direction of the given UCS.

Z

ZEffectiveScaleFactor property Specifies the effective ZScale factor of the block.

ZScaleFactor property Specifies the Z scale factor for the block or external reference (xref).


Action property [ActiveX and VBA Reference: AAR]

Action Property

Specifies the security-related operations to be performed on a drawing.

See Also | Example

Signature

object.Action

object

SecurityParams
The object or objects this property applies to.

Action

Long; AcadSecurityParamsType enum; read-write. Specify one or more of the following constants for drawing encryption, drawing properties encryption, a digital signature, or a time stamp.

ACADSECURITYPARAMS_ENCRYPT_DATA | 0x00000001
ACADSECURITYPARAMS_ENCRYPT_PROPS | 0x00000002
ACADSECURITYPARAMS_SIGN_DATA | 0x00000010
ACADSECURITYPARAMS_ADD_TIMESTAMP | 0x00000020

Remarks

Each constant represents a security-related operation. When you use the Action property, at some point in the set of operations you must set the Action property to either the ACADSECURITYPARAMS_ENCRYPT_DATA constant, the ACADSECURITYPARAMS_SIGN_DATA constant, or to both.

To specify multiple security-related operations, add the constants representing the operations. For example, to sign a drawing and use a time stamp, specify the following:

ACADSECURITYPARAMS_SIGN_DATA + ACADSECURITYPARAMS_ADD_TIMESTAMP


Active property [ActiveX and VBA Reference: AAR]

Active Property

Determines if the document is the active document for the session.

See Also | Example

Signature

object.Active

object

Document object
The object or objects this property applies to.

Active

Boolean; read-only
Determines if the document is the active document for the session.

TRUE: The document is the active document.

FALSE: The document is not the active document.


ActiveDimStyle property [ActiveX and VBA Reference: AAR]

ActiveDimStyle Property

Specifies the active dimension style.

See Also | Example

Signature

object.ActiveDimStyle

object

Document object
The object or objects this property applies to.

ActiveDimStyle

DimStyle object; read-write
A user-specified variable declared as an AcadDimStyle object type.

Remarks

This style will be applied to all newly created dimensions. To change the style on an existing dimension, use the StyleName property.

To control the settings of the current document overrides, use the dimensioning system variables. See "System Variables" in the AutoCAD Command Reference for a list of dimensioning system variables.

When you change a dimensioning system variable, you are actually setting a document override for the active dimension style. You are not changing the active dimension style itself. To change the settings of a given dimension style, use the CopyFrom method. This method copies a dimension style configuration, including overrides, from a document, dimension, or other dimension style.

Dimensions created via the AutoCAD user interface are created with the active dimension style plus all document overrides. Dimensions created via ActiveX are created with the active dimension style only. To have the dimensions created via ActiveX take on the document overrides, use the CopyFrom method to copy the dimension style from the document to the active dimension style. This process will copy all existing overrides into the active dimension style.


ActiveDocument property [ActiveX and VBA Reference: AAR]

ActiveDocument Property

Specifies the active document (drawing file).

See Also | Example

Signature

object.ActiveDocument

object

Application
The object or objects this property applies to.

ActiveDocument

Document object; read-write
The default is drawing.dwg.


ActiveLayer property [ActiveX and VBA Reference: AAR]

ActiveLayer Property

Specifies the active layer.

See Also | Example

Signature

object.ActiveLayer

object

Document
The object or objects this property applies to.

ActiveLayer

Layer object; read-write
The layer that is currently active.

Remarks

New objects are placed on the active layer as they are created. To change the layer on which an existing object resides, use the Layer property for that object.

To create a new layer, use the Add method.

To change the visibility or another property of a layer, refer to the Layer object.


ActiveLayout property [ActiveX and VBA Reference: AAR]

ActiveLayout Property

Specifies the active layout.

See Also | Example

Signature

object.ActiveLayout

object

Document
The object or objects this property applies to.

ActiveLayout

Layout object; read-write
The layout that is currently active for the drawing.


ActiveLinetype property [ActiveX and VBA Reference: AAR]

ActiveLinetype Property

Specifies the active linetype for the drawing.

See Also | Example

Signature

object.ActiveLinetype

object

Document
The object or objects this property applies to.

ActiveLinetype

Linetype object; read-write
The active linetype for the drawing.

Remarks

The specified linetype must already exist in the drawing. To add a new linetype, use the Add method.


ActiveMaterial property [ActiveX and VBA Reference: AAR]

ActiveMaterial property

Specifies the current default material for this document.

See Also | Example

Signature

object.ActiveMaterial

object

Document
The object or objects to which this property applies.

ActiveMaterial

AcadMaterial; input/output


ActiveProfile property [ActiveX and VBA Reference: AAR]

ActiveProfile Property

Specifies the active profile for the AutoCAD session.

See Also | Example

Signature

object.ActiveProfile

object

PreferencesProfiles
The object or objects this property applies to.

ActiveProfile

String; read-write
The name of the active profile.


ActivePViewport property [ActiveX and VBA Reference: AAR]

ActivePViewport Property

Specifies the active paper space viewport for the drawing.

See Also | Example

Signature

object.ActivePViewport

object

Document
The object or objects this property applies to.

ActivePViewport

PViewport object; read-write
The active paper space viewport.

Remarks

A viewport must be set active using this property before you can see any changes to it.


ActiveSelectionSet property [ActiveX and VBA Reference: AAR]

ActiveSelectionSet Property

Gets the active selection set for the drawing.

See Also | Example

Signature

object.ActiveSelectionSet

object

Document
The object or objects this property applies to.

ActiveSelectionSet

SelectionSet object; read-only
The active selection set for the drawing.


ActiveSpace property [ActiveX and VBA Reference: AAR]

ActiveSpace Property

Toggles the active space between paper space and model space.

See Also | Example

Signature

object.ActiveSpace

object

Document
The object or objects this property applies to.

ActiveSpace

acActiveSpace enum; read-write

acModelSpace

acPaperSpace

System variables

The value of this property is stored in the TILEMODE system variable.

Remarks

For model space floating viewports, this value is set to acPaperSpace. Even though you have the capability of editing the model, you are still technically in paper space.

For more information on this property, see the PViewport object.


ActiveTextStyle property [ActiveX and VBA Reference: AAR]

ActiveTextStyle Property

Specifies the active text style for the drawing.

See Also | Example

Signature

object.ActiveTextStyle

object

Document
The object or objects this property applies to.

ActiveTextStyle

TextStyle object; read-write
The active text style for the drawing.

Remarks

New text added to the drawing will adopt the active text style. Existing text that has no distinct text style specified will adopt the new active text style.

Changes made to the current active text style will become visible only after that text style is reset as the active text style. To reset the active text style, simply call this property with the updated text style object.

NOTE A call to the Regen method is necessary to see this change.

To specify a distinct text style for an object so it will not change along with the active text style, use the StyleName property.


ActiveUCS property [ActiveX and VBA Reference: AAR]

ActiveUCS Property

Specifies the active UCS for the drawing.

See Also | Example

Signature

object.ActiveUCS

object

Document
The object or objects this property applies to.

ActiveUCS

UCS object
The active UCS for the drawing.

Remarks

Changes made to the current active UCS will become visible only after that UCS is reset as the active UCS.

If you try to get the active UCS value when the current UCS is unsaved, an error will occur. It is recommended that you confirm that the value of the UCSNAME system variable is not empty before you get the active UCS value. Alternatively, you can add a new UCS object and set it to active before getting the active UCS value.


ActiveViewport property [ActiveX and VBA Reference: AAR]

ActiveViewport Property

Specifies the active viewport for the drawing.

See Also | Example

Signature

object.ActiveViewport

object

Document
The object or objects this property applies to.

ActiveViewport

Viewport object; read-write
The active viewport for the drawing.

Remarks

Changes made to the current active viewport will become visible only after you reset the viewport as the active viewport. To reset the active viewport, simply call this property with the updated viewport object.

Use the StatusID property to determine if a viewport is currently active.

You can iterate through existing viewports to find a particular viewport. To do this, first identify the name of the viewport configuration on which the desired viewport resides using the Name property. Additionally, if the viewport configuration has been split, each individual viewport on the configuration can be identified through the LowerLeftCorner and UpperRightCorner properties.

The LowerLeftCorner and UpperRightCorner properties represent the graphic placement of the viewport on the display. These properties are defined as follows (using a four-way split as an example):

Viewport 1—LowerLeftCorner = (0, .5), UpperRightCorner = (.5, 1)

Viewport 2—LowerLeftCorner = (.5, .5), UpperRightCorner = (1, 1)

Viewport 3—LowerLeftCorner = (0, 0), UpperRightCorner = (.5, .5)

Viewport 4—LowerLeftCorner = (.5, 0), UpperRightCorner = (1, .5)


ADCInsertUnitsDefaultSource property [ActiveX and VBA Reference: AAR]

ADCInsertUnitsDefaultSource Property

Determines the units to use automatically for objects in DesignCenter for a source drawing that does not have assigned insert units.

See Also | Example

Signature

object.ADCInsertUnitsDefaultSource

object

PreferencesUser
The object or objects this property applies to.

ADCInsertUnitsDefaultSource

AcInsertUnits enum; read-write

acInsertUnitsUnitless

acInsertUnitsInches

acInsertUnitsFeet

acInsertUnitsMiles

acInsertUnitsMillimeters

acInsertUnitsCentimeters

acInsertUnitsMeters

acInsertUnitsKilometers

acInsertUnitsMicroinches

acInsertUnitsMils

acInsertUnitsYards

acInsertUnitsAngstroms

acInsertUnitsNanometers

acInsertUnitsMicrons

acInsertUnitsDecimeters

acInsertUnitsDecameters

acInsertUnitsHectometers

acInsertUnitsGigameters

acInsertUnitsAstronomicalUnits

acInsertUnitsLightYears

acInsertUnitsParsecs

System variables

The value of this property is stored in the INSUNITSDEFSOURCE system variable.

Remarks

The initial value for this property is acInsertUnitsUnitless.


ADCInsertUnitsDefaultTarget property [ActiveX and VBA Reference: AAR]

ADCInsertUnitsDefaultTarget Property

Determines the units to use automatically for objects in DesignCenter for a target drawing that does not have assigned insert units.

See Also | Example

Signature

object.ADCInsertUnitsDefaultTarget

object

PreferencesUser
The object or objects this property applies to.

ADCInsertUnitsDefaultTarget

AcInsertUnits enum; read-write

acInsertUnitsUnitless

acInsertUnitsInches

acInsertUnitsFeet

acInsertUnitsMiles

acInsertUnitsMillimeters

acInsertUnitsCentimeters

acInsertUnitsMeters

acInsertUnitsKilometers

acInsertUnitsMicroinches

acInsertUnitsMils

acInsertUnitsYards

acInsertUnitsAngstroms

acInsertUnitsNanometers

acInsertUnitsMicrons

acInsertUnitsDecimeters

acInsertUnitsDecameters

acInsertUnitsHectometers

acInsertUnitsGigameters

acInsertUnitsAstronomicalUnits

acInsertUnitsLightYears

acInsertUnitsParsecs

System variables

The value of this property is stored in the INSUNITSDEFTARGET system variable.

Remarks

The initial value for this property is acInsertUnitsUnitless.


AdjustForBackground property [ActiveX and VBA Reference: AAR]

AdjustForBackground property

Determines whether the underlay colors are adjusted for the current background color.

See Also | Example

Signature

object.AdjustForBackground

object

DwfUnderlay
The object or objects to which this property applies.

AdjustForBackground

Boolean; input/output


AffectsGraphics property [ActiveX and VBA Reference: AAR]

AffectsGraphics Property

Specifies that the entry in the File Dependency List affects graphics.

See Also | Example

Signature

object.AffectsGraphics

object

FileDependency
The object or objects this property applies to.

AffectsGraphics

Boolean; read-only

TRUE: Entry affects the display.

FALSE: Entry does not affect the display.


Algorithm property [ActiveX and VBA Reference: AAR]

Algorithm Property

Specifies the identifier of the encryption algorithm.

See Also | Example

Signature

object.Algorithm

object

SecurityParams
The object or objects this property applies to.

Algorithm

Long; AcadSecurityParamsConstants enum; read-write. Specify only the following constant.

ACADSECURITYPARAMS_ALGID_RC4

0x00006801


Alignment property [ActiveX and VBA Reference: AAR]

Alignment Property

Specifies both the vertical and horizontal alignments for the attribute, attribute reference, or text.

See Also | Example

Signature

object.Alignment

object

Attribute, AttributeRef, Text
The object or objects this property applies to.

Alignment

acAlignment enum; read-write

acAlignmentLeft

acAlignmentCenter

acAlignmentRight

acAlignmentAligned

acAlignmentMiddle

acAlignmentFit

acAlignmentTopLeft

acAlignmentTopCenter

acAlignmentTopRight

acAlignmentMiddleLeft

acAlignmentMiddleCenter

acAlignmentMiddleRight

acAlignmentBottomLeft

acAlignmentBottomCenter

acAlignmentBottomRight

Remarks

Text aligned to acAlignmentLeft uses the InsertionPoint property to position the text.

Text aligned to acAlignmentAligned, or acAlignmentFit uses both the InsertionPoint and TextAlignmentPoint properties to position the text.

Text aligned to any other position uses the TextAlignmentPoint property to position the text.


AlignmentPointAcquisition property [ActiveX and VBA Reference: AAR]

AlignmentPointAcquisition Property

Specifies how AutoAlignment points are acquired.

See Also | Example

Signature

object.AlignmentPointAcquisition

object

PreferencesDrafting
The object or objects this property applies to.

AlignmentPointAcquisition

acAlignmentPointAcquisition enum; read-write

acAlignPntAcquisitionAutomatic:
AutoAlignment points are acquired automatically.

acAlignPntAcquisitionShiftToAcquire:
The user must use the SHIFT key to acquire AutoAlignment points.

Remarks

The initial value for this property is acAlignPntAcquisitionAutomatic.


AlignSpace property [ActiveX and VBA Reference: AAR]

AlignSpace Property

Specifies the AlignSpace of the mleaderstyle.

See Also | Example

Signature

object.AlignSpace

Object

MLeaderStyle
The object this property applies to.

AlignSpace

Long; read-write
The alignment space value.


AllowedValues property [ActiveX and VBA Reference: AAR]

AllowedValues Property

Specifies the allowed values for the property.

Signature

object.AllowedValues

object

DynamicBlockReferenceProperty
The object or objects this property applies to.

AllowedValues

Variant; read-only

Remarks

Not all dynamic block properties have a restricted set of property values. Some properties are unrestricted, some specify a mimimum or maximum value (or both), and some have a list of allowed values. This property supports only allowed property values that are defined by a list; mimimum, maximum, and unrestricted property types are not supported.


AllowLongSymbolNames property [ActiveX and VBA Reference: AAR]

AllowLongSymbolNames Property

Determines if symbol names may include extended character sets, or more than 31 characters.

See Also | Example

Signature

object.AllowLongSymbolNames

object

DatabasePreferences
The object or objects this property applies to.

AllowLongSymbolNames

Boolean; read-write

TRUE: Use extended symbol names.

FALSE: Use restricted symbol names.

System variables

The value of this property is stored in the EXTNAMES system variable.

Remarks

The initial value of this property is TRUE.

Extended symbol names may contain up to 255 characters and A-Z, 0-9, spaces, and any special character not used by Microsoft Windows and AutoCAD for other purposes.

Restricted symbol names may contain up to 31 characters and A-Z, 0-9, dollar sign ($), underscore (_), and hyphen (-).

This property applies to the names of non-graphical objects (such as linetypes and layers) that are stored in symbol tables.


AllowManualHeights property [ActiveX and VBA Reference: AAR]

AllowManualHeights Property

Toggles the manual heights in a table.

See Also | Example

Signature

object.AllowManualHeights

Object

Table
The object or objects this property applies to.

AllowManualHeights

Boolean; read-write
Allows the heights of broken table parts to have their own breaking height. When set to FALSE, all table parts will break at the height of the initial table part.


AllowManualPositions property [ActiveX and VBA Reference: AAR]

AllowManualPositions Property

Toggles the manual positions in a table.

See Also | Example

Signature

object.AllowManualPositions

Object

Table
The object or objects this property applies to.

AllowManualPositions

Boolean; read-write
When enabled, each table part can be moved outside of the boundary. When not enabled, the table parts are contained within a rectangular boundary.


AltFontFile property [ActiveX and VBA Reference: AAR]

AltFontFile Property

Specifies the location of the font file to use if AutoCAD can't locate the original font and an alternate font is not specified in the font mapping file.

See Also | Example

Signature

object.AltFontFile

object

PreferencesFiles
The object or objects this property applies to.

AltFontFile

String; read-write
The alternate font file.


AltRoundDistance property [ActiveX and VBA Reference: AAR]

AltRoundDistance Property

Specifies the rounding of alternate units.

See Also | Example

Signature

object.AltRoundDistance

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltRoundDistance

Double; read-write
A positive real number representing the value to round distances to. The initial value is 0.00.

System variables

This property overrides the value of the DIMALTRND system variable for the given dimension.

Remarks

If the AltUnits property is turned on, this property defines the number to round distances to.


AltSuppressLeadingZeros property [ActiveX and VBA Reference: AAR]

AltSuppressLeadingZeros Property

Specifies the suppression of leading zeros in alternate dimension values.

See Also | Example

Signature

object.AltSuppressLeadingZeros

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltSuppressLeadingZeros

Boolean; read-write

TRUE: Suppress leading zeros in alternate dimensions. For example, 0.5000 becomes .5000.

FALSE: Do not suppress leading zeros in alternate dimensions.

System variables

This property overrides the value for the DIMALTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltSuppressTrailingZeros property [ActiveX and VBA Reference: AAR]

AltSuppressTrailingZeros Property

Specifies the suppression of trailing zeros in alternate dimension values.

See Also | Example

Signature

object.AltSuppressTrailingZeros

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltSuppressTrailingZeros

Boolean; read-write

TRUE: Suppress trailing zeros in alternate dimensions. For example, 12.5000 becomes 12.5.

FALSE: Do not suppress trailing zeros in alternate dimensions.

System variables

This property overrides the value for the DIMALTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltSuppressZeroFeet property [ActiveX and VBA Reference: AAR]

AltSuppressZeroFeet Property

Specifies the suppression of a zero foot measurement in alternate dimension values.

See Also | Example

Signature

object.AltSuppressZeroFeet

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltSuppressZeroFeet

Boolean; read-write

TRUE: Suppress the display of a zero foot measurement.

FALSE: Do not suppress the display of a zero foot measurement.

System variables

This property overrides the value for the DIMALTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltSuppressZeroInches property [ActiveX and VBA Reference: AAR]

AltSuppressZeroInches Property

Specifies the suppression of a zero inch measurement in alternate dimension values.

See Also | Example

Signature

object.AltSuppressZeroInches

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltSuppressZeroInches

Boolean; read-write

TRUE: Suppress the display of a zero inch measurement.

FALSE: Do not suppress the display of a zero inch measurement.

System variables

This property overrides the value for the DIMALTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltTabletMenuFile property [ActiveX and VBA Reference: AAR]

AltTabletMenuFile Property

Specifies the path for an alternate menu to swap with the standard AutoCAD tablet menu.

See Also | Example

Signature

object.AltTabletMenuFile

object

PreferencesFiles
The object or objects this property applies to.

AltTabletMenuFile

String; read-write
The alternate tablet menu path.

Remarks

This property is applicable only if you use a digitizer.


AltTextPrefix property [ActiveX and VBA Reference: AAR]

AltTextPrefix Property

Specifies a prefix for the alternate dimension measurement for all dimension types except angular.

See Also | Example

Signature

object.AltTextPrefix

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltTextPrefix

String; read-write
The prefix for the alternate dimensions.

System variables

This property overrides the value of the DIMAPOST system variable for the given dimension.

Remarks

The initial value for this property is "".

To turn off an established prefix, set this property equal to a single period (.).


AltTextSuffix property [ActiveX and VBA Reference: AAR]

AltTextSuffix Property

Specifies a suffix for the alternate dimension measurement for all dimension types except angular.

See Also | Example

Signature

object.AltTextSuffix

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltTextSuffix

String; read-write
The suffix for the alternate dimensions.

System variables

This property overrides the value of the DIMAPOST system variable for the given dimension.

Remarks

The initial value for this property is "".

To turn off an established suffix, set this property equal to a single period (.).


AltTolerancePrecision property [ActiveX and VBA Reference: AAR]

AltTolerancePrecision Property

Specifies the precision of tolerance values in alternate dimensions.

See Also | Example

Signature

object.AltTolerancePrecision

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltTolerancePrecision

acDimPrecision enum; read-write

acDimPrecisionZero: | 0.
acDimPrecisionOne: | 0.0
acDimPrecisionTwo: | 0.00
acDimPrecisionThree: | 0.000
acDimPrecisionFour: | 0.0000
acDimPrecisionFive: | 0.00000
acDimPrecisionSix: | 0.000000
acDimPrecisionSeven: | 0.0000000
acDimPrecisionEight: | 0.00000000

System variables

This property overrides the value of the DIMTDEC system variable for the given dimension.

Remarks

The initial value for this property is acDimPrecisionTwo.

This property is available only when the ToleranceDisplay property is set to any value other than acTolNone.


AltToleranceSuppressLeadingZeros property [ActiveX and VBA Reference: AAR]

AltToleranceSuppressLeadingZeros Property

Specifies the suppression of leading zeros in alternate dimension values.

See Also | Example

Signature

object.AltToleranceSuppressLeadingZeros

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltToleranceSuppressLeadingZeros

Boolean; read-write

TRUE: Suppress leading zeros in alternate dimensions. For example, 0.5000 becomes .5000.

FALSE: Do not suppress leading zeros in alternate dimensions.

System variables

This property overrides the value for the DIMALTTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltToleranceSuppressTrailingZeros property [ActiveX and VBA Reference: AAR]

AltToleranceSuppressTrailingZeros Property

Specifies the suppression of trailing zeros in alternate tolerance values.

See Also | Example

Signature

object.AltToleranceSuppressTrailingZeros

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltToleranceSuppressTrailingZeros

Boolean; read-write

TRUE: Suppress trailing zeros in alternate tolerance values. For example, 12.5000 becomes 12.5.

FALSE: Do not suppress trailing zeros in alternate tolerance values.

System variables

This property overrides the value for the DIMALTTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltToleranceSuppressZeroFeet property [ActiveX and VBA Reference: AAR]

AltToleranceSuppressZeroFeet Property

Specifies the suppression of a zero foot measurement in alternate tolerance values.

See Also | Example

Signature

object.AltToleranceSuppressZeroFeet

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltToleranceSuppressZeroFeet

Boolean; read-write

TRUE: Suppress the display of a zero foot measurement.

FALSE: Do not suppress the display of a zero foot measurement.

System variables

This property overrides the value for the DIMALTTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltToleranceSuppressZeroInches property [ActiveX and VBA Reference: AAR]

AltToleranceSuppressZeroInches Property

Specifies the suppression of a zero inch measurement in alternate tolerance values.

See Also | Example

Signature

object.AltToleranceSuppressZeroInches

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltToleranceSuppressZeroInches

Boolean; read-write

TRUE: Suppress the display of a zero inch measurement.

FALSE: Do not suppress the display of a zero inch measurement.

System variables

This property overrides the value for the DIMALTTZ system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


AltUnits property [ActiveX and VBA Reference: AAR]

AltUnits Property

Enables dimensioning in alternate units.

See Also | Example

Signature

object.AltUnits

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltUnits

Boolean; read-write

TRUE: Enable dimensioning in alternate units.

FALSE: Disable dimensioning in alternate units.

System variables

This property overrides the value of the DIMALT system variable for the given dimension.


AltUnitsFormat property [ActiveX and VBA Reference: AAR]

AltUnitsFormat Property

Specifies the units format for alternate units of all dimensions except angular.

See Also | Example

Signature

object.AltUnitsFormat

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltUnitsFormat

acDimUnits enum; read-write

acDimScientific

acDimDecimal

acDimEngineering

acDimArchitecturalStacked

acDimFractionalStacked

acDimArchitectural

acDimFractional

acDimWindowsDesktop

System variables

This property overrides the value of the DIMALTU system variable for the given dimension.

Remarks

The initial value for this property is acDimDecimal.


AltUnitsPrecision property [ActiveX and VBA Reference: AAR]

AltUnitsPrecision Property

Specifies the number of decimal places in alternate units.

See Also | Example

Signature

object.AltUnitsPrecision

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltUnitsPrecision

acDimPrecision enum; read-write
Use one of the following constants to specify precision:

acDimPrecisionZero | 0.
acDimPrecisionOne | 0.0
acDimPrecisionTwo | 0.00
acDimPrecisionThree | 0.000
acDimPrecisionFour | 0.0000
acDimPrecisionFive | 0.00000
acDimPrecisionSix | 0.000000
acDimPrecisionSeven | 0.0000000
acDimPrecisionEight | 0.00000000

System variables

This property overrides the value of the DIMALTD system variable for the given dimension.


AltUnitsScale property [ActiveX and VBA Reference: AAR]

AltUnitsScale Property

Specifies the scale factor for alternate units.

See Also | Example

Signature

object.AltUnitsScale

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

AltUnitsScale

Double; read-write
Initial value: 25.4000

System variables

This property overrides the value of the DIMALTF system variable for the given dimension.

Remarks

If the AltUnits property is turned on, this property multiplies linear dimensions by a factor to produce a value in an alternate system of measurement. The initial value represents the number of millimeters in an inch.


Angle property [ActiveX and VBA Reference: AAR]

Angle Property

Gets the angle of a line.

See Also | Example

Signature

object.Angle

object

Line
The object or objects this property applies to.

Angle

Double; read-only
The angle of the line in radians. The angle measurement begins at the X axis and proceeds in a counterclockwise direction.


AngleFormat property [ActiveX and VBA Reference: AAR]

AngleFormat Property

Specifies the unit format for angular dimensions.

See Also | Example

Signature

object.AngleFormat

object

Dim3PointAngular, DimAngular
The object or objects this property applies to.

AngleFormat

acAngleUnits enum; read-write

acDegrees

acDegreeMinuteSeconds

acGrads

acRadians

System variables

This property overrides the value of the DIMAUNIT system variable for the given dimension.

Remarks

The initial value for this property is acDegrees.


AngleVertex property [ActiveX and VBA Reference: AAR]

AngleVertex Property

Specifies the angle vertex for the three-point angular dimension.

See Also | Example

Signature

object.AngleVertex

object

Dim3PointAngular
The object or objects this property applies to.

AngleVertex

Variant (three-element array of doubles); read-write
A 3D coordinate representing the angle vertex.


Annotation property [ActiveX and VBA Reference: AAR]

Annotation Property

Specifies the annotation object for a leader.

See Also | Example

Signature

object.Annotation

object

Leader
The object or objects this property applies to.

Annotation

Tolerance, MText, BlockRef
The annotation object for the leader. Leader annotations can be a tolerance object, multiline text object, or a block reference.

Remarks

Not all leaders have annotation objects. If a leader has no annotation, this property will return Nothing (logical FALSE). To test for a logical FALSE value in VB or VBA, use the Nothing keyword.


Annotative property [ActiveX and VBA Reference: AAR]

Annotative Property

Specifies the Annotative of the mleaderstyle.

See Also | Example

Signature

object.Annotative

Object

MLeaderStyle
The object this property applies to.

Annotative

Boolean; read-write
The mleaderstyle's annotative status.


Application property [ActiveX and VBA Reference: AAR]

Application Property

Gets the Application object.

See Also | Example

Signature

object.Application

object

All objects
The object or objects this property applies to.

Application

Application object; read-only

Remarks

The Application object represents the application's frame controls and path settings, and provides the means to navigate down the object hierarchy.


ArcEndParam property [ActiveX and VBA Reference: AAR]

ArcEndParam Property

Specifies the end parameter of the arc.

Signature

object.ArcEndParam

object

DimArcLength
The object or objects this property applies to.

ArcEndParam

Double; read-write


ArcLength property [ActiveX and VBA Reference: AAR]

ArcLength Property

Gets the length of the arc.

See Also | Example

Signature

object.ArcLength

object

Arc object
The object or objects this property applies to.

ArcLength

Double; read-only
The length of the arc.


ArcPoint property [ActiveX and VBA Reference: AAR]

ArcPoint Property

Specifies a point on the arc.

Signature

object.ArcPoint

object

DimArcLength
The object or objects this property applies to.

ArcPoint

Variant; read-write


ArcSmoothness property [ActiveX and VBA Reference: AAR]

ArcSmoothness Property

Specifies the smoothness of circles, arcs, and ellipses.

See Also | Example

Signature

object.ArcSmoothness

object

PViewport, Viewport
The object or objects this property applies to.

ArcSmoothness

Integer; read-write
A positive integer from 1 to 20,000.

Remarks

The initial value for this property is 100.

A higher number produces smoother objects, but AutoCAD requires more time to regenerate them. You can improve performance by setting this property to a low value for drawing and increasing the value for rendering. The valid range is 1 through 20,000.


ArcStartParam property [ActiveX and VBA Reference: AAR]

ArcStartParam Property

Specifies the start parameter of the arc.

Signature

object.ArcStartParam

object

DimArcLength
The object or objects this property applies to.

ArcStartParam

Double; read-write


Area property [ActiveX and VBA Reference: AAR]

Area Property

Specifies the enclosed area of an arc, circle, ellipse, hatch, lightweight polyline, polyline, region, or planar-closed spline.

See Also | Example

Signature

object.Area

object

Arc, Circle, Ellipse, Hatch, LightweightPolyline, Polyline, Region, Spline
The object or objects this property applies to.

Area

Double; read-write for Circle objects, read-only for all others
The area of the object specified in square drawing units.

Remarks

Hatch objects:
Note To access this property, use the IAcadHatch2 interface.

Wide polylines:
The area is defined by the center of the width.

Regions:
The area equals the combined area for all the objects in the region.

Open objects such as arcs, spline curves, and open polylines:
The area is computed as though a straight line connects the start point and endpoint.

Open polyline

Area calculated


Arrowhead1Block property [ActiveX and VBA Reference: AAR]

Arrowhead1Block Property

Specifies the block to use as the custom arrowhead for the first end of the dimension line.

See Also | Example

Signature

object.Arrowhead1Block

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRotated
The object or objects this property applies to.

Arrowhead1Block

String; read-write
The name of the block to use as the arrowhead for the first end of the dimension line.

System variables

This property overrides the value of the DIMBLK1 system variable for the given dimension.


Arrowhead1Type property [ActiveX and VBA Reference: AAR]

Arrowhead1Type Property

Specifies the type of arrowhead for the first end of the dimension line.

See Also | Example

Signature

object.Arrowhead1Type

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRotated
The object or objects this property applies to.

Arrowhead1Type

acDimArrowheadType enum; read-write

acArrowDefault |
acArrowDot |
acArrowDotSmall |
acArrowDotBlank |
acArrowOrigin |
acArrowOrigin2 |
acArrowOpen |
acArrowOpen90 |
acArrowOpen30 |
acArrowClosed |
acArrowSmall |
acArrowNone |
acArrowOblique |
acArrowBoxFilled |
acArrowBoxBlank |
acArrowClosedBlank |
acArrowDatumFilled |
acArrowDatumBlank |
acArrowIntegral |
acArrowArchTick |
acArrowUserDefined | Read-only

System variables

This property overrides the value of the DIMBLK1 system variable for the given dimension.

Remarks

The initial value for this property is acArrowDefault.

When you use the Arrowhead1Block property to specify a block to use as a custom arrowhead, this property will be set to acArrowUserDefined.


Arrowhead2Block property [ActiveX and VBA Reference: AAR]

Arrowhead2Block Property

Specifies the block to use as the custom arrowhead for the second end of the dimension line.

See Also | Example

Signature

object.Arrowhead2Block

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRotated
The object or objects this property applies to.

Arrowhead2Block

String; read-write
The name of the block to use as the arrowhead for the first end of the dimension line.

System variables

This property overrides the value of the DIMBLK2 system variable for the given dimension.


Arrowhead2Type property [ActiveX and VBA Reference: AAR]

Arrowhead2Type Property

Specifies the type of arrowhead for the second end of the dimension line.

See Also | Example

Signature

object.Arrowhead2Type

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRotated
The object or objects this property applies to.

Arrowhead2Type

acDimArrowheadType enum; read-write

acArrowDefault |
acArrowDot |
acArrowDotSmall |
acArrowDotBlank |
acArrowOrigin |
acArrowOrigin2 |
acArrowOpen |
acArrowOpen90 |
acArrowOpen30 |
acArrowClosed |
acArrowSmall |
acArrowNone |
acArrowOblique |
acArrowBoxFilled |
acArrowBoxBlank |
acArrowClosedBlank |
acArrowDatumFilled |
acArrowDatumBlank |
acArrowIntegral |
acArrowArchTick |
acArrowUserDefined | Read-only

System variables

This property overrides the value of the DIMBLK2 system variable for the given dimension.

Remarks

The initial value for this property is acArrowDefault.

When you use the Arrowhead2Block property to specify a block to use as a custom arrowhead, this property will be set to acArrowUserDefined.


ArrowheadBlock property [ActiveX and VBA Reference: AAR]

ArrowheadBlock Property

Specifies the block to use as the custom arrowhead for a radial dimension or leader line.

See Also | Example

Signature

object.ArrowheadBlock

object

DimRadial, DimRadialLarge, Leader
The object or objects this property applies to.

ArrowheadBlock

String; read-write
The name of the block to use as the arrowhead for the leader.

System variables

This property overrides the value of the DIMLDRBLK system variable for the given dimension.


ArrowheadSize property [ActiveX and VBA Reference: AAR]

ArrowheadSize Property

Specifies the size of dimension line arrowheads, leader line arrowheads, and hook lines.

See Also | Example

Signature

object.ArrowheadSize

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Leader
The object or objects this property applies to.

ArrowheadSize

Double; read-write
The size of the arrowhead must be specified as a positive real >= 0.0.

System variables

This property overrides the value of the DIMASZ system variable for the given dimension.

Remarks

The initial value for this property is 0.1800

Multiples of the arrowhead size determine if dimension lines and text should fit between the extension lines. This property is also used to scale arrowhead blocks if set by DIMBLK. This property has no effect when DIMTSZ is other than zero.


ArrowheadType property [ActiveX and VBA Reference: AAR]

ArrowheadType Property

Specifies the type of arrowhead for the radial dimension or leader.

See Also | Example

Signature

object.ArrowheadType

object

DimRadial, DimRadialLarge, Leader
The object or objects this property applies to.

ArrowheadType

acDimArrowheadType enum; read-write

acArrowDefault |
acArrowDot |
acArrowDotSmall |
acArrowDotBlank |
acArrowOrigin |
acArrowOrigin2 |
acArrowOpen |
acArrowOpen90 |
acArrowOpen30 |
acArrowClosed |
acArrowSmall |
acArrowNone |
acArrowOblique |
acArrowBoxFilled |
acArrowBoxBlank |
acArrowClosedBlank |
acArrowDatumFilled |
acArrowDatumBlank |
acArrowIntegral |
acArrowArchTick |
acArrowUserDefined | Read-only

System variables

This property overrides the value of the DIMLDRBLK system variable for the given dimension.

Remarks

The initial value for this property is acArrowDefault.

When you use the ArrowheadBlock property to specify a block to use as a custom arrowhead, this property will be set to acArrowUserDefined.


ArrowSize property [ActiveX and VBA Reference: AAR]

ArrowSize Property

Specifies the arrowSize of the mleaderstyle.

See Also | Example

Signature

object.ArrowSize

Object

MLeaderStyle
The object this property applies to.

ArrowSize

Long; read-write
Size of the arrow.


ArrowSymbol property [ActiveX and VBA Reference: AAR]

ArrowSymbol Property

Specifies the ArrowSymbol of the mleaderstyle.

See Also | Example

Signature

object.ArrowSymbol

Object

MLeaderStyle
The object this property applies to.

ArrowSymbol

Long; read-write
Size of the arrow.


AssociativeHatch property [ActiveX and VBA Reference: AAR]

AssociativeHatch Property

Specifies whether the hatch is associative.

See Also | Example

Signature

object.AssociativeHatch

object

Hatch
The object or objects this property applies to.

AssociativeHatch

Boolean; read-only

TRUE: The hatch is associative.

FALSE: The hatch is not associative.

Remarks

An associative hatch is updated when its boundaries are modified. A nonassociative hatch is not updated when its boundaries are modified.

Associativity can only be set when a hatch is created. See the AddHatch method for more information on creating a hatch.


AttachmentPoint property [ActiveX and VBA Reference: AAR]

AttachmentPoint Property

Specifies the attachment point for an MText object.

See Also | Example

Signature

object.AttachmentPoint

object

MText
The object or objects this property applies to.

AttachmentPoint

acAttachmentPoint enum; read-write

acAttachmentPointTopLeft

acAttachmentPointTopCenter

acAttachmentPointTopRight

acAttachmentPointMiddleLeft

acAttachmentPointMiddleCenter

acAttachmentPointMiddleRight

acAttachmentPointBottomLeft

acAttachmentPointBottomCenter

acAttachmentPointBottomRight

Remarks

The attachment point specifies where the insertion point aligns with the text boundary. The option you select determines both the text justification and text spill in relation to the text boundary. The options for text justification are Left, Right, and Center. The options for text spill are Top, Mid (middle), and Bottom.

Top Left left-justified, spills down | Top Center center-justified, spills down | Top Right right-justified, spills down

Mid Left left-justified, spills up and down | Mid Center center-justified, spills up and down | Mid Right right-justified, spills up and down

Bottom Left left-justified, spills up | Bottom Center center-justified, spills up | Bottom Right right-justified, spills up

When the AttachmentPoint property is changed, the position of the existing bounding box does not change; the text is simply rejustified within the bounding box. However, the InsertionPoint property reflects the coordinates of the attachment point being used, so the value of the InsertionPoint property will change to reflect the change in justification.


Author property [ActiveX and VBA Reference: AAR]

Author Property

Specifies the author of the drawing.

See Also | Example

Signature

object.Author

Object

SummaryInfo
The object or objects this property applies to.

Author

String; read-write
The Author property of a drawing.


AutoAudit property [ActiveX and VBA Reference: AAR]

AutoAudit Property

Specifies whether AutoCAD should perform an audit after you render a DXFIN or DXBIN interchange command.

See Also | Example

Signature

object.AutoAudit

object

PreferencesOpenSave
The object or objects this property applies to.

AutoAudit

Boolean; read-write

TRUE: Performs an audit after each DXFIN or DXBIN command.

FALSE: Does not perform an audit after each DXFIN or DXBIN command.


AutomaticPlotLog property [ActiveX and VBA Reference: AAR]

AutomaticPlotLog Property

Specifies whether to automatically save a Plot or Publish log.

See Also | Example

Signature

object.AutomaticPlotLog

Object

PreferencesOutput
The object or objects this property applies to.

AutomaticPlotLog

Boolean; read-write

Remarks

This property is equivalent to the AutoCAD Options dialog box setting "Automatically Save Plot and Publish Log."


AutoSaveInterval property [ActiveX and VBA Reference: AAR]

AutoSaveInterval Property

Specifies an automatic save interval in minutes.

See Also | Example

Signature

object.AutoSaveInterval

object

PreferencesOpenSave
The object or objects this property applies to.

AutoSaveInterval

Integer; read-write
0 >= AutoSaveInterval <= 600
An interval equal to 0 disables automatic save.
An interval greater than 0 automatically saves the drawing at the specified intervals.

System variables

This property is also controlled by the SAVETIME system variable. The ISAVEBAK system variable (set using the CreateBackup property) improves the speed of incremental saves, especially for larger drawings. The ISAVEPERCENT system variable (set using the IncrementalSavePercent property) determines the amount of wasted space tolerated in a drawing.

Remarks

The initial setting for this property is 120.

The timer starts as soon as you make a change to a drawing. It is reset and restarted whenever the drawing is saved. The current drawing is saved to auto.sv$ unless you have specified a different name using the AutoSavePath property.


AutoSavePath property [ActiveX and VBA Reference: AAR]

AutoSavePath Property

Specifies the path for the file that is created if you enable automatic save using the AutoSaveInterval property.

See Also | Example

Signature

object.AutoSavePath

object

PreferencesFiles
The object or objects this property applies to.

AutoSavePath

String; read-write
The drive and path of the automatic save files.

System variables

The value for this property is stored in the SAVEFILEPATH system variable.


AutoSnapAperture property [ActiveX and VBA Reference: AAR]

AutoSnapAperture Property

Toggles the display of the AutoSnap aperture.

See Also | Example

Signature

object.AutoSnapAperture

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapAperture

Boolean; read-write

TRUE: Displays the AutoSnap aperture.

FALSE: Hides the AutoSnap aperture.

System variables

The value of this property is stored in the APBOX system variable.

Remarks

The initial value for this property is TRUE.

The AutoSnap aperture is displayed in the center of the crosshairs when you snap to an object. This option is available only when the AutoSnap marker, magnet, or tooltip is enabled.


AutoSnapApertureSize property [ActiveX and VBA Reference: AAR]

AutoSnapApertureSize Property

Specifies the size of the AutoSnap aperture.

See Also | Example

Signature

object.AutoSnapApertureSize

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapApertureSize

Long; read-write
The size of the AutoSnap aperture in pixels.

System variables

The value of this property is stored in the APERTURE system variable.

Remarks

The initial value for this property is 10.

The AutoSnap aperture is displayed in the center of the crosshairs when you snap to an object. This option is available only when the AutoSnap marker, magnet, or tooltip is enabled.


AutoSnapMagnet property [ActiveX and VBA Reference: AAR]

AutoSnapMagnet Property

Toggles the AutoSnap magnet.

See Also | Example

Signature

object.AutoSnapMagnet

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapMagnet

Boolean; read-write

TRUE: Enables the AutoSnap magnet.

FALSE: Disables the AutoSnap magnet.

System variables

The value of this property is stored in the AUTOSNAP system variable.

Remarks

The initial value for this property is TRUE.


AutoSnapMarker property [ActiveX and VBA Reference: AAR]

AutoSnapMarker Property

Toggles the AutoSnap marker.

See Also | Example

Signature

object.AutoSnapMarker

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapMarker

Boolean; read-write

TRUE: Enables the AutoSnap marker.

FALSE: Disables the AutoSnap marker.

System variables

The value of this property is stored in the AUTOSNAP system variable.

Remarks

The initial value for this property is TRUE.


AutoSnapMarkerColor property [ActiveX and VBA Reference: AAR]

AutoSnapMarkerColor Property

Specifies the color of the AutoSnap marker.

See Also | Example

Signature

object.AutoSnapMarkerColor

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapMarkerColor acColor enum; read-write

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

Remarks

The initial value for this property is acYellow.


AutoSnapMarkerSize property [ActiveX and VBA Reference: AAR]

AutoSnapMarkerSize Property

Specifies the size of the AutoSnap marker.

See Also | Example

Signature

object.AutoSnapMarkerSize

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapMarkerSize

Long; read-write
A value from 1 to 20 representing the size of the AutoSnap marker in pixels.


AutoSnapToolTip property [ActiveX and VBA Reference: AAR]

AutoSnapToolTip Property

Toggles the AutoSnap tooltips.

See Also | Example

Signature

object.AutoSnapToolTip

object

PreferencesDrafting
The object or objects this property applies to.

AutoSnapToolTip

Boolean; read-write

TRUE: Enables the AutoSnap tooltips.

FALSE: Disables the AutoSnap tooltips.

System variables

The value of this property is stored in the AUTOSNAP system variable.

Remarks

The initial value for this property is TRUE.


AutoTrackingVecColor property [ActiveX and VBA Reference: AAR]

AutoTrackingVecColor Property

Specifies the color of the auto tracking vector.

See Also | Example

Signature

object.AutoTrackingVecColor

object

PreferencesDisplay
The object or objects this property applies to.

AutoTrackingVecColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The default color for this property is vbWhite.


AutoTrackTooltip property [ActiveX and VBA Reference: AAR]

AutoTrackTooltip Property

Toggles the display of the AutoTrack tooltips.

See Also | Example

Signature

object.AutoTrackTooltip

object

PreferencesDrafting
The object or objects this property applies to.

AutoTrackTooltip

Boolean; read-write

TRUE: Displays AutoTrack tooltips.

FALSE: Does not display AutoTrack tooltips.

System variables

The value of this property is stored in the AUTOSNAP system variable.

Remarks

The initial value for this property is TRUE.

When this property is enabled, the user sees a tooltip whenever the cursor is over an alignment path. When the property is disabled, the tooltip does not show.


AxisDirection property [ActiveX and VBA Reference: AAR]

AxisDirection property

Displays the direction of the axis of revolution.

See Also | Example

Signature

object.AxisDirection

object

RevolvedSurface
The object or objects to which this property applies.

AxisDirection

Variant; input-only


AxisPosition property [ActiveX and VBA Reference: AAR]

AxisPosition property

Specifies the start point of the axis of revolution.

See Also | Example

Signature

object.AxisPosition

object

RevolvedSurface
The object or objects to which this property applies.

AxisPosition

Variant; input/output


BackgroundFill property [ActiveX and VBA Reference: AAR]

BackgroundFill Property

Specifies whether multiline text has a background fill.

See Also | Example

Signature

object.BackgroundFill

Object

MText
The object or objects this property applies to.

BackgroundFill

Boolean; read-write

Remarks

The value contained in this property is the Background Mask property in the Properties palette.


BackgroundLinesColor property [ActiveX and VBA Reference: AAR]

BackgroundLinesColor property

Specifies the color of background lines.

See Also | Example

Signature

object.BackgroundLinesColor

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesColor

AcadAcCmColor; input/output


BackgroundLinesHiddenLine property [ActiveX and VBA Reference: AAR]

BackgroundLinesHiddenLine property

Specifies the hidden line visibility of background lines.

See Also | Example

Signature

object.BackgroundLinesHiddenLine

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesHiddenLine

Boolean; input/output


BackgroundLinesLayer property [ActiveX and VBA Reference: AAR]

BackgroundLinesLayer property

Specifies the layer of background lines.

See Also | Example

Signature

object.BackgroundLinesLayer

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesLayer

String; input/output


BackgroundLinesLinetype property [ActiveX and VBA Reference: AAR]

BackgroundLinesLinetype property

Specifies the linetype of background lines.

See Also | Example

Signature

object.BackgroundLinesLinetype

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesLinetype

String; input/output


BackgroundLinesLinetypeScale property [ActiveX and VBA Reference: AAR]

BackgroundLinesLinetypeScale property

Specifies the linetype scale of background lines.

See Also | Example

Signature

object.BackgroundLinesLinetypeScale

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesLinetypeScale

ACAD_NOUNITS; input/output


BackgroundLinesLineweight property [ActiveX and VBA Reference: AAR]

BackgroundLinesLineweight property

Specifies the line weight of background lines.

See Also | Example

Signature

object.BackgroundLinesLineweight

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesLineweight

ACAD_LWEIGHT; input/output


BackgroundLinesPlotStyleName property [ActiveX and VBA Reference: AAR]

BackgroundLinesPlotStyleName property

Specifies the plot style name of background lines.

See Also | Example

Signature

object.BackgroundLinesPlotStyleName

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesPlotStyleName

String; input/output


BackgroundLinesVisible property [ActiveX and VBA Reference: AAR]

BackgroundLinesVisible property

Specifies the visibility of background lines.

See Also | Example

Signature

object.BackgroundLinesVisible

object

SectionTypeSettings
The object or objects to which this property applies.

BackgroundLinesVisible

Boolean; input/output


Backward property [ActiveX and VBA Reference: AAR]

Backward Property

Specifies the direction of text.

See Also | Example

Signature

object.Backward

object

Attribute, AttributeReference, Text
The object or objects this property applies to.

Backward

Boolean; read-write

TRUE: The text is backward.

FALSE: The text is forward.


Bank property [ActiveX and VBA Reference: AAR]

Bank property

Specifies whether or not the profile curve twists and rotates along a 3D path.

See Also | Example

Signature

object.Bank

object

SweptSurface
The object or objects to which this property applies.

Bank

Boolean; input/output


BasePoint property [ActiveX and VBA Reference: AAR]

BasePoint Property

Specifies the point through which the ray or xline passes.

See Also | Example

Signature

object.BasePoint

object

Ray, XLine
The object or objects this property applies to.

BasePoint

Variant (three-element array of doubles); read-write
The 3D coordinate representing the point through which the ray or xline passes.


BaseRadius property [ActiveX and VBA Reference: AAR]

BaseRadius property

Specifies the base radius of the helix.

See Also | Example

Signature

object.BaseRadius

object

Helix
The object or objects to which this property applies.

BaseRadius

Double; input/output


BatchPlotProgress property [ActiveX and VBA Reference: AAR]

BatchPlotProgress Property

Gets the current status of the batch plot, or terminates the batch plot.

See Also | Example

Signature

object.BatchPlotProgress

object

Plot
The object or objects this property applies to.

BatchPlotProgress

Boolean; read-write

TRUE: The batch plot is in progress.

FALSE: The batch plot has been cancelled or aborted. Setting BatchPlotProgress to FALSE will terminate the batch plot.

Remarks

This property is obsolete and may be removed in a future version of AutoCAD.


BeepOnError property [ActiveX and VBA Reference: AAR]

BeepOnError Property

Specifies if AutoCAD should sound an alarm beep when it detects an invalid entry.

See Also | Example

Signature

object.BeepOnError

object

PreferencesSystem
The object or objects this property applies to.

BeepOnError

Boolean; read-write

TRUE: Sounds an alarm beep with an invalid entry.

FALSE: Does not sound an alarm beep with an invalid entry.

Remarks

The initial value for this property is FALSE.


BigFontFile property [ActiveX and VBA Reference: AAR]

BigFontFile Property

Specifies the name of the Big Font file associated with the text or attribute.

See Also | Example

Signature

object.BigFontFile

object

TextStyle
The object or objects this property applies to.

BigFontFile

String; read-write
The name of the Big Font file.

Remarks

This property is similar to the FontFile property, except that it is used to specify an Asian-language Big Font file. The only valid file type is SHX.

This property cannot be set to NULL or an empty string.


BitFlags property [ActiveX and VBA Reference: AAR]

BitFlags Property

Specifies the bit flag values of a style.

See Also | Example

Signature

object.BitFlags

Object

TableStyle, MLeaderStyle
The object or objects this property applies to.

BitFlags

Long; read-write


Block property [ActiveX and VBA Reference: AAR]

Block Property

Gets the block associated with the layout.

See Also | Example

Signature

object.Block

object

Layout
The object or objects this property applies to.

Block

Block; read-only
The block associated with the layout.


Block property [ActiveX and VBA Reference: AAR]

Block Property

Specifies the Block of the mleaderstyle.

See Also | Example

Signature

object.Block

Object

MLeaderStyle
The object this property applies to.

Block

String; read-write
The mleaderstyle block.


BlockColor property [ActiveX and VBA Reference: AAR]

BlockColor Property

Specifies the BlockColor of the mleaderstyle.

See Also | Example

Signature

object.BlockColor

Object

MLeaderStyle
The object this property applies to.

BlockColor

AcCmColor; read-write
The block color.


BlockConnectionType property [ActiveX and VBA Reference: AAR]

BlockConnectionType Property

The types of block connection a multileader can have.

See Also | Example

Signature

object.BlockConnectionType

Object

MLeader Object, MLeaderStyle
The object this property applies to.

BlockConnectionType

AcBlockConnectionType; read-write
The block connection type can either connect at the base (acConnectBase), or at the extents (acConnectExtents).


Blocks property [ActiveX and VBA Reference: AAR]

Blocks Property

Gets the Blocks collection for the drawing.

See Also | Example

Signature

object.Blocks

object

Document
The object or objects this property applies to.

Blocks

Blocks collection; read-only
The Blocks collection for the drawing.


BlockScale property [ActiveX and VBA Reference: AAR]

BlockScale Property

Specifies the BlockScale of the mleaderstyle.

See Also | Example

Signature

object.BlockScale

Object

MLeaderStyle
The object this property applies to.

BlockScale

Long; read-write
The block scale factor.


BlockScaling property [ActiveX and VBA Reference: AAR]

BlockScaling Property

Specifies the scaling allowed for the block.

Signature

object.BlockScaling

object

Block
The object or objects this property applies to.

BlockScaling

AcBlockScaling enum; read-write

acAny

acUniform

Remarks

Note To access this property, use the IAcadBlock3 interface.


Blue property [ActiveX and VBA Reference: AAR]

Blue Property

Specifies the blue component of the True Color.

See Also | Example

Signature

object.Blue

object

AcCmColor
The object or objects this property applies to.

Blue

Long; read-only
The blue component, from 0-255, of AcCmColor.


BookName property [ActiveX and VBA Reference: AAR]

BookName Property

Specifies the book name (if any) of the color.

See Also | Example

Signature

object.BookName

object

AcCmColor
The object or objects this property applies to.

BookName

String; read-only
The name of the color book that the color came from.


BottomHeight property [ActiveX and VBA Reference: AAR]

BottomHeight property

Specifies elevation of section plane bottom extents relative to the object’s elevation.

See Also | Example

Signature

object.BottomHeight

object

Section
The object or objects to which this property applies.

BottomHeight

Long; input/output


BreaksEnabled property [ActiveX and VBA Reference: AAR]

BreaksEnabled Property

Toggles the breaks in a table.

See Also | Example

Signature

object.BreaksEnabled

Object

Table
The object or objects this property applies to.

BreaksEnabled

Boolean; read-write
Determines whether table breaking is in use. When enabled, the table will break automatically at the current specified height.


BreakSize property [ActiveX and VBA Reference: AAR]

BreakSize Property

Specifies the BreakSize of the mleaderstyle.

See Also | Example

Signature

object.BreakSize

Object

MLeaderStyle
The object this property applies to.

BreakSize

Double; read-write
The size of the gap used for breaking leader lines.


BreakSpacing property [ActiveX and VBA Reference: AAR]

BreakSpacing Property

Toggles the break spacing in a table.

See Also | Example

Signature

object.BreakSpacing

Object

Table
The object or objects this property applies to.

BreakSpacing

Double; read-write
Controls the spacing between the broken table parts. Depending on the break direction this will be a horizontal or vertical spacing.


Brightness property [ActiveX and VBA Reference: AAR]

Brightness Property

Specifies the current brightness value of an image.

See Also | Example

Signature

object.Brightness

object

Raster
The object or objects this property applies to.

Brightness

Integer; read-write
The brightness value is a positive integer between 0 and 100 inclusive. The default value is 50.

Remarks

You can adjust the image brightness, contrast, and fade to the display of the image as well as to the plotted output without affecting the original raster image file. Adjust brightness to darken or lighten an image. Adjust contrast to make images that have poor quality easier to read. Adjust fade to make vectors easier to see over images and to create a watermark effect in your plotted output.

Bitonal images cannot be adjusted for brightness, contrast, or fade.


CanonicalMediaName property [ActiveX and VBA Reference: AAR]

CanonicalMediaName Property

Specifies the paper size by name.

See Also | Example

Signature

object.CanonicalMediaName

object

Layout, PlotConfiguration
The object or objects this property applies to.

CanonicalMediaName

String; read-write
The name of the paper size.

Remarks

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


Caption property [ActiveX and VBA Reference: AAR]

Caption Property

Gets the text that the user sees displayed for the application or a menu item.

See Also | Example

Signature

object.Caption

object

Application, PopupMenuItem
The object or objects this property applies to.

Caption

String; read-only

Remarks

For a menu item, this property is read-only and is derived from the Label property by removing any DIESEL string expressions.


CategoryName property [ActiveX and VBA Reference: AAR]

CategoryName property

Specifies the category name of a view.

See Also | Example

Signature

object.CategoryName

Object

View
The object or objects this property applies to.

CategoryName

String; read-write
The category name of the view.


Center property [ActiveX and VBA Reference: AAR]

Center Property

Specifies the center of an arc, circle, ellipse, view, or viewport.

See Also | Example

Signature

object.Center

object

Arc, Circle, DimRadialLarge, Ellipse, PViewport, View, Viewport
The object or objects this property applies to.

Center

Variant (three-element array of doubles); read-write
The 3D coordinate representing the center of the object. The default center is (0,0,0).
Viewport, View: The center for the viewport and view objects is a 2D coordinate.

Remarks

Center of an arc


CenterMarkSize property [ActiveX and VBA Reference: AAR]

CenterMarkSize Property

Specifies the size of the center mark for radial and diameter dimensions.

See Also | Example

Signature

object.CenterMarkSize

object

DimDiametric, DimRadial, DimRadialLarge
The object or objects this property applies to.

CenterMarkSize

Double; read-write
A positive real number specifying the size of the center mark or lines.

System variables

This property overrides the value of the DIMCEN system variable for the given dimension.

Remarks

The initial value for this property is 0.0900.

This property is not available if the CenterType property is set to acCenterNone.


CenterPlot property [ActiveX and VBA Reference: AAR]

CenterPlot Property

Specifies the centering of the plot on the media.

See Also | Example

Signature

object.CenterPlot

object

Layout, PlotConfiguration
The object or objects this property applies to.

CenterPlot

Boolean; read-write

TRUE: Center the plot on the media.

FALSE: Do not center the plot on the media.

Remarks

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.

This property cannot be set to TRUE on a layout object whose PlotType property is set to acLayout.


CenterPoint property [ActiveX and VBA Reference: AAR]

CenterPoint Property

Specifies the center of the arc.

Signature

object.CenterPoint

object

DimArcLength
The object or objects this property applies to.

CenterPoint

Variant; read-write


CenterType property [ActiveX and VBA Reference: AAR]

CenterType Property

Specifies the type of center mark for radial and diameter dimensions.

See Also | Example

Signature

object.CenterType

object

DimDiametric, DimRadial, DimRadialLarge
The object or objects this property applies to.

CenterType

acDimCenterType enum; read-write

acCenterMark

acCenterLine

acCenterNone

System variables

This property overrides the value of the DIMCEN system variable for the given dimension.

Remarks

acCenterMark | acCenterLine

The center mark is visible only if you place the dimension line outside the circle or arc.


Centroid property [ActiveX and VBA Reference: AAR]

Centroid Property

Gets the center of area or mass for a region or solid.

See Also | Example

Signature

object.Centroid

object

3DSolid, Region
The object or objects this property applies to.

Centroid

Variant (two-element array of doubles); read-only
The 2D coordinate representing the centroid.

Remarks

The centroid is returned as X and Y coordinates defined as a variant.


Check property [ActiveX and VBA Reference: AAR]

Check Property

Specifies the check status for the popup menu item.

See Also | Example

Signature

object.Check

object

PopupMenuItem
The object or objects this property applies to.

Check

Boolean; read-write

TRUE: The popup menu item is checked.

FALSE: The popup menu item is not checked.

Remarks

In the following example, the 1Drawing.dwg menu item is checked.


ChordPoint property [ActiveX and VBA Reference: AAR]

ChordPoint Property

Specifies the chord point for the arc.

Signature

object.ChordPoint

object

DimRadialLarge
The object or objects this property applies to.

ChordPoint

Variant; read-write


Circumference property [ActiveX and VBA Reference: AAR]

Circumference Property

Specifies the circumference of a circle.

See Also | Example

Signature

object.Circumference

object

Circle
The object or objects this property applies to.

Circumference

Double; read-write
The circumference of the circle.


Clipped property [ActiveX and VBA Reference: AAR]

Clipped Property

Determines if the viewport has been clipped.

See Also | Example

Signature

object.Clipped

object

PViewport
The object or objects this property applies to.

Clipped

Boolean; read-only

TRUE: The viewport has been clipped.

FALSE: The viewport has not been clipped.


ClippingEnabled property [ActiveX and VBA Reference: AAR]

ClippingEnabled Property

Enables or disables the clipping boundary.

See Also | Example

Signature

object.ClippingEnabled

object

DwfUnderlay, Raster
The object or objects this property applies to.

ClippingEnabled

Boolean; read-write

TRUE: The clipping boundary is enabled.

FALSE: The clipping boundary is not enabled.

Remarks

You can display a clipped image or underlay using the clipping boundary, or you can hide the clipping boundary and display the original image or underlay boundaries. To set the clipping boundary, use the ClipBoundary method.


Closed property [ActiveX and VBA Reference: AAR]

Closed Property

Specifies whether the 3D polyline, lightweight polyline, lofted surface, polyline, or spline is open or closed.

See Also | Example

Signature

object.Closed

object

3DPolyline , LightweightPolyline, LoftedSurface, Polyline, Spline
The object or objects this property applies to.

Closed

Boolean; read-only for spline objects; read-write for all others

TRUE: The object is closed.

FALSE: The object is open (default).

An open 3D polyline | A closed 3D polyline

A lofted surface is closed if the cross-section curves that determine its profile are closed. For instance, if an arc is used in the lofting profile, the resulting surface is open. If closed curves such as circles are used for lofting, the resulting surface is closed.


Color property [ActiveX and VBA Reference: AAR]

Color Property

Specifies the color of an object or layer.

See Also | Example

Signature

object.Color

object

All Drawing objects, Group, Layer
The object or objects this property applies to.

Color

acColor enum; read-write (write-only for the Group object)
The default color designation is acByLayer. Use a color index number from 0 to 256, or one of the constants listed here:

acByBlock

acByLayer (not valid for Layer object)

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

Remarks

This property is obsolete and will be removed in a future version. When using this property, colors can be set and read as numeric index values ranging from 0 to 256. Constants are provided for the standard seven colors, as well as for the BYBLOCK and BYLAYER designations.

If you use acByBlock, AutoCAD draws new objects in the default color (white or black, depending on your configuration) until they are grouped into the block. When the block is inserted in the drawing, the objects in the block inherit the current setting of the color property.

If you use acByLayer, new objects assume the color of the layer upon which they are drawn. The value acByLayer is not valid for a Layer object.


ColorBookPath property [ActiveX and VBA Reference: AAR]

ColorBookPath Property

Sets the color book path.

See Also | Example

Signature

object.ColorBookPath

object

PreferencesFiles
The object or objects this property applies to.

ColorBookPath

String; read-write
The color book path.


ColorIndex property [ActiveX and VBA Reference: AAR]

ColorIndex Property

Specifies the color index.

See Also | Example

Signature

object.ColorIndex

object

AcCmColor
The object or objects this property applies to.

ColorIndex

acColor enum; read-write
The default color designation is acByLayer. Use a color index number from 0 to 256, or one of the constants listed here:

acByBlock

acByLayer (not valid for Layer object)

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite


ColorMethod property [ActiveX and VBA Reference: AAR]

ColorMethod Property

Specifies the color method.

See Also | Example

Signature

object.ColorMethod

object

AcCmColor
The object or objects this property applies to.

ColorMethod

acColorMethod enum; read-write
The default color method is acColorMethodByLayer. To directly determine how a color is set, use the constants listed here:

acColorMethodByACI

acColorMethodByBlock

acColorMethodByLayer

acColorMethodByRGB

acColorMethodForeground


ColorName property [ActiveX and VBA Reference: AAR]

ColorName Property

Specifies the name (if any) of the color.

See Also | Example

Signature

object.ColorName

object

AcCmColor
The object or objects this property applies to.

ColorName

String; read-only


Columns property [ActiveX and VBA Reference: AAR]

Columns Property

Specifies the number of columns in a block array.

See Also | Example

Signature

object.Columns

object

MInsertBlock
The object or objects this property applies to.

Columns

Long; read-write
The number of columns in the block array.


Columns property [ActiveX and VBA Reference: AAR]

Columns Property

Specifies the number of columns in the table.

See Also | Example

Signature

object.Columns

Object

Table
The object or objects this property applies to.

Columns

Long; read-write
The number of columns in the table.


ColumnSpacing property [ActiveX and VBA Reference: AAR]

ColumnSpacing Property

Specifies the spacing of the columns in a block array.

See Also | Example

Signature

object.ColumnSpacing

object

MInsertBlock
The object or objects this property applies to.

ColumnSpacing

Double; read-write
The spacing of the columns in the block array.


ColumnWidth property [ActiveX and VBA Reference: AAR]

ColumnWidth Property

Specifies the uniform width of all columns in the table.

See Also | Example

Signature

object.ColumnWidth

Object

Table
The object or objects this property applies to.

ColumnWidth

Double; column width


Comment property [ActiveX and VBA Reference: AAR]

Comment Property

Specifies the comment to be included with a digital signature.

See Also | Example

Signature

object.Comment

object

SecurityParams
The object or objects this property applies to.

Comment

String; read-write
The comment to be included with a digital signature.


Comments property [ActiveX and VBA Reference: AAR]

Comments Property

Specifies the comments for the block.

Signature

object.Comments

object

Block
The object or objects this property applies to.

Comments

String; read-write

Remarks

Note To access this property, use the IAcadBlock3 interface.


Comments property [ActiveX and VBA Reference: AAR]

Comments Property

Specifies the comments you want to use to locate the drawing.

See Also | Example

Signature

object.Comments

Object

SummaryInfo
The object or objects this property applies to.

Comments

String; read-write
The Comments property of a drawing.


ConfigFile property [ActiveX and VBA Reference: AAR]

ConfigFile Property

Gets the location of the configuration file used to store hardware device driver information.

See Also | Example

Signature

object.ConfigFile

object

PreferencesFiles
The object or objects this property applies to.

ConfigFile

String; read-only
The location of the configuration file used to store hardware device driver information.

Remarks

This value is read-only and can only be changed using the /c command line switch. For more information about command line switches, see the Customization Guide.


ConfigName property [ActiveX and VBA Reference: AAR]

ConfigName Property

Specifies the plotter configuration name.

See Also | Example

Signature

object.ConfigName

object

Layout, PlotConfiguration
The object or objects this property applies to.

ConfigName

String; read-write
The name of the PC3 file or print device to be used by the layout or plot configuration.

Remarks

This property does not take a fully qualified path, only the file name for the configuration file. Use the PrinterConfigPath property to specify the path for printer configuration files.

Use the RefreshPlotDeviceInfo method before trying to change the ConfigName property.

Do not assign the ConfigName property a value of "None." Attempting to do so results in unexpected behavior.


Constant property [ActiveX and VBA Reference: AAR]

Constant Property

Specifies whether the attribute or attribute reference is constant or not.

See Also | Example

Signature

object.Constant

object

Attribute, AttributeReference
The object or objects this property applies to.

Constant

Boolean; read-write for Attribute object, read-only for AttributeReference object

TRUE: The attribute is a constant attribute.

FALSE: The attribute is not a constant attribute.

Remarks

A constant attribute is one that maintains the same value in every occurrence. AutoCAD does not prompt for a value of constant attributes.

An attribute can exist as only one of four optional modes: constant, preset, invisible, or verify. The AFLAGS system variable stores the current mode settings. You can query the current mode using the Mode property.


ConstantWidth property [ActiveX and VBA Reference: AAR]

ConstantWidth Property

Specifies a global width for all segments in a polyline.

See Also | Example

Signature

object.ConstantWidth

object

LightweightPolyline, Polyline
The object or objects this property applies to.

ConstantWidth

Double; read-write
The global width for all segments in the object.

Remarks

This property sets the start and end widths for all segments in a polyline to a uniform value. This property will return a constant width only if all the segments are set to a uniform width.

Use the SetWidth and GetWidth methods to specify the width of an individual segment.


Constrain property [ActiveX and VBA Reference: AAR]

Constrain property

Controls which property is constrained when editing other property values.

See Also | Example

Signature

object.Constrain

object

Helix
The object or objects to which this property applies.

Constrain

AcHelixConstrainType; input/output


ContentBlockName property [ActiveX and VBA Reference: AAR]

ContentBlockName Property

The name of the content block.

See Also | Example

Signature

object.ContentBlockName

Object

MLeader Object
The object this property applies to.

ContentBlockName

String; read-write
A string which contains the name of the content block.


ContentBlockType property [ActiveX and VBA Reference: AAR]

ContentBlockType Property

The type of the content block.

See Also | Example

Signature

object.ContentBlockType

Object

MLeader Object
The object this property applies to.

ContentBlockType

AcPredefBlockType; read-write
A type of content block.


ContentType property [ActiveX and VBA Reference: AAR]

ContentType Property

Specifies the content type.

See Also | Example

Signature

object.ContentType

object

MLeaderStyle
The object or objects this property applies to.

ContentType

AcMLeaderContentType; Read-write


ContinuousPlotLog property [ActiveX and VBA Reference: AAR]

ContinuousPlotLog Property

Specifies whether to save a continuous Plot log.

See Also | Example

Signature

object.ContinuousPlotLog

Object

PreferencesOutput
The object or objects this property applies to.

ContinuousPlotLog

Boolean; read-write

Remarks

This property is equivalent to the AutoCAD Options dialog box settings "Save One Continuous Plot Log" and "Save One Log Per Plot."


ContourlinesPerSurface property [ActiveX and VBA Reference: AAR]

ContourLinesPerSurface Property

Specifies the number of contour lines (isolines) per surface on objects.

See Also | Example

Signature

object.ContourLinesPerSurface

object

DatabasePreferences
The object or objects this property applies to.

ContourLinesPerSurface

Integer; read-write
The valid range is 0 to 2047.

System variables

The value of this property is stored in the ISOLINES system variable.

Remarks

The initial value for this property is 4.

A torus with ContourLinesPerSurface set to 4 | A torus with ContourLinesPerSurface set to 20


Contrast property [ActiveX and VBA Reference: AAR]

Contrast Property

Specifies the current contrast value of an image or underlay.

See Also | Example

Signature

object.Contrast

object

DwfUnderlay, Raster
The object or objects this property applies to.

Contrast

Integer; read-write
The valid range is 0 to 100 inclusive.
The default is 50.

Remarks

You can adjust the image brightness, contrast, and fade to the display of the image as well as to the plotted output without affecting the original raster image or underlay file. Adjust brightness to darken or lighten an image. Adjust contrast to make images that have poor quality easier to read. Adjust fade to make vectors easier to see over images, and to create a watermark effect in your plotted output.

NOTE Bitonal images cannot be adjusted for brightness, contrast, or fade.


ControlPoints property [ActiveX and VBA Reference: AAR]

ControlPoints Property

Specifies the control points of a spline.

See Also | Example

Signature

object.ControlPoints

object

Spline
The object or objects this property applies to.

ControlPoints

Variant (array of doubles); read-write
An array of 3D WCS control points for the spline.

Remarks

You can find out how many control points a spline has by using the NumberOfControlPoints property.


Coordinate property [ActiveX and VBA Reference: AAR]

Coordinate Property

Specifies the coordinate of a single vertex in the object.

See Also | Example

Signature

object.Coordinate(index)

object

3DPoly, Leader, LightweightPolyline, Point, PolyfaceMesh, PolygonMesh, Polyline, Section, Solid, Trace
The object or objects this property applies to.

Coordinate

Variant (three-element or two-element array of doubles); read-write
The array of X, Y, and Z coordinates for the specified vertex.

LightweightPolyline object: The variant has two elements representing the X and Y coordinates in OCS.
Polyline object: The variant has three elements, representing the X and Y coordinates in OCS. The Z coordinate is present in the variant but ignored.

All other objects: The variant has three elements, representing the X and Y coordinates in WCS; the Z coordinate will default to 0 on the active UCS.

Index

Integer
The index in the array of vertices for the vertex you want to set or query. The vertex arrays are 0 based.

Remarks

This property will replace any existing vertices for the specified object. Use standard array-handling techniques to process the values contained in this property.

3DPolyline, Polyline, PolygonMesh: For simple polylines (not splined or curve fit), this property specifies simple vertices. For splined or curve-fit polylines, this property specifies control point vertices.

The OCS coordinates for the Polyline and LightweightPolyline objects can be converted to and from other coordinate systems using the TranslateCoordinates method.


Coordinates property [ActiveX and VBA Reference: AAR]

Coordinates Property

Specifies the coordinates for each vertex in the object.

See Also | Example

Signature

object.Coordinates

object

3DFace, 3DPolyline , Leader, LightweightPolyline, MLine, Point, PolyfaceMesh, PolygonMesh, Polyline, Solid, Trace
The object or objects this property applies to.

Coordinates

Variant (array of doubles); read-write
The array of points.

LightweightPolyline objects: The variant is an array of 2D points in OCS.

Polyline objects: The variant is an array of 3D points: the X and Y coordinates are in OCS; the Z coordinate is ignored.

All other objects: The variant is an array of 3D points in WCS.

Remarks

This property will replace any existing coordinates for the specified object. Use standard array-handling techniques to process the coordinates contained in this property.

You cannot change the number of coordinates in the object by using this property. You can change only the location of existing coordinates.

For the following objects, the Z coordinate will always default to 0 on the active UCS: 3DFace, Leader, MLine, PolyfaceMesh, and Trace.

3DPolyline , Polyline, PolygonMesh: For simple polylines (not splined or curve fit), this property specifies simple vertices. For splined or curve-fit polylines, this property specifies control point vertices.

When setting the coordinates for a polyline, if you supply fewer coordinates than the object currently possesses, the polyline will be truncated. Any fit points applying to the truncated vertices will also be truncated. If you supply more coordinates than the object currently possesses, the extra vertices will be appended to the polyline.

The OCS coordinates for the Polyline and LightweightPolyline objects can be converted to and from other coordinate systems using the TranslateCoordinates method.


Count property [ActiveX and VBA Reference: AAR]

Count Property

Gets the number of items in the object.

See Also | Example

Signature

object.Count

object

All Collections, Block, Dictionary, Group, Materials, SelectionSet, SectionManager
The object or objects this property applies to.

Count

Integer; read-only
The number of items in the object.


CreateBackup property [ActiveX and VBA Reference: AAR]

CreateBackup Property

Specifies the use of a backup file.

See Also | Example

Signature

object.CreateBackup

object

PreferencesOpenSave
The object or objects this property applies to.

CreateBackup

Boolean; read-write

TRUE: A backup file is created.

FALSE: No backup file is created (even for a full save).

System variables

The value of this property is stored in the ISAVEBAK system variable.

Remarks

The initial value for this property is TRUE.

This property improves the speed of incremental saves by creating a backup file (.bak). In Windows, copying the file data to create a backup file for large drawings takes a major portion of the incremental save time.

WARNING! In the case of a problem (such as a power failure in the middle of a save), it's possible that drawing data can be lost.


CurrentSectionType property [ActiveX and VBA Reference: AAR]

CurrentSectionType property

Specifies the current section type.

See Also | Example

Signature

object.CurrentSectionType

object

SectionSettings
The object or objects to which this property applies.

CurrentSectionType

AcSectionType; input/output


CursorSize property [ActiveX and VBA Reference: AAR]

CursorSize Property

Specifies the crosshairs size as a percentage of the screen size.

See Also | Example

Signature

object.CursorSize

object

PreferencesDisplay
The object or objects this property applies to.

CursorSize

Integer; read-write
A positive integer from 1 to 100 representing the percentage of total screen area to size the crosshairs to.

System variables

The value for this property is stored in the CURSORSIZE system variable.

Remarks

The default value for this property is 5 percent.

The allowable range is 1 to 100 percent of the total screen. At 100 percent, the ends of the crosshairs are not visible. If the size is decreased to 99 percent or below, the crosshairs have a finite size and the ends of the crosshairs are visible when moved to the edge of the drawing area.


CurveTangencyLinesColor property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesColor property

Specifies the color of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesColor

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesColor

AcadAcCmColor; input/output


CurveTangencyLinesLayer property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesLayer property

Specifies the layer of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesLayer

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesLayer

String; input/output


CurveTangencyLinesLinetype property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesLinetype property

Specifies the linetype of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesLinetype

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesLinetype

String; input/output


CurveTangencyLinesLinetypeScale property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesLinetypeScale property

Specifies the linetype scale of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesLinetypeScale

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesLinetypeScale

ACAD_NOUNITS; input/output


CurveTangencyLinesLineweight property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesLineweight property

Specifies the line weight of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesLineweight

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesLineweight

ACAD_LWEIGHT; input/output


CurveTangencyLinesPlotStyleName property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesPlotStyleName property

Specifies the plot style name of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesPlotStyleName

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesPlotStyleName

String; input/output


CurveTangencyLinesVisible property [ActiveX and VBA Reference: AAR]

CurveTangencyLinesVisible property

Specifies the visibility of curve tangency lines.

See Also | Example

Signature

object.CurveTangencyLinesVisible

object

SectionTypeSettings
The object or objects to which this property applies.

CurveTangencyLinesVisible

Boolean; input/output


CustomDictionary property [ActiveX and VBA Reference: AAR]

CustomDictionary Property

Specifies a custom dictionary to use if you have one.

See Also | Example

Signature

object.CustomDictionary

object

PreferencesFiles
The object or objects this property applies to.

CustomDictionary

String; read-write
The custom dictionary to use.

Remarks

This property contains the drive, path, and file name of the custom dictionary for the AutoCAD session.


CustomIconPath property [ActiveX and VBA Reference: AAR]

CustomIconPath property

Specifies the search path for custom icons

See Also | Example

Signature

object.CustomIconPath

object

PreferencesFiles
The object or objects to which this property applies.

CustomIconPath

String; input/output


CustomScale property [ActiveX and VBA Reference: AAR]

CustomScale Property

Specifies the custom scale factor for the viewport.

See Also | Example

Signature

object.CustomScale

object

PViewport
The object or objects this property applies to.

CustomScale

Double; read-write
The custom scale factor for the viewport.

Remarks

To set the viewport to a custom scale, first set the StandardScale property to acVpCustomScale, then use this property to define the custom scale value.


Database property [ActiveX and VBA Reference: AAR]

Database Property

Gets the database in which the object belongs.

See Also | Example

Signature

object.Database

object

Document
The object or objects this property applies to.

Database

Database object; read-only
The Database object that contains the object.


DecimalSeparator property [ActiveX and VBA Reference: AAR]

DecimalSeparator Property

Specifies the character to be used as the decimal separator in decimal dimension and tolerance values.

See Also | Example

Signature

object.DecimalSeparator

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Tolerance
The object or objects this property applies to.

DecimalSeparator

String; read-write
A single character used as the separator in decimal values.

System variables

This property overrides the value of the DIMDSEP system variable for the given dimension.

Remarks

The initial value for this property is ".".

Any character will be accepted as a valid value for this property.

This property will be used only when the UnitsFormat property is set to acDimDecimal.


DefaultInternetURL property [ActiveX and VBA Reference: AAR]

DefaultInternetURL Property

Specifies the default Internet address.

See Also | Example

Signature

object.DefaultInternetURL

object

PreferencesFiles
The object or objects this property applies to.

DefaultInternetURL

String; read-write
The default Internet address.

System variables

The value for this property is stored in the INETLOCATION system variable.


DefaultOutputDevice property [ActiveX and VBA Reference: AAR]

DefaultOutputDevice Property

Specifies the default output device for new layouts and model space.

See Also | Example

Signature

object.DefaultOutputDevice

object

PreferencesOutput
The object or objects this property applies to.

DefaultOutputDevice

String; read-write
The name of the default printer to use.

Remarks

You can specify any printers your computer is configured for, as well as any PC3 files in the plotter configuration path.

If no devices are on the system, this property will return "None."


DefaultPlotStyleForLayer property [ActiveX and VBA Reference: AAR]

DefaultPlotStyleForLayer Property

Specifies the default plot style for Layer 0 for new drawings or drawings created with earlier releases of AutoCAD that have never been saved in AutoCAD 2000 or later format.

See Also | Example

Signature

object.DefaultPlotStyleForLayer

object

PreferencesOutput
The object or objects this property applies to.

DefaultPlotStyleForLayer

String; read-write
You can enter the default value "Normal" and enter any plot styles defined in the currently loaded plot style table.

System variables

The value of this property is stored in the DEFLPLSTYLE system variable.

Remarks

The initial value of this property is "Normal".

This property is only available when PlotPolicy is set to acPolicyNamed.

Use the DefaultPlotStyleTable property to find the current plot style.


DefaultPlotStyleForObjects property [ActiveX and VBA Reference: AAR]

DefaultPlotStyleForObjects Property

Specifies the default plot style name for newly created objects.

See Also | Example

Signature

object.DefaultPlotStyleForObjects

object

PreferencesOutput
The object or objects this property applies to.

DefaultPlotStyleForObjects

String; read-write
Valid entries include "ByLayer", "ByBlock", "Normal", or any style name in the currently loaded plot style.

System variables

The value of this property is stored in the DEFPLSTYLE system variable.

Remarks

The initial value of this property is "ByLayer".

This property is available only when PlotPolicy is set to acPolicyNamed.

Use the DefaultPlotStyleTable property to find the current plot style.


DefaultPlotStyleTable property [ActiveX and VBA Reference: AAR]

DefaultPlotStyleTable Property

Specifies the default plot style table to attach to new drawings.

See Also | Example

Signature

object.DefaultPlotStyleTable

object

PreferencesOutput
The object or objects this property applies to.

DefaultPlotStyleTable

String; read-write
A plot style table has a .ctb or .stb extension and includes and defines plot styles.

Remarks

If you are using color-dependent plot styles, this option can be set to any color dependent plot style tables found in the search path as well as the value "None". If you are using named plot styles, this option can be set to any named plot style tables.

To set color-dependent plot styles, use the PlotPolicy property.


DefaultPlotToFilePath property [ActiveX and VBA Reference: AAR]

DefaultPlotToFilePath property

Sets the default location for plot to file operations.

See Also | Example

Signature

object.DefaultPlotToFilePath

object

PreferencesOutput
The object or objects to which this property applies.

DefaultPlotToFilePath

String; input/output


DefaultPlotToFilePath property [ActiveX and VBA Reference: AAR]

DefaultPlotToFilePath Property

Specifies the default path for plotting to a file.

See Also | Example

Signature

object.DefaultPlotToFilePath

Object

PreferencesOutput
The object or objects this property applies to.

DefaultPlotToFilePath

String; read-write

Remarks

This property is equivalent to the AutoCAD Options dialog box setting "Default Location for Plot to File Operations."


Degree property [ActiveX and VBA Reference: AAR]

Degree Property

Gets the degree of the spline's polynomial representation.

See Also | Example

Signature

object.Degree

object

Spline
The object or objects this property applies to.

Degree

Integer; read-only
An integer between 1 and 25 inclusive.

Remarks

The order of the spline is equal to the degree of the spline plus one (+1).


Delta property [ActiveX and VBA Reference: AAR]

Delta Property

Gets the delta of a line.

See Also | Example

Signature

object.Delta

object

Line
The object or objects this property applies to.

Delta

Variant (three-element array of doubles); read-only
A three-element array representing the deltaX, deltaY, and deltaZ values for the line.


DemandLoadArxApp property [ActiveX and VBA Reference: AAR]

DemandLoadARXApp Property

Specifies whether AutoCAD demand-loads a third-party application if a drawing contains custom objects.

See Also | Example

Signature

object.DemandLoadARXApp

object

PreferencesOpenSave
The object or objects this property applies to.

DemandLoadARXApp

acARXDemandLoad enum; read-write

acDemandLoadDisabled

acDemandLoadOnObjectDetect

acDemandLoadCmdInvoke

acDemandLoadOnObjectDetect + acDemandLoadCmdInvoke

System variables

The value for this property is stored in the DEMANDLOAD system variable.

Remarks

The initial value for this property is acDemandLoadOnObjectDetect + acDemandLoadCmdInvoke.

acDemandLoadDisabled

Turns off demand-loading.

acDemandLoadOnObjectDetect

Demand-loads the source application when you open a drawing that contains custom objects. This setting does not demand-load the application when you invoke one of the application's commands.

acDemandLoadCmdInvoke

Demand-loads the source application when you invoke one of the application's commands. This setting does not demand-load the application when you open a drawing that contains custom objects.

acDemandLoadOnObjectDetect + acDemandLoadCmdInvoke

Demand-loads the source application when you open a drawing that contains custom objects or when you invoke one of the application's commands.


Description property [ActiveX and VBA Reference: AAR]

Description Property

Specifies the description of an object.

See Also | Example

Signature

object.Description

object

DynamicBlockReferenceProperty, Layer, Linetype, Material, MLeaderStyle, TableStyle
The object or objects this property applies to.

Description

String; read-only for DynamicBlockReferenceProperty objects, read-write for all others
The description.

Remarks

The description for a dynamic block reference property is set by the block author and cannot be edited.

A linetype description can have up to 47 characters. The description can be a comment or a series of underscores, dots, dashes, and spaces to show a simple representation of the linetype pattern.


DestinationBlock property [ActiveX and VBA Reference: AAR]

DestinationBlock property

Specifies the destination block for section generation.

See Also | Example

Signature

object.DestinationBlock

object

SectionTypeSettings
The object or objects to which this property applies.

DestinationBlock

DestinationFile; input/output


DestinationFile property [ActiveX and VBA Reference: AAR]

DestinationFile property

Specifies the destination file for section generation.

See Also | Example

Signature

object.DestinationFile

object

SectionTypeSettings
The object or objects to which this property applies.

DestinationFile

String; input/output


Diameter property [ActiveX and VBA Reference: AAR]

Diameter Property

Specifies the diameter of a circle.

See Also | Example

Signature

object.Diameter

object

Circle
The object or objects this property applies to.

Diameter

Double; read-write
The diameter of the circle.


Dictionaries property [ActiveX and VBA Reference: AAR]

Dictionaries Property

Gets the Dictionaries collection for the document.

See Also | Example

Signature

object.Dictionaries

object

Document
The object or objects this property applies to.

Dictionaries

Dictionaries collection; read-only
The Dictionaries collection for the document.


DimensionLineColor property [ActiveX and VBA Reference: AAR]

DimensionLineColor Property

Specifies the color of the dimension line for a dimension, leader, or tolerance object.

See Also | Example

Signature

object.DimensionLineColor

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated, Leader, Tolerance
The object or objects this property applies to.

DimensionLineColor

acColor enum; read-write
Use a color index number from 0 to 256, or one of the constants listed here:

acByBlock

acByLayer

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

System variables

This property overrides the value of the DIMCLRD system variable for the given dimension, leader, or tolerance object.

Remarks

Colors can be set and read as numeric index values ranging from 0 to 256. Constants have been provided for the standard seven colors, as well as the BYBLOCK and BYLAYER designations.

If you use acByBlock, AutoCAD draws new objects in the default color (white or black, depending on your configuration) until they are grouped into the block. When the block is inserted in the drawing, the objects in the block inherit the current setting of the color property.

If you use acByLayer, new objects assume the color of the layer upon which they are drawn.

When you assign color to a dimension object, the color applies to the dimension lines, arrowheads, and dimension leader lines.


DimensionLineExtend property [ActiveX and VBA Reference: AAR]

DimensionLineExtend Property

Specifies the distance the dimension line extends beyond the extension line when oblique strokes are drawn instead of arrowheads.

See Also | Example

Signature

object.DimensionLineExtend

object

DimAligned, DimArcLength, DimRotated
The object or objects this property applies to.

DimensionLineExtend

Double; read-write
A positive real number specifying the distance to extend the dimension line beyond the extension line.

System variables

This property overrides the value of the DIMDLE system variable for the given dimension.

Remarks

The initial value for this property is 0.0000.


DimensionLinetype property [ActiveX and VBA Reference: AAR]

DimensionLinetype property

Specifies the linetype of the dimension line (DIMLTYPE system variable).

See Also | Example

Signature

object.DimensionLinetype

object

DimAligned, DimRotated, Dim3PointAngular, DimAngular, DimDiametric, DimRadial
The object or objects to which this property applies.

DimensionLinetype

String; input/output


DimensionLineWeight property [ActiveX and VBA Reference: AAR]

DimensionLineWeight Property

Specifies the lineweight for the dimension lines.

See Also | Example

Signature

object.DimensionLineWeight

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

DimensionLineWeight

acLineWeight enum; read-write

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

System variables

This property overrides the value of the DIMLWD system variable for the given dimension.

Remarks

The initial value for this property is acLnWtByBlock.

Lineweight settings are only visible when the LineweightDisplay property is set to TRUE.


DimLine1Suppress property [ActiveX and VBA Reference: AAR]

DimLine1Suppress Property

Specifies the suppression of the first dimension line.

See Also | Example

Signature

object.DimLine1Suppress

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRotated
The object or objects this property applies to.

DimLine1Suppress

Boolean; read-write

TRUE: Suppress the first dimension line.

FALSE: Do not suppress the first dimension line.

System variables

This property overrides the value of the DIMSD1 system variable for the given dimension.

Remarks

The initial value for this property is FALSE.

When this property is set to TRUE, the display of the dimension line and arrowhead between the first extension line and the text is suppressed.


DimLine2Suppress property [ActiveX and VBA Reference: AAR]

DimLine2Suppress Property

Specifies the suppression of the second dimension line.

See Also | Example

Signature

object.DimLine2Suppress

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRotated
The object or objects this property applies to.

DimLine2Suppress

Boolean; read-write

TRUE: Suppress the second dimension line.

FALSE: Do not suppress the second dimension line.

System variables

This property overrides the value of the DIMSD2 system variable for the given dimension.

Remarks

The initial value for this property is FALSE.

When this property is set to TRUE, the display of the dimension line and arrowhead between the second extension line and the text is suppressed.


DimLineInside property [ActiveX and VBA Reference: AAR]

DimLineInside Property

Specifies the display of dimension lines inside the extension lines only.

See Also | Example

Signature

object.DimLineInside

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimRotated
The object or objects this property applies to.

DimLineInside

Boolean; read-write

TRUE: Suppress the display of dimension lines outside the extension lines.

FALSE: Display dimension lines outside the extension lines.

System variables

This property overrides the value of the DIMSOXD system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


DimLineSuppress property [ActiveX and VBA Reference: AAR]

DimLineSuppress Property

Specifies the suppression of the dimension line for radial dimensions.

See Also | Example

Signature

object.DimLineSuppress

object

DimRadial, DimRadialLarge
The object or objects this property applies to.

DimLineSuppress

Boolean; read-write

TRUE: Suppress the dimension line.

FALSE: Do not suppress the dimension line.

System variables

This property overrides the value of the DIMSD2 system variable.

Remarks

The initial value for this property is FALSE.

When this property is set to TRUE, the display of the dimension line and arrowhead between the extension line and the text is suppressed.


DimStyles property [ActiveX and VBA Reference: AAR]

DimStyles Property

Gets the DimStyles collection for the document.

See Also | Example

Signature

object.DimStyles

object

Document
The object or objects this property applies to.

DimStyles

DimStyles collection; read-only
The DimStyles collection for the document.


Direction property [ActiveX and VBA Reference: AAR]

Direction Property

Specifies the viewing direction for a 3D visualization of the drawing, or the direction vector of the table.

See Also | Example

Signature

object.Direction

object

Table, View, Viewport, PViewport, ExtrudedSurface
The object or objects this property applies to.

Direction

Variant; read-write

Table objects: The vector (X axis, in WCS coordinates) defines the horizontal plane containing the table.

All other objects: The vector is a three-element array of doubles that defines a direction from which the drawing can be viewed.

Remarks

This property puts the viewer in a position to look at the drawing as if looking back at the origin (0, 0, 0) from a specified point in space. This property is similar to the VPOINT command in AutoCAD.


DirectionVector property [ActiveX and VBA Reference: AAR]

DirectionVector Property

Specifies the direction for the ray, tolerance, or xline through a vector.

See Also | Example

Signature

object.DirectionVector

object

Ray, Tolerance, XLine
The object or objects this property applies to.

DirectionVector

Variant (three-element array of doubles); read-write
The direction for the ray, tolerance, or xline.


Display property [ActiveX and VBA Reference: AAR]

Display Property

Gets the PreferencesDisplay object.

See Also | Example

Signature

object.Display

object

Preferences
The object or objects this property applies to.

Display

PreferencesDisplay; read-Only
Gets the PreferencesDisplay object.

Remarks

The PreferencesDisplay object holds all the options from the Display tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


DisplayGrips property [ActiveX and VBA Reference: AAR]

DisplayGrips Property

Controls the display of selection set grips for the Stretch, Move, Rotate, Scale, and Mirror grip modes.

See Also | Example

Signature

object.DisplayGrips

object

PreferencesSelection
The object or objects this property applies to.

DisplayGrips

Boolean; read-write

TRUE: Display grips.

FALSE: Do not display grips.

System variables

The value for this property is stored in the GRIPS system variable.

Remarks

The initial value of this property is TRUE.

To adjust the size of the grips and the effective selection area used by the cursor when you snap to a grip, use the GripSize property.

To adjust the color of selected or unselected grips, use the GripColorSelected or GripColorUnselected properties.


DisplayGripsWithinBlocks property [ActiveX and VBA Reference: AAR]

DisplayGripsWithinBlocks Property

Controls the assignment of grips within blocks.

See Also | Example

Signature

object.DisplayGripsWithinBlocks

object

PreferencesSelection
The object or objects this property applies to.

DisplayGripsWithinBlocks

Boolean; read-write

TRUE: Assigns grips to objects within the block.

FALSE: Assigns a grip only to the insertion point of the block.

System variables

The value for this property is stored in the GRIPBLOCK system variable.

Remarks

The initial value of this property is FALSE.


DisplayLayoutTabs property [ActiveX and VBA Reference: AAR]

DisplayLayoutTabs Property

Specifies whether to display the Model and layout tabs in the drawing editor.

See Also | Example

Signature

object.DisplayLayoutTabs

object

PreferencesDisplay
The object or objects this property applies to.

DisplayLayoutTabs

Boolean; read-write

TRUE: Display the Model and layout tabs.

FALSE: Do not display the Model and layout tabs.

Remarks

The initial value for this property is TRUE.


DisplayLocked property [ActiveX and VBA Reference: AAR]

DisplayLocked Property

Specifies whether the viewport is locked.

See Also | Example

Signature

object.DisplayLocked

object

PViewport
The object or objects this property applies to.

DisplayLocked

Boolean; read-write

TRUE: The viewport is locked.

FALSE: The viewport is not locked.


DisplayOLEScale property [ActiveX and VBA Reference: AAR]

DisplayOLEScale Property

Determines whether the OLE scaling dialog is displayed when OLE objects are inserted into a drawing.

See Also | Example

Signature

object.DisplayOLEScale

object

PreferencesSystem
The object or objects this property applies to.

DisplayOLEScale

Boolean; read-write

TRUE: Display the OLE scaling dialog when OLE objects are inserted into a drawing.

FALSE: Do not display the OLE scaling dialog when OLE objects are inserted into a drawing.

Remarks

The initial value for this property is TRUE.


DisplayScreenMenu property [ActiveX and VBA Reference: AAR]

DisplayScreenMenu Property

Specifies whether to display the screen menu on the right side of the drawing window.

See Also | Example

Signature

object.DisplayScreenMenu

object

PreferencesDisplay
The object or objects this property applies to.

DisplayScreenMenu

Boolean; read-write

TRUE: Display the screen menu.

FALSE: Do not display the screen menu.

Remarks

The initial value for this property is FALSE.


DisplayScrollBars property [ActiveX and VBA Reference: AAR]

DisplayScrollBars Property

Specifies whether to display scroll bars at the bottom and right sides of the drawing window.

See Also | Example

Signature

object.DisplayScrollBars

object

PreferencesDisplay
The object or objects this property applies to.

DisplayScrollBars

Boolean; read-write

TRUE: Display the scroll bars.

FALSE: Do not display the scroll bars.

Remarks

The initial value for this property is FALSE.


DisplaySilhouette property [ActiveX and VBA Reference: AAR]

DisplaySilhouette Property

Controls whether silhouette curves of solid objects are displayed in Wireframe mode.

See Also | Example

Signature

object.DisplaySilhouette

object

DatabasePreferences
The object or objects this property applies to.

DisplaySilhouette

Boolean; read-write

TRUE: Display only silhouette lines for solid objects.

FALSE: Display isolines for solid objects.

System variables

The value of this property is stored in the DISPSILH system variable.

Remarks

The initial value for this property is FALSE.


DockedVisibleLines property [ActiveX and VBA Reference: AAR]

DockedVisibleLines Property

Specifies the number of lines of text to display in the command window.

See Also | Example

Signature

object.DockedVisibleLines

object

PreferencesDisplay

DockedVisibleLines

Integer; read-write
A positive integer representing the number of text lines to display in the command window.

Remarks

This property is obsolete.


DockStatus property [ActiveX and VBA Reference: AAR]

DockStatus Property

Specifies whether the toolbar is docked or floating.

See Also | Example

Signature

object.DockStatus

object

Toolbar
The object or objects this property applies to.

DockStatus

acToolbarDockStatus enum; read-only

acToolbarDockTop

acToolbarDockBottom

acToolbarDockLeft

acToolbarDockRight

acToolbarFloating


Document property [ActiveX and VBA Reference: AAR]

Document Property

Gets the document (drawing) in which the object belongs.

See Also | Example

Signature

object.Document

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport,, Viewports, XRecord
The object or objects this property applies to.

Document

Document object; read-only
The document (drawing) that contains the object.


Documents property [ActiveX and VBA Reference: AAR]

Documents Property

Gets the Documents collection.

See Also | Example

Signature

object.Documents

object

Application
The object or objects this property applies to.

Documents

Documents collection; read-only
The Documents collection for the current AutoCAD session.

Remarks

The Documents collection allows you to access all the documents, or drawings, in the current AutoCAD session.


DogLegged property [ActiveX and VBA Reference: AAR]

DogLegged Property

The status of the dog-leg.

See Also | Example

Signature

object.DogLegged

Object

MLeader Object
The object this property applies to.

DogLegged

Boolean; read-write
Enables/Disables the horizontal landing of multileader


DoglegLength property [ActiveX and VBA Reference: AAR]

DoglegLength Property

The length of the dog-leg.

See Also | Example

Signature

object.DogLegged

Object

MLeader Object, MLeaderStyle
The object this property applies to.

DoglegLength

Double; read-write
Specifies the landing distance.


Drafting property [ActiveX and VBA Reference: AAR]

Drafting Property

Gets the PreferencesDrafting object.

See Also | Example

Signature

object.Drafting

object

Preferences
The object or objects this property applies to.

Drafting

PreferencesDrafting; read-Only
Gets the PreferencesDrafting object.

Remarks

The PreferencesDrafting object holds all the options from the Drafting tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


DrawingDirection property [ActiveX and VBA Reference: AAR]

DrawingDirection Property

Specifies the direction in which the mtext paragraph is to be read.

See Also | Example

Signature

object.DrawingDirection

object

MText
The object or objects this property applies to.

DrawingDirection

acDrawingDirection enum; read-write

acLeftToRight

acTopToBottom

acRightToLeft (Reserved for future use)

acBottomToTop (Reserved for future use)

acByStyle (Reserved for future use)

Remarks

For languages such as English or Spanish, text is read horizontally, left to right. For languages such as Chinese or Japanese, sometimes text is read vertically, top to bottom. AutoCAD will draw the text according to this property setting.

Left to right
Top to bottom

The settings acRightToLeft, acBottomToTop, and acByStyle are reserved for future use and cannot be used in this release.


DrawLeaderOrderType property [ActiveX and VBA Reference: AAR]

DrawLeaderOrderType Property

Specifies the drawLeaderOrderType of the mleaderstyle.

See Also | Example

Signature

object.DrawLeaderOrderType

Object

MLeaderStyle
The object this property applies to.

DrawLeaderOrderType

AcDrawLeaderOrderType; read-write
This describes the types of the order of creating mleader object's leaderline.


DrawMLeaderOrderType property [ActiveX and VBA Reference: AAR]

DrawMLeaderOrderType Property

Specifies the drawMLeaderOrderType of the mleaderstyle.

See Also | Example

Signature

object.DrawMLeaderOrderType

Object

MLeaderStyle
The object this property applies to.

DrawMLeaderOrderType

AcDrawLeaderOrderType; read-write
This describes the types of the order of creating mleader object's leaderline.


DriversPath property [ActiveX and VBA Reference: AAR]

DriversPath Property

Specifies the directory in which AutoCAD looks for ADI device drivers for the video display, pointing devices, printers, and plotters.

See Also | Example

Signature

object.DriversPath

object

PreferencesFiles
The object or objects this property applies to.

DriversPath

String; read-write
The directory in which the device drivers are located. Specify a drive letter and path for each path. Separate multiple directory listings with a semicolon (;).


EffectiveName property [ActiveX and VBA Reference: AAR]

EffectiveName Property

Specifies the original block name.

See Also

Signature

object.EffectiveName

object

BlockRef, MInsertBlock
The object or objects this property applies to.

EffectiveName

String; read-only

Remarks

The effective name is the name of the block as the user would see it in the user interface. Dynamic blocks may draw themselves with an anonymous block whose name is different than the block name the user sees for the block in the user interface. The Name property returns the name of the block used to draw the reference, while the EffectiveName is the name the user sees for the reference.

Note To access this property, use the IAcadBlockReference2 or IAcadMInsertBlock2 interface.


Elevation property [ActiveX and VBA Reference: AAR]

Elevation Property

Specifies the current elevation of the hatch, polyline, or section.

See Also | Example

Signature

object.Elevation

object

Hatch, LightWeightPolyline, Polyline, Section
The object or objects this property applies to.

Elevation

Double; read-write
The current elevation of the object.


ElevationModelSpace property [ActiveX and VBA Reference: AAR]

ElevationModelSpace Property

Specifies the elevation setting in model space.

See Also | Example

Signature

object.ElevationModelSpace

object

Document
The object or objects this property applies to.

ElevationModelSpace

Double; read-write
The elevation setting for model space.

Remarks

The current elevation is the Z value that is used whenever a 3D point is expected but only the X and Y values are supplied. The current elevation is maintained separately in model space and paper space.


ElevationPaperSpace property [ActiveX and VBA Reference: AAR]

ElevationPaperSpace Property

Specifies the elevation setting in paper space.

See Also | Example

Signature

object.ElevationPaperSpace

object

Document
The object or objects this property applies to.

ElevationPaperSpace

Double; read-write
The elevation for paper space.

Remarks

The current elevation is the Z value that is used whenever a 3D point is expected but only the X and Y values are supplied. The current elevation is maintained separately in model space and paper space.


Enable property [ActiveX and VBA Reference: AAR]

Enable Property

Enables the popup menu item. Specifies the name of the object.

See Also | Example

Signature

object.Enable

object

PopupMenuItem
The object or objects this property applies to.

Enable

Boolean; read-write

TRUE: The item is enabled.

FALSE: The item is disabled.

Remarks

In the following example, the Undo and Redo menu items are disabled.


EnableBlockRotation property [ActiveX and VBA Reference: AAR]

EnableBlockRotation Property

Specifies the EnableBlockRotation of the mleaderstyle.

See Also | Example

Signature

object.EnableBlockRotation

Object

MLeaderStyle
The object this property applies to.

EnableBlockRotation

Boolean; read-write
Enable or disable block rotation.


EnableBlockScale property [ActiveX and VBA Reference: AAR]

EnableBlockScale Property

Specifies the EnableBlockScale of the mleaderstyle.

See Also | Example

Signature

object.EnableBlockScale

Object

MLeaderStyle
The object this property applies to.

EnableBlockScale

Boolean; read-write
Enable or disable block scales.


EnableDogleg property [ActiveX and VBA Reference: AAR]

EnableDogleg Property

Specifies the enableDogleg of the mleaderstyle.

See Also | Example

Signature

object.EnableDogleg

Object

MLeaderStyle
The object this property applies to.

EnableDogleg

Boolean; read-write
Boolean to enable/disable dog legs of leader line.


EnableFrameText property [ActiveX and VBA Reference: AAR]

EnableFrameText Property

Specifies the EnableFrameText of the mleaderstyle.

See Also | Example

Signature

object.EnableFrameText

Object

MLeaderStyle
The object this property applies to.

EnableFrameText

Boolean; read-write
Enables or disables frame text.


EnableLanding property [ActiveX and VBA Reference: AAR]

EnableLanding Property

Specifies the enableLanding of the mleaderstyle.

See Also | Example

Signature

object.EnableLanding

Object

MLeaderStyle
The object this property applies to.

EnableLanding

Boolean; read-write
Boolean to enable/disable landing of leader line.


EnableShadowDisplay property [ActiveX and VBA Reference: AAR]

EnableShadowDisplay property

Specifies whether the shadow display property is enabled for the object.

See Also | Example

Signature

object.EnableShadowDisplay

object

ShadowDisplay
The object or objects to which this property applies.

EnableShadowDisplay

Long; input-only

Remarks

This property is always set to 1 for 3D solid objects. It can be either 0 or 1 for 2D objects that can have thickness. For 2D objects whose thickness is non-zero, this property returns 1. For 2D objects whose thickness is 0, it returns 0. This property always returns 0 for 2D objects that are not capable of thickness, such as AcadImage.


EnableStartupDialog property [ActiveX and VBA Reference: AAR]

EnableStartupDialog Property

Specifies whether a startup dialog box is displayed when AutoCAD is launched or a new drawing is created.

See Also | Example

Signature

object.EnableStartupDialog

object

PreferencesSystem
The object or objects this property applies to.

EnableStartupDialog

Boolean; read-write

TRUE: Displays a startup dialog box.

FALSE: Does not display a startup dialog box.

Remarks

The initial value for this property is FALSE.

The traditional startup dialog box can be displayed when EnableStartupDialog is TRUE.


EndAngle property [ActiveX and VBA Reference: AAR]

EndAngle Property

Specifies the end angle of an arc or ellipse.

See Also | Example

Signature

object.EndAngle

object

Arc, Ellipse
The object or objects this property applies to.

EndAngle

Double; read-write
The end angle in radians. Use 6.28 radians to specify a closed circle or ellipse.

Remarks

EndAngle

StartAngle


EndDraftAngle property [ActiveX and VBA Reference: AAR]

EndDraftAngle property

Specifies the draft angle of the surface for the last cross section.

See Also | Example

Signature

object.EndDraftAngle

object

LoftedSurface
The object or objects to which this property applies.

EndDraftAngle

Long; input/output


EndDraftMagnitude property [ActiveX and VBA Reference: AAR]

EndDraftMagnitude property

Specifies the draft magnitude of the surface for the last cross section.

See Also | Example

Signature

object.EndDraftMagnitude

object

LoftedSurface
The object or objects to which this property applies.

EndDraftMagnitude

Long; input/output


EndParameter property [ActiveX and VBA Reference: AAR]

EndParameter Property

Specifies the end parameter for an ellipse.

See Also | Example

Signature

object.EndParameter

object

Ellipse
The object or objects this property applies to.

EndParameter

Double; read-write
The valid range is 0 to 2*PI.

Remarks

The start and end parameters of the ellipse are calculated based on the following equation:

P(Theta) = A * cos(Theta) + B * sin(Theta)

where A and B are the semimajor and semiminor axes respectively.

For example, if your start angle is Theta1, the corresponding start parameter is P(Theta1) calculated based on the above formula. Similarly, if your end angle is Theta2, the corresponding end parameter is P(Theta2) calculated based on the above formula.

You can use either an angle or a parameter to create the ellipse.


EndPoint property [ActiveX and VBA Reference: AAR]

EndPoint Property

Specifies the endpoint for the arc, line, or ellipse.

See Also | Example

Signature

object.EndPoint

object

Arc, Line, Ellipse
The object or objects this property applies to.

EndPoint

Variant (three-element array of doubles);
For the Arc and Ellipse objects this property is read-only.
For the Line object this property is read-write.
A 3D coordinate representing the endpoint of the object.

Remarks

The endpoint for an arc, ellipse, and line

NOTE You cannot change the endpoint of an arc or an ellipse. To edit an arc, use the EndAngle and Radius properties. To edit an ellipse, use the EndAngle, MajorAxis, and RadiusRatio properties.


EndSubMenuLevel property [ActiveX and VBA Reference: AAR]

EndSubMenuLevel Property

Specifies the last item in a submenu.

See Also

Signature

object.EndSubMenuLevel

object

PopupMenuItem
The object or objects this property applies to.

EndSubMenuLevel

Integer; read-write
The number of menu levels this menu item terminates.

Remarks

The default value for this property is zero (0), specifying that this menu item is not the last item in the submenu.

A value of one (1) indicates that this item is the last item in a submenu. A value of two (2) indicates that this item is the last item of a submenu and also of its parent menu. This value should be incremented for each parent menu for which this item terminates.


EndTangent property [ActiveX and VBA Reference: AAR]

EndTangent Property

Specifies the end tangent of the spline as a directional vector.

See Also | Example

Signature

object.EndTangent

object

Spline
The object or objects this property applies to.

EndTangent

Variant (three-element array of doubles); read-write
A directional vector representing the end tangent of the spline.

Remarks

When a spline is elevated, it is converted from an interpolated (fit) spline to a control point spline. This means that after elevation, the spline no longer has fit tangents and the StartTangent and EndTangent properties for the spline are no longer accessible. The only way to edit a control point spline is through the ControlPoints property, or the SetControlPoint or GetControlPoint methods.


EnterpriseMenuFile property [ActiveX and VBA Reference: AAR]

EnterpriseMenuFile property

Specifies the location of the enterprise menu file

See Also | Example

Signature

object.EnterpriseMenuFile

object

PreferencesFiles
The object or objects to which this property applies.

EnterpriseMenuFile

String; input/output


EntityColor property [ActiveX and VBA Reference: AAR]

EntityColor Property

Specifies the color value of the true color.

See Also | Example

Signature

object.EntityColor

object

AcCmColor
The object or objects this property applies to.

EntityColor

Long; read-write

Remarks

This property specifies the 32-bit AcCmEntityColor portion of the color.


Explodable property [ActiveX and VBA Reference: AAR]

Explodable Property

Specifies whether the block can be exploded.

Signature

object.Explodable

object

Block
The object or objects this property applies to.

Explodable

Boolean; read-write

TRUE: The block can be exploded.

FALSE: The block cannot be exploded.

Remarks

Note To access this property, use the IAcadBlock3 interface.


ExtensionLineColor property [ActiveX and VBA Reference: AAR]

ExtensionLineColor Property

Specifies the color for dimension extension lines.

See Also | Example

Signature

object.ExtensionLineColor

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimOrdinate, DimRotated
The object or objects this property applies to.

ExtensionLineColor

acColor enum; read-write
Use a color index number from 0 to 256, or one of the constants listed here:

acByBlock

acByLayer

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

System variables

This property overrides the value of the DIMCLRE system variable for the given dimension object.

Remarks

Colors can be set and read as numeric index values ranging from 0 to 256. Constants have been provided for the standard seven colors, as well as the BYBLOCK and BYLAYER designations.

If you use acByBlock, AutoCAD draws new objects in the default color (white or black, depending on your configuration) until they are grouped into the block. When the block is inserted in the drawing, the objects in the block inherit the current setting of the color property.

If you use acByLayer, new objects assume the color of the layer upon which they are drawn.


ExtensionLineExtend property [ActiveX and VBA Reference: AAR]

ExtensionLineExtend Property

Specifies the distance the extension line extends beyond the dimension line.

See Also | Example

Signature

object.ExtensionLineExtend

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimRotated
The object or objects this property applies to.

ExtensionLineExtend

Double; read-write
A positive real number specifying the distance to extend the extension line beyond the dimension line.

System variables

This property overrides the value of the DIMEXE system variable for the given dimension.

Remarks

The initial value for this property is 0.1800.


ExtensionLineOffset property [ActiveX and VBA Reference: AAR]

ExtensionLineOffset Property

Specifies the distance the extension lines are offset from the origin points.

See Also | Example

Signature

object.ExtensionLineOffset

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRotated
The object or objects this property applies to.

ExtensionLineOffset

Double; read-write
A positive real number specifying the distance to offset the extension line beyond the origin points.

System variables

This property overrides the value of the DIMEXO system variable for the given dimension.

Remarks

The initial value for this property is 0.0625.


ExtensionLineWeight property [ActiveX and VBA Reference: AAR]

ExtensionLineWeight Property

Specifies the lineweight for the extension lines.

See Also | Example

Signature

object.ExtensionLineWeight

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimRotated
The object or objects this property applies to.

ExtensionLineWeight

acLineWeight enum; read-write

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

System variables

This property overrides the value of the DIMLWE system variable for the given dimension.

Remarks

The initial value for this property is acLnWtByBlock.

Lineweight settings are only visible when the LineweightDisplay property is set to TRUE.


ExtLine1EndPoint property [ActiveX and VBA Reference: AAR]

ExtLine1EndPoint Property

Specifies the endpoint of the first extension line.

See Also | Example

Signature

object.ExtLine1EndPoint

object

Dim3PointAngular, DimAngular
The object or objects this property applies to.

ExtLine1EndPoint

Variant (three-element array of doubles); read-write
A 3D coordinate representing the endpoint of the first extension line.

Remarks

ExtLine1EndPoint

The ExtLine1EndPoint and ExtLine2EndPoint properties contain the endpoints of the extension lines. If no extension lines exist for a given dimension, these points will equal ExtLine1StartPoint and ExtLine2StartPoint.


ExtLine1Linetype property [ActiveX and VBA Reference: AAR]

ExtLine1Linetype property

Specifies the linetype of the first extension line (DIMLTEX1 system variable).

See Also | Example

Signature

object.ExtLine1Linetype

object

DimAligned, DimRotated, Dim3PointAngular, DimAngular
The object or objects to which this property applies.

ExtLine1Linetype

String; input/output


ExtLine1Point property [ActiveX and VBA Reference: AAR]

ExtLine1Point Property

Specifies the origin of extension line 1.

See Also | Example

Signature

object.ExtLine1Point

object

DimAligned, DimArcLength
The object or objects this property applies to.

ExtLine1Point

Variant (three-element array of doubles); read-write
A 3D coordinate representing the origin of the first extension line.

Remarks

The dimension line of an aligned dimension will be parallel to the line joining the origins of extension lines 1 and 2.

ExtLine1Point ExtLine2Point |  |
 | Line to be dimensioned | Dimension created


ExtLine1StartPoint property [ActiveX and VBA Reference: AAR]

ExtLine1StartPoint Property

Specifies the start point of the first extension line.

See Also | Example

Signature

objectExtLine1StartPoint

object

DimAngular
The object or objects this property applies to.

ExtLine1StartPoint

Variant (three-element array of doubles); read-write
A 3D coordinate representing the start point of the first extension line.

Remarks

ExtLine1StartPoint

The ExtLine1StartPoint and ExtLine2StartPoint properties are equal to the FirstEndPoint and SecondEndPoint parameters from the AddDimAngular method. The extension lines are originally drawn from the FirstEndPoint and SecondEndPoint locations to the intersection of the dimension line. AutoCAD draws the dimension line as an arc between the extension lines.


ExtLine1Suppress property [ActiveX and VBA Reference: AAR]

ExtLine1Suppress Property

Specifies the suppression of the first extension line.

See Also | Example

Signature

object.ExtLine1Suppress

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimRotated
The object or objects this property applies to.

ExtLine1Suppress

Boolean; read-write

TRUE: Suppress the first extension line.

FALSE: Do not suppress the first extension line.

System variables

This property overrides the value of the DIMSE1 system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


ExtLine2EndPoint property [ActiveX and VBA Reference: AAR]

ExtLine2EndPoint Property

Specifies the endpoint of the second extension line.

See Also | Example

Signature

object.ExtLine2EndPoint

object

Dim3PointAngular, DimAngular
The object or objects this property applies to.

ExtLine2EndPoint

Variant (three-element array of doubles); read-write
A 3D coordinate representing the endpoint of the second extension line.

Remarks

ExtLine2EndPoint

The ExtLine1EndPoint and ExtLine2EndPoint properties contain the endpoints of the extension lines. If no extension lines exist for a given dimension, these points will equal ExtLine1StartPoint and ExtLine2StartPoint.


ExtLine2Linetype property [ActiveX and VBA Reference: AAR]

ExtLine2Linetype property

Specifies the linetype of the second extension line (DIMLTEX2 system variable).

See Also | Example

Signature

object.ExtLine2Linetype

object

DimAligned, DimRotated, Dim3PointAngular, DimAngular
The object or objects to which this property applies.

ExtLine2Linetype

String; input/output


ExtLine2Point property [ActiveX and VBA Reference: AAR]

ExtLine2Point Property

Specifies the origin of extension line 2.

See Also | Example

Signature

object.ExtLine2Point

object

DimAligned, DimArcLength
The object or objects this property applies to.

ExtLine2Point

Variant (three-element array of doubles); read-write
A 3D coordinate representing the origin of the second extension line.

Remarks

The dimension line of an aligned dimension will be parallel to the origins of extension lines 1 and 2.

ExtLine1Point ExtLine2Point |  |
 | Line to be dimensioned | Dimension created


ExtLine2StartPoint property [ActiveX and VBA Reference: AAR]

ExtLine2StartPoint Property

Specifies the start point of the second extension line.

See Also | Example

Signature

object.ExtLine2StartPoint

object

DimAngular
The object or objects this property applies to.

ExtLine2StartPoint

Variant (three-element array of doubles); read-write
A 3D coordinate representing the start point of the second extension line.

Remarks

ExtLine2StartPoint

The ExtLine1StartPoint and ExtLine2StartPoint properties are equal to the FirstEndPoint and SecondEndPoint parameters from the AddDimAngular method. The extension lines are originally drawn from the FirstEndPoint and SecondEndPoint locations to the intersection of the dimension line. AutoCAD draws the dimension line as an arc between the extension lines.


ExtLine2Suppress property [ActiveX and VBA Reference: AAR]

ExtLine2Suppress Property

Specifies the suppression of the second extension line.

See Also | Example

Signature

object.ExtLine2Suppress

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimRotated
The object or objects this property applies to.

ExtLine2Suppress

Boolean; read-write

TRUE: Suppress the second extension line.

FALSE: Do not suppress the second extension line.

System variables

This property overrides the value of the DIMSE2 system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


ExtLineFixedLen property [ActiveX and VBA Reference: AAR]

ExtLineFixedLen property

Set extension line fixed length (DIMFXL system variable).

See Also | Example

Signature

object.ExtLineFixedLen

object

DimAligned, DimRotated, Dim3PointAngular, DimAngular, DimDiametric
The object or objects to which this property applies.

ExtLineFixedLen

double; input/output


ExtLineFixedLenSuppress property [ActiveX and VBA Reference: AAR]

ExtLineFixedLenSuppress property

Sets suppression of extension line fixed length On or Off (DIMFXLON system variable).

See Also | Example

Signature

object.ExtLineFixedLenSuppress

object

DimAligned, DimRotated, Dim3PointAngular, DimAngular, DimDiametric
The object or objects to which this property applies.

ExtLineFixedLenSuppress

Boolean; input/output


Fade property [ActiveX and VBA Reference: AAR]

Fade Property

Specifies the current fade value of a raster or underlay image.

See Also | Example

Signature

object.Fade

object

DwfUnderlay, Raster
The object or objects this property applies to.

Fade

Integer; read-write
The value is between 0 and 100 inclusive.

Remarks

You can adjust the raster or underlay image brightness, contrast, and fade to the display of the image as well as to the plotted output without affecting the original raster or underlay file. Adjust brightness to darken or lighten an image. Adjust contrast to make images with poor quality easier to read. Adjust fade to make vectors easier to see over images and to create a watermark effect in your plotted output.

NOTE Bitonal images cannot be adjusted for brightness, contrast, or fade.


Feature property [ActiveX and VBA Reference: AAR]

Feature Property

Specifies the feature name of an entry in the File Dependency List.

See Also | Example

Signature

object.Feature

object

FileDependency
The object or objects this property applies to.

Feature

String; read-only
Feature name (for example, "Acad:Xref").


FieldLength property [ActiveX and VBA Reference: AAR]

FieldLength Property

Specifies the field length of the attribute.

See Also | Example

Signature

object.FieldLength

object

Attribute, AttributeReference
The object or objects this property applies to.

FieldLength

Integer; read-write
The field length of the attribute.


File property [ActiveX and VBA Reference: AAR]

File property

Specifies the path to the underlay file.

See Also | Example

Signature

object.File

object

DwfUnderlay
The object or objects to which this property applies.

File

String; input/output


FileDependencies Collection [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

FileDependencies Collection

Creates, updates, retrieves, and removes items in the File Dependency List.

VBA class name: | AcadFileDependencies
Create using: | N/A
Access via: | Document.FileDependencies

Files in the AutoCAD 2004 drawing-file format contain a File Dependency List. The File Dependency List is a list of the files on which the drawing file depends. You can perform operations on the File Dependency List using the FileDependencies collection.

Methods

CreateEntry

IndexOf

Item

RemoveEntry

UpdateEntry

Properties

Application

Count


FileName property [ActiveX and VBA Reference: AAR]

FileName Property

Specifies the file name of an entry in the File Dependency List.

See Also | Example

Signature

object.FileName

object

FileDependency
The object or objects this property applies to.

FileName

String; read-only
Saved base file name without the path.


Files property [ActiveX and VBA Reference: AAR]

Files Property

Gets the PreferencesFiles object.

See Also | Example

Signature

object.Files

object

Preferences
The object or objects this property applies to.

Files

PreferencesFiles; read-only
Gets the PreferencesFiles object.

Remarks

The PreferencesFiles object holds all the options from the Files tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


FileSize property [ActiveX and VBA Reference: AAR]

FileSize Property

Specifies the file size of an entry in the File Dependency List.

See Also | Example

Signature

object.FileSize

object

FileDependency
The object or objects this property applies to.

FileSize

Long; read-only
Current file size in bytes


FingerprintGUID property [ActiveX and VBA Reference: AAR]

FingerprintGUID Property

Specifies the Fingerprint GUID of an entry in the File Dependency List.

See Also | Example

Signature

object.FingerprintGUID

object

FileDependency
The object or objects this property applies to.

FingerprintGUID

String; read-only
The Fingerprint GUID of the entry.


FirstSegmentAngleConstraint property [ActiveX and VBA Reference: AAR]

FirstSegmentAngleConstraint Property

Specifies the FirstSegmentAngleConstraint of the mleaderstyle.

See Also | Example

Signature

object.FirstSegmentAngleConstraint

Object

MLeaderStyle
The object this property applies to.

FirstSegmentAngleConstraint

Long; read-write
The first segment's angle constraint value.


Fit property [ActiveX and VBA Reference: AAR]

Fit Property

Specifies the placement of text and arrowheads inside or outside extension lines, based on the available space between the extension lines.

See Also | Example

Signature

object.Fit

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

Fit

acDimFit enum; read-write

acTextAndArrows

acArrowsOnly

acTextOnly

acBestFit

System variables

This property overrides the value of the DIMATFIT system variable for the given dimension.

Remarks

The initial value for this property is acBestFit.

The Fit property sets priorities for moving text and arrowheads when space is not available to fit both within the extension lines.

acTextAndArrows

This option places both the text and arrowheads inside the extension lines.

acArrowsOnly

This option places only the arrowheads inside the extension lines. The text is placed outside the arrowheads.

acTextOnly

This option places only the text inside the extension lines. The arrowheads are placed outside the extension lines.

acBestFit

This option places the text and arrowheads in the best fit location given the space available.

When enough space is available for text and arrowheads, this option places both between the extension lines.

When enough space is available for text only, this option places the text between the extension lines and places the arrowheads outside the extension lines.

When enough space is available for arrowheads only, this option places them between the extension lines and places the text outside the extension lines.

When space is available for neither text nor arrowheads, this option places them both outside the extension lines.


FitPoints property [ActiveX and VBA Reference: AAR]

FitPoints Property

Specifies the fit points of a spline.

See Also | Example

Signature

object.FitPoints

object

Spline
The object or objects this property applies to.

FitPoints

Variant (array of doubles); read-write
An array of 3D WCS coordinates representing the fit points of the spline.

Remarks

The fit points define the path of the spline. You can change the tolerance of a given fit point by using the FitTolerance property. You can add a fit point by using the AddFitPoint method. You can delete a fit point by using the DeleteFitPoint method. You can query the location of a fit point by using the GetFitPoint method. You can change the location of a given fit point by using the SetFitPoint method.


FitTolerance property [ActiveX and VBA Reference: AAR]

FitTolerance Property

Refits the spline to the existing points with new tolerance values.

See Also | Example

Signature

object.FitTolerance

object

Spline
The object or objects this property applies to.

FitTolerance

Double; read-write
The fit tolerance cannot be a negative number.

Remarks

If the fit tolerance is set to zero, then the spline will pass through all the fit points. Providing a value greater than zero allows the curve to pass through the fit points within the specified tolerance.


FloatingRows property [ActiveX and VBA Reference: AAR]

FloatingRows Property

Specifies the number of rows for a floating toolbar.

See Also | Example

Signature

object.FloatingRows

object

Toolbar
The object or objects this property applies to.

FloatingRows

Integer; read-write
The number of rows for a floating toolbar.


FlowDirection property [ActiveX and VBA Reference: AAR]

FlowDirection Property

Specifies whether the title and header rows are at the bottom or the top of the table.

See Also | Example

Signature

object.FlowDirection

Object

Table, TableStyle
The object or objects this property applies to.

FlowDirection

AcTableDirection enum; read-write. Specify one of the following constants for the location of the title and header rows.

acTableBottomToTop | Table flow direction of bottom to top; value = 1
acTableTopToBottom | Table flow direction of top to bottom (default); value = 0


Flyout property [ActiveX and VBA Reference: AAR]

Flyout Property

Gets the toolbar associated with a flyout toolbar item.

See Also | Example

Signature

object.Flyout

object

ToolbarItem
The object or objects this property applies to.

Flyout

Toolbar object; read-only
The toolbar that contains the toolbar item.


FontFile property [ActiveX and VBA Reference: AAR]

FontFile Property

Specifies the primary font file name and the path.

See Also | Example

Signature

object.FontFile

object

TextStyle
The object or objects this property applies to.

FontFile

String; read-write
The primary font file path.

Remarks

To specify an Asian-language font file, use the BigFontFile property.

Fonts define the shapes of the text characters that make up each character set.

NOTE Once this property has been set, you must call the Regen method to see the changes to the text.


FontFileMap property [ActiveX and VBA Reference: AAR]

FontFileMap Property

Specifies the location of the file that defines how AutoCAD should convert unfound fonts.

See Also | Example

Signature

object.FontFileMap

object

PreferencesFiles
The object or objects this property applies to.

FontFileMap

String; read-write
The drive, path, and file name of the font mapping file.


ForceLineInside property [ActiveX and VBA Reference: AAR]

ForceLineInside Property

Specifies whether a dimension line is drawn between the extension lines even when the text is placed outside the extension lines.

See Also | Example

Signature

object.ForceLineInside

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ForceLineInside

Boolean; read-write

TRUE: Draw dimension lines between the measured points when arrowheads are placed outside the measured points.

FALSE: Do not draw dimension lines between the measured points when arrowheads are placed outside the measured points.

System variables

This property overrides the value of the DIMTOFL system variable for the given dimension.

Remarks

The initial value for this property is FALSE.

For radius and diameter dimensions (when the TextInside property is set to FALSE), this property draws a dimension line and arrowheads inside the circle or arc and places the text and leader outside.


ForegroundLinesColor property [ActiveX and VBA Reference: AAR]

ForegroundLinesColor property

Specifies the color of foreground lines.

See Also | Example

Signature

object.ForegroundLinesColor

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesColor

AcadAcCmColor; input/output


ForegroundLinesEdgeTransparency property [ActiveX and VBA Reference: AAR]

ForegroundLinesEdgeTransparency property

Specifies the edge transparency of foreground lines.

See Also | Example

Signature

object.ForegroundLinesEdgeTransparency

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesEdgeTransparency

Long; input/output


ForegroundLinesFaceTransparency property [ActiveX and VBA Reference: AAR]

ForegroundLinesFaceTransparency property

Specifies the face transparency of foreground lines.

See Also | Example

Signature

object.ForegroundLinesFaceTransparency

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesFaceTransparency

Long; input/output


ForegroundLinesHiddenLine property [ActiveX and VBA Reference: AAR]

ForegroundLinesHiddenLine property

Specifies the hidden line visibility of foreground lines.

See Also | Example

Signature

object.ForegroundLinesHiddenLine

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesHiddenLine

Boolean; input/output


ForegroundLinesLayer property [ActiveX and VBA Reference: AAR]

ForegroundLinesLayer property

Specifies the layer of foreground lines.

See Also | Example

Signature

object.ForegroundLinesLayer

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesLayer

String; input/output


ForegroundLinesLinetype property [ActiveX and VBA Reference: AAR]

ForegroundLinesLinetype property

Specifies the linetype of foreground lines.

See Also | Example

Signature

object.ForegroundLinesLinetype

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesLinetype

String; input/output


ForegroundLinesLinetypeScale property [ActiveX and VBA Reference: AAR]

ForegroundLinesLinetypeScale property

Specifies the linetype scale of foreground lines.

See Also | Example

Signature

object.ForegroundLinesLinetypeScale

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesLinetypeScale

ACAD_NOUNITS; input/output


ForegroundLinesLineweight property [ActiveX and VBA Reference: AAR]

ForegroundLinesLineweight property

Specifies the line weight of foreground lines.

See Also | Example

Signature

object.ForegroundLinesLineweight

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesLineweight

ACAD_LWEIGHT; input/output


ForegroundLinesPlotStyleName property [ActiveX and VBA Reference: AAR]

ForegroundLinesPlotStyleName property

Specifies the plot style name of foreground lines.

See Also | Example

Signature

object.ForegroundLinesPlotStyleName

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesPlotStyleName

String; input/output


ForegroundLinesVisible property [ActiveX and VBA Reference: AAR]

ForegroundLinesVisible property

Specifies the visibility of foreground lines.

See Also | Example

Signature

object.ForegroundLinesVisible

object

SectionTypeSettings
The object or objects to which this property applies.

ForegroundLinesVisible

Boolean; input/output


FoundPath property [ActiveX and VBA Reference: AAR]

FoundPath Property

Specifies an alternate path of an entry in the File Dependency List.

See Also | Example

Signature

object.FoundPath

object

FileDependency
The object or objects this property applies to.

FoundPath

String; read-only
Alternate path at which the file was found, if any.


FractionFormat property [ActiveX and VBA Reference: AAR]

FractionFormat Property

Specifies the format of fractional values in dimensions and tolerances.

See Also | Example

Signature

object.FractionFormat

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Tolerance
The object or objects this property applies to.

FractionFormat

acDimFractionType enum; read-write

acHorizontal

acDiagonal

acNotStacked

System variables

This property overrides the value of the DIMFRAC system variable for the given dimension.

Remarks

This property is used when the UnitsFormat property is set to acDimLArchitectural or acDimLFractional.


Freeze property [ActiveX and VBA Reference: AAR]

Freeze Property

Specifies the freeze status of a layer.

See Also | Example

Signature

object.Freeze

object

Layer
The object or objects this property applies to.

Freeze

Boolean; read-write

TRUE: Freeze the layer.

FALSE: Thaw the layer.

Remarks

Freezing layers makes them invisible and excludes them from regeneration and plotting. Thawing a layer enables these capabilities. AutoCAD surfaces and circles on a turned-off or frozen layer are invisible, but they still hide objects when you use the HIDE, SHADEMODE, or RENDER commands.

You cannot freeze the active layer, or make a frozen layer active.

This property differs from the LayerOn property because frozen layers are not generated during a regeneration.


FullCRCValidation property [ActiveX and VBA Reference: AAR]

FullCRCValidation Property

Specifies whether a cyclic redundancy check (CRC) should be performed each time an object is read into the drawing.

See Also | Example

Signature

object.FullCRCValidation

object

PreferencesOpenSave
The object or objects this property applies to.

FullCRCValidation

Boolean; read-write

TRUE: Turns on full-time cyclic redundancy check.

FALSE: Turns off full-time cyclic redundancy check.

Remarks

The initial value for this property is FALSE.

If your drawings are being corrupted and you suspect a hardware problem or an AutoCAD error, set FullCRCValidation to TRUE.


FullFileName property [ActiveX and VBA Reference: AAR]

FullFileName Property

Specifies the saved full path name of an entry in the File Dependency List.

See Also | Example

Signature

object.FullFileName

object

FileDependency
The object or objects this property applies to.

FullFileName

String; read-only
Saved full path name.


FullName property [ActiveX and VBA Reference: AAR]

FullName Property

Gets the name of the application or document, including the path.

See Also | Example

Signature

object.FullName

object

Application, Document
The object or objects this property applies to.

FullName

String; read-only
The name and path of the application or document.


FullScreenTrackingVector property [ActiveX and VBA Reference: AAR]

FullScreenTrackingVector Property

Toggles the display of full-screen tracking vectors.

See Also | Example

Signature

object.FullScreenTrackingVector

object

PreferencesDrafting
The object or objects this property applies to.

FullScreenTrackingVector

Boolean; read-write

TRUE: Enables full-screen tracking vectors.

FALSE: Disables full-screen tracking vectors.

System variables

The value of this property is stored in the TRACKPATH system variable.

Remarks

The initial value for this property is TRUE.


GenerationOptions property [ActiveX and VBA Reference: AAR]

GenerationOptions property

Specifies the section generation options.

See Also | Example

Signature

object.GenerationOptions

object

SectionTypeSettings
The object or objects to which this property applies.

GenerationOptions

AcSectionGeneration; input/output


GradientAngle property [ActiveX and VBA Reference: AAR]

GradientAngle Property

Specifies the gradient angle.

See Also | Example

Signature

object.GradientAngle

object

Hatch
The object or objects this property applies to.

GradientAngle

Read-write


GradientCentered property [ActiveX and VBA Reference: AAR]

GradientCentered Property

Specifies whether the gradient is centered.

See Also | Example

Signature

object.GradientCentered

object

Hatch
The object or objects this property applies to.

GradientCentered

Boolean; read-write


GradientColor1 property [ActiveX and VBA Reference: AAR]

GradientColor1 Property

Specifies the start color of the gradient.

See Also | Example

Signature

object.GradientColor1

object

Hatch
The object or objects this property applies to.

GradientColor1

Read-write; AcCmColor object.
The AcCmColor object must contain one of the following constants, or an error is returned:

acColorMethodByACI

acColorMethodByBlock


GradientColor2 property [ActiveX and VBA Reference: AAR]

GradientColor2 Property

Specifies the end color of the gradient.

See Also | Example

Signature

object.GradientColor2

object

Hatch
The object or objects this property applies to.

GradientColor2

Read-write; AcCmColor object.
The AcCmColor object must contain one of the following constants, or an error is returned:

acColorMethodByACI

acColorMethodByBlock


GradientName property [ActiveX and VBA Reference: AAR]

GradientName Property

Specifies the pattern name of the gradient.

See Also | Example

Signature

object.GradientName

object

Hatch
The object or objects this property applies to.

GradientName

String; read-write
The pattern name of the gradient, which can be LINEAR, CYLINDER, INVCYLINDER, SPHERICAL HEMISPHERICAL, CURVED, INVSPHERICAL, INVHEMISPHERICAL, or INVCURVED.


GraphicsWinLayoutBackgrndColor property [ActiveX and VBA Reference: AAR]

GraphicsWinLayoutBackgrndColor Property

Specifies the background color for the paper space layouts.

See Also | Example

Signature

object.GraphicsWinLayoutBackgrndColor

object

PreferencesDisplay
The object or objects this property applies to.

GraphicsWinLayoutBackgrndColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The initial value for this property is a color halfway between the Windows standard background color and the Windows standard active button color.

The paper space windows are identified by the Layout tabs in AutoCAD. The model space window is identified by the Model tab. You can change the background color of the model space window by using the GraphicsWinModelBackgrndColor property.


GraphicsWinModelBackgrndColor property [ActiveX and VBA Reference: AAR]

GraphicsWinModelBackgrndColor Property

Specifies the background color for the model space window.

See Also | Example

Signature

object.GraphicsWinModelBackgrndColor

object

PreferencesDisplay
The object or objects this property applies to.

GraphicsWinModelBackgrndColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The default color for this property is vbBlack.


Green property [ActiveX and VBA Reference: AAR]

Green Property

Specifies the green component of the True Color.

See Also | Example

Signature

object.Green

object

AcCmColor
The object or objects this property applies to.

Green

Long; read-only
The green component, from 0-255, of AcCmColor.


GridOn property [ActiveX and VBA Reference: AAR]

GridOn Property

Specifies the status of the viewport grid.

See Also | Example

Signature

object.GridOn

object

Viewport, PViewport
The object or objects this property applies to.

GridOn

Boolean; read-write

TRUE: The grid is on.

FALSE: The grid is off.

System variables

The value of this property is stored in the GRIDMODE system variable. When using the SetVariable method to update the grid mode of the active viewport, you do not have to reset the viewport as the active viewport to see the change.

Remarks

The grid is used only for visual reference. It is not plotted, nor is it considered part of the drawing. The grid origin is set by the SnapBasePoint method.

When the grid is turned on, it is set to the current grid spacing. To change the grid spacing, use the SetGridSpacing method.

When you turn the grid on or off on a viewport, the visibility of the grid will not change until the viewport is made active. If you toggle the grid of the active viewport, the visibility of the grid will not change until the viewport is reset as the active viewport. To set or reset the viewport as the active viewport, use the ActiveViewport property with the updated viewport object.


GripColorSelected property [ActiveX and VBA Reference: AAR]

GripColorSelected Property

Specifies the color of selected grips.

See Also | Example

Signature

object.GripColorSelected

object

PreferencesSelection
The object or objects this property applies to.

GripColorSelected

acColor enum; read-write
Control of the selected grips (drawn as filled boxes). The valid range is 1 to 255, or one of the constants listed here:

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

System variables

The value for this property is stored in the GRIPHOT system variable.

Remarks

The initial value of this property is acRed.


GripColorUnselected property [ActiveX and VBA Reference: AAR]

GripColorUnselected Property

Specifies the color of unselected grips.

See Also | Example

Signature

object.GripColorUnselected

object

PreferencesSelection
The object or objects this property applies to.

GripColorUnselected

acColor enum; read-write
Control of the selected grips (drawn as box outlines). The valid range is 1 to 255, or one of the constants listed here:

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

System variables

The value for this property is stored in the GRIPCOLOR system variable.

Remarks

The initial value of this property is acBlue.


GripSize property [ActiveX and VBA Reference: AAR]

GripSize Property

Specifies the size of grips.

See Also | Example

Signature

object.GripSize

object

PreferencesSelection
The object or objects this property applies to.

GripSize

Long; read-write
The size of the box drawn to display the grip, in pixels. The practical range for this property is 1 to 20, although any value from 1 to 255 is legal.

System variables

The value for this property is stored in the GRIPSIZE system variable.

Remarks

The initial value of this property is 3.


Groups property [ActiveX and VBA Reference: AAR]

Groups Property

Gets the Groups collection for the document.

See Also | Example

Signature

object.Groups

object

Document
The object or objects this property applies to.

Groups

Groups collection; read-only
The Groups collection for the document.


Handle property [ActiveX and VBA Reference: AAR]

Handle Property

Gets the handle of an object.

See Also | Example

Signature

object.Handle

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

Handle

String; read-only
The handle of the entity.

Remarks

An object ID and a unique handle are the two ways of referencing an object. A handle is persistent (stays the same) in a drawing for the lifetime of the object.

In general, use a handle unless you plan to work with certain ObjectARX functions that require an object ID.


HasAttributes property [ActiveX and VBA Reference: AAR]

HasAttributes Property

Specifies whether the block has any attributes in it.

See Also | Example

Signature

object.HasAttributes

Object

BlockRef, ExternalReference; MInsertBlock

HasAttributes

Boolean; read-only

TRUE: The block reference has attributes.

FALSE: The block reference does not have attributes.

Remarks

This property is TRUE if the block reference contains any editable or constant (non-editable) attributes. It is FALSE if there are no attributes.

To return an array of Attribute objects associated to a block, use the GetAttributes method.


HasExtensionDictionary property [ActiveX and VBA Reference: AAR]

HasExtensionDictionary Property

Determines whether the object has an extension dictionary associated with it.

See Also | Example

Signature

object.HasExtensionDictionary

Object

All Drawing Objects , AttributeReference, Dictionary, DimStyle, Group, Layer, Linetype, RegisteredApplication, TextStyle, UCS, View, Viewport; XRecord
The object or objects this property applies to.

HasExtensionDictionary

Boolean; read-only

TRUE: The object has an extension dictionary associated with it.

FALSE: The object does not have an extension dictionary associated with it.

Remarks

You can create an extension dictionary for an object, or query an existing extension dictionary by using the GetExtensionDictionary method.


HasLeader property [ActiveX and VBA Reference: AAR]

HasLeader Property

Specifies whether the dimension has a leader.

Signature

object.HasLeader

object

DimArcLength
The object or objects this property applies to.

HasLeader

Boolean; read-write

TRUE: The dimension has a leader.

FALSE: The dimension does not have a leader.


HasSheetView property [ActiveX and VBA Reference: AAR]

HasSheetView Property

Specifies whether the viewport is linked to a corresponding sheet view.

Signature

object.HasSheetView

object

PViewport
The object or objects this property applies to.

HasSheetView

Boolean; read-only

TRUE: The viewport has a corresponding sheet view.

FALSE: The viewport does not have a corresponding sheet view.

Remarks

Note To access this property, use the IAcadPViewport2 interface.


HasSubSelection property [ActiveX and VBA Reference: AAR]

HasSubSelection Property

Specifies whether the table contains a subselection set.

See Also | Example

Signature

object.HasSubSelection

Object

Table
The object or objects this property applies to.

HasSubSelection

Boolean; read-only


HasVpAssociation property [ActiveX and VBA Reference: AAR]

HasVpAssociation property

Specifies whether the view is associated with a paper space viewport.

See Also | Example

Signature

object.HasVpAssociation

Object

View
The object or objects this property applies to.

HasVpAssociation

Boolean; read-write

TRUE: The view is associated with a paper space viewport.

FALSE: The view is not associated with a paper space viewport.


HatchObjectType property [ActiveX and VBA Reference: AAR]

HatchObjectType Property

Specifies the type of the hatch, classic or gradient.

See Also | Example

Signature

object.HatchObjectType

object

Hatch
The object or objects this property applies to.

HatchObjectType

AcHatchObjectType enum; read-write. Specify one of the following constants.

AcHatchObject | 0
AcGradientObject | 1

Remarks

The default value of this property is 0, acHatchObject, which creates a classic hatch.

If the value of this property is 1, acGradientObject, a gradient is created by the AddHatch method for hatch creation. If a gradient is created, then PatternType should be AcGradientPatternType and PatternName should contain a gradient pattern name of LINEAR, CYLINDER, INVCYLINDER, SPHERICAL, HEMISPHERICAL, CURVED, INVSPHERICAL, INVHEMISPHERICAL, or INVCURVED.


HatchStyle property [ActiveX and VBA Reference: AAR]

HatchStyle Property

Specifies the hatch style.

See Also | Example

Signature

object.HatchStyle

object

Hatch
The object or objects this property applies to.

HatchStyle

acHatchStyle enum; read-write

acHatchStyleNormal

acHatchStyleOuter

acHatchStyleIgnore

Remarks

acHatchStyleNormal

Specifies standard style or normal. This option hatches inward from the outermost area boundary. If AutoCAD encounters an internal boundary, it turns off hatching until it encounters another boundary.

acHatchStyleOuter

Fills the outermost areas only. This style also hatches inward from the area boundary, but it turns off hatching if it encounters an internal boundary and doesn't turn it back on again.

acHatchStyleIgnore

Ignores internal structure. This option hatches through all internal objects.


HeaderSuppressed property [ActiveX and VBA Reference: AAR]

HeaderSuppressed Property

Specifies whether the header of the table is suppressed.

See Also | Example

Signature

object.HeaderSuppressed

Object

Table, TableStyle
The object or objects this property applies to.

HeaderSuppressed

Boolean; read-write


Height property [ActiveX and VBA Reference: AAR]

Height property

Specifies the height of the extrusion.

See Also | Example

Signature

object.Height

object

ExtrudedSurface
The object or objects to which this property applies.

Height

Double; input/output


Height property [ActiveX and VBA Reference: AAR]

Height Property

Changes the height of the attribute, helix, shape, text, or underlay object, the view toolbar, or the main application window.

See Also | Example

Signature

object.Height

object

Application, Attribute, AttributeReference, DwfUnderlay, Helix, MText, PViewport, Raster, Shape, Text, TextStyle, Toolbar, Viewport, View
The object or objects this property applies to.

Height

Double (except for the Application and Toolbar objects for which it is an integer)
Read-write (except for the Toolbar and Raster objects that are read-only)
This must be a positive, non-negative number.

Remarks

Application: The height of the main application window in pixels.

MText, Text: The height of the uppercase text. Height is measured in the current units. The Height property is used as a scale factor for both the height and width of the text.

Height

Raster: The height of the raster image in pixels.

Viewport: The height of a viewport is the Y axis measurement of the viewport frame.

View: The height of a view is the Y axis measurement of the area within a viewport that is used to display the model.


Height property [ActiveX and VBA Reference: AAR]

Height Property

Specifies the height of the OLE object box.

Signature

object.Height

object

OLE
The object or objects this property applies to.

Height

Double
Read-write
This must be a positive, non-negative number.


Height property [ActiveX and VBA Reference: AAR]

Height Property

Specifies the height of the table.

See Also | Example

Signature

object.Height

Object

Table
The object or objects this property applies to.

Height

Double; read-write
The height of the table.


HelpFilePath property [ActiveX and VBA Reference: AAR]

HelpFilePath Property

Specifies the location of the AutoCAD Help file.

See Also | Example

Signature

object.HelpFilePath

object

PreferencesFiles
The object or objects this property applies to.

HelpFilePath

String; read-write
The location of the AutoCAD Help file.

Remarks

This property specifies the drive, path, and file name for the AutoCAD Help file.


HelpString property [ActiveX and VBA Reference: AAR]

HelpString Property

Specifies the Help string for the toolbar, toolbar item, or menu item.

See Also | Example

Signature

object.HelpString

object

PopupMenuItem, Toolbar, ToolbarItem
The object or objects this property applies to.

HelpString

String; read-write
The Help string for the toolbar, toolbar item, or menu item.

Remarks

The Help string is the text string that appears in the AutoCAD status line when a user highlights a menu item.


History property [ActiveX and VBA Reference: AAR]

History property

Specifies whether history is saved.

See Also | Example

Signature

object.History

object

3dSolid
The object or objects to which this property applies.

History

Variant; input/output


HistoryLines property [ActiveX and VBA Reference: AAR]

HistoryLines Property

Specifies the number of lines of text in the text window to keep in memory.

See Also | Example

Signature

object.HistoryLines

object

PreferencesDisplay
The object or objects this property applies to.

HistoryLines

Integer; read-write
The initial value is 400.


HorizontalTextPosition property [ActiveX and VBA Reference: AAR]

HorizontalTextPosition Property

Specifies the horizontal justification for dimension text.

See Also | Example

Signature

object.HorizontalTextPosition

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

HorizontalTextPosition

acDimHorizontalJustification enum; read-write

acHorzCentered

acFirstExtensionLine

acSecondExtensionLine

acOverFirstExtension

acOverSecondExtension

System variables

This property overrides the value of the DIMJUST system variable for the given dimension.

Remarks

acHorzCentered

The text is centered along the dimension line between the extension lines.

acFirstExtensionLine

The text is next to the first extension line.

acSecondExtensionLine

The text is next to the second extension line.

acOverFirstExtension

The text is above and aligned with the first extension line.

acOverSecondExtension

The text is above and aligned with the second extension line.


HorzCellMargin property [ActiveX and VBA Reference: AAR]

HorzCellMargin Property

Specifies the value of the horizontal margin of cells.

See Also | Example

Signature

object.HorzCellMargin

Object

Table, TableStyle
The object or objects this property applies to.

HorzCellMargin

Double; read-write


HWND property [ActiveX and VBA Reference: AAR]

HWND Property

Gets the window handle of the window frame.

See Also | Example

Signature

object.HWND

object

Document, Application
The object or objects this property applies to.

HWND

Long_PTR; read-only


HWND32 property [ActiveX and VBA Reference: AAR]

HWND32 Property

Gets the window handle of the window frame for a 64-bit system.

See Also | Example

Signature

object.HWND32

object

Document, Application
The object or objects this property applies to.

HWND32

Long; read-only
The handle window.


HyperlinkBase property [ActiveX and VBA Reference: AAR]

HyperlinkBase Property

Specifies the base address used for all relative links inserted within the drawing.

See Also | Example

Signature

object.HyperlinkBase

Object

SummaryInfo
The object or objects this property applies to.

HyperlinkBase

String; read-write
The HyperlinkBase property of a drawing.

Remarks

You can specify an Internet location or a path to a folder on a network drive.


HyperlinkDisplayCursor property [ActiveX and VBA Reference: AAR]

HyperlinkDisplayCursor Property

Toggles the display of the hyperlink cursor and shortcut menu.

See Also | Example

Signature

object.HyperlinkDisplayCursor

object

PreferencesUser
The object or objects this property applies to.

HyperlinkDisplayCursor

Boolean; read-write

TRUE: Displays the hyperlink cursor and shortcut menu.

FALSE: Does not display the hyperlink cursor and shortcut menu.

Remarks

The initial value for this property is TRUE.

When this property is enabled, the user sees a small bitmap (just below and to the right of the crosshairs) whenever the cursor is over an object that contains a hyperlink. When the property is disabled, this bitmap will not be shown.


HyperlinkDisplayTooltip property [ActiveX and VBA Reference: AAR]

HyperlinkDisplayTooltip Property

Toggles the display of hyperlink tooltips.

See Also | Example

Signature

object.HyperlinkDisplayTooltip

object

PreferencesUser
The object or objects this property applies to.

HyperlinkDisplayTooltip

Boolean; read-write

TRUE: Displays hyperlink tooltips.

FALSE: Does not display hyperlink tooltips.

Remarks

The initial value for this property is TRUE.

When this property is enabled, the user sees a tooltip whenever the cursor is over an object that contains a hyperlink. When this property is disabled, the tooltip does not show.

This property is automatically disabled when the HyperlinkDisplayCursor property is disabled.


Hyperlinks property [ActiveX and VBA Reference: AAR]

Hyperlinks Property

Gets the Hyperlinks collection for an entity.

See Also | Example

Signature

object.Hyperlinks

object

All Drawing objects
The object or objects this property applies to.

Hyperlinks

Hyperlinks; read-only
The Hyperlinks collection for the entity.


Hyperlinks Collectionobject [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Hyperlinks Collection

The collection of all hyperlinks for a given object.

VBA class name: | AcadHyperlinks
Create using: | N/A
Access via: | Hyperlinks property found on all objects

To add a new member to the collection, use the Add method. To select a specific Hyperlink, use the Item method. To delete a specific Hyperlink, use the Delete method found in the Hyperlink object.

Methods

Add

Item

Properties

Application

Count


ImageFile property [ActiveX and VBA Reference: AAR]

ImageFile Property

Specifies the full path and file name of the raster image file.

See Also | Example

Signature

object.ImageFile

object

Raster
The object or objects this property applies to.

ImageFile

String; read-write
The full path and file name of the raster image file.

Remarks

This property is similar to the Name property, except that this property contains the path information and the Name property does not.

You can use this property to load a new raster image into an existing raster object.


ImageFrameHighlight property [ActiveX and VBA Reference: AAR]

ImageFrameHighlight Property

Controls the display of raster images during selection.

See Also | Example

Signature

object.ImageFrameHighlight

object

PreferencesDisplay
The object or objects this property applies to.

ImageFrameHighlight

Boolean; read-write

TRUE: Display raster image frame when the image is selected.

FALSE: Display raster image content when the image is selected.

System variables

This value of this property is stored in the IMAGEHLT system variable.

Remarks

The initial value for this property is TRUE.


ImageHeight property [ActiveX and VBA Reference: AAR]

ImageHeight Property

Specifies the height of the raster image.

See Also | Example

Signature

object.ImageHeight

object

Raster
The object or objects this property applies to.

ImageHeight

Double; read-write
The height of the raster image.

Remarks

This property is similar to the Height property. The Height property specifies the height of the image in pixels. This property specifies the height of the image in current units.


ImageVisibility property [ActiveX and VBA Reference: AAR]

ImageVisibility Property

Specifies whether image visibility is on or off.

See Also | Example

Signature

object.ImageVisibility

object

Raster
The object or objects this property applies to.

ImageVisibility

Boolean; read-write

TRUE: The image is visible.

FALSE: The image is hidden.

Remarks

You can increase redrawing speed by turning the image visibility off when you do not need it in the current drawing session. Hidden images are not displayed or plotted; only the drawing boundary is displayed. You can choose to hide an image regardless of the current viewport coordinate system, or specifically when the image is not orthogonal (aligned) with the current viewport coordinate system.


ImageWidth property [ActiveX and VBA Reference: AAR]

ImageWidth Property

Specifies the width of the raster image.

See Also | Example

Signature

object.ImageWidth

object

Raster
The object or objects this property applies to.

ImageWidth

Double; read-write
The width of the raster image.

Remarks

This property is similar to the Width property. The Width property specifies the width of the image in pixels. This property specifies the width of the image in the current units.


IncrementalSavePercent property [ActiveX and VBA Reference: AAR]

IncrementalSavePercent Property

Specifies the percentage of wasted space allowed in a drawing file.

See Also | Example

Signature

object.IncrementalSavePercent

object

PreferencesOpenSave
The object or objects this property applies to.

IncrementalSavePercent

Integer; read-write
The valid range is 0 to 100.

System variables

The value of this property is stored in the ISAVEPERCENT system variable.

Remarks

The initial value of this property is 50.

When the specified percentage is reached, AutoCAD performs a full save instead of an incremental save. Full saves eliminate wasted space. If you set this property to 0, every save is a full save.

Although incremental saves increase the size of your drawing, do not set a very low value. For optimum performance, set the value to 50. If memory becomes an issue, set the value to 25. If you set the value to 20 or less, performance slows significantly. Low values lower the program's performance because AutoCAD performs time-consuming full saves more often.


Index property [ActiveX and VBA Reference: AAR]

Index Property

Specifies the index of the menu or toolbar item.

See Also | Example

Signature

object.Index

object

PopupMenuItem, ToolbarItem
The object or objects this property applies to.

Index

Integer; read-only
The position of the menu or toolbar item. The first position in the index is 0.


Index property - FDL [ActiveX and VBA Reference: AAR]

Index Property

Specifies the index of an entry in the File Dependency List.

See Also | Example

Signature

object.Feature

object

FileDependency
The object or objects this property applies to.

Index

Long; read-only
Index in the File Dependency List.


IndicatorFillColor property [ActiveX and VBA Reference: AAR]

IndicatorFillColor property

Specifies color of section plane when shading is turned on.

See Also | Example

Signature

object.IndicatorFillColor

object

Section
The object or objects to which this property applies.

IndicatorFillColor

AcadAcCmColor; input/output


IndicatorTransparency property [ActiveX and VBA Reference: AAR]

IndicatorTransparency property

Specifies transparency of section plane when shading is turned on.

See Also | Example

Signature

object.IndicatorTransparency

object

Section
The object or objects to which this property applies.

IndicatorTransparency

Long; input/output


InsertionPoint property [ActiveX and VBA Reference: AAR]

InsertionPoint Property

Insertion point for a tolerance, text, block, or shape.

See Also | Example

Signature

object.InsertionPoint

object

Attribute, AttributeReference, BlockRef, ExternalReference, MInsertBlock, MText, Shape, Table, Text, Tolerance Symbol
The object or objects this property applies to.

InsertionPoint

Variant (three-element array of doubles); read-write
A 3D WCS coordinate representing the insertion point.

Remarks

MText: Specifies the location for a corner of the text boundary. Use the AttachmentPoint property to specify which corner of the text boundary is to be positioned at this insertion point.

Text: This property is read-only except for text whose Alignment property is set to acAlignmentLeft, acAlignmentAligned, or acAlignmentFit. To position text whose justification is other than left, aligned, or fit, use the TextAlignmentPoint property.


InsertionPoint property [ActiveX and VBA Reference: AAR]

InsertionPoint Property

Specifies the origin coordinates (upper-left corner) of the OLE object.

Signature

object.InsertionPoint

object

OLE
The object or objects this property applies to.

InsertionPoint

Variant
Read-write


InsUnits property [ActiveX and VBA Reference: AAR]

InsUnits Property

Specifies the insert units saved with the block.

See Also

Signature

object.InsUnits

object

BlockRef, ExternalReference, MInsertBlock
The object or objects this property applies to.

InsUnits

String; read-only

Remarks

The InsUnits property specifies the native units for the block reference as defined by the block author. When a block is inserted in a drawing whose units have been defined, the block is automatically scaled proportional to the InsUnitsFactor, the conversion factor between the block units and the current drawing units.

Note To access this property, use the IAcadBlockReference2, IAcadExternalReference2, or IAcadMInsertBlock2 interface.


InsUnitsFactor property [ActiveX and VBA Reference: AAR]

InsUnitsFactor Property

Specifies the conversion factor between block units and drawing units.

See Also

Signature

object.InsUnitsFactor

object

BlockRef, ExternalReference, MInsertBlock
The object or objects this property applies to.

InsUnitsFactor

Double; read-only

Remarks

Note To access this property, use the IAcadBlockReference2, IAcadExternalReference2, or IAcadMInsertBlock2 interface.


IntersectionBoundaryColor property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryColor property

Specifies the color of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryColor

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryColor

AcadAcCmColor; input/output


IntersectionBoundaryDivisionLines property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryDivisionLines property

Specifies whether division lines are shown in intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryDivisionLines

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryDivisionLines

Boolean; input/output


IntersectionBoundaryLayer property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryLayer property

Specifies the layer of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryLayer

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryLayer

String; input/output


IntersectionBoundaryLinetype property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryLinetype property

Specifies the linetype of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryLinetype

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryLinetype

String; input/output


IntersectionBoundaryLinetypeScale property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryLinetypeScale property

Specifies the linetype scale of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryLinetypeScale

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryLinetypeScale

ACAD_NOUNITS; input/output


IntersectionBoundaryLineweight property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryLineweight property

Specifies the line weight of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryLineweight

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryLineweight

ACAD_LWEIGHT; input/output


IntersectionBoundaryPlotStyleName property [ActiveX and VBA Reference: AAR]

IntersectionBoundaryPlotStyleName property

Specifies the plot style name of intersection boundary.

See Also | Example

Signature

object.IntersectionBoundaryPlotStyleName

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionBoundaryPlotStyleName

String; input/output


IntersectionFillColor property [ActiveX and VBA Reference: AAR]

IntersectionFillColor property

Specifies the color of intersection fill.

See Also | Example

Signature

object.IntersectionFillColor

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillColor

AcadAcCmColor; input/output


IntersectionFillFaceTransparency property [ActiveX and VBA Reference: AAR]

IntersectionFillFaceTransparency property

Specifies the face transparency of intersection fill.

See Also | Example

Signature

object.IntersectionFillFaceTransparency

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillFaceTransparency

Long; input/output


IntersectionFillHatchAngle property [ActiveX and VBA Reference: AAR]

IntersectionFillHatchAngle property

Specifies the hatch angle for intersection fill.

See Also | Example

Signature

object.IntersectionFillHatchAngle

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillHatchAngle

ACAD_ANGLE; input/output


IntersectionFillHatchPatternName property [ActiveX and VBA Reference: AAR]

IntersectionFillHatchPatternName property

Specifies the hatch pattern name for intersection fill.

See Also | Example

Signature

object.IntersectionFillHatchPatternName

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillHatchPatternName

String; input/output


IntersectionFillHatchPatternType property [ActiveX and VBA Reference: AAR]

IntersectionFillHatchPatternType property

Specifies the hatch pattern type for intersection fill.

See Also | Example

Signature

object.IntersectionFillHatchPatternType

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillHatchPatternType

AcPatternType; input/output


IntersectionFillHatchScale property [ActiveX and VBA Reference: AAR]

IntersectionFillHatchScale property

Specifies the hatch scale for intersection fill.

See Also | Example

Signature

object.IntersectionFillHatchScale

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillHatchScale

ACAD_NOUNITS; input/output


IntersectionFillHatchSpacing property [ActiveX and VBA Reference: AAR]

IntersectionFillHatchSpacing property

Specifies the hatch spacing for intersection fill.

See Also | Example

Signature

object.IntersectionFillHatchSpacing

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillHatchSpacing

Double; input/output


IntersectionFillLayer property [ActiveX and VBA Reference: AAR]

IntersectionFillLayer property

Specifies the layer of intersection fill.

See Also | Example

Signature

object.IntersectionFillLayer

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillLayer

String; input/output


IntersectionFillLinetype property [ActiveX and VBA Reference: AAR]

IntersectionFillLinetype property

Specifies the linetype of intersection fill.

See Also | Example

Signature

object.IntersectionFillLinetype

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillLinetype

String; input/output


IntersectionFillLinetypeScale property [ActiveX and VBA Reference: AAR]

IntersectionFillLinetypeScale property

Specifies the linetype scale of intersection fill.

See Also | Example

Signature

object.IntersectionFillLinetypeScale

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillLinetypeScale

ACAD_NOUNITS; input/output


IntersectionFillLineweight property [ActiveX and VBA Reference: AAR]

IntersectionFillLineweight property

Specifies the line weight of intersection fill.

See Also | Example

Signature

object.IntersectionFillLineweight

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillLineweight

ACAD_LWEIGHT; input/output


IntersectionFillPlotStyleName property [ActiveX and VBA Reference: AAR]

IntersectionFillPlotStyleName property

Specifies the plot style name of intersection fill.

See Also | Example

Signature

object.IntersectionFillPlotStyleName

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillPlotStyleName

String; input/output


IntersectionFillVisible property [ActiveX and VBA Reference: AAR]

IntersectionFillVisible property

Specifies the visibility of intersection fill.

See Also | Example

Signature

object.IntersectionFillVisible

object

SectionTypeSettings
The object or objects to which this property applies.

IntersectionFillVisible

Boolean; input/output


Invisible property [ActiveX and VBA Reference: AAR]

Invisible Property

Specifies whether the attribute or attribute reference is invisible.

See Also | Example

Signature

object.Invisible

object

Attribute, AttributeReference
The object or objects this property applies to.

Invisible

Boolean; read-write

TRUE: The attribute is an invisible attribute.

FALSE: The attribute is not an invisible attribute.

Remarks

An invisible attribute will not be displayed or plotted.

An attribute can exist as only one of four optional modes: constant, preset, invisible, or verify. The AFLAGS system variable stores the current mode settings. You can query the current mode using the Mode property.


IsCloned property [ActiveX and VBA Reference: AAR]

IsCloned Property

Determines whether the source object in a CopyObjects operation has been cloned.

See Also | Example

Signature

object.IsCloned

object

IDPair
The object or objects this property applies to.

IsCloned

Boolean; read-only

TRUE: The source object has been cloned.

FALSE: The source object has not been cloned.


IsDynamicBlock property [ActiveX and VBA Reference: AAR]

IsDynamicBlock Property

Specifies whether this is a dynamic block.

Signature

object.IsDynamicBlock

object

Block, BlockRef, MInsertBlock
The object or objects this property applies to.

IsDynamicBlock

Boolean; read-only

TRUE: The block is a dynamic block.

FALSE: The block is not a dynamic block.

Remarks

Note To access this property, use the IAcadBlock3, IAcadBlockReference2, or IAcadMInsertBlock2 interface.


IsLayout property [ActiveX and VBA Reference: AAR]

IsLayout Property

Determines whether the given block is a layout block.

See Also | Example

Signature

object.IsLayout

object

Block
The object or objects this property applies to.

IsLayout

Boolean; read-only

TRUE: The block is a layout.

FALSE: The block is not a layout.

Remarks

The IsLayout property works with the IsXRef property. If both properties are FALSE, then the block is a simple block. If the IsXRef property is TRUE, then the block is an external reference. If the IsLayout property is TRUE, then the block contains all the geometry associated with a layout.


IsModified property [ActiveX and VBA Reference: AAR]

IsModified Property

Specifies whether an entry in the File Dependency List was modified.

See Also | Example

Signature

object.IsModified

object

FileDependency
The object or objects this property applies to.

IsModified

Boolean; read-only

TRUE: File is modified.

FALSE: File is not modified.


ISOPenWidth property [ActiveX and VBA Reference: AAR]

ISOPenWidth Property

Specifies the ISO pen width of an ISO hatch pattern.

See Also | Example

Signature

object.ISOPenWidth

object

Hatch
The object or objects this property applies to.

ISOPenWidth

acISOPenWidth enum, read-write for all ISO hatch patterns. Specify one of the following constants.

acPenWidth000 | 0.00 mm
acPenWidth013 | 0.13 mm
acPenWidth018 | 0.18 mm
acPenWidth025 | 0.25 mm
acPenWidth035 | 0.35 mm
acPenWidth050 | 0.50 mm
acPenWidth070 | 0.70 mm
acPenWidth100 | 1.00 mm
acPenWidth140 | 1.40 mm
acPenWidth200 | 2.00 mm
acPenWidthUnk | unknown

Remarks

The first ten values represent the pen width in hundredths of a millimeter.

The acPenWidthUnk value identifies an unknown, or non-standard, pen width. When you query a hatch and receive a value of acPenWidthUnk, use the PatternScale property to obtain the non-standard value. Setting the pen width of any hatch to acPenWidthUnk has no effect.

This property shares a relationship with the PatternScale property. When you work with ISO hatch patterns, the standard scale values can be entered through the PatternScale property or through this property. Non-standard pen widths can only be entered using the PatternScale property.


IsOwnerXlated property [ActiveX and VBA Reference: AAR]

IsOwnerXlated Property

Determines whether the owning object in a CopyObjects operation has been translated.

See Also | Example

Signature

object.IsOwnerXlated

object

IDPair
The object or objects this property applies to.

IsOwnerXlated

Boolean; read-only

TRUE: The owning object has been translated.

FALSE: The owning object has not been translated.

Remarks

When copying objects from one database to another, the owner of the object being copied may already exist in the new drawing. If this happens, the owning object is not copied, and this property is set to FALSE.


IsPartial property [ActiveX and VBA Reference: AAR]

IsPartial Property

Specifies whether the dimension is for a partial arc.

Signature

object.IsPartial

object

DimArcLength
The object or objects this property applies to.

IsPartial

Boolean; read-write

TRUE: The dimension is for a partial arc.

FALSE: The dimension is not for a partial arc.


IsPeriodic property [ActiveX and VBA Reference: AAR]

IsPeriodic Property

Determines whether the given spline is periodic.

See Also | Example

Signature

object.IsPeriodic

object

Spline
The object or objects this property applies to.

IsPeriodic

Boolean; read-only

TRUE: The spline is periodic.

FALSE: The spline is not periodic.


IsPlanar property [ActiveX and VBA Reference: AAR]

IsPlanar Property

Determines whether the given spline is planar.

See Also | Example

Signature

object.IsPlanar

object

Spline
The object or objects this property applies to.

IsPlanar

Boolean; read-only

TRUE: The spline is planar.

FALSE: The spline is not planar.


IsPrimary property [ActiveX and VBA Reference: AAR]

IsPrimary Property

Determines whether the source object in a CopyObjects operation was part of the primary set of objects being copied, or if it was simply owned by a member in the primary set.

See Also | Example

Signature

object.IsPrimary

object

IDPair
The object or objects this property applies to.

IsPrimary

Boolean; read-only

TRUE: The source object is part of the primary set of objects being cloned.

FALSE: The source object is owned by a member in the primary set of objects being cloned.


IsQuiescent property [ActiveX and VBA Reference: AAR]

IsQuiescent Property

Checks whether AutoCAD is idle and ready to accept automation calls from out-of-process applications.

See Also | Example

Signature

object.IsQuiescent

object

AcadState
The object or objects this property applies to.

IsQuiescent

Boolean; read-only

TRUE: AutoCAD is idle.

FALSE: AutoCAD is busy.


IsRational property [ActiveX and VBA Reference: AAR]

IsRational Property

Determines whether the given spline is rational.

See Also | Example

Signature

object.IsRational

object

Spline
The object or objects this property applies to.

IsRational

Boolean; read-only

TRUE: The spline is rational.

FALSE: The spline is not rational.


Issuer property [ActiveX and VBA Reference: AAR]

Issuer Property

Specifies the issuer name of the digital certificate.

See Also | Example

Signature

object.Issuer

object

SecurityParams
The object or objects this property applies to.

Issuer

String; read-write
The issuer name of the digital certificate.


IsXRef property [ActiveX and VBA Reference: AAR]

IsXRef Property

Determines whether the given block is an XRef block.

See Also | Example

Signature

object.IsXRef

object

Block
The object or objects this property applies to.

IsXRef

Boolean; read-only

TRUE: The block is an XRef.

FALSE: The block is not an XRef.

Remarks

The IsXRef property works with the IsLayout property. If both properties are FALSE, then the block is a simple block. If the IsXRef property is TRUE, then the block is an external reference. If the IsLayout property is TRUE, then the block contains all the geometry associated with a layout.


ItemName property [ActiveX and VBA Reference: AAR]

ItemName property

Specifies the item of the underlay file.

See Also | Example

Signature

object.ItemName

object

DwfUnderlay
The object or objects to which this property applies.

ItemName

String; input/output


JogAngle property [ActiveX and VBA Reference: AAR]

JogAngle Property

Specifies the jog angle.

Signature

object.JogAngle

object

DimRadialLarge
The object or objects this property applies to.

JogAngle

ACAD_ANGLE; read-write


JogLocation property [ActiveX and VBA Reference: AAR]

JogLocation Property

Specifies the jog location or pick point.

Signature

object.JogLocation

object

DimRadialLarge
The object or objects this property applies to.

JogLocation

Variant; read-write


Justification property [ActiveX and VBA Reference: AAR]

Justification Property

Specifies the justification of the MLine.

Signature

object.Justification

object

MLine
The object or objects this property applies to.

Justification

AcMLineJustification enum; the justification

acBottom

acTop

acZero

Remarks

Note To access this property, use the IAcadMLine2 interface.


Key property [ActiveX and VBA Reference: AAR]

Key Property

The object ID of the source object in the CopyObjects operation.

See Also | Example

Signature

object.Key

object

IDPair
The object or objects this property applies to.

Key

Long_PTR; read-only
The object ID of the source object.

Remarks

Use the Value property to get the object ID of the newly created cloned object.


Key32 property [ActiveX and VBA Reference: AAR]

Key32 Property

The object ID of the source object in the CopyObjects operation for a 64-bit system.

See Also | Example

Signature

object.Key32

object

IDPair
The object or objects this property applies to.

Key32

Long; read-only
The object ID of the source object.

Remarks

Use the Value32 property to get the object ID of the newly created cloned object.


KeyboardAccelerator property [ActiveX and VBA Reference: AAR]

KeyboardAccelerator Property

Specifies the Windows standard or AutoCAD classic keyboard.

See Also | Example

Signature

object.KeyboardAccelerator

object

PreferencesUser
The object or objects this property applies to.

KeyboardAccelerator

acKeyboardAccelerator enum; read-write

acPreferenceClassic | Uses the AutoCAD classic keyboard.
acPreferenceCustom | Uses the Windows standard keyboard.


KeyboardPriority property [ActiveX and VBA Reference: AAR]

KeyboardPriority Property

Controls how AutoCAD responds to the input of coordinate data.

See Also | Example

Signature

object.KeyboardPriority

object

PreferencesUser
The object or objects this property applies to.

KeyboardPriority

acKeyboardPriority enum; read-write

acKeyboardRunningObjSnap

acKeyboardEntry

acKeyboardEntryExceptScripts

System variables

The value of this property is stored in the OSNAPCOORD system variable.

Remarks

The initial value for this property is acKeyboardEntryExceptScripts.

The available options are as follows:

acKeyboardRunningObjSnap

Object snaps are strictly adhered to when typing in coordinates.

acKeyboardEntry

Keyboard entry values are strictly adhered to when typing in coordinates.

acKeyboardEntryExceptScripts

Keyboard entry values are strictly adhered to when typing in coordinates. However, when coordinates are entered through a script, running object snaps are adhered to.


KeyLength property [ActiveX and VBA Reference: AAR]

KeyLength Property

Specifies the length of the encryption key.

See Also | Example

Signature

object.KeyLength

object

SecurityParams
The object or objects this property applies to.

KeyLength

Long; read-write
The length of the encryption key, which is based on the value of ProviderName.


Keywords property [ActiveX and VBA Reference: AAR]

Keywords Property

Specifies the keywords you want to use to locate the drawing.

See Also | Example

Signature

object.Keywords

Object

SummaryInfo
The object or objects this property applies to.

Keywords

String; read-write
The Keywords property of a drawing.


Knots property [ActiveX and VBA Reference: AAR]

Knots Property

Gets the knot vector for a spline.

See Also | Example

Signature

object.Knots

object

Spline
The object or objects this property applies to.

Knots

Variant (three-element array of doubles); read-write
The knots vector of the spline.


Label property [ActiveX and VBA Reference: AAR]

Label Property

Specifies the content and formatting of menu items as they appear to the user.

See Also | Example

Signature

object.Label

object

PopupMenuItem
The object or objects this property applies to.

Label

String; read-write
The label for the popup menu item.

Remarks

Unlike the Caption property, this property can contain DIESEL string expressions that conditionally alter the labels each time they are displayed.


LabelBlockId property [ActiveX and VBA Reference: AAR]

LabelBlockId Property

Returns and sets the label block ID associated with the viewport.

Signature

object.LabelBlockId

object

PViewport
The object or objects this property applies to.

LabelBlockId

Long_PTR; read-write

Remarks

Note To access this property, use the IAcadPViewport2 Interface.


LabelBlockId32 property [ActiveX and VBA Reference: AAR]

LabelBlockId32 Property

Returns and sets the label block ID associated with the viewport for a 64-bit system.

Signature

object.LabelBlockId32

object

PViewport
The object or objects this property applies to.

LabelBlockId32

Long_PTR; read-write

Remarks

Note To access this property, use the IAcadPViewport2 Interface.


LandingGap property [ActiveX and VBA Reference: AAR]

LandingGap Property

The text landing gap.

See Also | Example

Signature

object.LandingGap

Object

MLeader Object, MLeaderStyle
The object this property applies to.

LandingGap

Double; read-write
Specifies the landing gap.


LargeButtons property [ActiveX and VBA Reference: AAR]

LargeButtons Property

Specifies whether the toolbar button is large or small.

See Also | Example

Signature

object.LargeButtons

object

Toolbar, Toolbars

LargeButtons

Boolean; read-only for Toolbar object, read-write for Toolbars collection.

TRUE: The toolbar is large.

FALSE: The toolbar is small.


LastHeight property [ActiveX and VBA Reference: AAR]

LastHeight Property

Specifies the last text height used.

See Also | Example

Signature

object.LastHeight

object

TextStyle
The object or objects this property applies to.

LastHeight

Double; read-write
The last text height used for the text style.


LastSavedBy property [ActiveX and VBA Reference: AAR]

LastSavedBy Property

Specifies the name of the last person who modified the file.

See Also | Example

Signature

object.LastSavedBy

Object

SummaryInfo
The object or objects this property applies to.

LastSavedBy

String; read-write
The LastSavedBy property of a drawing.


Layer property [ActiveX and VBA Reference: AAR]

Layer Property

Specifies the layer for an object.

See Also | Example

Signature

object.Layer

object

All Drawing objects, AttributeReference, Group
The object or objects this property applies to.

Layer

String; read-write (write-only for the Group object)
The name of the layer.

Remarks

All objects have an associated layer. The document always contains at least one layer (layer 0). As with linetypes, you can specify a layer for an object. If you don't specify a layer, the current active layer is used for a new object. If a layer is specified for an object, the current active layer is ignored. Use the ActiveLayer property to set or query the current active layer.

Each layer has associated properties that can be set and queried through the Layer object.


LayerOn property [ActiveX and VBA Reference: AAR]

LayerOn Property

Specifies the state of a layer.

See Also | Example

Signature

object.LayerOn

object

Layer
The object or objects this property applies to.

LayerOn

Boolean; read-write

TRUE: The layer is on.

FALSE: The layer is off.

Remarks

Objects associated with a turned-off layer are not displayed on the screen or plotted. Unlike the Freeze property, layers that are turned off are generated during a regeneration but are not displayed.

AutoCAD surfaces and circles on a turned-off or frozen layer are invisible but they still hide objects when you use the HIDE, SHADEMODE, or RENDER commands.


Layers property [ActiveX and VBA Reference: AAR]

Layers Property

Gets the Layers collection for the document.

See Also | Example

Signature

object.Layers

object

Document
The object or objects this property applies to.

Layers

Layers collection; read-only
The Layers collection for the document.


LayerState property [ActiveX and VBA Reference: AAR]

LayerState property

Specifies the name of the layer state of the view.

See Also | Example

Signature

object.LayerState

Object

View
The object or objects this property applies to.

LayerState

String; read-write
The name of the layer state.


Layout property [ActiveX and VBA Reference: AAR]

Layout Property

Specifies the layout associated with the model space, paper space, or block object.

See Also | Example

Signature

object.Layout

object

ModelSpace, PaperSpace , Block
The object or objects this property applies to.

Layout

Layout object; read-write
The layout that is associated with the model space, paper space, or block object.

Remarks

The Layout object contains the plot settings for the model space, paper space, or block object.

Named plot settings not associated with a given block are stored as PlotConfiguration objects.


LayoutCreateViewport property [ActiveX and VBA Reference: AAR]

LayoutCreateViewport Property

Toggles the automatic creation of a viewport for new layouts.

See Also | Example

Signature

object.LayoutCreateViewport

object

PreferencesDisplay
The object or objects this property applies to.

LayoutCreateViewport

Boolean; read-write

TRUE: A viewport is created for new layouts.

FALSE: A viewport is not created for new layouts.

Remarks

The initial value for this property is TRUE.


LayoutCrosshairColor property [ActiveX and VBA Reference: AAR]

LayoutCrosshairColor Property

Specifies the color of the crosshairs and text for paper space layouts.

See Also | Example

Signature

object.LayoutCrosshairColor

object

PreferencesDisplay
The object or objects this property applies to.

LayoutCrosshairColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The initial value for this property is the Windows standard text color.

To specify the crosshairs color for the model space layout, use the ModelCrosshairColor property.


LayoutDisplayMargins property [ActiveX and VBA Reference: AAR]

LayoutDisplayMargins Property

Toggles the display of margins in layouts.

See Also | Example

Signature

object.LayoutDisplayMargins

object

PreferencesDisplay
The object or objects this property applies to.

LayoutDisplayMargins

Boolean; read-write

TRUE: Margins are displayed in layouts.

FALSE: Margins are not displayed in layouts.

Remarks

The initial value for this property is TRUE.


LayoutDisplayPaper property [ActiveX and VBA Reference: AAR]

LayoutDisplayPaper Property

Toggles the display of the paper background in layouts.

See Also | Example

Signature

object.LayoutDisplayPaper

object

PreferencesDisplay
The object or objects this property applies to.

LayoutDisplayPaper

Boolean; read-write

TRUE: The paper background is displayed in layouts.

FALSE: The paper background is not displayed in layouts.

Remarks

The initial value for this property is TRUE.


LayoutDisplayPaperShadow property [ActiveX and VBA Reference: AAR]

LayoutDisplayPaperShadow Property

Toggles the display of the paper background shadow in layouts.

See Also | Example

Signature

object.LayoutDisplayPaperShadow

object

PreferencesDisplay
The object or objects this property applies to.

LayoutDisplayPaperShadow

Boolean; read-write

TRUE: The shadow is displayed in layouts.

FALSE: The shadow is not displayed in layouts.

Remarks

The initial value for this property is TRUE.


LayoutID property [ActiveX and VBA Reference: AAR]

LayoutID property

Specifies the layout of the view.

See Also | Example

Signature

object.LayoutID

Object

View
The object or objects this property applies to.

LayoutID

Long_PTR; read-only
The ObjectID of the layout.


LayoutID32 property [ActiveX and VBA Reference: AAR]

LayoutID32 property

Specifies the layout of the view for a 64-bit system.

See Also | Example

Signature

object.LayoutID32

Object

View
The object or objects this property applies to.

LayoutID32

Long_PTR; read-only
The ObjectID of the layout.


Layouts property [ActiveX and VBA Reference: AAR]

Layouts Property

Gets the Layouts collection for the document.

See Also | Example

Signature

object.Layouts

object

Document
The object or objects this property applies to.

Layouts

Layouts object; read-only
The Layouts collection for the document.


LayoutShowPlotSetup property [ActiveX and VBA Reference: AAR]

LayoutShowPlotSetup Property

Toggles the display of the Plot Setup dialog when a new layout is created.

See Also | Example

Signature

object.LayoutShowPlotSetup

object

PreferencesDisplay
The object or objects this property applies to.

LayoutShowPlotSetup

Boolean; read-write

TRUE: The dialog is displayed when a new layout is created.

FALSE: The dialog is not displayed when a new layout is created.

Remarks

The initial value for this property is TRUE.


Leader1Point property [ActiveX and VBA Reference: AAR]

Leader1Point Property

Specifies the origin of leader 1.

Signature

object.Leader1Point

object

DimArcLength
The object or objects this property applies to.

Leader1Point

Variant; read-write


Leader2Point property [ActiveX and VBA Reference: AAR]

Leader2Point Property

Specifies the origin of leader 2.

Signature

object.Leader2Point

object

DimArcLength
The object or objects this property applies to.

Leader2Point

Variant; read-write


LeaderLength property [ActiveX and VBA Reference: AAR]

LeaderLength Property

Specifies the length of the leader on the diameter or radius dimension.

See Also | Example

Signature

object.LeaderLength

object

DimDiametric, DimRadial
The object or objects this property applies to.

LeaderLength

Double; write-only
The length of the leader.

Remarks

The LeaderLength is the distance from the ChordPoint dimension definition point out to where the dimension will do a horizontal dogleg to the annotation text (or stop if no dogleg is necessary). (See the AddDimDiametric or AddDimRadial method for more information.)

WARNING! The LeaderLength setting will be used only during the creation of the dimension. After the dimension has been saved, changing the LeaderLength value will not affect how the dimension displays. The LeaderLength property is used to calculate the leader location. The value is not saved, and therefore will always return a zero if read.


LeaderLineColor property [ActiveX and VBA Reference: AAR]

LeaderLineColor Property

Specifies the color of the leader lines.

See Also | Example

Signature

object.LeaderLineColor

Object

MLeader Object, MLeaderStyle
The object this property applies to.

LeaderLineColor

AcadAcCmColor; read-write
A value which stands for the leader line color display.


LeaderLinetype property [ActiveX and VBA Reference: AAR]

LeaderLinetype Property

Specifies the type of the leader lines.

See Also | Example

Signature

object.LeaderLinetype

Object

MLeader Object, MLeaderStyle
The object this property applies to.

LeaderLinetype

ACAD_LTYPE; read-write
A value which stands for the leader line's linetype.


LeaderLineTypeId property [ActiveX and VBA Reference: AAR]

LeaderLineTypeId Property

Specifies the linetype of leader lines of the mleaderstyle.

See Also | Example

Signature

object.LeaderLineTypeId

Object

MLeaderStyle
The object this property applies to.

SecondSegmentAngleConstraint

ACAD_LTYPE; read-write
The leader line type ID value.


LeaderLineWeight property [ActiveX and VBA Reference: AAR]

LeaderLineWeight Property

Specifies the weight of the leader lines.

See Also | Example

Signature

object.LeaderLineWeight

Object

MLeader Object, MLeaderStyle
The object this property applies to.

LeaderLineWeight

ACAD_LWEIGHT; read-write
A value which stands for the leader line's linetype.


LeaderType property [ActiveX and VBA Reference: AAR]

LeaderType Property

Specifies the type of the leader.

See Also | Example

Signature

object.LeaderType

Object

MLeader Object
The object this property applies to.

LeaderType

AcMLeaderType; read-write
A value which stands for the leader's type.


Left property [ActiveX and VBA Reference: AAR]

Left Property

Specifies the left edge of a toolbar.

See Also | Example

Signature

object.Left

object

Toolbar
The object or objects this property applies to.

Left

Integer; read-write
The left edge of the toolbar.


Length property [ActiveX and VBA Reference: AAR]

Length Property

Gets the length of an object.

See Also | Example

Signature

object.Length

object

Line, LightweightPolyline, Polyline, 3dPolyline
The object or objects this property applies to.

Length

Double; read-only
The length of the line.


LensLength property [ActiveX and VBA Reference: AAR]

LensLength Property

Specifies the lens length used in perspective viewing.

See Also | Example

Signature

object.LensLength

object

PViewport
The object or objects this property applies to.

LensLength

Double; read-write
The length of the lens in millimeters.

System variables

The value of this property is stored in the LENSLENGTH system variable.


Limits property [ActiveX and VBA Reference: AAR]

Limits Property

Specifies the drawing limits.

See Also | Example

Signature

object.Limits

object

Document
The object or objects this property applies to.

Limits

Variant (array of doubles); read-write
An array of four values. The first pair of values define the X and Y coordinates of the lower-left limit, the second pair of values define the X and Y coordinates of the upper-right limit.

System variables

The lower-left limit controls the LIMMIN system variable. The upper-right limit controls the LIMMAX system variable. The LIMCHECK system variable turns limits checking on and off for the current space.

Remarks

The drawing limits are two-dimensional points in the World Coordinate System (WCS) that represent a lower-left and an upper-right limit. You cannot impose limits on the Z direction.

The drawing limits also govern the portion of the drawing covered by the visible grid and determine the minimum area that the ZoomAll method displays.


LinearScaleFactor property [ActiveX and VBA Reference: AAR]

LinearScaleFactor Property

Specifies a global scale factor for linear dimensioning measurements.

See Also | Example

Signature

object.LinearScaleFactor

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

LinearScaleFactor

Double; read-write
A real number greater than 0.0.

System variables

This property overrides the value of the DIMLFAC system variable for the given dimension.

Remarks

The initial value for this property is 1.0000.

When LinearScaleFactor is assigned a negative value, the factor is only applied in paper space.The paper space factor to be applied is the absolute value of this property.


LineSpacingDistance property [ActiveX and VBA Reference: AAR]

LineSpacingDistance Property

Specifies the spacing of multiline text.

See Also | Example

Signature

object.LineSpacingDistance

Object

MText
The object or objects this property applies to.

LineSpacingDistance

Double; read-write

Remarks

The value contained in this property is the Line Space Distance property in the Properties palette.


LineSpacingFactor property [ActiveX and VBA Reference: AAR]

LineSpacingFactor Property

Specifies the relative line spacing factor for the MText object.

See Also | Example

Signature

object.LineSpacingFactor

object

MText
The object or objects this property applies to.

LineSpacingFactor

Double; read-write
The relative line spacing factor for the MText object. Enter a value between 0.25 and 4 inclusive.

Remarks

The spacing factor is the vertical distance between the baseline of one text line and the baseline of the next text line. The spacing factor is set as a multiple of single line spacing.

You can set the line spacing to be either "At Least" the specified distance, or "Exactly" the specified distance by using the LineSpacingStyle property.


LineSpacingStyle property [ActiveX and VBA Reference: AAR]

LineSpacingStyle Property

Specifies the line spacing style for the MText object.

See Also | Example

Signature

object.LineSpacingStyle

object

MText
The object or objects this property applies to.

LineSpacingStyle

acLineSpacingStyle enum; read-write

acLineSpacingStyleAtLeast

acLineSpacingStyleExactly

Remarks

The acLineSpacingStyleAtLeast setting allows the spacing between different lines of text to adjust automatically, based on the height of the largest character in a line of text. The acLineSpacingStyleExactly setting forces the line spacing to be the same size for all the lines in the MText object regardless of formatting overrides.


Linetype property [ActiveX and VBA Reference: AAR]

Linetype Property

Specifies the linetype of an object.

See Also | Example

Signature

object.Linetype

object

All Drawing objects, AttributeReference, Group, Layer
The object or objects this property applies to.

Linetype

String; read-write (write-only for the Group object)
The linetype of an object. The default linetype is the linetype of the layer (BYLAYER).

Remarks

The linetype values identify the series of dots and dashes used for drawing lines. If you don't specify a linetype, the current active linetype is used for a new entity. If a linetype is specified for an entity, the current active linetype is ignored. Use the ActiveLinetype property to set or query the current active linetype.

NOTE It is not possible to create a linetype programmatically. An existing linetype may be added to a drawing by using the Load method to first load the linetype, and then the Add method to add it to the Linetypes collection.

Special linetype entries are as follows:

CONTINUOUS

The default linetype, which is automatically created in the linetype symbol table.

BYLAYER

The linetype value of the object's layer.

BYBLOCK

The linetype value of the object's surrounding block definition's current block reference.


LinetypeGeneration property [ActiveX and VBA Reference: AAR]

LinetypeGeneration Property

Specifies the linetype generation of a 2D polyline or a lightweight polyline.

See Also | Example

Signature

object.LinetypeGeneration

object

LightweightPolyline, Polyline
The object or objects this property applies to.

LinetypeGeneration

Boolean; read-write

TRUE: Generates the linetype in a continuous pattern through the polyline vertices.

FALSE: Generates the linetype starting and ending with a dash at each polyline vertex.

Remarks

This property does not apply to polylines with tapered segments.

A polyline with linetype generation set to true (left) and set to false (right)


Linetypes property [ActiveX and VBA Reference: AAR]

Linetypes Property

Gets the Linetypes collection for the document.

See Also | Example

Signature

object.Linetypes

object

Document
The object or objects this property applies to.

Linetypes

Linetypes collection; read-only
The Linetypes collection for the document.


LinetypeScale property [ActiveX and VBA Reference: AAR]

LinetypeScale Property

Specifies the linetype scale of an object.

See Also | Example

Signature

object.LinetypeScale

object

All Drawing objects, AttributeReference, Group
The object or objects this property applies to.

LinetypeScale

Double; read-write (write-only for the Group object)
This value must be a positive real number. The default is 1.0.

Remarks

The linetype scale of an object specifies the relative length of dash-dot linetypes per drawing unit.

Linetype scale = 1.0

Linetype scale = 0.5

Linetype scale = 0.25


Lineweight property [ActiveX and VBA Reference: AAR]

Lineweight Property

Specifies the lineweight of an individual object or the default lineweight for the drawing.

See Also | Example

Signature

object.Lineweight

object

All Drawing objects; DatabasePreferences, Layer
The object or objects this property applies to.

Lineweight

acLineWeight enum; read-write

acLnWtByLayer

acLnWtByBlock

acLnWtByLwDefault

acLnWt000

acLnWt005

acLnWt009

acLnWt013

acLnWt015

acLnWt018

acLnWt020

acLnWt025

acLnWt030

acLnWt035

acLnWt040

acLnWt050

acLnWt053

acLnWt060

acLnWt070

acLnWt080

acLnWt090

acLnWt100

acLnWt106

acLnWt120

acLnWt140

acLnWt158

acLnWt200

acLnWt211

Remarks

The initial value for this property is acLnWtByBlock.

Lineweight values consist of standard settings including BYLAYER, BYBLOCK, and DEFAULT. The DEFAULT value is set by the LWDEFAULT system variable and defaults to a value of 0.01 in. or 0.25 mm. All new objects and layers have a default setting of DEFAULT. The lineweight value of 0 plots at the thinnest lineweight available on the specified plotting device and is displayed at one pixel wide in model space.


LineweightDisplay property [ActiveX and VBA Reference: AAR]

LineweightDisplay Property

Specifies whether lineweights are displayed in model space for the drawing.

See Also | Example

Signature

object.LineweightDisplay

object

DatabasePreferences
The object or objects this property applies to.

LineweightDisplay

Boolean; read-write

TRUE: Lineweights are displayed in model space.

FALSE: Lineweights are not displayed in model space.

Remarks

The initial value for this property is TRUE.

AutoCAD regeneration time increases with lineweights that are represented by more than one pixel. Set this property to FALSE if AutoCAD performance slows down when working with large lineweights.


LiveSectionEnabled property [ActiveX and VBA Reference: AAR]

LiveSectionEnabled property

Turns live section on or off for this section object.

See Also | Example

Signature

object.LiveSectionEnabled

object

Section
The object or objects to which this property applies.

LiveSectionEnabled

Boolean; input/output


LoadAcadLspInAllDocuments property [ActiveX and VBA Reference: AAR]

LoadAcadLspInAllDocuments Property

Specifies whether acad.lsp is loaded at startup or with each drawing.

See Also | Example

Signature

object.LoadAcadLspInAllDocuments

object

PreferencesSystem
The object or objects this property applies to.

LoadAcadLspInAllDocuments

Boolean; read-write

TRUE: Acad.lsp is loaded with each drawing.

FALSE: Acad.lsp is loaded only with the first drawing at startup.

System variables

The value for this property is stored in the ACADLSPASDOC system variable.

Remarks

The initial value for this property is TRUE.


LocaleID property [ActiveX and VBA Reference: AAR]

LocaleID Property

Gets the locale ID of the current AutoCAD session.

See Also | Example

Signature

object.LocaleID

object

Application
The object or objects this property applies to.

LocaleID

Long; read-only
The locale ID of the current AutoCAD session.

Remarks

The locale ID is defined by the operating system.


Lock property [ActiveX and VBA Reference: AAR]

Lock Property

Locks or unlocks a layer.

See Also | Example

Signature

object.Lock

object

Layer
The object or objects this property applies to.

Lock

Boolean; read-write

TRUE: The layer is locked.

FALSE: The layer is unlocked.

Remarks

You cannot edit objects on a locked layer; however, they are still visible if the layer is on and thawed. You can make a locked layer active and you can add objects to it. You can also apply object snap modes to objects on locked layers. You can freeze and turn off locked layers and change their associated colors.

Locking is useful when you want to edit objects that are associated with particular layers but also want to view objects on other layers.


LockAspectRatio property [ActiveX and VBA Reference: AAR]

LockAspectRatio Property

Ensures that the width and height of the object stay in proportion.

Signature

object.LockAspectRatio

object

OLE
The object or objects this property applies to.

LockAspectRatio

Boolean; read-write

TRUE: The proportion of the width to the height of the object is locked.

FALSE: The proportion of the width to the height of the object is not locked.


LockPosition property [ActiveX and VBA Reference: AAR]

LockPosition Property

Specifies whether the attribute or attribute reference may be moved relative to the geometry in the block.

Signature

object.LockPosition

object

Attribute, AttributeReference
The object or objects this property applies to.

LockPosition

Boolean; read-write for Attribute object, read only for AttributeReference object

TRUE: The attribute's position is locked.

FALSE: The attribute's position is not locked.

Remarks

Note To access this property, use the IAcadAttribute2 or IAcadAttributeReference2 interface.


LogFileOn property [ActiveX and VBA Reference: AAR]

LogFileOn Property

Specifies whether the contents of the text window are written to a log file.

See Also | Example

Signature

object.LogFileOn

object

PreferencesOpenSave
The object or objects this property applies to.

LogFileOn

Boolean; read-write

TRUE: The log file is turned on.

FALSE: The log file is turned off.

System variables

The value for this property is stored in the LOGFILEMODE system variable.

Remarks

The initial value of this property is TRUE.

The log file records the contents of the text window in a text file. Use the LogFilePath property to specify the name of the log file.


LogFilePath property [ActiveX and VBA Reference: AAR]

LogFilePath Property

Specifies the location for the log file.

See Also | Example

Signature

object.LogFilePath

object

PreferencesFiles
The object or objects this property applies to.

LogFilePath

String; read-write
The drive and path for the log file.

System variables

The value for this property is stored in the LOGFILEPATH system variable.

Remarks

Use the LogFileOn property to enable or disable log file capabilities.


LowerLeftCorner property [ActiveX and VBA Reference: AAR]

LowerLeftCorner Property

Gets the lower-left corner of the current active viewport.

See Also | Example

Signature

object.LowerLeftCorner

object

Viewport
The object or objects this property applies to.

LowerLeftCorner

Variant (two-element array of doubles); read-only
A 2D coordinate representing the lower-left corner of the current active viewport.

Remarks

The LowerLeftCorner and UpperRightCorner properties represent the graphic placement of the viewport on the display. These properties are defined as follows:

Viewport 1—LowerLeftCorner = (0, .5), UpperRightCorner = (.5, 1)

Viewport 2—LowerLeftCorner = (.5, .5), UpperRightCorner = (1, 1)

Viewport 3—LowerLeftCorner = (0, 0), UpperRightCorner = (.5, .5)

Viewport 4—LowerLeftCorner = (.5, 0), UpperRightCorner = (1, .5)


Macro property [ActiveX and VBA Reference: AAR]

Macro Property

Specifies the macro for the menu or toolbar item.

See Also | Example

Signature

object.Macro

object

PopupMenuItem, ToolbarItem
The object or objects this property applies to.

Macro

String; read-write
The name of the macro associated with the menu or toolbar item.


MainDictionary property [ActiveX and VBA Reference: AAR]

MainDictionary Property

Specifies the current dictionary to use for spell checking.

See Also | Example

Signature

object.MainDictionary

object

PreferencesFiles
The object or objects this property applies to.

MainDictionary

String; read-write
The spell-checking dictionary to use.


MajorAxis property [ActiveX and VBA Reference: AAR]

MajorAxis Property

Specifies the direction of the major axis of the ellipse.

See Also | Example

Signature

object.MajorAxis

object

Ellipse
The object or objects this property applies to.

MajorAxis

Variant (three-element array of doubles); read-write
A 3D vector defining the major axis. The vector originates at the ellipse center.

Remarks

The longer axis of an ellipse is called the major axis; the shorter one is the minor axis.

Minor axis |
 | Major axis


MajorRadius property [ActiveX and VBA Reference: AAR]

MajorRadius Property

Specifies the length of the major axis of the ellipse.

See Also | Example

Signature

object.MajorRadius

object

Ellipse
The object or objects this property applies to.

MajorRadius

Double; read-write
The length of the major axis for an ellipse.

Remarks

The longer axis of an ellipse is called the major axis; the shorter one is the minor axis.

Minor axis |
 | Major axis


Mask property [ActiveX and VBA Reference: AAR]

Mask Property

Specifies the layer properties to be restored.

See Also | Example

Signature

object.Mask

object

LayerStateManager
A LayerStateManager object.

Mask

enum; input-only
A number representing the layer properties to be restored. Use the constants in the following table to identify layer properties:
Constant | Layer Property | Numeric Value
acLsAll | All layer properties | 65535
acLsColor | Color | 32
acLsFrozen | Frozen or thawed | 2
acLsLineType | Linetype | 64
acLsLineWeight | Lineweight | 128
acLsLocked | Locked or unlocked | 4
acLsNewViewport | New viewport layers frozen or thawed | 16
acLsNone | None | 0
acLsOn | On or off | 1
acLsPlot | Plotting on or off | 8
acLsPlotStyle | Plot style | 256

Remarks

The LayerStateManager Restore method uses the Mask property to identify which layer properties are to be restored. You first set the Mask property when saving layer settings with the LayerStateManager Save method. However, the Save method actually saves all properties of each drawing layer. You can update the Mask property any time prior to restoring layer settings, thereby changing which layer properties are restored.

To specify multiple layer properties in the Mask, add the constants representing those properties. For example, to save the Color and LineType properties, specify the following:

acLsColor + acLsLineType


Material property [ActiveX and VBA Reference: AAR]

Material property

Specifies the name of the material

See Also | Example

Signature

object.Material

object

All Drawing objects
The object or objects to which this property applies.

Material

String; input/output


Material property [ActiveX and VBA Reference: AAR]

Material Property

Returns the material of a table.

See Also | Example

Signature

object.Material

Object

Table
The object or objects this property applies to.

Material

String; read-write
String set for the table's material value.


Materials property [ActiveX and VBA Reference: AAR]

Materials property

Returns the materials collection for the database.

See Also | Example

Signature

object.Materials

object

Database, Document
The object or objects to which this property applies.

Materials

AcadMaterials; input-only


MaxActiveViewports property [ActiveX and VBA Reference: AAR]

MaxActiveViewports Property

Specifies the maximum number of active viewports.

See Also | Example

Signature

object.MaxActiveViewports

object

DatabasePreferences
The object or objects this property applies to.

MaxActiveViewports

Integer; read-write
The maximum number of active viewports.
2 <= MaxActiveViewports <= 48

System variables

The value of this property is stored in the MAXACTVP system variable.

Remarks

Inactive viewports are blank, so their contents are not regenerated. You can, therefore, improve performance by specifying a low value. The initial value is 48.


MaxAutoCADWindow property [ActiveX and VBA Reference: AAR]

MaxAutoCADWindow Property

Specifies whether the AutoCAD window should fill the entire screen area when you start.

See Also | Example

Signature

object.MaxAutoCADWindow

object

PreferencesDisplay
The object or objects this property applies to.

MaxAutoCADWindow

Boolean; read-write

TRUE: Maximizes AutoCAD.

FALSE: Does not maximize AutoCAD.


MaxLeaderSegmentsPoints property [ActiveX and VBA Reference: AAR]

MaxLeaderSegmentsPoints Property

Specifies the maxLeaderSegmentsPoints of the mleaderstyle.

See Also | Example

Signature

object.MaxLeaderSegmentsPoints

Object

MLeaderStyle
The object this property applies to.

MaxLeaderSegmentsPoints

Integer; read-write
The maximum number of leader segment points.


Mclose property [ActiveX and VBA Reference: AAR]

MClose Property

Specifies whether the PolygonMesh is closed in the M direction.

See Also | Example

Signature

object.MClose

object

PolygonMesh
The object or objects this property applies to.

MClose

Boolean; read-write

TRUE: The PolygonMesh is closed in the M direction.

FALSE: The PolygonMesh is open in the M direction.

Remarks

If the PolygonMesh is closed, it will be treated as continuous from the last row on to the first row. If the PolygonMesh is open, it will be treated as discontinuous between the last row and the first row.


Mdensity property [ActiveX and VBA Reference: AAR]

MDensity Property

Specifies the surface density of a PolygonMesh in the M direction.

See Also | Example

Signature

object.MDensity

object

PolygonMesh
The object or objects this property applies to.

MDensity

Integer; read-write
An integer value between 2 and 256.

Remarks

The M surface density is the number of vertices in the M direction for PolygonMesh objects that are of the following types: acQuadSurfaceMesh, acCubicSurfaceMesh, or acBezierSurfaceMesh.

The initial value for this property is derived from the value in the SURFU system variable + 1. Therefore, if the current value of SURFU is 6, the MDensity for a mesh after a surface fit operation would be 7. To perform a surface fit operation on a mesh, change the mesh type using the Type property.


Measurement property [ActiveX and VBA Reference: AAR]

Measurement Property

Gets the measurement for the dimension.

See Also | Example

Signature

object.Measurement

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

Measurement

Double; read-only
For linear dimensions this is a length, for angular dimensions it is an angle.

System variables

For non-angular dimensions, this property overrides the value for the DIMLUNIT system variable.

For angular dimension, this property overrides the value for the DIMAUNIT system variable.


MenuBar property [ActiveX and VBA Reference: AAR]

MenuBar Property

Gets the MenuBar object for the session.

See Also | Example

Signature

object.MenuBar

object

Application
The object or objects this property applies to.

MenuBar

MenuBar object; read-only
The MenuBar object for the session.


MenuFile property [ActiveX and VBA Reference: AAR]

MenuFile Property

Specifies the location of the AutoCAD customization file for the session.

See Also | Example

Signature

object.MenuFile

object

PreferencesFiles
The object or objects this property applies to.

MenuFile

String; read-write
The location of the AutoCAD customization file.

Remarks

This property contains the drive, path, and file name for a customization (CUI) file.


MenuFileName property [ActiveX and VBA Reference: AAR]

MenuFileName Property

Gets the customization file name where the menu group is located.

See Also | Example

Signature

object.MenuFileName

object

MenuGroup
The object or objects this property applies to.

MenuFileName

String; read-only
A user-specified variable declared as a string type.


MenuGroups property [ActiveX and VBA Reference: AAR]

MenuGroups Property

Gets the MenuGroups collection for the session.

See Also | Example

Signature

object.MenuGroups

object

Application
The object or objects this property applies to.

MenuGroups

MenuGroups collection; read-only
The MenuGroups collection for the session.


Menus property [ActiveX and VBA Reference: AAR]

Menus Property

Gets the PopupMenus collection.

See Also | Example

Signature

object.Menus

object

MenuGroup object
The object or objects this property applies to.

Menus

PopupMenus collection; read-only
A user-specified variable declared as a PopupMenus collection.


MinimumTableHeight property [ActiveX and VBA Reference: AAR]

MinimumTableHeight Property

Specifies the minimum height of the table.

See Also | Example

Signature

object.MinimumTableHeight

Object

Table
The object or objects this property applies to.

MinimumTableHeight

Double; read-only
The minimum height of the table.


MinimumTableWidth property [ActiveX and VBA Reference: AAR]

MinimumTableWidth Property

Specifies the minimum width of the table.

See Also | Example

Signature

object.MinimumTableWidth

Object

Table
The object or objects this property applies to.

MinimumTableWidth

Double; read-only
The minimum width of the table.


MinorAxis property [ActiveX and VBA Reference: AAR]

MinorAxis Property

Specifies the direction of the minor axis of an ellipse.

See Also | Example

Signature

object.MinorAxis

object

Ellipse
The object or objects this property applies to.

MinorAxis

Variant (three-element array of doubles); read-only
A 3D vector defining the minor axis. The vector originates at the ellipse center.

Remarks

The longer axis of an ellipse is called the major axis; the shorter one is the minor axis.

Minor axis |
 | Major axis


MinorRadius property [ActiveX and VBA Reference: AAR]

MinorRadius Property

Specifies the length of the minor axis of the ellipse.

See Also | Example

Signature

object.MinorRadius

object

Ellipse
The object or objects this property applies to.

MinorRadius

Double; read-write
The length of the minor axis for an ellipse.

Remarks

The longer axis of an ellipse is called the major axis; the shorter one is the minor axis.

Minor axis |
 | Major axis


MLineScale property [ActiveX and VBA Reference: AAR]

MLineScale property

Specifies the scale of the MLine

See Also | Example

Signature

object.MLineScale

object

MLine
The object or objects to which this property applies.

MLineScale

double; input/output


Mode property [ActiveX and VBA Reference: AAR]

Mode Property

Specifies the mode of the attribute definition.

See Also | Example

Signature

object.Mode

object

Attribute
The object or objects this property applies to.

Mode

acAttributeMode enum; read-write

acAttributeModeNormal

acAttributeModeInvisible

acAttributeModeConstant

acAttributeModeVerify

acAttributeModeLockPosition

acAttributeModeMultipleLine

acAttributeModePreset

System variables

The value of this property is stored in the AFLAGS system variable.

Remarks

The following modes are available:

acAttributeModeNormal

Specifies that the current visibility of each attribute is retained.

acAttributeModeInvisible

Specifies that attribute values won't be shown when you insert the block. The ATTDISP command overrides Invisible mode.

acAttributeModeConstant

Gives attributes a fixed value for block insertions.

acAttributeModeVerify

Prompts you to verify that the attribute value is correct when you insert the block.

acAttributeModeLockPosition

Locks the position of the attributes.

acAttributeModeMultipleLine

Allows the attributes to carry-over onto multiple lines.

acAttributeModePreset

Sets the attribute to its default value when you insert a block containing a preset attribute.


ModelCrosshairColor property [ActiveX and VBA Reference: AAR]

ModelCrosshairColor Property

Specifies the color of the crosshairs and text for model space.

See Also | Example

Signature

object.ModelCrosshairColor

object

PreferencesDisplay
The object or objects this property applies to.

ModelCrosshairColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The initial value of this property is vbWhite.

To specify the crosshair color for the paper space layouts, use the LayoutCrosshairColor property.


ModelSpace property [ActiveX and VBA Reference: AAR]

ModelSpace Property

Gets the ModelSpace collection for the document.

See Also | Example

Signature

object.ModelSpace

object

Document
The object or objects this property applies to.

ModelSpace

ModelSpace collection; read-only
The ModelSpace collection for the document.


ModelType property [ActiveX and VBA Reference: AAR]

ModelType Property

Specifies whether a plot configuration applies to model space or to all layouts.

See Also | Example

Signature

object.ModelType

object

Layout, PlotConfiguration
The object or objects this property applies to.

ModelType

Boolean; read-only

TRUE: The plot configuration applies only to the Model Space tab, or the layout is the model space layout.

FALSE: The plot configuration applies to all layouts, or the layout is a paper space layout.


ModelView property [ActiveX and VBA Reference: AAR]

ModelView Property

Returns and sets the model view associated with the viewport.

Signature

object.ModelView

object

PViewport
The object or objects this property applies to.

ModelView

View object; read-write

Remarks

Note To access this property, use the IAcadPViewport2 interface.


MomentOfInertia property [ActiveX and VBA Reference: AAR]

MomentOfInertia Property

Gets the moment of inertia for the solid.

See Also | Example

Signature

object.MomentOfInertia

object

3DSolid, Region
The object or objects this property applies to.

MomentOfInertia

Variant (three-element array of doubles); read-only
A 3D coordinate based on the current coordinate system.

Remarks

The moment of inertia is returned as X, Y, and Z coordinates defined as a variant.


Monochrome property [ActiveX and VBA Reference: AAR]

Monochrome property

Determines whether underlay is monochrome.

See Also | Example

Signature

object.Monochrome

object

DwfUnderlay
The object or objects to which this property applies.

Monochrome

Boolean; input/output


MRUNumber property [ActiveX and VBA Reference: AAR]

MRUNumber Property

Specifies the number of most recently used files that is shown in the File menu.

See Also | Example

Signature

object.MRUNumber

object

PreferencesOpenSave
The object or objects this property applies to.

MRUNumber

Long; read-only
The number of most recently used files that is shown in the File menu.

Remarks

The default value for this property is 4.


MSpace property [ActiveX and VBA Reference: AAR]

MSpace Property

Allows editing of the model from floating paper space viewports.

See Also | Example

Signature

object.MSpace

object

Document
The object or objects this property applies to.

MSpace

Boolean; read-write

TRUE: Allows editing of the model.

FALSE: Does not allow editing of the model.

Remarks

AutoCAD operates in either model space or paper space. Use model space for drafting and design work and to create 2D drawings or 3D models. Use paper space to create a finished layout of a drawing for printing or plotting.

NOTE Before using the MSpace property, the ActiveSpace property must be set to acPaperSpace, and the display control of the PViewport object must be switched on by the Display property.


MTextAttribute property [ActiveX and VBA Reference: AAR]

MTextAttribute property

Determines if the attribute is multi-line.

See Also | Example

Signature

object.MTextAttribute

Object

Attribute Object
The object this method applies to.

MTextAttribute

Boolean; read-write
The value of the attribute.


MTextAttribute property [ActiveX and VBA Reference: AAR]

MTextAttribute property

Determines if the attribute is multi-line.

See Also | Example

Signature

object.MTextAttribute

Object

Attribute Object, AttributeReference Object
The object this method applies to.

MTextAttribute

Boolean; read-write
The value of the attribute.


MTextAttributeContent property [ActiveX and VBA Reference: AAR]

MTextAttributeContent Method

Gets the multi-line attribute content.

See Also | Example

Signature

object.MTextAttributeContent

Object

Attribute Object
The object this method applies to.

MTextAttributeContent

String
The content of the attribute.


MTextAttributeContent property [ActiveX and VBA Reference: AAR]

MTextAttributeContent Method

Gets the multi-line attribute content.

See Also | Example

Signature

object.MTextAttributeContent

Object

Attribute Object, AttributeReference Object
The object this method applies to.

MTextAttributeContent

String
The content of the attribute.


MTextBoundaryWidth property [ActiveX and VBA Reference: AAR]

MTextBoundaryWidth property

Determines the width of text boundary for the MText.

See Also | Example

Signature

object.MTextBoundaryWidth

Object

Attribute Object, AttributeReference Object
The object this method applies to.

MTextBoundaryWidth

Double
The boundaryWidth.


MTextBoundaryWidth property [ActiveX and VBA Reference: AAR]

MTextBoundaryWidth property

Determines the width of text boundary for the MText.

See Also | Example

Signature

object.MTextBoundaryWidth

Object

Attribute Object
The object this method applies to.

MTextBoundaryWidth

Double
The boundaryWidth.


MTextDrawingDirection property [ActiveX and VBA Reference: AAR]

MTextDrawingDirection property

Determines the drawing direction for the MText.

See Also | Example

Signature

object.MTextDrawingDirection drawDir

Object

Attribute Object, AttributeReference Object
The object this method applies to.

MTextDrawingDirection

AcDrawingDirection; read-write
The drawing direction.


MTextDrawingDirection property [ActiveX and VBA Reference: AAR]

MTextDrawingDirection property

Determines the drawing direction for the MText.

See Also | Example

Signature

object.MTextDrawingDirection drawDir

Object

Attribute Object
The object this method applies to.

MTextDrawingDirection

AcDrawingDirection; read-write
The drawing direction.


MVertexCount property [ActiveX and VBA Reference: AAR]

MVertexCount Property

Gets the vertex count in the M direction for a PolygonMesh.

See Also | Example

Signature

object.MVertexCount

object

PolygonMesh
The object or objects this property applies to.

MVertexCount

Integer; read-only
A positive integer value between 2 and 256.

Remarks

This is the number of vertices that will be used to make up an M row in the PolygonMesh if the Type property is acSimpleMesh. For any other PolygonMesh type, the MDensity value will be used as the row size.

The number of vertices can't be changed for a simple mesh.


Name property [ActiveX and VBA Reference: AAR]

Name Property

Specifies the name of the object.

See Also | Example

Signature

object.Name

object

Application, Block, BlockRef, Dictionary, DimStyle, Document, ExternalReference, Group, Layer, Layout, Linetype, Material, MenuGroup, MInsertBlock, MLeaderStyle, ModelSpace, PaperSpace, PlotConfiguration, PopupMenu, Raster, RegisteredApplication, SelectionSet, Section, Shape, TextStyle, Toolbar, ToolbarItem, UCS, View, Viewport, XRecord
The object or objects this property applies to.

Name

String;
Read-write for the following objects: Block, BlockRef, Dictionary, DimStyle, Group, Layer, Layout, Linetype, Material, MLeaderStyle, PlotConfiguration, PopupMenu, Raster, RegisteredApplication, Section, Shape, Toolbar, ToolbarItem, UCS, View, Viewport, XRecord.

Read-only for the following objects: Application, Document, MenuGroup, ModelSpace, PaperSpace, SelectionSet, TextStyle.

Remarks

Application, Document: This property returns the file name only, not the path.

ToolbarItem: This name is used as the tooltip text.

MenuGroup: The name is limited to 32 characters and cannot contain spaces or punctuation marks.

Raster: This property is similar to the ImageFile property, except that this property does not contain path information.

XRecord: The name of the object within the dictionary in which it resides. This name does not represent the class name of the object.

BlockRef: A block reference can be assigned the name of only a valid block definition in the drawing. Assigning a block reference a unique name will not automatically create a new block definition. To create a new block definition, use the Add method to add a new Block object to the Blocks collection.


NameNoMnemonic property [ActiveX and VBA Reference: AAR]

NameNoMnemonic Property

Specifies the name of the popup menu without the underscore mnemonic.

See Also | Example

Signature

object.NameNoMnemonic

object

PopupMenu
The object or objects this property applies to.

NameNoMnemonic

String; read-only
The popup menu name without the underscore mnemonic.


Nclose property [ActiveX and VBA Reference: AAR]

NClose Property

Specifies whether the PolygonMesh is closed in the N direction.

See Also | Example

Signature

object.NClose

object

PolygonMesh
The object or objects this property applies to.

NClose

Boolean; read-write

TRUE: The PolygonMesh is closed in the N direction.

FALSE: The PolygonMesh is open in the N direction.

Remarks

If the PolygonMesh is closed, it will be treated as continuous from the last column on to the first column. If the PolygonMesh is open, it will be treated as discontinuous between the last column and the first column.


NDensity property [ActiveX and VBA Reference: AAR]

NDensity Property

Specifies the smooth surface density of a PolygonMesh in the N direction.

See Also | Example

Signature

object.NDensity

object

PolygonMesh
The object or objects this property applies to.

NDensity

Integer; read-write
The default is 6.

Remarks

The N surface density is the number of vertices in the N direction for PolygonMesh objects that are of the following types: acQuadSurfaceMesh, acCubicSurfaceMesh, or acBezierSurfaceMesh.

The initial value for this property is derived from the value in the SURFV system variable + 1. Therefore, if the current value of SURFV is 6, the NDensity for a mesh after a surface fit operation would be 7. To perform a surface fit operation on a mesh, change the mesh type using the Type property.


Normal property [ActiveX and VBA Reference: AAR]

Normal Property

Specifies the three-dimensional normal unit vector for the object.

See Also | Example

Signature

object.Normal

object

Arc, Attribute, AttributeReference, BlockRef, Circle, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Ellipse, ExternalReference, Hatch, Leader, LightweightPolyline, Line, MInsertBlock, MText, Point, Polyline, Region, Section, Shape, Solid, Text, Tolerance, Trace
The object or objects this property applies to.

Normal

Variant (three-element array of doubles); read-write
A 3D normal unit vector in WCS.

Remarks

This normal vector defines the Z axis for the given object. Although the normal is returned in WCS, it can be used to determine the OCS for the object. Use this property as the OCSNormal in the TranslateCoordinates method when converting coordinates to and from OCS.

Note that this property specifies a vector, not a point. The vector defines the direction of the normal, not a location in space. You can add this normal vector to a point to obtain another point.

Tolerance: The normal vector must be perpendicular to the direction of the Tolerance object. A normal that is not perpendicular to the Tolerance object will generate an error.


NumberOfControlPoints property [ActiveX and VBA Reference: AAR]

NumberOfControlPoints Property

Gets the number of control points of the spline.

See Also | Example

Signature

object.NumberOfControlPoints

object

Spline
The object or objects this property applies to.

NumberOfControlPoints

Integer; read-only

Remarks

Control points fine-tune a spline definition by adding weight to a portion of the spline curve.

You can query the current position of a control point by using the GetControlPoint method. You can set a new coordinate location for a control point by using the SetControlPoint method. You can set a new weight for a control point by using the SetWeight method.


NumberOfCopies property [ActiveX and VBA Reference: AAR]

NumberOfCopies Property

Specifies the number of copies to plot.

See Also | Example

Signature

object.NumberOfCopies

object

Plot
The object or objects this property applies to.

NumberOfCopies

Long; read-write
The number of copies to plot.


NumberOfFaces property [ActiveX and VBA Reference: AAR]

NumberOfFaces Property

Gets the number of faces for the PolyfaceMesh.

See Also | Example

Signature

object.NumberOfFaces

object

PolyFaceMesh
The object or objects this property applies to.

NumberOfFaces

Long; read-only


NumberOfFitPoints property [ActiveX and VBA Reference: AAR]

NumberOfFitPoints Property

Gets the number of fit points of the spline.

See Also | Example

Signature

object.NumberOfFitPoints

object

Spline
The object or objects this property applies to.

NumberOfFitPoints

Integer; read-only

Remarks

The fit points define the path of the spline. You can change the tolerance of a given fit point by using the FitTolerance property. You can add a fit point by using the AddFitPoint method. You can delete a fit point by using the DeleteFitPoint method. You can query the location of a fit point by using the GetFitPoint method. You can change the location of a given fit point by using the SetFitPoint method.


NumberOfLoops property [ActiveX and VBA Reference: AAR]

NumberOfLoops Property

Gets the number of loops in the hatch boundary.

See Also | Example

Signature

object.NumberOfLoops

object

Hatch
The object or objects this property applies to.

NumberOfLoops

Integer, read-only
The number of loops in the hatch boundary.


NumberOfVertices property [ActiveX and VBA Reference: AAR]

NumberOfVertices Property

Gets the number of vertices for the PolyfaceMesh.

See Also | Example

Signature

object.NumberOfVertices

object

PolyFaceMesh
The object or objects this property applies to.

NumberOfVertices

Long; read-only


NumCellStyles property [ActiveX and VBA Reference: AAR]

NumCellStyles Property

The number of cell styles a table has.

See Also | Example

Signature

RetVal = object.NumCellStyles

Object

TableStyle
The object this property applies to.

RetVal

Long; read-only
Location for the value.


NumCrossSections property [ActiveX and VBA Reference: AAR]

NumCrossSections property

Displays the number of cross-section curves used.

See Also | Example

Signature

object.NumCrossSections

object

LoftedSurface
The object or objects to which this property applies.

NumCrossSections

Long; input-only


NumGuidePaths property [ActiveX and VBA Reference: AAR]

NumGuidePaths property

Displays the number of guide paths used.

See Also | Example

Signature

object.NumGuidePaths

object

LoftedSurface
The object or objects to which this property applies.

NumGuidePaths

Long; input-only


NumVertices property [ActiveX and VBA Reference: AAR]

NumVertices property

Gets the number of vertices in the section line.

See Also | Example

Signature

object.NumVertices

object

Section
The object or objects to which this property applies.

NumVertices

Integer; input/output


NVertexCount property [ActiveX and VBA Reference: AAR]

NVertexCount Property

Gets the vertex count in the N direction for a PolygonMesh.

See Also | Example

Signature

object.NVertexCount

object

PolygonMesh
The object or objects this property applies to.

NVertexCount

Integer; read-only
A positive integer between 2 and 256.

Remarks

This is the number of vertices that will be used to make up an N column in the PolygonMesh if the Type property is acSimpleMesh. For any other PolygonMesh type, the NDensity value will be used as the column size.

The number of vertices can't be changed for a simple mesh.


ObjectID property [ActiveX and VBA Reference: AAR]

ObjectID Property

Gets the object ID.

See Also | Example

Signature

object.ObjectID

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

ObjectID

Long_PTR; read-only
The object ID of an object.

Remarks

An object ID and a unique handle are both ways of referencing an object.

In general, use a handle unless you plan to work with certain ObjectARX functions that require an object ID.


ObjectID32 property [ActiveX and VBA Reference: AAR]

ObjectID32 Property

Gets the object ID for a 64-bit system.

See Also | Example

Signature

object.ObjectID32

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

ObjectID32

Long; read-only
The object ID of an object.

Remarks

An object ID and a unique handle are both ways of referencing an object.

In general, use a handle unless you plan to work with certain ObjectARX functions that require an object ID.


ObjectName property [ActiveX and VBA Reference: AAR]

ObjectName Property

Gets the AutoCAD class name of the object.

See Also | Example

Signature

object.ObjectName

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

ObjectName

String; read-only
The AutoCAD class name of an object.


ObjectSnapMode property [ActiveX and VBA Reference: AAR]

ObjectSnapMode Property

Specifies the setting of the object snap mode.

See Also | Example

Signature

object.ObjectSnapMode

object

Document
The object or objects this property applies to.

ObjectSnapMode

Boolean; read-write

TRUE: Snap mode is on.

FALSE: Snap mode is off.


ObjectSortByPlotting property [ActiveX and VBA Reference: AAR]

ObjectSortByPlotting Property

Toggles sorting of drawing objects by plotting order.

See Also | Example

Signature

object.ObjectSortByPlotting

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortByPlotting

Boolean; read-write

TRUE: Enable sort by plotting order.

FALSE: Disable sort by plotting order.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is TRUE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObjectSortByPSOutput property [ActiveX and VBA Reference: AAR]

ObjectSortByPSOutput Property

Toggles sorting of drawing objects by PostScript output order.

See Also | Example

Signature

object.ObjectSortByPSOutput

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortByPSOutput

Boolean; read-write

TRUE: Enable sort by PostScript output order.

FALSE: Disable sort by PostScript output order.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is TRUE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObjectSortByRedraws property [ActiveX and VBA Reference: AAR]

ObjectSortByRedraws Property

Toggles sorting of drawing objects by redraw order.

See Also | Example

Signature

object.ObjectSortByRedraws

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortByRedraws

Boolean; read-write

TRUE: Enable sort by redraw order.

FALSE: Disable sort by redraw order.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is FALSE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObjectSortByRegens property [ActiveX and VBA Reference: AAR]

ObjectSortByRegens Property

Toggles sorting of drawing objects by regeneration order.

See Also | Example

Signature

object.ObjectSortByRegens

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortByRegens

Boolean; read-write

TRUE: Enable sort by regeneration order.

FALSE: Disable sort by regeneration order.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is FALSE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObjectSortBySelection property [ActiveX and VBA Reference: AAR]

ObjectSortBySelection Property

Toggles sorting of drawing objects by object selection.

See Also | Example

Signature

object.ObjectSortBySelection

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortBySelection

Boolean; read-write

TRUE: Enable sort by object selection.

FALSE: Disable sort by object selection.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is FALSE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObjectSortBySnap property [ActiveX and VBA Reference: AAR]

ObjectSortBySnap Property

Toggles sorting of drawing objects by object snap.

See Also | Example

Signature

object.ObjectSortBySnap

object

DatabasePreferences
The object or objects this property applies to.

ObjectSortBySnap

Boolean; read-write

TRUE: Enable sort by object snap.

FALSE: Disable sort by object snap.

System variables

The value of this property is stored in the SORTENTS system variable.

Remarks

The initial value of this property is FALSE.

AutoCAD initially enables sorting for plotting and PostScript output only. Setting additional sorting options can result in slower regeneration and redrawing times.


ObliqueAngle property [ActiveX and VBA Reference: AAR]

ObliqueAngle Property

Specifies the oblique angle of the object.

See Also | Example

Signature

object.ObliqueAngle

object

Attribute, AttributeReference, Shape, Text, TextStyle
The object or objects this property applies to.

ObliqueAngle

Double; read-write
The angle in radians within the range of -85 to +85 degrees. A positive angle denotes a lean to the right; a negative value will have 2*PI added to it to convert it to its positive equivalent.

Remarks

The oblique angle is the object's "angle of slant" away from its vertical axis.


OleItemType property [ActiveX and VBA Reference: AAR]

OleItemType Property

Specifies whether the OLE object is linked to the original pasted file when opening the object for editing.

Signature

object.OleItemType

object

OLE
The object or objects this property applies to.

OleItemType

AcOleType enum; read-write

acOTEmbedded

acOTLink

acOTStatic


OLELaunch property [ActiveX and VBA Reference: AAR]

OLELaunch Property

Determines whether to launch the parent application when plotting OLE objects.

See Also | Example

Signature

object.OLELaunch

object

DatabasePreferences
The object or objects this property applies to.

OLELaunch

Boolean; read-write

TRUE: The parent application of an OLE object is launched to print it.

FALSE: The OLE object is printed from AutoCAD.

System variables

The value of this property is stored in the OLESTARTUP system variable.

Remarks

The initial value of this property is FALSE.

Plotting from the parent application achieves a higher quality plot; however, the speed of the plot is decreased.


OlePlotQuality property [ActiveX and VBA Reference: AAR]

OlePlotQuality Property

Controls the plot quality of an OLE object based on the file type selected from the list.

Signature

object.OlePlotQuality

object

OLE
The object or objects this property applies to.

OlePlotQuality

AcOlePlotQuality enum; read-write

acOPQHighGraphics

acOPQLowGraphics

acOPQMonochrome


OLEQuality property [ActiveX and VBA Reference: AAR]

OLEQuality Property

Specifies the plot quality of OLE objects.

See Also | Example

Signature

object.OLEQuality

object

PreferencesOutput
The object or objects this property applies to.

OLEQuality

acOleQuality enum; read-write

acOQLineArt

acOQText

acOQGraphics

acOQPhoto

acOQHighPhoto

System variables

The value for this property is stored in the OLEQUALITY system variable.

Remarks

The initial value for this property is acOQText.


OleSourceApp property [ActiveX and VBA Reference: AAR]

OleSourceApp Property

Specifies the application for editing the OLE object.

Signature

object.OleSourceApp

object

OLE
The object or objects this property applies to.

OleSourceApp

String; read-write


OnMenuBar property [ActiveX and VBA Reference: AAR]

OnMenuBar Property

Determines if the specified popup menu is on the menu bar.

See Also | Example

Signature

object.OnMenuBar

object

PopupMenu
The object or objects this property applies to.

OnMenuBar

Boolean; read-only

TRUE: This menu is on the menu bar.

FALSE: This menu is not on the menu bar.


OpenSave property [ActiveX and VBA Reference: AAR]

OpenSave Property

Gets the PreferencesOpenSave object.

See Also | Example

Signature

object.OpenSave

object

Preferences
The object or objects this property applies to.

OpenSave

PreferencesOpenSave; read-Only
Gets the PreferencesOpenSave object.

Remarks

The PreferencesOpenSave object holds all the options from the Open and Save tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


Origin property [ActiveX and VBA Reference: AAR]

Origin Property

Specifies the origin of the UCS, block, layout, hatch, or raster image in WCS coordinates.

See Also | Example

Signature

object.Origin

object

Block, Hatch, Layout, PlotConfiguration, Raster, UCS
The object or objects this property applies to.

Origin

Variant (three-element array of doubles); read-write
A 3D WCS coordinate specifying the origin of the object.

For the Layout and PlotConfiguration objects:
Variant (two-element array of doubles); read-write
The X and Y values representing the origin relative to the lower-left corner of the media.

Remarks

Layout, PlotConfiguration: The origin is offset from the media edge by the paper margin. Use the GetPaperMargins method to query the margins. The origin is given in paper units. The units can be queried or set with the PaperUnits property.

Hatch: This property is the origin coordinates for the pattern of the hatch entity.


OrthoOn property [ActiveX and VBA Reference: AAR]

OrthoOn Property

Specifies the status of the Isometric snap mode for the viewport.

See Also | Example

Signature

object.OrthoOn

object

Viewport
The object or objects this property applies to.

OrthoOn

Boolean; read-write

TRUE: Isometric snap mode is on.

FALSE: Isometric snap mode is off.


Output property [ActiveX and VBA Reference: AAR]

Output Property

Gets the PreferencesOutput object.

See Also | Example

Signature

object.Output

object

Preferences
The object or objects this property applies to.

Output

PreferencesOutput; read-only
Gets the PreferencesOutput object.

Remarks

The PreferencesOutput object holds all the options from the Output tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


OverrideCenter property [ActiveX and VBA Reference: AAR]

OverrideCenter Property

Specifies the override center location or pick point.

Signature

object.OverrideCenter

object

DimRadialLarge
The object or objects this property applies to.

OverrideCenter

Variant; read-write


OwnerID property [ActiveX and VBA Reference: AAR]

OwnerID Property

Gets the object ID of the owner (parent) object.

See Also | Example

Signature

object.OwnerID

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

OwnerID

Long_PTR; read-only
The object ID of an object's owner.


OwnerID property [ActiveX and VBA Reference: AAR]

OwnerID Property

Gets the object ID of the owner (parent) object

See Also | Example

Signature

object.OwnerID

Object

TableStyle
The object this property applies to.

OwnerID

Long_PTR; read-only
Location for the value.


OwnerID32 property [ActiveX and VBA Reference: AAR]

OwnerID32 Property

Gets the object ID of the owner (parent) object for 64-bit systems.

See Also | Example

Signature

object.OwnerID32

object

All Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace Collection, PaperSpace Collection, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecord
The object or objects this property applies to.

OwnerID32

Long; read-only
The object ID of an object's owner.


PageSetupOverridesTemplateFile property [ActiveX and VBA Reference: AAR]

PageSetupOverridesTemplateFile Property

Specifies the default template for Page Setup overrides.

See Also | Example

Signature

object.PageSetupOverridesTemplateFile

Object

PreferencesFiles
The object or objects this property applies to.

PageSetupOverridesTemplateFile

String; read-write


PaperSpace property [ActiveX and VBA Reference: AAR]

PaperSpace Property

Gets the PaperSpace collection for the document.

See Also | Example

Signature

object.PaperSpace

object

Document
The object or objects this property applies to.

PaperSpace

PaperSpace collection; read-only
The PaperSpace collection for the document.


PaperUnits property [ActiveX and VBA Reference: AAR]

PaperUnits Property

Specifies the units for the display of layout or plot configuration properties.

See Also | Example

Signature

object.PaperUnits

object

Layout, PlotConfiguration
The object or objects this property applies to.

PaperUnits

acPlotPaperUnits enum; read-write

acInches

acMillimeters

acPixels

Remarks

This property determines the units for the display of the layout or plot configuration in the user interface. This property does not determine the units for input or query of the ActiveX Automation properties. All ActiveX Automation properties are represented in millimeters or radians, regardless of the units settings.

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


Parent property [ActiveX and VBA Reference: AAR]

Parent Property

Gets the parent of the object.

See Also | Example

Signature

object.Parent

object

MenuBar, MenuGroup,, MenuGroups, PopupMenu, PopupMenus, PopupMenuItem, Toolbar, Toolbars, ToolbarItem
The object or objects this property applies to.

Parent

The parent of the object; read-only
This user-specified variable must be declared as an appropriate object type. The valid object types are: Application, MenuBar, MenuGroup, MenuGroups, PopupMenu, PopupMenus, Toolbar, Toolbars


Password property [ActiveX and VBA Reference: AAR]

Password Property

Specifies the encryption password.

See Also | Example

Signature

object.Password

object

SecurityParams
The object or objects this property applies to.

Password

String; read-write
The encryption password.


Path property [ActiveX and VBA Reference: AAR]

Path Property

Gets the path of the block, document, application, or external reference.

See Also | Example

Signature

object.Path

object

Application, Block, Document, ExternalReference
The object or objects this property applies to.

Path

String; read-only (read-write for the ExternalReference and Block objects)
The path of the application, document, or external reference.


PatternAngle property [ActiveX and VBA Reference: AAR]

PatternAngle Property

Specifies the angle of the hatch pattern.

See Also | Example

Signature

object.PatternAngle

object

Hatch

PatternAngle

Double; read-write
The angle in radians. The valid range is 0 to 6.28.

System variables

The value of this property is stored in the HPANG system variable.


PatternDouble property [ActiveX and VBA Reference: AAR]

PatternDouble Property

Specifies if the user-defined hatch is double-hatched.

See Also | Example

Signature

object.PatternDouble

object

Hatch
The object or objects this property applies to.

PatternDouble

Boolean; read-write

TRUE: Double pattern is on.

FALSE: Double pattern is off.

System variables

The value of this property is stored in the HPDOUBLE system variable.

Remarks

If the PatternType property is set to acHatchPatternTypePreDefined or acHatchPatternTypeCustomDefined, then the PatternDouble property is not used.


PatternName property [ActiveX and VBA Reference: AAR]

PatternName Property

Specifies the hatch pattern name.

See Also | Example

Signature

object.PatternName

object

Hatch
The object or objects this property applies to.

PatternName

String; read-write
The hatch pattern name.

System variables

The value of this property is stored in the HPNAME system variable.

Remarks

The default hatch pattern name can be up to 34 characters, no spaces allowed. Returns "" if there is no default. Enter a period (.) to set no default.

If the PatternType property is set to acHatchPatternTypePreDefined, then the PatternName property refers to the name of a hatch pattern in acad.pat.

If the PatternType property is set to acHatchPatternTypeCustomDefined, then the PatternName property refers to the name of a hatch pattern in a custom .pat file.

If the PatternType property is set to acHatchPatternTypeUserDefined, then the PatternName property is not used.


PatternScale property [ActiveX and VBA Reference: AAR]

PatternScale Property

Specifies the hatch pattern scale.

See Also | Example

Signature

object.PatternScale

object

Hatch
The object or objects this property applies to.

PatternScale

Double; read-write
Must be non-zero.

System variables

The value of this property is stored in the HPSCALE system variable.

Remarks

If the PatternType property is set to acHatchPatternTypeUserDefined, then PatternScale is not used.


PatternSpace property [ActiveX and VBA Reference: AAR]

PatternSpace Property

Specifies the user-defined hatch pattern spacing.

See Also | Example

Signature

object.PatternSpace

object

Hatch
The object or objects this property applies to.

PatternSpace

Double; read-write
The hatch pattern spacing.

System variables

This value is also controlled by the HPSPACE system variable.

Remarks

If the PatternType property is set to acHatchPatternTypePreDefined or acHatchPatternTypeCustomDefined, then the PatternSpace property is not used.


PatternType property [ActiveX and VBA Reference: AAR]

PatternType Property

Gets the pattern type used for the hatch.

See Also | Example

Signature

object.PatternType

object

Hatch
The object or objects this property applies to.

PatternType

acPatternType enum; read-only

acHatchPatternTypePreDefined

acHatchPatternTypeUserDefined

acHatchPatternTypeCustomDefined

Remarks

The hatch pattern type is defined by one of the following settings:

PreDefined: Selects the pattern name from those defined in the acad.pat file.

UserDefined: Defines a pattern of lines using the current linetype.

CustomDefined: Selects the pattern name from a PAT file other than the acad.pat file.

The pattern type for a hatch can only be set by the AddHatch method for hatch creation, or by the SetPattern method.


Perimeter property [ActiveX and VBA Reference: AAR]

Perimeter Property

Gets the total length of the inner and outer region loops.

See Also | Example

Signature

object.Perimeter

object

Region
The object or objects this property applies to.

Perimeter

Double; read-only
The perimeter is returned in drawing units.


PickAdd property [ActiveX and VBA Reference: AAR]

PickAdd Property

Determines if objects are added to the selection set using the SHIFT key.

See Also | Example

Signature

object.PickAdd

object

PreferencesSelection
The object or objects this property applies to.

PickAdd

Boolean; read-write

TRUE: Adds objects to the current selection set by holding down SHIFT while selecting.

FALSE: Removes objects from the selection set by holding down SHIFT while selecting.

System variables

The value for this property is stored in the PICKADD system variable.

Remarks

The initial value of this property is FALSE.


PickAuto property [ActiveX and VBA Reference: AAR]

PickAuto Property

Controls automatic windowing at the Select Objects prompt.

See Also | Example

Signature

object.PickAuto

object

PreferencesSelection
The object or objects this property applies to.

PickAuto

Boolean; read-write

TRUE: Draws a selection window (for either window or crossing selection) automatically at the Select Objects prompt.

FALSE: Disables PickAuto.

System variables

The value for this property is stored in the PICKAUTO system variable.

Remarks

The initial value of this property is TRUE.


PickBoxSize property [ActiveX and VBA Reference: AAR]

PickBoxSize Property

Specifies the size of the object selection target.

See Also | Example

Signature

object.PickBoxSize

object

PreferencesSelection
The object or objects this property applies to.

PickBoxSize

Long; read-write
The height of the object selection target in pixels. You can enter a value from 0 to 50.

System variables

The value for this property is stored in the PICKBOX system variable.

Remarks

The initial value of this property is 3.


PickDrag property [ActiveX and VBA Reference: AAR]

PickDrag Property

Controls the method of drawing a selection window.

See Also | Example

Signature

object.PickDrag

object

PreferencesSelection
The object or objects this property applies to.

PickDrag

Boolean; read-write

TRUE: Draws the selection window by dragging. Click at one corner, hold down the pick button on the pointing device, drag and release the button at the other corner.

FALSE: Draws the selection window using two points. Click the pointing device at one corner and then at the other corner.

System variables

The value for this property is stored in the PICKDRAG system variable.

Remarks

The initial value of this property is FALSE.


PickFirst property [ActiveX and VBA Reference: AAR]

PickFirst Property

Determines if you select objects before (noun-verb selection) or after you issue a command.

See Also | Example

Signature

object.PickFirst

object

PreferencesSelection
The object or objects this property applies to.

PickFirst

Boolean; read-write

TRUE: Turns on PICKFIRST.

FALSE: Turns off PICKFIRST.

System variables

The value for this property is stored in the PICKFIRST system variable.

Remarks

The initial value of this property is TRUE.


PickfirstSelectionSet property [ActiveX and VBA Reference: AAR]

PickfirstSelectionSet Property

Gets the pickfirst selection set.

See Also | Example

Signature

object.PickfirstSelectionSet

object

Document object
The object or objects this property applies to.

PickfirstSelectionSet

SelectionSet object; read only
The pickfirst selection set.


PickGroup property [ActiveX and VBA Reference: AAR]

PickGroup Property

Determines if picking a single object in a group selects the entire group.

See Also | Example

Signature

object.PickGroup

object

PreferencesSelection
The object or objects this property applies to.

PickGroup

Boolean; read-write

TRUE: Picking one object in a group results in the entire group being selected.

FALSE: Picking one object in a group results in only that object being selected.

Remarks

The initial value of this property is FALSE.


Plot property [ActiveX and VBA Reference: AAR]

Plot Property

Gets the Plot object for the document.

See Also | Example

Signature

object.Plot

object

Document
The object or objects this property applies to.

Plot

Plot object; read-only


PlotConfigurations property [ActiveX and VBA Reference: AAR]

PlotConfigurations Property

Gets the PlotConfigurations collection for the document.

See Also | Example

Signature

object.PlotConfigurations

object

Document
The object or objects this property applies to.

PlotConfigurations

PlotConfigurations collection; read-only
The PlotConfigurations collection for the document.


PlotHidden property [ActiveX and VBA Reference: AAR]

PlotHidden Property

Specifies if objects are to be hidden during a plot.

See Also | Example

Signature

object.PlotHidden

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotHidden

Boolean; read-write

TRUE: Hide objects during the plot.

FALSE: Do not hide objects during the plot.

Remarks

This property specifies if the objects in paper space are processed through the hidden line algorithm. Note that this property does not affect objects inside floating model space viewports.


PlotLegacy property [ActiveX and VBA Reference: AAR]

PlotLegacy Property

Toggles whether legacy plot scripts are allowed to run.

See Also | Example

Signature

object.PlotLegacy

object

PreferencesOutput
The object or objects this property applies to.

PlotLegacy

Boolean; read-write

TRUE: Allow legacy plot scripts to run.

FALSE: Do not allow legacy plot scripts to run.

Remarks

The initial value for this property is FALSE.


PlotLogFilePath property [ActiveX and VBA Reference: AAR]

PlotLogFilePath Property

Specifies the path of the Plot log file.

See Also | Example

Signature

object.PlotLogFilePath

Object

PreferencesFiles
The object or objects this property applies to.

PlotLogFilePath

String; read-write

Remarks

This property is equivalent to the AutoCAD Options dialog box setting "Plot and Publish Log File Location."


PlotOrigin property [ActiveX and VBA Reference: AAR]

PlotOrigin Property

Specifies the origin of the UCS, block, layout, or raster image in WCS coordinates.

See Also | Example

Signature

object.PlotOrigin

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotOrigin

Variant (two-element array of doubles); read-write
The X and Y values representing the origin relative to the lower-left corner of the media.

Remarks

The origin is offset from the media edge by the paper margin. Use the GetPaperMargins method to query the margins. The origin is given in millimeters.

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


PlotPolicy property [ActiveX and VBA Reference: AAR]

PlotPolicy Property

Determines whether an object's color property is associated with its plot style name when a new drawing is created.

See Also | Example

Signature

object.PlotPolicy

object

PreferencesOutput
The object or objects this property applies to.

PlotPolicy

acPlotPolicy enum; read-write

acPolicyLegacy | An object's plot style name is associated with its color per the naming convention ACIx, where x is the color number of the object according to the AutoCAD Color Index.
acPolicyNamed | No association is made between color and plot style name. Plot style name for each object is set to the default defined in the DefaultPlotStyleForObjects property.

System variables

The value for this property is stored in the PSTYLEPOLICY system variable.

Remarks

The initial value for this property is acPolicyNamed.

If you want to change the default plot style behavior for a drawing, enter either acPolicyLegacy or acPolicyNamed before opening or creating the drawing. Changing the default plot style behavior using this property only affects new drawings or drawings created in a previous release of AutoCAD that have never been saved in AutoCAD 2000 or later format. This setting is saved with the drawing. You can change the default behavior for a drawing from acPolicyLegacy to acPolicyNamed once it is saved by using a migration utility. However, once a drawing is saved with acPolicyNamed as the default behavior, you cannot change it to acPolicyLegacy.

acPolicyLegacy

Specifies color-dependent plot styles in both new drawings and drawings created in earlier versions of AutoCAD. Color-dependent plot styles use the numbers from the AutoCAD color index to create a plot style table with a CTB file extension. Each color is defined by a name or number ranging from 1 to 255. You can assign each color number to a different pen on a pen plotter to achieve different property settings in the plotted drawing. If this option is entered, a plot style is created for each color setting.

acPolicyNamed

Specifies named plot styles in both new drawings and drawings created in earlier versions of AutoCAD. AutoCAD plots the drawing according to the property settings you specify in the plot style definition. The plot style is defined in the plot style table attached to the layout or viewport. Named plot style tables are files with the file extension STB.


PlotRotation property [ActiveX and VBA Reference: AAR]

PlotRotation Property

Specifies the rotation angle for the layout or plot configuration.

See Also | Example

Signature

object.PlotRotation

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotRotation

acPlotRotation enum; read-write

ac0degrees

ac90degrees

ac180degrees

ac270degrees

Remarks

The rotation angle is relative to the X axis of the object's WCS with positive angles going counterclockwise when looking down from the Z axis toward the origin.

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


PlotStyleName property [ActiveX and VBA Reference: AAR]

PlotStyleName Property

Specifies the plot style name for an object, group of objects, or layer.

See Also | Example

Signature

object.PlotStyleName

object

All Drawing objects, Group, Layer
The object or objects this property applies to.

PlotStyleName

String; read-write (write-only for the Group object)
The plot style name for the object.


Plottable property [ActiveX and VBA Reference: AAR]

Plottable Property

Specifies if the layer is plottable.

See Also | Example

Signature

object.Plottable

object

Layer
The object or objects this property applies to.

Plottable

Boolean; read-write

TRUE: The layer is plottable.

FALSE: The layer is not plottable.


PlotType property [ActiveX and VBA Reference: AAR]

PlotType Property

Specifies the type of layout or plot configuration.

See Also | Example

Signature

object.PlotType

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotType

acPlotType enum; read-write

acDisplay | Prints everything that is in the current display.
acExtents | Prints everything that falls within the extents of the currently selected space.
acLimits | Prints everything that is in the limits of the current space.
acView | Prints the view named by the ViewToPlot property.
acWindow | Prints everything in the window specified by the SetWindowToPlot method.
acLayout | Prints everything that falls within the margins of the specified paper size with the origin being calculated from 0,0 coordinate location in the Layout tab. This option is not available when printing from model space.

Remarks

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.

The ViewToPlot property or SetWindowToPlot method must be called before you can set the PlotType to acView or acWindow.


PlotViewportBorders property [ActiveX and VBA Reference: AAR]

PlotViewportBorders Property

Specifies if the viewport borders are to be plotted.

See Also | Example

Signature

object.PlotViewportBorders

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotViewportBorders

Boolean; read-write

TRUE: Plot the viewport borders.

FALSE: Do not plot the viewport borders.


PlotViewportsFirst property [ActiveX and VBA Reference: AAR]

PlotViewportsFirst Property

Specifies if all geometry in paper space viewports is plotted first.

See Also | Example

Signature

object.PlotViewportsFirst

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotViewportsFirst

Boolean; read-write

TRUE: Geometry in paper space viewports is plotted first, and the geometry in paper space is plotted last.

FALSE: Paper space geometry is plotted first, and the geometry in paper space viewports is plotted last.


PlotWithLineweights property [ActiveX and VBA Reference: AAR]

PlotWithLineweights Property

Specifies whether objects plot with the lineweights they're assigned in the plot file, or with the lineweights in the drawing file.

See Also | Example

Signature

object.PlotWithLineweights

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotWithLineweights

Boolean; read-write

TRUE: Plot using the lineweights in the plot style.

FALSE: Plot using the lineweights in the drawing file.


PlotWithPlotStyles property [ActiveX and VBA Reference: AAR]

PlotWithPlotStyles Property

Specifies whether or not to plot using the plot styles that are applied to objects and defined in the plot style table.

See Also | Example

Signature

object.PlotWithPlotStyles

object

Layout, PlotConfiguration
The object or objects this property applies to.

PlotWithPlotStyles

Boolean; read-write

TRUE: Use the plot styles applied to objects when plotting.

FALSE: Do not use plot styles applied to objects when plotting.

Remarks

The PlotWithPlotStyles property is equivalent to the Plot with Plot Styles option in AutoCAD.


PolarTrackingVector property [ActiveX and VBA Reference: AAR]

PolarTrackingVector Property

Toggles the display of polar tracking vectors.

See Also | Example

Signature

object.PolarTrackingVector

object

PreferencesDrafting
The object or objects this property applies to.

PolarTrackingVector

Boolean; read-write

TRUE: Enables polar tracking vectors.

FALSE: Disables polar tracking vectors.

System variables

The value of this property is stored in the TRACKPATH system variable.

Remarks

The initial value for this property is TRUE.


Position property [ActiveX and VBA Reference: AAR]

Position property

Specifies the X, Y, Z coordinate for center of the base or center of the solid, or the origin for the DWF underlay.

See Also | Example

Signature

object.Position

object

3dSolid, DwfUnderlay
The object or objects to which this property applies.

Position

Variant; input/output


PostScriptPrologFile property [ActiveX and VBA Reference: AAR]

PostScriptPrologFile Property

Specifies a name for a customized prolog section in the acad.psf file.

See Also | Example

Signature

object.PostScriptPrologFile

object

PreferencesFiles
The object or objects this property applies to.

PostScriptPrologFile

String; read-write
The name of the postscript prolog section of the acad.psf file to use when performing a PSOUT.

System variables

The value of this property is stored in the PSPROLOG system variable.

Remarks

The prolog section is used with the PSOUT AutoCAD command to customize the resulting output. For more information, see the AutoCAD documentation.


Preferences property [ActiveX and VBA Reference: AAR]

Preferences Property

Gets the Preferences object.

See Also | Example

Signature

object.Preferences

object

Application, Document
The object or objects this property applies to.

Preferences

Preferences, DatabasePreferences object; read-only
The Preferences or DatabasePreferences object.

Remarks

The Preferences object holds the options from the Options dialog that reside in the registry. Options that reside in the drawing can be found through the DatabasePreferences object.


Preset property [ActiveX and VBA Reference: AAR]

Preset Property

Specifies if the attribute is preset.

See Also | Example

Signature

object.Preset

object

Attribute
The object or objects this property applies to.

Preset

Boolean; read-write

TRUE: The attribute is a preset attribute.

FALSE: The attribute is not a preset attribute.

Remarks

A preset attribute sets the attribute to its default, or preset, value when the user inserts the block.

An attribute may exist as only one of four optional modes: constant, preset, invisible, or verify. The AFLAGS system variable stores the current mode settings. You can query the current mode using the Mode property.


PrimaryUnitsPrecision property [ActiveX and VBA Reference: AAR]

PrimaryUnitsPrecision Property

Specifies the number of decimal places displayed for the primary units of a dimension or tolerance.

See Also | Example

Signature

object.PrimaryUnitsPrecision

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Tolerance
The object or objects this property applies to.

PrimaryUnitsPrecision

acDimPrecision enum; read-write
Use one of the following constants to specify precision:

acDimPrecisionZero | 0.
acDimPrecisionOne | 0.0
acDimPrecisionTwo | 0.00
acDimPrecisionThree | 0.000
acDimPrecisionFour | 0.0000
acDimPrecisionFive | 0.00000
acDimPrecisionSix | 0.000000
acDimPrecisionSeven | 0.0000000
acDimPrecisionEight | 0.00000000

System variables

This property overrides the value of the DIMDEC system variable for the given dimension.


PrincipalDirections property [ActiveX and VBA Reference: AAR]

PrincipalDirections Property

Gets the principal directions of the solid or region.

See Also | Example

Signature

object.PrincipalDirections

object

3DSolid, Region
The object or objects this property applies to.

PrincipalDirections

Variant (three-element array of doubles); read-only
The X, Y, and Z coordinates calculated on the current coordinate system.

Remarks

The principal directions are returned as X, Y, and Z coordinates defined as a variant. They are calculated based on the current coordinate system.


PrincipalMoments property [ActiveX and VBA Reference: AAR]

PrincipalMoments Property

Gets the principal moments property of the solid or region.

See Also | Example

Signature

object.PrincipalMoments

object

3DSolid, Region
The object or objects this property applies to.

PrincipalMoments

Variant (three-element array of doubles); read-only
The X, Y, and Z coordinates calculated on the current coordinate system.

Remarks

The principal moments are returned as X, Y, and Z coordinates defined as a variant. They are calculated based on the current coordinate system.


PrinterConfigPath property [ActiveX and VBA Reference: AAR]

PrinterConfigPath Property

Specifies the location for printer configuration files.

See Also | Example

Signature

object.PrinterConfigPath

object

PreferencesFiles
The object or objects this property applies to.

PrinterConfigPath

String; read-write
The drive and path for printer configuration files.


PrinterDescPath property [ActiveX and VBA Reference: AAR]

PrinterDescPath Property

Specifies the location for printer description files.

See Also | Example

Signature

object.PrinterDescPath

object

PreferencesFiles
The object or objects this property applies to.

PrinterDescPath

String; read-write
The drive and path for printer description files.


PrinterPaperSizeAlert property [ActiveX and VBA Reference: AAR]

PrinterPaperSizeAlert Property

Specifies whether to alert the user when a layout is configured with a paper size that is different than the default setting for the PC3 file.

See Also | Example

Signature

object.PrinterPaperSizeAlert

object

PreferencesOutput
The object or objects this property applies to.

PrinterPaperSizeAlert

Boolean; read-write

TRUE: Alert the user.

FALSE: Do not alert the user.

Remarks

The initial value for this property is TRUE.


PrinterSpoolAlert property [ActiveX and VBA Reference: AAR]

PrinterSpoolAlert Property

Specifies whether to alert the user when the output to a device must be spooled through a system printer due to a conflict with the I/O port.

See Also | Example

Signature

object.PrinterSpoolAlert

object

PreferencesOutput
The object or objects this property applies to.

PrinterSpoolAlert

acPrinterSpoolAlert; read-write

acPrinterAlwaysAlert | Always alert and log errors.
acPrinterAlertOnce | Alert only the first error and log all errors.
acPrinterNeverAlertLogOnce | Never alert, but log all errors.
acPrinterNeverAlert | Never alert and don't log any errors.

Remarks

The initial value for this property is acPrinterAlwaysAlert.


PrinterStyleSheetPath property [ActiveX and VBA Reference: AAR]

PrinterStyleSheetPath Property

Specifies the location for printer style sheet files.

See Also | Example

Signature

object.PrinterStyleSheetPath

object

PreferencesFiles
The object or objects this property applies to.

PrinterStyleSheetPath

String; read-write
The drive and path for printer style sheet files.

Remarks

Use a semicolon (;) to separate multiple directories; however, do not end the string with a semicolon.


PrintFile property [ActiveX and VBA Reference: AAR]

PrintFile Property

Specifies an alternate name to use for the temporary plot file name.

See Also | Example

Signature

object.PrintFile

object

PreferencesFiles
The object or objects this property applies to.

PrintFile

String; read-write
The alternate name for plot files. Enter "." to use default (the current drawing name). Enter the drive, path, and file name for the alternate plot file.

Remarks

The default name is the name of the drawing, plus the file extension .plt.


PrintSpoolerPath property [ActiveX and VBA Reference: AAR]

PrintSpoolerPath Property

Specifies the directory for the print spool files. AutoCAD writes the plot to this location.

See Also | Example

Signature

object.PrintSpoolerPath

object

PreferencesFiles
The object or objects this property applies to.

PrintSpoolerPath

String; read-write
The directory for the print spool files.


PrintSpoolExecutable property [ActiveX and VBA Reference: AAR]

PrintSpoolExecutable Property

Specifies the application to use for print spooling.

See Also | Example

Signature

object.PrintSpoolExecutable

object

PreferencesFiles
The object or objects this property applies to.

PrintSpoolExecutable

String; read-write
The print spooling application.

Remarks

This property contains the drive, path, and application name of the print spooling executable to use with AutoSpool.


ProductOfInertia property [ActiveX and VBA Reference: AAR]

ProductOfInertia Property

Gets the product of inertia of the solid or region.

See Also | Example

Signature

object.ProductOfInertia

object

3DSolid, Region
The object or objects this property applies to.

ProductOfInertia

Variant (three-element array of doubles); read-only
The X, Y, and Z coordinates calculated on the current coordinate system.

Remarks

The product of inertia is returned as X, Y, and Z coordinates defined as a variant. It is calculated based on the current coordinate system.


ProfileRotation property [ActiveX and VBA Reference: AAR]

ProfileRotation property

Specifies the rotation of the sweep profile.

See Also | Example

Signature

object.ProfileRotation

object

SweptSurface
The object or objects to which this property applies.

ProfileRotation

ACAD_ANGLE; input/output


Profiles property [ActiveX and VBA Reference: AAR]

Profiles Property

Gets the PreferencesProfiles object.

See Also | Example

Signature

object.Profiles

object

Preferences
The object or objects this property applies to.

Profiles

PreferencesProfiles; read-only
Gets the PreferencesProfiles object.

Remarks

The PreferencesProfiles object holds all the options from the Profiles tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


PromptString property [ActiveX and VBA Reference: AAR]

PromptString Property

Specifies the prompt string for an attribute.

See Also | Example

Signature

object.PromptString

object

Attribute
The object or objects this property applies to.

PromptString

String; read-write
The prompt string for the attribute.

Remarks

This string appears when a block containing this attribute is inserted. The default for this string is the TagString property. Entering acAttributeModeConstant for the Mode property disables the prompt.


PropertyName property [ActiveX and VBA Reference: AAR]

PropertyName Property

Specifies the name for the property.

Signature

object.PropertyName

object

DynamicBlockReferenceProperty
The object or objects this property applies to.

PropertyName

String; read-only

Remarks

Property names are guaranteed to be unique among all properties on a given block reference.


ProviderName property [ActiveX and VBA Reference: AAR]

ProviderName Property

Specifies the encryption provider name.

See Also | Example

Signature

object.ProviderName

object

SecurityParams
The object or objects this property applies to.

ProviderName

String; read-write
The encryption provider name. More information about cryptography providers is available on MSDN.


ProviderType property [ActiveX and VBA Reference: AAR]

ProviderType Property

Specifies the encryption provider type.

See Also | Example

Signature

object.ProviderType

object

SecurityParams
The object or objects this property applies to.

ProviderType

Long; read-write
The encryption provider type. More information about cryptography providers is available on MSDN.


ProxyImage property [ActiveX and VBA Reference: AAR]

ProxyImage Property

Controls the display of objects in a drawing that were created in a third-party application.

See Also | Example

Signature

object.ProxyImage

object

PreferencesOpenSave
The object or objects this property applies to.

ProxyImage

acProxyImage enum; read-write

acProxyNotShow

acProxyShow

acProxyBoundingBox

Remarks

The initial value for this property is acProxyShow.


QNewTemplateFile property [ActiveX and VBA Reference: AAR]

QNewTemplateFile Property

Sets the default template file name for the QNEW command.

See Also | Example

Signature

object.QNewTemplateFile

Object

PreferencesFiles
The object or objects this property applies to.

QNewTemplateFile

String; read-write

Remarks

The value of this property controls the default template used with the QNEW command. To use this property, you must declare an object as an AcadPrefrencesFiles object.


QuietErrorMode property [ActiveX and VBA Reference: AAR]

QuietErrorMode Property

Toggles the quiet error mode for plot-error reporting.

See Also | Example

Signature

object.QuietErrorMode

object

Plot
The object or objects this property applies to.

QuietErrorMode

Boolean; read-write

TRUE: Enables quiet error mode.

FALSE: Disables quiet error mode.

Remarks

Quiet error mode logs all plot-related error messages into a log file.

When the quiet error mode is disabled, the normal error reporting mechanisms (alert boxes) are used.


RadiiOfGyration property [ActiveX and VBA Reference: AAR]

RadiiOfGyration Property

Gets the radius of gyration of the solid or region.

See Also | Example

Signature

object.RadiiOfGyration

object

3DSolid, Region
The object or objects this property applies to.

RadiiOfGyration

Variant (three-element array of doubles); read-only
The X, Y, and Z coordinates calculated on the current coordinate system.

Remarks

The radius of gyration is returned as X, Y, and Z coordinates defined as a variant. It is calculated based on the current coordinate system.


Radius property [ActiveX and VBA Reference: AAR]

Radius Property

Specifies the radius of an arc or circle.

See Also | Example

Signature

object.Radius

object

Arc, Circle
The object or objects this property applies to.

Radius

Double; read-write
The radius of the arc or circle.

Remarks

Radius of a circle


RadiusRatio property [ActiveX and VBA Reference: AAR]

RadiusRatio Property

Specifies the major to minor axis ratio of an ellipse.

See Also | Example

Signature

object.RadiusRatio

object

Ellipse
The object or objects this property applies to.

RadiusRatio

Double; read-write
The radius ratio of the arc or circle.

Remarks

If the minor axis is entered longer than the major axis, the ellipse will be round because the radius ratio cannot be greater than 1.0. (A radius ratio of 1.0 defines a circle.)

Radius ratio = 0.25

Radius ratio = 0.75


ReadOnly property [ActiveX and VBA Reference: AAR]

ReadOnly Property

Specifies if the document or property is read-only or read-write.

See Also | Example

Signature

object.ReadOnly

object

Document, DynamicBlockReferenceProperty
The object or objects this property applies to.

ReadOnly

Boolean; read-only

TRUE: The document or property is read-only.

FALSE: The document or property is read-write.


Red property [ActiveX and VBA Reference: AAR]

Red Property

Specifies the red component of the True Color.

See Also | Example

Signature

object.Red

object

AcCmColor
The object or objects this property applies to.

Red

Long; read-only
The red component, from 0-255, of AcCmColor.


ReferenceCount property [ActiveX and VBA Reference: AAR]

ReferenceCount Property

Specifies the reference count of an entry in the File Dependency List.

See Also | Example

Signature

object.ReferenceCount

object

FileDependency
The object or objects this property applies to.

ReferenceCount

Long; read-only
Current reference count for the entry.


RegenerateTableSuppressed property [ActiveX and VBA Reference: AAR]

RegenerateTableSuppressed Property

Enables or disables regeneration of the table block.

Example

Signature

object.RegenerateTableSuppressed

object

Table
The object or objects this property applies to.

RegenerateTableSuppressed

Boolean; read-write

TRUE: Regeneration of the table is suppressed.

FALSE: Regeneration of the table is not suppressed.

Remarks

All methods that change the Table object do the following:

  1. Open the Table object in write mode
  2. Modify the Table object based on the input parameters
  3. Close the Table object, which recomputes the Table

Recomputing large tables consumes a lot of time and memory because the Table object is reconstructed from scratch.

To avoid performance problems, you should temporarily disable the regeneration of the Table object when modifying large tables through the VBA APIs, then apply the modifications and re-enable regeneration.

Note To access this property, use the IAcadTable2 interface.


RegisteredApplications property [ActiveX and VBA Reference: AAR]

RegisteredApplications Property

Gets the RegisteredApplications collection for the document.

See Also | Example

Signature

object.RegisteredApplications

object

Document
The object or objects this property applies to.

RegisteredApplications

RegisteredApplications collection; read-only
The RegisteredApplications collection for the document.


RemoveHiddenLines property [ActiveX and VBA Reference: AAR]

RemoveHiddenLines Property

Specifies if hidden lines are to be plotted on a paper space viewport.

See Also | Example

Signature

object.RemoveHiddenLines

object

PViewport
The object or objects this property applies to.

RemoveHiddenLines

Boolean; read-write

TRUE: Removes hidden lines in the plot.

FALSE: Does not remove hidden lines in the plot.

Remarks

This property is obsolete and will be removed in a future version.


RenderSmoothness property [ActiveX and VBA Reference: AAR]

RenderSmoothness Property

Specifies the smoothness of shaded, rendered, and hidden line-removed objects.

See Also | Example

Signature

object.RenderSmoothness

object

DatabasePreferences
The object or objects this property applies to.

RenderSmoothness

Double; read-write
The valid range is 0.01 to 10.0.

System variables

The value of this property is stored in the FACETRES system variable.

Remarks

The initial value for this property is 0.5. To improve performance, set this value to 1 or less when drawing.


RepeatBottomLabels property [ActiveX and VBA Reference: AAR]

RepeatBottomLabels Property

Determines whether the bottom set of label rows is repeated at the bottom of each broken table part.

See Also | Example

Signature

object.RepeatBottomLabels

Object

Table
The object or objects this property applies to.

RepeatBottomLabels

Boolean; read-write
Flag indicating how bottom labels ought to display.


RepeatTopLabels property [ActiveX and VBA Reference: AAR]

RepeatTopLabels Property

Determines whether the first set of label rows will be repeated at the top of each broken table part.

See Also | Example

Signature

object.RepeatTopLabels

Object

Table
The object or objects this property applies to.

RepeatTopLabels

Boolean; read-write
Flag indicating how top labels ought to display.


RevisionNumber property [ActiveX and VBA Reference: AAR]

RevisionNumber Property

Specifies the revision number.

See Also | Example

Signature

object.RevisionNumber

Object

SummaryInfo
The object or objects this property applies to.

RevisionNumber

String; read-write
The RevisionNumber property of a drawing.


RevolutionAngle property [ActiveX and VBA Reference: AAR]

RevolutionAngle property

Specifies the angle of revolution.

See Also | Example

Signature

object.RevolutionAngle

object

RevolvedSurface
The object or objects to which this property applies.

RevolutionAngle

ACAD_ANGLE; input/output


Rotation property [ActiveX and VBA Reference: AAR]

Rotation Property

Specifies the rotation angle of the OLE object.

Signature

object.Rotation

object

OLE
The object or objects this property applies to.

Rotation

ACAD_ANGLE
Read-write


Rotation property [ActiveX and VBA Reference: AAR]

Rotation Property

Specifies the rotation angle for the object.

See Also | Example

Signature

object.Rotation

object

Attribute, AttributeReference, BlockRef, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, DwfUnderlay, ExternalReference, MInsertBlock, MText, Raster, Shape, Text, Underlay
The object or objects this property applies to.

Rotation

Double; read-write
The rotation angle in radians.

Remarks

The rotation angle is relative to the X axis of the object's WCS with positive angles going counterclockwise when looking down from the Z axis toward the origin.

Raster: To display the raster image at the specified rotation, set the ShowRotation property to TRUE.

Text: The rotation angle is read-only for text whose Alignment property is set to acAlignmentAligned or acAlignmentFit.

Text rotation angle

Dimension line angle


RoundDistance property [ActiveX and VBA Reference: AAR]

RoundDistance Property

Specifies the rounding of dimension units.

See Also | Example

Signature

object.RoundDistance

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

RoundDistance

Double; read-write
A positive real number representing the value to round distances to. The initial value is 0.00.

System variables

This property overrides the value of the DIMRND system variable for the given dimension.

Remarks

This property rounds all dimensioning distances to the specified value. For instance, if this property is set to 0.25, the distance is rounded to the nearest 0.25 unit. If you set this property to 1.0, the distance for the dimension is rounded to the nearest integer. Note that the number of digits edited after the decimal point depends on the precision set by the PrimaryUnitsPrecision property or DIMDEC system variable. This property does not apply to angular dimensions.


RowHeight property [ActiveX and VBA Reference: AAR]

RowHeight Property

Specifies a uniform height for all rows in the table.

See Also | Example

Signature

object.RowHeight

Object

Table
The object or objects this property applies to.

RowHeight

Double; read-write
The uniform height for all rows in the table.


Rows property [ActiveX and VBA Reference: AAR]

Rows Property

Specifies the number of rows in a block array.

See Also | Example

Signature

object.Rows

object

MInsertBlock
The object or objects this property applies to.

Rows

Long; read-write
The number of rows in the block array.


Rows property [ActiveX and VBA Reference: AAR]

Rows Property

Specifies the number of rows in the table.

See Also | Example

Signature

object.Rows

Object

Table
The object or objects this property applies to.

Rows

Long; read-write
The number of rows in the table.


RowSpacing property [ActiveX and VBA Reference: AAR]

RowSpacing Property

Specifies the spacing of the rows in a block array.

See Also | Example

Signature

object.RowSpacing

object

MInsertBlock
The object or objects this property applies to.

RowSpacing

Double; read-write
The spacing of the rows in the block array.


SaveAsType property [ActiveX and VBA Reference: AAR]

SaveAsType Property

Specifies the drawing type for saving the drawing.

See Also | Example

Signature

object.SaveAsType

object

PreferencesOpenSave
The object or objects this property applies to.

SaveAsType

acSaveAsType enum; read-write

acR14_dwg | AutoCAD R14 DWG (*.dwg)
ac2000_dwg | AutoCAD 2000 DWG (*.dwg)
ac2000_dxf | AutoCAD 2000 DXF (*.dxf)
ac2000_Template | AutoCAD 2000 Drawing Template File (*.dwt)
ac2004_dwg | AutoCAD 2004 DWG (*.dwg)
ac2004_dxf | AutoCAD 2004 DXF (*.dxf)
ac2004_Template | AutoCAD 2004 Drawing Template File (*.dwt)
ac2007_dwg | AutoCAD 2007 DWG (*.dwg)
ac2007_dxf | AutoCAD 2007 DXF (*.dxf)
ac2007_Template | AutoCAD 2007 Drawing Template File (*.dwt)
acNative | A synonym for the current drawing release format. If you want your application to save the drawing in the format of whatever version of AutoCAD the application is running on, then use the acNative format.
AcUnknown | Read-only. The drawing type is unknown or invalid.

Remarks

The initial value for this property is ac2007_dwg. The following values are obsolete: acR13_DWG, acR13_DXF, acR14_DWG, and acR14_DXF.


Saved property [ActiveX and VBA Reference: AAR]

Saved Property

Specifies if the document has any unsaved changes.

See Also | Example

Signature

object.Saved

object

Document
The object or objects this property applies to.

Saved

Boolean; read-only

TRUE: The document has no unsaved changes.

FALSE: The document has unsaved changes.


SavePreviewThumbnail property [ActiveX and VBA Reference: AAR]

SavePreviewThumbnail Property

Specifies if BMP preview images are saved with the drawing.

See Also | Example

Signature

object.SavePreviewThumbnail

object

PreferencesOpenSave
The object or objects this property applies to.

SavePreviewThumbnail

Boolean; read-write

TRUE: No preview image is created.

FALSE: Preview image is created.

System variables

The value for this property is saved in the RASTERPREVIEW system variable.

Remarks

The initial value for this property is TRUE.


scale property [ActiveX and VBA Reference: AAR]

scale property

Specifies the scale factor from start to the end of the sweep path.

See Also | Example

Signature

object.scale

object

SweptSurface
The object or objects to which this property applies.

scale

Double; input/output


ScaleFactor property [ActiveX and VBA Reference: AAR]

ScaleFactor Property

Specifies the scale factor for the object.

See Also | Example

Signature

object.ScaleFactor

object

Attribute, AttributeReference, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, DwfUnderlay, Leader, MLeaderStyle, Raster, Shape, Text, Tolerance
The object or objects this property applies to.

ScaleFactor

Double; read-write
A real number greater than 0.0. A scale factor greater than 1 enlarges the object. A scale factor between 0 and 1 shrinks the object.

Remarks

The initial value for this property is 1.0000.

The scale factor is often referred to as the relative X scale factor. The scale factor is applied to the object's width to allow the width to be adjusted independently of the height. For example, if the scale factor value is 0.8, then the object will be drawn with a width that is 80 percent of its normal unadjusted width.

Dimension, leader, and tolerance objects:

This property overrides the DIMSCALE system variable.

If you are working in paper space, the scale factor for dimensions will equal 0.0 and AutoCAD will compute a reasonable default value based on the scaling between the current model space viewport and paper space. You will not be able to change the scale factor for a dimension in paper space.


ScaleHeight property [ActiveX and VBA Reference: AAR]

ScaleHeight Property

Specifies the height of the object as a percentage of its original height.

Signature

object.ScaleHeight

object

OLE
The object or objects this property applies to.

ScaleHeight

Double; read-write


ScaleLineweights property [ActiveX and VBA Reference: AAR]

ScaleLineweights Property

Specifies if the lineweight is scaled with the rest of the geometry when a layout is printed.

See Also | Example

Signature

object.ScaleLineweights

object

Layout, PlotConfiguration
The object or objects this property applies to.

ScaleLineweights

Boolean; read-write

TRUE: Scale lineweights.

FALSE: Do not scale lineweights.

Remarks

By default, lineweights are printed at absolute size (not scaled).

The property disabled for the model space layout.


ScaleWidth property [ActiveX and VBA Reference: AAR]

ScaleWidth Property

Specifies the width of the object as a percentage of its original height.

Signature

object.ScaleWidth

object

OLE
The object or objects this property applies to.

ScaleWidth

Double; read-write


SCMCommandMode property [ActiveX and VBA Reference: AAR]

SCMCommandMode Property

Determines right-click functionality in the drawing area while in Command mode, which means that a command is currently in progress.

See Also | Example

Signature

object.SCMCommandMode

object

PreferencesUser
The object or objects this property applies to.

SCMCommandMode

AcDrawingAreaSCMCommand enum; read-write

acEnter | Disables the Command shortcut menu. As a result, right-clicking in the drawing area when a command is in progress issues ENTER.
acEnableSCM | Enables the Command shortcut menu.
acEnableSCMOptions | Enables the Command shortcut menu only when options are currently available from the command line prompt. In a command line prompt, options are enclosed in square brackets. If no options are available, right-clicking issues ENTER.

System variables

The value of this property is stored in the SHORTCUTMENU system variable.

Remarks

The initial value for this property is acEnableSCMOptions.

This property can only be set when the ShortcutMenuDisplay property is set to TRUE.


SCMDefaultMode property [ActiveX and VBA Reference: AAR]

SCMDefaultMode Property

Determines right-click functionality in the drawing area while in Default mode, which means that no objects are selected and no commands are in progress.

See Also | Example

Signature

object.SCMDefaultMode

object

PreferencesUser
The object or objects this property applies to.

SCMDefaultMode

AcDrawingAreaSCMDefault enum; read-write

acRepeatLastCommand | Disables the Default shortcut menu. As a result, right-clicking in the drawing area when no objects are selected and no commands are in progress issues ENTER, which repeats the last issued command.
acSCM | Enables the Default shortcut menu.

System variables

The value of this property is stored in the SHORTCUTMENU system variable.

Remarks

The initial value for this property is acSCM.

This property can only be set when the ShortcutMenuDisplay property is set to TRUE.


SCMEditMode property [ActiveX and VBA Reference: AAR]

SCMEditMode Property

Determines right-click functionality in the drawing area while in Edit mode, which means that one or more objects are selected and no commands are in progress.

See Also | Example

Signature

object.SCMEditMode

object

PreferencesUser
The object or objects this property applies to.

SCMEditMode

AcDrawingAreaSCMEdit enum; read-write

acEdRepeatLastCommand | Disables the Edit shortcut menu. As a result, right-clicking in the drawing area when one or more objects are selected and no commands are in progress issues ENTER, which repeats the last issued command.
acEdSCM | Enables the Edit shortcut menu.

System variables

The value of this property is stored in the SHORTCUTMENU system variable.

Remarks

The initial value for this property is acEdSCM.

This property can only be set when the ShortcutMenuDisplay property is set to TRUE.


SCMTimeMode property [ActiveX and VBA Reference: AAR]

SCMTimeMode Property

Controls time-sensitive right-click behavior.

See Also | Example

Signature

object.SCMTimeMode

Object

PreferencesUser
The object or objects this property applies to.

SCMTimeMode

Boolean; read-write

TRUE: Time-sensitive right-click is enabled.

FALSE: Time-sensitive right-click is disabled.

System variables

The value of this property is stored in the SHORTCUTMENU system variable.

Remarks

This property is for setting time-sensitive right-click behavior. A quick click is the same as pressing ENTER. A longer click displays a shortcut menu. This property can only be set when the ShortcutMenuDisplay property is set to TRUE.

You can set a duration for the right-click using the SCMTimeValue property.


SCMTimeValue property [ActiveX and VBA Reference: AAR]

SCMTimeValue Property

Controls time-sensitive right-click behavior by setting the duration of the long click that displays a shortcut menu.

See Also | Example

Signature

object.SCMTimeValue

Object

PreferencesUser
The object or objects this property applies to.

SCMTimeValue

Integer; read-write
A number in milliseconds between 100 and 10,000. The initial value is 250.

Remarks

This property affects right-click behavior when the SCMTimeMode property is set to TRUE.


SecondPoint property [ActiveX and VBA Reference: AAR]

SecondPoint Property

Specifies the second point of the ray or xline.

See Also | Example

Signature

object.SecondPoint

object

Ray, XLine
The object or objects this property applies to.

SecondPoint

Variant (three-element array of doubles); read-write
The 3D WCS coordinate representing the second point of the ray or xline.

Remarks

You cannot set the second point of a ray equal to its base point.


SecondSegmentAngleConstraint property [ActiveX and VBA Reference: AAR]

SecondSegmentAngleConstraint Property

Specifies the SecondSegmentAngleConstraint of the mleaderstyle.

See Also | Example

Signature

object.SecondSegmentAngleConstraint

Object

MLeaderStyle
The object this property applies to.

SecondSegmentAngleConstraint

Long; read-write
The second segment's angle constraint value.


SectionManager property [ActiveX and VBA Reference: AAR]

SectionManager property

Returns the section manager object.

See Also | Example

Signature

object.SectionManager

object

Database, Document
The object or objects to which this property applies.

SectionManager

AcadSectionManager; input-only


SegmentPerPolyline property [ActiveX and VBA Reference: AAR]

SegmentPerPolyline Property

Specifies the number of line segments to be generated for each polyline curve.

See Also | Example

Signature

object.SegmentPerPolyline

object

DatabasePreferences
The object or objects this property applies to.

SegmentPerPolyline

Integer; read-write
The number of line segments to be generated for each polyline curve.
0 < SegmentPerPolyline <= 42950

System variables

The value of this property is stored in the SPLINESEGS system variable.

Remarks

The initial value is 8. The higher the number you specify, the greater the performance impact.


Selection property [ActiveX and VBA Reference: AAR]

Selection Property

Gets the PreferencesSelection object.

See Also | Example

Signature

object.Selection

object

Preferences
The object or objects this property applies to.

Selection

PreferencesSelection; read-only
Gets the PreferencesSelection object.

Remarks

The PreferencesSelection object holds all the options from the Selection tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


SelectionSets property [ActiveX and VBA Reference: AAR]

SelectionSets Property

Gets the SelectionSets collection for the document.

See Also | Example

Signature

object.SelectionSets

object

Document
The object or objects this property applies to.

SelectionSets

SelectionSets collection; read-only
The selection set collection for the drawing.


SerialNumber property [ActiveX and VBA Reference: AAR]

SerialNumber Property

Specifies the serial number of the digital certificate.

See Also | Example

Signature

object.SerialNumber

object

SecurityParams
The object or objects this property applies to.

SerialNumber

String; read-write
The serial number of the digital certificate.


ShadePlot property [ActiveX and VBA Reference: AAR]

ShadePlot Property

Specifies the shaded viewport plotting mode of a viewport.

See Also | Example

Signature

object.ShadePlot

object

PViewport
The object or objects this property applies to.

ShadePlot

AcShadePlot enum; read-write

acShadePlotAsDisplayed | Model space view plots the same way it is displayed
acShadePlotHidden | Model space view plots with hidden lines removed, regardless of display
acShadePlotRendered | Model space view plots as rendered regardless of display
acShadePlotWireframe | Model space view plots as wireframe regardless of display


ShadowDisplay property [ActiveX and VBA Reference: AAR]

ShadowDisplay property

Specifies the shadow display property of the object.

See Also | Example

Signature

object.ShadowDisplay

object

ShadowDisplay
The object or objects to which this property applies.

ShadowDisplay

AcShadowDisplayType; input/output

acCastsAndReceivesShadows

acCastsShadows

acReceivesShadows

acIgnoreShadows


SheetView property [ActiveX and VBA Reference: AAR]

SheetView Property

Returns and sets the sheet view associated with the viewport.

Signature

object.SheetView

object

PViewport
The object or objects this property applies to.

SheetView

View object; read-write

Remarks

Note To access this property, use the IAcadPViewport2 interface.


ShortCutMenu property [ActiveX and VBA Reference: AAR]

ShortcutMenu Property

Determines if the specified popup menu is the shortcut menu.

See Also | Example

Signature

object.ShortcutMenu

object

PopupMenu
The object or objects this property applies to.

ShortcutMenu

Boolean; read-only

TRUE: This is the shortcut menu.

FALSE: This is not the shortcut menu.


ShortCutMenuDisplay property [ActiveX and VBA Reference: AAR]

ShortCutMenuDisplay Property

Controls whether right-clicking in the drawing area displays a shortcut menu or issues ENTER.

See Also | Example

Signature

object.ShortCutMenuDisplay

object

PreferencesUser
The object or objects this property applies to.

ShortCutMenuDisplay

Boolean; read-write

TRUE: Shortcut menus are enabled in the drawing area.

FALSE: Shortcut menus are disabled in the drawing area. A right-click in the drawing area will be interpreted as an ENTER.

System variables

The value of this property is stored in the SHORTCUTMENU system variable.

Remarks

The initial value for this property is TRUE.

When this property is set to TRUE, you can customize the functionality of right-clicking in the drawing area using properties in the PreferencesUser object.


Show property [ActiveX and VBA Reference: AAR]

Show Property

Specifies whether the property is shown in the user interface.

Signature

object.Show

object

DynamicBlockReferenceProperty
The object or objects this property applies to.

Show

Boolean; read-only

TRUE: The property is shown in the user interface.

FALSE: The property is not shown in the user interface.

Remarks

If this property is true, the dynamic block reference property is displayed in the Properties palette when the block reference containing it is selected.


ShowHistory property [ActiveX and VBA Reference: AAR]

ShowHistory property

Specifies whether to show history of the solid.

See Also | Example

Signature

object.ShowHistory

object

3dSolid
The object or objects to which this property applies.

ShowHistory

Boolean; input/output


ShowPlotStyles property [ActiveX and VBA Reference: AAR]

ShowPlotStyles Property

Specifies whether or not plot styles and plot style names are displayed in the drawing.

See Also | Example

Signature

object.ShowPlotStyles

object

Layout, PlotConfiguration
The object or objects this property applies to.

ShowPlotStyles

Boolean; read-write

TRUE: Plot styles and plot style names are displayed and plotted.

FALSE: Plot styles and plot style names are not displayed.

Remarks

The ShowPlotStyles property is equivalent to the Display Plot Styles option in AutoCAD.


ShowProxyDialogBox property [ActiveX and VBA Reference: AAR]

ShowProxyDialogBox Property

Specifies if AutoCAD displays a warning message when you open a drawing that contains custom objects.

See Also | Example

Signature

object.ShowProxyDialogBox

object

PreferencesOpenSave
The object or objects this property applies to.

ShowProxyDialogBox

Boolean; read-write

TRUE: Displays a warning.

FALSE: Does not display a warning.

System variables

The value of this property is stored in the PROXYNOTICE system variable.

Remarks

The initial value of this property is TRUE.


ShowRasterImage property [ActiveX and VBA Reference: AAR]

ShowRasterImage Property

Controls the display of raster images during real-time pan and zooms.

See Also | Example

Signature

object.ShowRasterImage

object

PreferencesDisplay
The object or objects this property applies to.

ShowRasterImage

Boolean; read-write

TRUE: Display raster image content during pans and zooms.

FALSE: Display raster image outlines during pans and zooms.

System variables

This value of this property is stored in the RTDISPLAY system variable.

Remarks

The initial value for this property is FALSE.

If dragging display is turned on, and you enable ShowRasterImage, a copy of the image moves with the cursor as you reposition the original image.


ShowRotation property [ActiveX and VBA Reference: AAR]

ShowRotation Property

Determines if a raster image is displayed at its rotation value.

See Also | Example

Signature

object.ShowRotation

object

Raster
The object or objects this property applies to.

ShowRotation

Boolean; read-write

TRUE: Display the raster image at the rotation value stored in the Rotation property.

FALSE: Do not display the raster image at the rotation value stored in the Rotation property.


ShowWarningMessages property [ActiveX and VBA Reference: AAR]

ShowWarningMessages Property

Resets all dialog boxes that have the "Don't Display This Warning Again" check box so they display again.

See Also | Example

Signature

object.ShowWarningMessages

object

PreferencesSystem
The object or objects this property applies to.

ShowWarningMessages

Boolean; read-write

TRUE: Resets the warning dialog boxes.

FALSE: Does not reset the warning dialog boxes.

Remarks

The initial value for this property is FALSE.


SingleDocumentMode property [ActiveX and VBA Reference: AAR]

SingleDocumentMode Property

Determines if AutoCAD runs in single- or multiple-document mode.

See Also | Example

Signature

object.SingleDocumentMode

object

PreferencesSystem
The object or objects this property applies to.

SingleDocumentMode

Boolean; read-write

TRUE: Single-drawing mode enabled.

FALSE: Single-drawing mode disabled.

System variables

The value for this property is stored in the SDI system variable.

Remarks

The initial value for this property is FALSE.

This property helps third-party developers update applications to work smoothly with the AutoCAD multiple-drawing mode. It may become obsolete in future releases of AutoCAD.


SnapBasePoint property [ActiveX and VBA Reference: AAR]

SnapBasePoint Property

Specifies the snap base point for the viewport.

See Also | Example

Signature

object.SnapBasePoint

object

PViewport, Viewport
The object or objects this property applies to.

SnapBasePoint

Variant (two-element array of doubles); read-write
A 2D WCS coordinate representing the snap base point for the viewport.

System variables

The value of this property is stored in the SNAPBASE system variable.

Remarks

You cannot change the snap base point for the active paper space viewport.

Changes to this property are not reflected in the display until a call to either the Update or Regen method is performed.


SnapOn property [ActiveX and VBA Reference: AAR]

SnapOn Property

Specifies the status of snap.

See Also | Example

Signature

object.SnapOn

object

Viewport, PViewport
The object or objects this property applies to.

SnapOn

Boolean; read-write

TRUE: Snap is on.

FALSE: Snap is off.

System variables

The value of this property is stored in the SNAPMODE system variable. To change the snap style, use the SNAPSTYL system variable.

Remarks

SnapOn activates Snap mode using the current snap grid resolution, rotation, and style. To change the snap grid resolution, use the SetSnapSpacing method. To change the snap rotation, use the SnapRotationAngle property.

The snap grid is invisible. Use the GridOn property to display a separate visible grid.

AutoCAD ignores the Snap mode in perspective views.


SnapRotationAngle property [ActiveX and VBA Reference: AAR]

SnapRotationAngle Property

Specifies the snap rotation angle of the viewport relative to the current UCS.

See Also | Example

Signature

object.SnapRotationAngle

object

Viewport, PViewport
The object or objects this property applies to.

SnapRotationAngle

Double; read-write
The angle in radians. The valid range is 0 to 6.28.

System variables

The value of this property is stored in the SNAPANG system variable.

Remarks

You cannot change the snap base point for the active paper space viewport.

Changes to this property are not reflected in the drawing until a call to either the Update or Regen method is performed.


SolidFill property [ActiveX and VBA Reference: AAR]

SolidFill Property

Specifies if multilines, traces, solids, all hatches (including solid-fill), and wide polylines are filled in.

See Also | Example

Signature

object.SolidFill

object

DatabasePreferences
The object or objects this property applies to.

SolidFill

Boolean; read-write

TRUE: Displays solid fills.

FALSE: Does not display solid fills.

System variables

The value of this property is stored in the FILLMODE system variable.

Remarks

The initial value of this property is TRUE.


SolidType property [ActiveX and VBA Reference: AAR]

SolidType property

Indicates the type of solid.

See Also | Example

Signature

object.SolidType

object

3dSolid
The object or objects to which this property applies.

SolidType

String; input-only


SourceObjects property [ActiveX and VBA Reference: AAR]

SourceObjects property

Specifies the source objects for section generation.

See Also | Example

Signature

object.SourceObjects

object

SectionTypeSettings
The object or objects to which this property applies.

SourceObjects

Variant; input/output


StandardScale property [ActiveX and VBA Reference: AAR]

StandardScale Property

Specifies the standard scale for the layout, viewport, or plot configuration.

See Also | Example

Signature

object.StandardScale

object

Layout, PViewport, PlotConfiguration
The object or objects this property applies to.

StandardScale

For Layout and PlotConfiguration objects, use acPlotScale. For the PViewport object, use acViewportScale.

acViewportScale enum; read-write

acVpScaleToFit | Scale to fit
acVpCustomScale | Custom
acVp1_128in_1ft | 1/128"= 1'
acVp1_64in_1ft | 1/64"= 1'
acVp1_32in_1ft | 1/32"= 1'
acVp1_16in_1ft | 1/16"= 1'
acVp3_32in_1ft | 3/32"= 1'
acVp1_8in_1ft | 1/8" = 1'
acVp3_16in_1ft | 3/16"= 1'
acVp1_4in_1ft | 1/4" = 1'
acVp3_8in_1ft | 3/8" = 1'
acVp1_2in_1ft | 1/2" = 1'
acVp3_4in_1ft | 3/4" = 1'
acVp1in_1ft | 1"= 1'
acVp1and1_2in_1ft | 1-1/2"= 1'
acVp3in_1ft | 3"= 1'
acVp6in_1ft | 6"= 1'
acVp1ft_1ft | 1'= 1'
acVp1_1 | 1:1
acVp1_2 | 1:2
acVp1_4 | 1:4
acVp1_8 | 1:8
acVp1_10 | 1:10
acVp1_16 | 1:16
acVp1_20 | 1:20
acVp1_30 | 1:30
acVp1_40 | 1:40
acVp1_50 | 1:50
acVp1_100 | 1:100
acVp2_1 | 2:1
acVp4_1 | 4:1
acVp8_1 | 8:1
acVp10_1 | 10:1
acVp100_1 | 100:1

acPlotScale enum; read-write

acScaleToFit | Scale to Fit
ac1_128in_1ft | 1/128"= 1'
ac1_64in_1ft | 1/64"= 1'
ac1_32in_1ft | 1/32"= 1'
ac1_16in_1ft | 1/16"= 1'
ac3_32in_1ft | 3/32"= 1'
ac1_8in_1ft | 1/8" = 1'
ac3_16in_1ft | 3/16"= 1'
ac1_4in_1ft | 1/4" = 1'
ac3_8in_1ft | 3/8" = 1'
ac1_2in_1ft | 1/2" = 1'
ac3_4in_1ft | 3/4" = 1'
ac1in_1ft | 1"= 1'
ac3in_1ft | 3"= 1'
ac6in_1ft | 6"= 1'
ac1ft_1ft | 1'= 1'
ac1_1 | 1:1
ac1_2 | 1:2
ac1_4 | 1:4
ac1_8 | 1:8
ac1_10 | 1:10
ac1_16 | 1:16
ac1_20 | 1:20
ac1_30 | 1:30
ac1_40 | 1:40
ac1_50 | 1:50
ac1_100 | 1:100
ac2_1 | 2:1
ac4_1 | 4:1
ac8_1 | 8:1
ac10_1 | 10:1
ac100_1 | 100:1

Remarks

To set the viewport to a custom scale, set this property to acVpCustomScale and then use the CustomScale property to define the custom scale value.

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.


StartAngle property [ActiveX and VBA Reference: AAR]

StartAngle Property

Specifies the start angle of an arc or an ellipse.

See Also | Example

Signature

object.StartAngle

object

Arc, Ellipse
The object or objects this property applies to.

StartAngle

Double; read-write
The start angle in radians.

Remarks

EndAngle

StartAngle


StartDraftAngle property [ActiveX and VBA Reference: AAR]

StartDraftAngle property

Specifies the draft angle of the surface for the first cross section.

See Also | Example

Signature

object.StartDraftAngle

object

LoftedSurface
The object or objects to which this property applies.

StartDraftAngle

Long; input/output


StartDraftMagnitude property [ActiveX and VBA Reference: AAR]

StartDraftMagnitude property

Specifies the draft magnitude of the surface for the first cross section.

See Also | Example

Signature

object.StartDraftMagnitude

object

LoftedSurface
The object or objects to which this property applies.

StartDraftMagnitude

Long; input/output


StartParameter property [ActiveX and VBA Reference: AAR]

StartParameter Property

Specifies the start parameter for an ellipse.

See Also | Example

Signature

object.StartParameter

object

Ellipse
The object or objects this property applies to.

StartParameter

Double; read-write
The valid range is 0 to 2*PI.

Remarks

The start and end parameters of the ellipse are calculated based on the following equation:

P(Theta) = A * cos(Theta) + B * sin(Theta)

where A and B are the semimajor and -minor axes respectively.

For example, if your start angle is Theta1, the corresponding start parameter is P(Theta1) calculated based on the above formula. Similarly, if your end angle is Theta2, the corresponding end parameter is P(Theta2) calculated based on the above formula.

You can use either angle or parameter to create the ellipse.


StartPoint property [ActiveX and VBA Reference: AAR]

StartPoint Property

Specifies the start point for the arc, line, or ellipse.

See Also | Example

Signature

object.StartPoint

object

Arc, Ellipse, Line
The object or objects this property applies to.

StartPoint

Variant (three-element array of doubles);
For the Arc and Ellipse objects this property is read-only.
For the Line object this property is read-write.
The 3D WCS coordinate representing the start point for the object.

Remarks

The start point for an arc, ellipse, and line

You cannot change the start point of an arc or ellipse. To edit an arc, use the EndAngle and Radius properties. To edit an ellipse, use the EndAngle, MajorAxis, and RadiusRatio properties.


State property [ActiveX and VBA Reference: AAR]

State property

Specifies section object type.

See Also | Example

Signature

object.State

object

Section
The object or objects to which this property applies.

State

AcSectionState; input/output


StatusID property [ActiveX and VBA Reference: AAR]

StatusID Property

Gets the current active status of the viewport.

See Also | Example

Signature

RetVal = object.StatusID (VportObj)

object

Application
The object or objects this property applies to.

VportObj

Viewport; input-only; required
The viewport to query the status of.

RetVal

Boolean; read-only

TRUE: The specified viewport is the current active viewport.

FALSE: The specified viewport is not the current active viewport.


StoreSQLIndex property [ActiveX and VBA Reference: AAR]

StoreSQLIndex Property

Determines if the SQL index is stored in the drawing.

See Also | Example

Signature

object.StoreSQLIndex

object

PreferencesSystem
The object or objects this property applies to.

StoreSQLIndex

Boolean; read-write

TRUE: Stores the SQL index in the drawing.

FALSE: Does not store the SQL index in the drawing.

Remarks

The initial value for this property is TRUE.


StyleName property [ActiveX and VBA Reference: AAR]

StyleName Property

Specifies the name of the style used with the object.

See Also | Example

Signature

object.StyleName

object

Attribute, AttributeReference, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Leader, MLine, MText, Text, Tolerance
The object or objects this property applies to.

StyleName

String; read-write
(For the MLine object, this property is read-only.)
The default equals the current style.

System variables

For dimensions, the value of this property is stored in the DIMSTYLE system variable.

Remarks

Use the TextStyle object to change the attributes of a given text style. Use the DimStyle object to change the attributes of a given dimension style.

The name given must already be defined in the drawing.


StyleName property [ActiveX and VBA Reference: AAR]

StyleName Property

Specifies the name of the table style.

See Also | Example

Signature

object.StyleName

Object

Table
The object or objects this property applies to.

StyleName

String; read-write
The name of the table style.


StyleSheet property [ActiveX and VBA Reference: AAR]

StyleSheet Property

Specifies the style sheet for the layout or plot configuration.

See Also | Example

Signature

object.StyleSheet

object

Layout, PlotConfiguration
The object or objects this property applies to.

StyleSheet

String; read-write
The name of the style sheet.


Subject property [ActiveX and VBA Reference: AAR]

Subject Property

Specifies the subject name of the digital ID (certificate).

See Also | Example

Signature

object.Subject

object

SecurityParams
The object or objects this property applies to.

Subject

String; read-write
The subject name of the digital certificate.


Subject property (SummmaryInfo object) [ActiveX and VBA Reference: AAR]

Subject Property

Specifies the subject of the drawing.

See Also | Example

Signature

object.Subject

object

SummaryInfo
The object or objects this property applies to.

Subject

String; read-write
The Subject property of a drawing.

Remarks

You can use the subject name to group drawings that have the same subject.


SubMenu property [ActiveX and VBA Reference: AAR]

SubMenu Property

Gets the popup menu associated with a sub menu.

See Also | Example

Signature

object.SubMenu

object

PopupMenuItem
The object or objects this property applies to.

SubMenu

PopupMenu; read-only
The popup menu associated with the sub menu.

Remarks

If the popup menu item is not a sub menu, this property returns an error.


SummaryInfo property [ActiveX and VBA Reference: AAR]

SummaryInfo Property

Specifies the properties of a drawing.

See Also | Example

Signature

object.SummaryInfo

object

Document
The object or objects this property applies to.

SummaryInfo

SummaryInfo object.

Remarks

This property is used to change the properties of a drawing.


SupportPath property [ActiveX and VBA Reference: AAR]

SupportPath Property

Specifies the directories where AutoCAD searches for support files.

See Also | Example

Signature

object.SupportPath

object

PreferencesFiles
The object or objects this property applies to.

SupportPath

String; read-write
The directories in which support files are located. Specify a drive letter and path for support, fonts, help, and bonus files.

Remarks

Use a semicolon (;) to separate multiple directories; however, do not end the string with a semicolon.


SuppressLeadingZeros property [ActiveX and VBA Reference: AAR]

SuppressLeadingZeros Property

Specifies the suppression of leading zeros in dimension values.

See Also | Example

Signature

object.SuppressLeadingZeros

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

SuppressLeadingZeros

Boolean; read-write

TRUE: Suppress leading zeros in decimal dimensions. For example, 0.5000 becomes .5000.

FALSE: Do not suppress leading zeros in decimal dimensions.

System variables

This value overrides the value for the DIMZIN system variable.

Remarks

The initial value for this property is FALSE.


SuppressTrailingZeros property [ActiveX and VBA Reference: AAR]

SuppressTrailingZeros Property

Specifies the suppression of trailing zeros in dimension values.

See Also | Example

Signature

object.SuppressTrailingZeros

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

SuppressTrailingZeros

Boolean; read-write

TRUE: Suppress trailing zeros in decimal dimensions. For example, 12.5000 becomes 12.5.

FALSE: Do not suppress trailing zeros in decimal dimensions.

System variables

This value overrides the value for the DIMZIN system variable.

Remarks

The initial value for this property is FALSE.


SuppressZeroFeet property [ActiveX and VBA Reference: AAR]

SuppressZeroFeet Property

Specifies the suppression of a zero foot measurement in dimension values.

See Also | Example

Signature

object.SuppressZeroFeet

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

SuppressZeroFeet

Boolean; read-write

TRUE: Suppress the display of a zero foot measurement.

FALSE: Do not suppress the display of a zero foot measurement.

System variables

This property overrides the value for the DIMZIN system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


SuppressZeroInches property [ActiveX and VBA Reference: AAR]

SuppressZeroInches Property

Specifies the suppression of a zero inch measurement in dimension values.

See Also | Example

Signature

object.SuppressZeroInches

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

SuppressZeroInches

Boolean; read-write

TRUE: Suppress the display of a zero inch measurement.

FALSE: Do not suppress the display of a zero inch measurement.

System variables

This property overrides the value for the DIMZIN system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


SurfaceNormals property [ActiveX and VBA Reference: AAR]

SurfaceNormals property

Specifies for which cross-section curves the surface is normal to the cross section.

See Also | Example

Signature

object.SurfaceNormals

object

LoftedSurface
The object or objects to which this property applies.

SurfaceNormals

Long; input/output


SurfaceType property [ActiveX and VBA Reference: AAR]

SurfaceType property

Indicates the type of surface.

See Also | Example

Signature

object.SurfaceType

object

Surface
The object or objects to which this property applies.

SurfaceType

String; input-only


SymbolPosition property [ActiveX and VBA Reference: AAR]

SymbolPosition Property

Specifies placement of the arc length dimension symbol.

Signature

object.SymbolPosition

object

DimArcLength
The object or objects this property applies to.

SymbolPosition

AcDimArcLengthSymbol enum; the symbol position

acSymAbove

acSymInFront

acSymNone


System property [ActiveX and VBA Reference: AAR]

System Property

Gets the PreferencesSystem object.

See Also | Example

Signature

object.System

object

Preferences
The object or objects this property applies to.

System

PreferencesSystem; read-only
Gets the PreferencesSystem object.

Remarks

The PreferencesSystem object holds all the options from the System tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


TableBreakFlowDirection property [ActiveX and VBA Reference: AAR]

TableBreakFlowDirection Property

Determines the direction that parts of the table flow.

See Also | Example

Signature

object.TableBreakFlowDirection

Object

Table
The object or objects this property applies to.

TableBreakFlowDirection

AcTableFlowDirection; read-write
Flag indicating how the break flow direction.


TableBreakHeight property [ActiveX and VBA Reference: AAR]

TableBreakHeight Property

Sets the breaking height for the initial table part and any other table parts that do not have manual heights set.

See Also | Example

Signature

object.TableBreakHeight

Object

Table
The object or objects this property applies to.

TableBreakHeight

Double; read-write
Value for the break height.


TablesReadOnly property [ActiveX and VBA Reference: AAR]

TablesReadOnly Property

Determines whether to open database tables in read-only mode.

See Also | Example

Signature

object.TablesReadOnly

object

PreferencesSystem
The object or objects this property applies to.

TablesReadOnly

Boolean; read-write

TRUE: Open database tables in read-only mode.

FALSE: Open database tables in read-write mode.

Remarks

The initial value for this property is FALSE.


TableStyleOverrides property [ActiveX and VBA Reference: AAR]

TableStyleOverrides Property

Specifies the table style overrides.

See Also | Example

Signature

object.TableStyleOverrides

Object

Table
The object or objects this property applies to.

TableStyleOverrides

Variant; read-only
The table style overrides, which can include values of acTableStyleOverrides enum.


TabOrder property [ActiveX and VBA Reference: AAR]

TabOrder Property

Specifies the tab order of a layout.

See Also | Example

Signature

object.TabOrder

object

Layout
The object or objects this property applies to.

TabOrder

Long; read-write
The tab order for the layout.

Remarks

This property controls the order in which the layouts are displayed in the tab control. The tab order should be unique and sequential among all layouts in the database.

The model space tab must have a tab order of zero (0). Paper space tabs must have a tab order of 1 or greater.


TagString property [ActiveX and VBA Reference: AAR]

TagString Property

Specifies the tag string of the object.

See Also | Example

Signature

object.TagString

object

Attribute, AttributeReference, PopupMenu, PopupMenuItem, Toolbar, ToolbarItem
The object or objects this property applies to.

TagString

String; read-write (read-only for PopupMenu and Toolbar objects)
The tag string of the object.

Remarks

Attribute, AttributeReference: This string identifies each occurrence of the attribute. Enter any characters except spaces or exclamation points. AutoCAD changes lowercase letters to uppercase.

PopupMenu, PopupMenuItem, Toolbar, ToolbarItem: A tag, or name tag, is a string consisting of alphanumeric and underscore (_) characters. This string uniquely identifies the item within a given customization file. This string is automatically assigned when the object is created and is used internally by AutoCAD for toolbar and menu identification. Most developers do not need this level of identification and can safely ignore the TagString property.


TaperAngle property [ActiveX and VBA Reference: AAR]

TaperAngle property

Specifies the taper angle of the extrusion.

See Also | Example

Signature

object.TaperAngle

object

ExtrudedSurface
The object or objects to which this property applies.

TaperAngle

ACAD_ANGLE; input/output


Target property [ActiveX and VBA Reference: AAR]

Target Property

Specifies the target point for the view or viewport.

See Also | Example

Signature

object.Target

object

PViewport, View, Viewport
The object or objects this property applies to.

Target

Variant (three-element array of doubles); read-write
A 3D WCS coordinate representing the target point.

Remarks

The line of sight is drawn from the center to the target point.


TempFileExtension property [ActiveX and VBA Reference: AAR]

TempFileExtension Property

Specifies the extension for temporary files.

See Also | Example

Signature

object.TempFileExtension

object

PreferencesOpenSave
The object or objects this property applies to.

TempFileExtension

String; read-write
This string must be between one and three characters inclusive.

Remarks

The default value for this property is ac$.

The temporary file extension is a one to three character extension that is used for temporary files. In a multiuser environment, you can avoid confusion by specifying a different name for each user.


TempFilePath property [ActiveX and VBA Reference: AAR]

TempFilePath Property

Specifies the directory AutoCAD uses to store temporary files.

See Also | Example

Signature

object.TempFilePath

object

PreferencesFiles
The object or objects this property applies to.

TempFilePath

String; read-write
The drive and path of the directory used for temporary files.


TemplateDwgPath property [ActiveX and VBA Reference: AAR]

TemplateDWGPath Property

Specifies the path for the template files used by the start-up wizards.

See Also | Example

Signature

object.TemplateDWGPath

object

PreferencesFiles
The object or objects this property applies to.

TemplateDWGPath

String; read-write
The drive and path for the template files.


TempXRefPath property [ActiveX and VBA Reference: AAR]

TempXRefPath Property

Specifies the location of external reference files.

See Also | Example

Signature

object.TempXRefPath

object

PreferencesFiles
The object or objects this property applies to.

TempXRefPath

String; read-write
The drive and path of the directory to search for external reference files.

Remarks

This location is used for the copy of the external reference if you choose acEnableWithCopy demand loading on the XRefDemandLoad property.


TextAlignmentPoint property [ActiveX and VBA Reference: AAR]

TextAlignmentPoint Property

Specifies the alignment point for text and attributes.

See Also | Example

Signature

object.TextAlignmentPoint

object

Attribute, AttributeReference, Text
The object or objects this property applies to.

TextAlignmentPoint

Variant (three-element array of doubles); read-write
A 3D WCS coordinate representing the alignment point of the object.

Remarks

Text: This property will be reset to 0, 0, 0 and will become read-only when the Alignment property is set to acAlignmentLeft. To position text whose justification is left, fit, or aligned, use the InsertionPoint property.


TextAlignmentType property [ActiveX and VBA Reference: AAR]

TextAlignmentType Property

Specifies the TextAlignmentType of the mleaderstyle.

See Also | Example

Signature

object.TextAlignmentType

Object

MLeaderStyle
The object this property applies to.

TextAngleType

AcTextAlignmentType; read-write
The text alignment type.


TextAngleType property [ActiveX and VBA Reference: AAR]

TextAngleType Property

Specifies the TextAngleType of the mleaderstyle.

See Also | Example

Signature

object.TextAngleType

Object

MLeaderStyle
The object this property applies to.

TextAngleType

AcTextAngleType; read-write
The text angle type.


TextAttachmentType property [ActiveX and VBA Reference: AAR]

TextAttachmentType Property

Specify how leaders connect with the text.

See Also | Example

Signature

object.TextAttachmentType

Object

MLeader Object
The object this property applies to.

TextAttachmentType

AcTextAttachmentType; read-write


TextBackgroundFill property [ActiveX and VBA Reference: AAR]

TextBackgroundFill Property

Specifies if Background Mask ought to be used.

See Also | Example

Signature

object.TextBackgroundFill

Object

MLeader Object
The object this property applies to.

TextBackgroundFill

Boolean; read-write


TextColor property [ActiveX and VBA Reference: AAR]

TextColor Property

Specifies the color of the text for dimension and tolerance objects.

See Also | Example

Signature

object.TextColor

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, MLeaderStyle, Tolerance
The object or objects this property applies to.

TextColor

acColor enum; read-write
Use a color index number from 0 to 256, or one of the constants listed here:

acByBlock

acByLayer

acRed

acYellow

acGreen

acCyan

acBlue

acMagenta

acWhite

System variables

This property overrides the value of the DIMCLRT system variable for the given dimension or tolerance object.

Remarks

Colors can be set and read as numeric index values ranging from 0 to 256. Constants have been provided for the standard seven colors, as well as the BYBLOCK and BYLAYER designations.

If you use acByBlock, AutoCAD draws new objects in the default color (white or black, depending on your configuration) until they are grouped into the block. When the block is inserted in the drawing, the objects in the block inherit the current setting of the color property.

If you use acByLayer, new objects assume the color of the layer upon which they are drawn.


TextDirection property [ActiveX and VBA Reference: AAR]

TextDirection Property

Specifies the drawing direction of the Mtext.

See Also | Example

Signature

object.TextDirection

Object

MLeader Object
The object this property applies to.

TextDirection

AcDrawingDirection; read-write


TextEditor property [ActiveX and VBA Reference: AAR]

TextEditor Property

Specifies the name of the text editor for the MTEXT command.

See Also | Example

Signature

object.TextEditor

object

PreferencesFiles
The object or objects this property applies to.

TextEditor

String; read-write
The name of the multiline text editor.


TextFill property [ActiveX and VBA Reference: AAR]

TextFill property

Sets fill color On or Off (DIMTFILL system variable)

See Also | Example

Signature

object.TextFill

object

Dimension
The object or objects to which this property applies.

TextFill

Boolean; input/output


TextFillColor property [ActiveX and VBA Reference: AAR]

TextFillColor property

Sets text fill color (DIMTFILLCLR system variable).

See Also | Example

Signature

object.TextFillColor

object

Dimension
The object or objects to which this property applies.

TextFillColor

ACAD_COLOR; input/output


TextFont property [ActiveX and VBA Reference: AAR]

TextFont Property

Specifies the font for new text.

See Also | Example

Signature

object.TextFont

object

PreferencesDisplay
The object or objects this property applies to.

TextFont

String; read-write
The name of the new font.

Remarks

The initial value for this property is Courier.


TextFontSize property [ActiveX and VBA Reference: AAR]

TextFontSize Property

Specifies the font size for new text.

See Also | Example

Signature

object.TextFontSize

object

PreferencesDisplay
The object or objects this property applies to.

TextFontSize

Integer; read-write
The font size for new text. The limit for the font size is determined by the font.

Remarks

The initial value for this property is 10.


TextFontStyle property [ActiveX and VBA Reference: AAR]

TextFontStyle Property

Specifies the font style for new text.

See Also | Example

Signature

object.TextFontStyle

object

PreferencesDisplay
The object or objects this property applies to.

TextFontStyle

acTextFontStyle enum; read-write

acFontRegular

acFontItalic

acFontBold

acFontBoldItalic

Remarks

The initial value for this property is acFontRegular.


TextFrameDisplay property [ActiveX and VBA Reference: AAR]

TextFrameDisplay Property

Toggles the display of frames for text objects instead of displaying the text itself.

See Also | Example

Signature

object.TextFrameDisplay

object

DatabasePreferences
The object or objects this property applies to.

TextFrameDisplay

Boolean; read-write

TRUE: Displays the frame around the extents of the text, but does not display the text itself.

FALSE: Displays the full text.

System variables

The value of this property is stored in the QTEXTMODE system variable.

Remarks

The initial value for this property is FALSE.

After you enable or disable this option, you must use the Regen method to update the display.


TextGap property [ActiveX and VBA Reference: AAR]

TextGap Property

Specifies the distance between the dimension text and the dimension line when you break the dimension line to accommodate dimension text.

See Also | Example

Signature

object.TextGap

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Leader
The object or objects this property applies to.

TextGap

Double; read-write
A real number specifying the gap distance.

System variables

This property overrides the value of the DIMGAP system variable for the given dimension.

Remarks

This property also sets the gap between the annotation and a hook line on a Leader object.

A negative value creates basic dimensioning (dimension text with a box around the text).


TextGenerationFlag property [ActiveX and VBA Reference: AAR]

TextGenerationFlag Property

Specifies the attribute text generation flag.

See Also | Example

Signature

object.TextGenerationFlag

object

Attribute, AttributeReference, Text, TextStyle
The object or objects this property applies to.

TextGenerationFlag

acTextGenerationFlag enum; read-write

acTextFlagBackward

acTextFlagUpsideDown

Remarks

To specify both flags, add them together.


TextHeight property [ActiveX and VBA Reference: AAR]

TextHeight Property

Specifies the height for the dimension or tolerance text.

See Also | Example

Signature

object.TextHeight

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, MLeaderStyle, Tolerance
The object or objects this property applies to.

TextHeight

Double; read-write
The height for the dimension text.

System variables

This property overrides the value of the DIMTXT system variable for the given dimension.

Remarks

The initial value for this property is 0.1800.

If the current text style has a fixed text height, this property is ignored.


TextInside property [ActiveX and VBA Reference: AAR]

TextInside Property

Specifies if the dimension text is to be drawn inside the extension lines.

See Also | Example

Signature

object.TextInside

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextInside

Boolean; read-write

TRUE: Force the dimension text between the extension lines.

FALSE: Draw dimension text inside the extension lines only if there is sufficient room.

System variables

This property overrides the value of the DIMTIX system variable for the given dimension.

Remarks

The initial value for this property is TRUE.

Setting this property to FALSE has varying results. For linear and angular dimensions, AutoCAD places text inside the extension lines if there is sufficient room. For radius and diameter dimensions that don't fit inside the circle or arc, this property has no effect and always forces the text outside the circle or arc.


TextInsideAlign property [ActiveX and VBA Reference: AAR]

TextInsideAlign Property

Specifies the position of dimension text inside the extension lines for all dimension types except ordinate.

See Also | Example

Signature

object.TextInsideAlign

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextInsideAlign

Boolean; read-write

TRUE: Align the text horizontally.

FALSE: Align the text with the dimension line.

System variables

This property overrides the value of the DIMTIH system variable for the given dimension.

Remarks

The initial value for this property is TRUE.

This property is only available when the TextInside property is set to TRUE.


TextJustify property [ActiveX and VBA Reference: AAR]

TextJustify Property

Specifies the attachment point of the Mtext.

See Also | Example

Signature

object.TextJustify

Object

MLeader Object
The object this property applies to.

TextJustify

AcAttachmentPoint; read-write


TextLeftAttachmentType property [ActiveX and VBA Reference: AAR]

TextLeftAttachmentType Property

Specify how leaders on the left side connect with the text.

See Also | Example

Signature

object.TextLeftAttachmentType

Object

MLeader Object, MLeaderStyle
The object this property applies to.

type

AcTextAttachmentType; read-write


TextLineSpacingDistance property [ActiveX and VBA Reference: AAR]

TextLineSpacingDistance Property

Specifies the line spacing distance of the Mtext.

See Also | Example

Signature

object.TextLineSpacingDistance

Object

MLeader Object
The object this property applies to.

TextLineSpacingDistance

Double; read-write


TextLineSpacingFactor property [ActiveX and VBA Reference: AAR]

TextLineSpacingFactor Property

Specifies the line spacing factor of the Mtext.

See Also | Example

Signature

object.TextLineSpacingFactor

Object

MLeader Object
The object this property applies to.

TextLineSpacingFactor

Double; read-write


TextLineSpacingStyle property [ActiveX and VBA Reference: AAR]

TextLineSpacingStyle Property

Specifies the line spacing style of the Mtext.

See Also | Example

Signature

object.TextLineSpacingStyle

Object

MLeader Object
The object this property applies to.

TextLineSpacingStyle

AcLineSpacingStyle; read-write


TextMovement property [ActiveX and VBA Reference: AAR]

TextMovement Property

Specifies how dimension text is drawn when text is moved.

See Also | Example

Signature

object.TextMovement

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextMovement

acDimTextMovement enum; read-write

acDimLineWithText | The dimension line follows the text.
acMoveTextAddLeader | The text moves independently of the dimension line, with a leader drawn from the text to the dimension line.
acMoveTextNoLeader | The text moves independently of the dimension line, with no leader drawn from the text to the dimension line.

System variables

This property overrides the value of the DIMTMOVE system variable for the given dimension.

Remarks

The initial value for this property is acMoveTextNoLeader.


TextOutsideAlign property [ActiveX and VBA Reference: AAR]

TextOutsideAlign Property

Specifies the position of dimension text outside the extension lines for all dimension types except ordinate.

See Also | Example

Signature

object.TextOutsideAlign

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextOutsideAlign

Boolean; read-write

TRUE: Align the text horizontally.

FALSE: Align the text with the dimension line.

System variables

This property overrides the value of the DIMTOH system variable for the given dimension.

Remarks

The initial value for this property is TRUE.


TextOverride property [ActiveX and VBA Reference: AAR]

TextOverride Property

Specifies the text string for the dimension.

See Also | Example

Signature

object.TextOverride

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextOverride

String; read-write
The maximum length is 256 characters.

Remarks

The user string replaces the calculated dimension value. You can revert to the calculated dimension value by setting the text to a NULL string (""). You can append or prepend text to the primary dimension value by using a closed set of brackets (<>) to represent the value. The primary dimension value will replace the brackets when the string is displayed. For example, TextString = "<> mm" will result in a displayed string of "3.5 mm" where the value of the dimension is 3.5. You can also include the secondary dimension value using square brackets ( [] ).


TextPosition property [ActiveX and VBA Reference: AAR]

TextPosition Property

Specifies the dimension text position.

See Also | Example

Signature

object.TextPosition

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextPosition

Variant (three-element array of doubles); read-write
A 3D WCS coordinate representing the text position of the dimension.

Remarks


TextPrecision property [ActiveX and VBA Reference: AAR]

TextPrecision Property

Specifies the precision of angular dimension text.

See Also | Example

Signature

object.TextPrecision

object

DimAngular, Dim3PointAngular
The object or objects this property applies to.

TextPrecision

acDimPrecision enum; read-write
Use one of the following constants to specify precision:

acDimPrecisionZero | 0.
acDimPrecisionOne | 0.0
acDimPrecisionTwo | 0.00
acDimPrecisionThree | 0.000
acDimPrecisionFour | 0.0000
acDimPrecisionFive | 0.00000
acDimPrecisionSix | 0.000000
acDimPrecisionSeven | 0.0000000
acDimPrecisionEight | 0.00000000

System variables

This property overrides the value of the DIMADEC system variable for the given dimension.


TextPrefix property [ActiveX and VBA Reference: AAR]

TextPrefix Property

Specifies the dimension value prefix.

See Also | Example

Signature

object.TextPrefix

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextPrefix

String; read-write
The prefix for the dimension value.

System variables

This property overrides the value of the DIMPOST system variable for the given dimension.

Remarks

The initial value for this property is "".


TextRightAttachmentType property [ActiveX and VBA Reference: AAR]

TextRightAttachmentType Property

Specify how leaders on the right side connect with the text.

See Also | Example

Signature

object.TextRightAttachmentType

Object

MLeader Object, MLeaderStyle
The object this property applies to.

type

AcTextAttachmentType; read-write


TextRotation property [ActiveX and VBA Reference: AAR]

TextRotation Property

Specifies the rotation angle of the dimension text.

See Also | Example

Signature

object.TextRotation

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextRotation

Double; read-write
The angle in radians of the dimension text. The valid range is 0 to 6.28.

Remarks

By default, this value is equal to either 0 degrees, or to the Rotation property, as specified by the dimension style.

Text with 0 degree angle | Text with angle equal to the dimension rotation


TextString property [ActiveX and VBA Reference: AAR]

TextString Property

Specifies the text string for the entity.

See Also | Example

Signature

object.TextString

object

Attribute, AttributeReference, MLeaderStyle, MText, Text, Tolerance
The object or objects this property applies to.

TextString

String; read-write
The maximum length is 256 characters.

Remarks

AttributeReference: This is equivalent to the value of the attribute in AutoCAD.

MText: The text string may contain format codes. You can underline, add a line over text, and create stacked text. You can also change color, font, and text height. You can change the spaces between text characters or increase the width of the characters themselves. To apply formatting, or parse existing text strings for their formatting, use the codes shown in the "Format Multiline Text" section of the ActiveX and VBA Developer's Guide.


TextStyle property [ActiveX and VBA Reference: AAR]

TextStyle Property

Specifies the text style for the dimension or tolerance text.

See Also | Example

Signature

object.TextStyle

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Tolerance
The object or objects this property applies to.

TextStyle

String; read-write
The style for the dimension value.

System variables

This property overrides the value of the DIMTXSTY system variable for the given dimension.

Remarks

The initial value for this property is STANDARD.


TextStyleName property [ActiveX and VBA Reference: AAR]

TextStyleName Property

Specifies the style name of the Mtext.

See Also | Example

Signature

object.TextStyleName

Object

MLeader Object
The object this property applies to.

TextStyleName

String; read-write


TextStyles property [ActiveX and VBA Reference: AAR]

TextStyles Property

Gets the TextStyles collection for the document.

See Also | Example

Signature

object.TextStyles

object

Document
The object or objects this property applies to.

TextStyles

TextStyles collection; read-only
The TextStyles collection for the document.


TextSuffix property [ActiveX and VBA Reference: AAR]

TextSuffix Property

Specifies the dimension value suffix.

See Also | Example

Signature

object.TextSuffix

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TextSuffix

String; read-write
The suffix for the dimension value.

System variables

This property overrides the value of the DIMPOST system variable for the given dimension.

Remarks

The initial value for this property is "".


TextureMapPath property [ActiveX and VBA Reference: AAR]

TextureMapPath Property

Specifies the directory in which AutoCAD searches for rendering texture maps.

See Also | Example

Signature

object.TextureMapPath

object

PreferencesFiles
The object or objects this property applies to.

TextureMapPath

String; read-write
The drive and path of the directory for rendering texture maps.

Remarks

Multiple paths can be entered by using a semicolon (;) to paths.


TextWidth property [ActiveX and VBA Reference: AAR]

TextWidth Property

Specifies the width of the Mtext.

See Also | Example

Signature

object.TextWidth

Object

MLeader Object
The object this property applies to.

TextWidth

Double; read-write


TextWinBackgrndColor property [ActiveX and VBA Reference: AAR]

TextWinBackgrndColor Property

Specifies the background color for the text window.

See Also | Example

Signature

object.TextWinBackgrndColor

object

PreferencesDisplay
The object or objects this property applies to.

TextWinBackgrndColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The default color for this property is the Windows standard window color.


TextWinTextColor property [ActiveX and VBA Reference: AAR]

TextWinTextColor Property

Specifies the text color for the text window.

See Also | Example

Signature

object.TextWinTextColor

object

PreferencesDisplay
The object or objects this property applies to.

TextWinTextColor

OLE_COLOR (constant); read-write

vbBlack

vbRed

vbYellow

vbGreen

vbCyan

vbBlue

vbMagenta

vbWhite

Remarks

The default color for this property is the Windows standard window text color.


Thickness property [ActiveX and VBA Reference: AAR]

Thickness Property

Specifies the distance a 2D AutoCAD object is extruded above or below its elevation.

See Also | Example

Signature

object.Thickness

object

Arc, Attribute, AttributeReference, Circle, LightweightPolyline, Line, Point, Polyline, Shape, Solid, Text, Trace
The object or objects this property applies to.

Thickness

Double; read-write
The default is 0.0.

Remarks

Changing the thickness of an object changes its Z direction thickness.

Changing the thickness of a 3D polyline, dimension, or floating viewport has no effect.


TimeServer property [ActiveX and VBA Reference: AAR]

TimeServer Property

Specifies the name of the time server to be used for a digital signature.

See Also | Example

Signature

object.TimeServer

object

SecurityParams
The object or objects this property applies to.

TimeServer

String; read-write
The name of the time server to be used for a digital signature.

Remarks

If you do not set this property, the time from the local machine is used as the time stamp for the digital signature.


TimeStamp property [ActiveX and VBA Reference: AAR]

TimeStamp Property

Specifies the timestamp of an entry in the File Dependency List.

See Also | Example

Signature

object.TimeStamp

object

FileDependency
The object or objects this property applies to.

TimeStamp

Long; read-only
Current time/date, in number of seconds since 1/1/1980 .


Title property [ActiveX and VBA Reference: AAR]

Title Property

Specifies the title you want to use to locate the drawing.

See Also | Example

Signature

object.Title

Object

SummaryInfo
The object or objects this property applies to.

Title

String; read-write
The Title property of a drawing.


TitleSuppressed property [ActiveX and VBA Reference: AAR]

TitleSuppressed Property

Specifies whether the title of the table is suppressed.

See Also | Example

Signature

object.TitleSuppressed

Object

Table, TableStyle
The object or objects this property applies to.

TitleSuppressed

Boolean; read-write


ToleranceDisplay property [ActiveX and VBA Reference: AAR]

ToleranceDisplay Property

Specifies if tolerances are displayed with the dimension text.

See Also | Example

Signature

object.ToleranceDisplay

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceDisplay

acDimToleranceMethod enum; read-write

acTolNone

acTolSymmetrical

acTolDeviation

acTolLimits

acTolBasic

System variables

This property overrides the value of the DIMTOL system variable for the given dimension.

Remarks

The initial value for this property is acTolNone.


ToleranceHeightScale property [ActiveX and VBA Reference: AAR]

ToleranceHeightScale Property

Specifies a scale factor for the text height of tolerance values relative to the dimension text height.

See Also | Example

Signature

object.ToleranceHeightScale

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceHeightScale

Double; read-write
The scale factor for the tolerance values.

System variables

This property overrides the value of the DIMTFAC system variable for the given dimension.

Remarks

The initial value for this property is 1.0000.

This property is only available when the ToleranceDisplay property is set to any value other than acTolNone.

Use this property for plus and minus tolerance strings when DIMTOL is on and DIMTM is not equal to DIMTP, or when DIMLIM is on.


ToleranceJustification property [ActiveX and VBA Reference: AAR]

ToleranceJustification Property

Specifies the vertical justification of tolerance values relative to the nominal dimension text.

See Also | Example

Signature

object.ToleranceJustification

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceJustification

acDimToleranceJustify enum; read-write

acTolTop

acTolMiddle

acTolBottom

System variables

This property overrides the value of the DIMTOLJ system variable for the given dimension.

Remarks

The initial value for this property is acTolMiddle.

This property is only available when the ToleranceDisplay property is set to any value other than acTolNone.


ToleranceLowerLimit property [ActiveX and VBA Reference: AAR]

ToleranceLowerLimit Property

Specifies the minimum tolerance limit for dimension text.

See Also | Example

Signature

object.ToleranceLowerLimit

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceLowerLimit

Double; read-write
The tolerance lower limit.

System variables

This property overrides the value of the DIMTM system variable for the given dimension.

Remarks

The initial value for this property is 0.0000.

This property is only available when the ToleranceDisplay property is set to acTolDeviation or acTolLimits.


TolerancePrecision property [ActiveX and VBA Reference: AAR]

TolerancePrecision Property

Specifies the precision of tolerance values in primary dimensions.

See Also | Example

Signature

object.TolerancePrecision

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

TolerancePrecision

acDimPrecision enum; read-write
Use one of the following constants to specify precision:

acDimPrecisionZero | 0.
acDimPrecisionOne | 0.0
acDimPrecisionTwo | 0.00
acDimPrecisionThree | 0.000
acDimPrecisionFour | 0.0000
acDimPrecisionFive | 0.00000
acDimPrecisionSix | 0.000000
acDimPrecisionSeven | 0.0000000
acDimPrecisionEight | 0.00000000

System variables

This property overrides the value of the DIMTDEC system variable for the given dimension.

Remarks

The initial value for this property is acDimPrecisionFour.

This property is only available when the ToleranceDisplay property is set to any value other than acTolNone.


ToleranceSuppressLeadingZeros property [ActiveX and VBA Reference: AAR]

ToleranceSuppressLeadingZeros Property

Specifies the suppression of leading zeros in tolerance values.

See Also | Example

Signature

object.ToleranceSuppressLeadingZeros

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceSuppressLeadingZeros

Boolean; read-write

TRUE: Suppress leading zeros in decimal values. For example, 0.5000 becomes .5000.

FALSE: Do not suppress leading zeros in decimal values.

System variables

This value overrides the value for the DIMTZIN system variable.

Remarks

The initial value for this property is FALSE.


ToleranceSuppressTrailingZeros property [ActiveX and VBA Reference: AAR]

ToleranceSuppressTrailingZeros Property

Specifies the suppression of trailing zeros in dimension values.

See Also | Example

Signature

object.ToleranceSuppressTrailingZeros

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceSuppressTrailingZeros

Boolean; read-write

TRUE: Suppress trailing zeros in decimal values. For example, 12.5000 becomes 12.5.

FALSE: Do not suppress trailing zeros in decimal values.

System variables

This value overrides the value for the DIMTZIN system variable.

Remarks

The initial value for this property is FALSE.


ToleranceSuppressZeroFeet property [ActiveX and VBA Reference: AAR]

ToleranceSuppressZeroFeet Property

Specifies the suppression of a zero foot measurement in tolerance values.

See Also | Example

Signature

object.ToleranceSuppressZeroFeet

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceSuppressZeroFeet

Boolean; read-write

TRUE: Suppress the display of a zero foot measurement.

FALSE: Do not suppress the display of a zero foot measurement.

System variables

This property overrides the value for the DIMTZIN system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


ToleranceSuppressZeroInches property [ActiveX and VBA Reference: AAR]

ToleranceSuppressZeroInches Property

Specifies the suppression of a zero inch measurement in tolerance values.

See Also | Example

Signature

object.ToleranceSuppressZeroInches

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceSuppressZeroInches

Boolean; read-write

TRUE: Suppress the display of a zero inch measurement.

FALSE: Do not suppress the display of a zero inch measurement.

System variables

This property overrides the value for the DIMTZIN system variable for the given dimension.

Remarks

The initial value for this property is FALSE.


ToleranceUpperLimit property [ActiveX and VBA Reference: AAR]

ToleranceUpperLimit Property

Specifies the maximum tolerance limit for dimension text.

See Also | Example

Signature

object.ToleranceUpperLimit

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

ToleranceUpperLimit

Double; read-write
The tolerance lower limit.

System variables

This property overrides the value of the DIMTP system variable for the given dimension.

Remarks

The initial value for this property is 0.0000.

This property is only available when the ToleranceDisplay property is set to acTolSymmetrical, acTolDeviation, or acTolLimits.


Toolbars property [ActiveX and VBA Reference: AAR]

Toolbars Property

Gets the Toolbars collection.

See Also | Example

Signature

object.Toolbars

object

MenuGroup object
The object or objects this property applies to.

Toolbars

Toolbars collection; read-only
A user-specified variable declared as a Toolbars collection.


ToolPalettePath property [ActiveX and VBA Reference: AAR]

ToolPalettePath Property

Sets the tool palette path.

See Also | Example

Signature

object.ToolPalettePath

object

PreferencesFiles
The object or objects this property applies to.

ToolPalettePath

String; read-write
The tool palette path.


Top property [ActiveX and VBA Reference: AAR]

Top Property

Specifies the top edge of a toolbar.

See Also | Example

Signature

object.Top

object

Toolbar
The object or objects this property applies to.

Top

Integer; read-write
The top edge of the toolbar.


TopHeight property [ActiveX and VBA Reference: AAR]

TopHeight property

Specifies elevation of section plane top extents relative to the object’s elevation.

See Also | Example

Signature

object.TopHeight

object

Section
The object or objects to which this property applies.

TopHeight

Double; input/output


TopRadius property [ActiveX and VBA Reference: AAR]

TopRadius property

Specifies the top radius of the helix.

See Also | Example

Signature

object.TopRadius

object

Helix
The object or objects to which this property applies.

TopRadius

Double; input/output


TotalAngle property [ActiveX and VBA Reference: AAR]

TotalAngle Property

Gets the total angle for the arc.

See Also | Example

Signature

object.TotalAngle

object

Arc object
The object or objects this property applies to.

TotalAngle

Double; read-only
The total length of the arc in radians.


TotalLength property [ActiveX and VBA Reference: AAR]

TotalLength property

Specifies the total length of the helix.

See Also | Example

Signature

object.TotalLength

object

Helix
The object or objects to which this property applies.

TotalLength

Double; input-only


TranslateIDs property [ActiveX and VBA Reference: AAR]

TranslateIDs Property

Specifies the translation of any contained object IDs during deepClone or wblockClone operations.

See Also | Example

Signature

object.TranslateIDs

Object

XRecord
The object or objects this property applies to.

TranslateIDs

Boolean; read-write

TRUE: Translate contained IDs during deepClone and wblockClone operations.

FALSE: Do not translate contained IDs during deepClone and wblockClone operations.


Transparency property [ActiveX and VBA Reference: AAR]

Transparency Property

Specifies if the transparency for a particular bitonal image is on or off.

See Also | Example

Signature

object.Transparency

object

Raster

Transparency

Boolean; read-write

TRUE: Transparency is on.

FALSE: Transparency is off.

Remarks

Bitonal raster images are images consisting only of a foreground and a background color. When you attach a bitonal image, the entire image inherits current layer settings for color. In addition to the modifications you can make to any attached image, you can modify bitonal images by turning the transparency of the background on and off.

NOTE Bitonal images and bitonal image boundaries are always the same color.


TrueColor property [ActiveX and VBA Reference: AAR]

TrueColor Property

Specifies the True Color of an object.

See Also | Example

Signature

object.TrueColor

object

All Drawing objects, Group, Layer
The object or objects this property applies to.

TrueColor

AcCmColor object.

Remarks

This property is used to change an object's color. Colors are identified by an AcCmColor object. This object can hold an RGB value, an ACI number (an integer from 1 to 255), or a named color. Using an RGB value, you can choose from millions of colors.


TrueColorImages property [ActiveX and VBA Reference: AAR]

TrueColorImages Property

Determines if raster and render images are displayed at true color or palletized color.

See Also | Example

Signature

object.TrueColorImages

object

PreferencesDisplay
The object or objects this property applies to.

TrueColorImages

Boolean; read-write

TRUE: Displays raster and render images at the highest color resolution the operating system is capable of.

FALSE: Displays raster and render images in palette colors.

Remarks

The initial value for this property is FALSE.


TurnHeight property [ActiveX and VBA Reference: AAR]

TurnHeight property

Specifies the height of one full turn for the helix.

See Also | Example

Signature

object.TurnHeight

object

Helix
The object or objects to which this property applies.

TurnHeight

Double; input/output


Turns property [ActiveX and VBA Reference: AAR]

Turns property

Specifies the number of turns for the helix.

See Also | Example

Signature

object.Turns

object

Helix
The object or objects to which this property applies.

Turns

ACAD_NOUNITS; input/output


TurnSlope property [ActiveX and VBA Reference: AAR]

TurnSlope property

Displays the constant incline angle for the helix path.

See Also | Example

Signature

object.TurnSlope

object

Helix
The object or objects to which this property applies.

TurnSlope

ACAD_ANGLE; input-only


Twist property [ActiveX and VBA Reference: AAR]

Twist property

Controls the twist direction of the helix.

See Also | Example

Signature

object.Twist

object

Helix
The object or objects to which this property applies.

Twist

AcHelixTwistType; input/output


Twist property [ActiveX and VBA Reference: AAR]

Twist property

Specifies the amount of rotation along the entire length of the sweep path.

See Also | Example

Signature

object.Twist

object

SweptSurface
The object or objects to which this property applies.

Twist

ACAD_ANGLE; input/output


TwistAngle property [ActiveX and VBA Reference: AAR]

TwistAngle Property

Specifies the twist angle for the viewport.

See Also | Example

Signature

object.TwistAngle

object

PViewport
The object or objects this property applies to.

TwistAngle

Double; read-write
The twist angle in radians.

Remarks

This method twists or tilts the view around the line of sight. AutoCAD measures the twist angle counterclockwise, with 0 degrees to the right.


Type property [ActiveX and VBA Reference: AAR]

Type Property

Specifies type of a Leader, MenuGroup, PopupMenuItem, ToolbarItem, Polyline, or PolygonMesh object.

See Also | Example

Signature

object.Type

object

3DPolyline , Layout, Leader, MenuGroup, PlotConfiguration, Polyline, PolygonMesh, PopupMenuItem, ToolbarItem
The object or objects this property applies to.

Type

Integer;

Leader uses the acLeaderType enum; read-write

acLineNoArrow | A line with no arrow.
acLineWithArrow | A line with arrow.
acSplineNoArrow | A spline with no arrow.
acSplineWithArrow | A spline with arrow.

MenuGroup uses the acMenuGroupType enum; read-only

acBaseMenuGroup | The base menu group.
acPartialMenuGroup | A partial menu group.

PopupMenuItem uses the acMenuItemType enum; read-only

acMenuItem | A menu item.
acMenuSeparator | A menu separator.
acMenuSubMenu | A sub menu.

ToolbarItem uses the acToolbarItemType enum; read-only

acToolbarButton | A generic button.
acToolbarFlyout | A flyout button.
acToolbarControl | A control button.
acToolbarSeparator | A separator.

3DPolyline uses the ac3DPolylineType enum; read-write

acSimple3DPoly | A simple polyline.
acQuadSpline3DPoly | A quadratic B-spline polyline.
acCubicSpline3DPoly | A cubic B-spline polyline.

Polyline uses the acPolylineType enum; read-write

acSimplePoly | A simple polyline.
acFitCurvePoly | A fit curve polyline.
acQuadSplinePoly | A quadratic B-spline polyline.
acCubicSplinePoly | A cubic B-spline polyline.

PolygonMesh uses the acPolymeshType enum; read-write

acSimpleMesh | A simple mesh with no surface fitting or smoothing.
acQuadSurfaceMesh | A quadratic B-spline surface fit.
acCubicSurfaceMesh | A cubic B-spline surface fit.
acBezierSurfaceMesh | A Bezier surface fit.

Layout and PlotConfiguration use the acPlotType enum; read-write

acDisplay | Prints everything that is in the current display.
acExtents | Print everything that falls within the extents of the currently selected space.
acLimits | Prints everything that is in the limits of the current space.
acView | Prints the view named by the ViewToPlot property.
acWindow | Prints everything in the window specified by the SetWindowToPlot method.
acLayout | Prints everything that falls within the margins of the specified paper size with the origin being calculated from 0,0 coordinate location in the Layout tab. This option is not available when printing from model space.

Remarks

PolygonMesh: If the PolygonMesh type is set to acSimpleMesh then the M and N vertex count values will be used for vertex row column sizes. For any other PolygonMesh type, the M and N density values will be used as the row and column sizes.


UCSIconAtOrigin property [ActiveX and VBA Reference: AAR]

UCSIconAtOrigin Property

Specifies if the UCS icon is displayed at the origin.

See Also | Example

Signature

object.UCSIconAtOrigin

object

PViewport, Viewport
The object or objects this property applies to.

UCSIconAtOrigin

Boolean; read-write

TRUE: The UCS icon is displayed at the origin.

FALSE: The UCS icon is not displayed at the origin.

Remarks

If the UCS icon is on (see the UCSIconOn property) and is not displayed at the origin, it is displayed at the WCS coordinate defined by the UCSORG system variable.


UCSIconOn property [ActiveX and VBA Reference: AAR]

UCSIconOn Property

Specifies if the UCS icon is on.

See Also | Example

Signature

object.UCSIconOn

object

PViewport, Viewport
The object or objects this property applies to.

UCSIconOn

Boolean; read-write

TRUE: The UCS icon is on.

FALSE: The UCS icon is off.


UCSPerViewport property [ActiveX and VBA Reference: AAR]

UCSPerViewport Property

Specifies if the UCS is saved with the viewport.

See Also | Example

Signature

object.UCSPerViewport

object

PViewport
The object or objects this property applies to.

UCSPerViewport

Boolean; read-write

TRUE: The UCS is saved with the viewport.

FALSE: The UCS is not saved with the viewport.


UIsolineDensity property [ActiveX and VBA Reference: AAR]

UIsolineDensity property

Specifies the number of U isolines that are displayed.

See Also | Example

Signature

object.UIsolineDensity

object

Surface
The object or objects to which this property applies.

UIsolineDensity

Long; input/output


UnderlayLayerOverrideApplied property [ActiveX and VBA Reference: AAR]

UnderlayLayerOverrideApplied property

Determines whether underlay layver overrides are applied or not.

See Also | Example

Signature

object.UnderlayLayerOverrideApplied

object

DwfUnderlay
The object or objects to which this property applies.

UnderlayLayerOverrideApplied

Boolean; input/output


UnderlayName property [ActiveX and VBA Reference: AAR]

UnderlayName property

Specifies the name of the underlay file.

See Also | Example

Signature

object.UnderlayName

object

DwfUnderlay
The object or objects to which this property applies.

UnderlayName

String; input/output


UnderlayVisibility property [ActiveX and VBA Reference: AAR]

UnderlayVisibility property

Specifies the visibility of the underlay file.

See Also | Example

Signature

object.UnderlayVisibility

object

DwfUnderlay
The object or objects to which this property applies.

UnderlayVisibility

Bool; input/output


Units property [ActiveX and VBA Reference: AAR]

Units Property

Specifies the native units of measure for the block.

Signature

object.Units

object

Block
The object or objects this property applies to.

Units

AcInsertUnits enum; read-write

acInsertUnitsAngstroms

acInsertUnitsAstronomicalUnits

acInsertUnitsCentimeters

acInsertUnitsDecameters

acInsertUnitsDecimeters

acInsertUnitsFeet

acInsertUnitsGigameters

acInsertUnitsHectometers

acInsertUnitsInches

acInsertUnitsKilometers

acInsertUnitsLightYears

acInsertUnitsMeters

acInsertUnitsMicroinches

acInsertUnitsMicrons

acInsertUnitsMiles

acInsertUnitsMillimeters

acInsertUnitsMils

acInsertUnitsNanometers

acInsertUnitsParsecs

acInsertUnitsUnitless

acInsertUnitsYards

Remarks

Note To access this property, use the IAcadBlock3 interface.


UnitsFormat property [ActiveX and VBA Reference: AAR]

UnitsFormat Property

Specifies the unit format for all dimensions except angular.

See Also | Example

Signature

object.UnitsFormat

object

DimAligned, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated
The object or objects this property applies to.

UnitsFormat

acDimLUnits enum; read-write

acDimLScientific

acDimLDecimal

acDimLEngineering

acDimLArchitectural

acDimLFractional

acDimLWindowsDesktop

SystemVariables

This property overrides the value of the DIMLUNIT system variable for the given dimension.

Remarks

The initial value for this property is acDimLDecimal.

If this property is set to acDimLDecimal, the format specified by the DecimalSeparator and PrimaryUnitsPrecision properties will be used to format the decimal value.

To create a stacked architectural or fractional unit format, use the FractionFormat property.


UnitsType property [ActiveX and VBA Reference: AAR]

UnitsType Property

Specifies the current display units type for the property.

Signature

object.UnitsType

object

DynamicBlockReferenceProperty
The object or objects this property applies to.

UnitsType

AcDynamicBlockReferencePropertyUnitsType enum; read-only

acNoUnits

acAngular

acDistance

acArea


UpperRightCorner property [ActiveX and VBA Reference: AAR]

UpperRightCorner Property

Gets the upper-right corner of the current active viewport.

See Also | Example

Signature

object.UpperRightCorner

object

Viewport
The object or objects this property applies to.

UpperRightCorner

Variant (two element array of doubles); read-only
A 2D coordinate representing the upper-right corner of the current active viewport.

Remarks

The LowerLeftCorner and UpperRightCorner properties represent the graphic placement of the viewport on the display. These properties are defined as follows:

Viewport 1—LowerLeftCorner = (0, .5), UpperRightCorner = (.5, 1)

Viewport 2—LowerLeftCorner = (.5, .5), UpperRightCorner = (1, 1)

Viewport 3—LowerLeftCorner = (0, 0), UpperRightCorner = (.5, .5)

Viewport 4—LowerLeftCorner = (.5, 0), UpperRightCorner = (1, .5)


UpsideDown property [ActiveX and VBA Reference: AAR]

UpsideDown Property

Specifies the direction of text.

See Also | Example

Signature

object.UpsideDown

object

Attribute, AttributeReference, Text
The object or objects this property applies to.

UpsideDown

Boolean; read-write

TRUE: The text is upside down.

FALSE: The text is not upside down.


URL property [ActiveX and VBA Reference: AAR]

URL Property

Specifies the URL for the Hyperlink object.

See Also | Example

Signature

object.URL

object

Hyperlink
The object or objects this property applies to.

URL

String; read-write
A string representing the URL for the Hyperlink object.

Remarks

The file can be stored locally, on a network drive, or on an Internet or intranet location.


URLDescription property [ActiveX and VBA Reference: AAR]

URLDescription Property

Specifies the URL description for the Hyperlink object.

See Also | Example

Signature

object.URLDescription

object

Hyperlink
The object or objects this property applies to.

URLDescription

String; read-write
A string representing the description of the URL for the Hyperlink object.

Remarks

This is useful in cases where the name or URL of the file is not very helpful in identifying the contents of the file.


URLNamedLocation property [ActiveX and VBA Reference: AAR]

URLNamedLocation Property

Specifies the named location for the Hyperlink object.

See Also | Example

Signature

object.URLNamedLocation

object

Hyperlink
The object or objects this property applies to.

URLNamedLocation

String; read-write
A string representing the named location for the Hyperlink object.

Remarks

This property specifies a given location, such as a named view in AutoCAD or a bookmark in a word processing program. If you specify a named view to jump to in an AutoCAD drawing, AutoCAD restores that view when the hyperlink is opened. Views that are created in model space are restored in the Model tab. Views that are created in paper space are restored in the last active layout tab.


Used property [ActiveX and VBA Reference: AAR]

Used Property

Specifies whether a layer is in use.

See Also | Example

Signature

object.Used

Object

Layer
The object or objects this property applies to.

Used

Boolean; read-only

TRUE: The layer is in use.

FALSE: The layer is not in use.

Remarks

This property specifies whether a layer is in use when the GenerateUsageData method is called.


UseLastPlotSettings property [ActiveX and VBA Reference: AAR]

UseLastPlotSettings Property

Applies the plotting settings of the last successful plot.

See Also | Example

Signature

object.UseLastPlotSettings

object

PreferencesOutput
The object or objects this property applies to.

UseLastPlotSettings

Boolean; read-write

TRUE: Use the settings of the last successful plot as the current plot settings.

FALSE: Do not use the settings of the last successful plot as the current plot settings.


User property [ActiveX and VBA Reference: AAR]

User Property

Gets the PreferencesUser object.

See Also | Example

Signature

object.User

object

Preferences
The object or objects this property applies to.

User

PreferencesUser; read-only
Gets the PreferencesUser object.

Remarks

The PreferencesUser object holds all the options from the User tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.


UserCoordinateSystems [ActiveX and VBA Reference: AAR]

UserCoordinateSystems Property

Gets the UCSs collection for the document.

See Also | Example

Signature

object.UserCoordinateSystems

object

Document
The object or objects this property applies to.

UserCoordinateSystems

UCSs collection; read-only
The UCSs collection for the document.


UseStandardScale property [ActiveX and VBA Reference: AAR]

UseStandardScale Property

Specifies if the plot is to use a standard or custom scale.

See Also | Example

Signature

object.UseStandardScale

object

Layout, PlotConfiguration
The object or objects this property applies to.

UseStandardScale

Boolean; read-write

TRUE: Plot with the standard scale.

FALSE: Plot with a custom scale.

Remarks

To specify the standard scale to use in the plot, use the StandardScale property. To specify a custom scale, use the SetCustomScale method.


Utility property [ActiveX and VBA Reference: AAR]

Utility Property

Gets the Utility object for the document.

See Also | Example

Signature

object.Utility

object

Document
The object or objects this property applies to.

Utility

Utility object; read-only
The Utility object for the document.


Value property [ActiveX and VBA Reference: AAR]

Value Property

Specifies the current value for the property, or the object ID of the newly created cloned object.

See Also | Example

Signature

object.Value

object

DynamicBlockReferenceProperty, IDPair
The object or objects this property applies to.

Value

DynamicBlockReferenceProperty objects: Variant; read-write
The current value for the property.

IDPair objects: Long_PTR; read-only
The object ID of the newly created cloned object in the CopyObjects operation.

Remarks

IDPair: Use the Key property to get the object ID of the source object.

DynamicBlockReferenceProperty: No error is returned if the specified property value could not be set. For example, if the property has a list of allowable values or a minimum-maximum range, and the value provided is not in the list or is out of range, no error is returned.


Value32 property [ActiveX and VBA Reference: AAR]

Value32 Property

Specifies the current value for the property, or the object ID of the newly created cloned object, for a 64-bit system.

See Also | Example

Signature

object.Value32

object

DynamicBlockReferenceProperty, IDPair
The object or objects this property applies to.

Value32

DynamicBlockReferenceProperty objects: Variant; read-write
The current value for the property.

IDPair objects: Long; read-only
The object ID of the newly created cloned object in the CopyObjects operation.

Remarks

IDPair: Use the Key property to get the object ID of the source object.

DynamicBlockReferenceProperty: No error is returned if the specified property value could not be set. For example, if the property has a list of allowable values or a minimum-maximum range, and the value provided is not in the list or is out of range, no error is returned.


VBE property [ActiveX and VBA Reference: AAR]

VBE Property

Gets the VBAIDE extensibility object.

See Also | Example

Signature

object.VBE

object

Application
The object or objects this property applies to.

VBE

Microsoft VBE object; read-only
The VBAIDE extensibility object.

Remarks

This property allows you to access the VBA IDE object model from AutoCAD's object model. The property will throw an exception if the VBAIDE is not available. For example, the VBAIDE is not available if the acvba.arx app has not been loaded.

The following line of code returns the name of the active VBA project description string:

ThisDrawing.Application.VBE.ActiveVBProject.Description


Verify property [ActiveX and VBA Reference: AAR]

Verify Property

Specifies if the attribute is set for verification.

See Also | Example

Signature

object.Verify

object

Attribute
The object or objects this property applies to.

Verify

Boolean; read-write

TRUE: The attribute is set to verify.

FALSE: The attribute is not set to verify.

Remarks

An attribute set to verify prompts the user for verification that the attribute value is correct when inserting the block.

An attribute may exist as only one of four optional modes: constant, preset, invisible, or verify. The AFLAGS system variable stores the current mode settings. You can query the current mode using the Mode property.


Version property [ActiveX and VBA Reference: AAR]

Version Property

Gets the version of the AutoCAD application you are using.

See Also | Example

Signature

object.Version

object

Application
The object or objects this property applies to.

Version

String; read-only
The version of AutoCAD that you are using.

System variables

The value of this property is stored in the ACADVER system variable.


VersionGUID property [ActiveX and VBA Reference: AAR]

VersionGUID Property

Specifies the name of the Version GUID of an entry in the File Dependency List.

See Also | Example

Signature

object.VersionGUID

object

FileDependency
The object or objects this property applies to.

VersionGUID

String; read-only
The version GUID of an entry.


VertCellMargin property [ActiveX and VBA Reference: AAR]

VertCellMargin Property

Specifies the value of the vertical margin of cells.

See Also | Example

Signature

object.VertCellMargin

Object

Table, TableStyle
The object or objects this property applies to.

VertCellMargin

Double; read-write


VerticalDirection property [ActiveX and VBA Reference: AAR]

VerticalDirection property

Specifies the vertical direction for the section plane.

See Also | Example

Signature

object.VerticalDirection

object

Section
The object or objects to which this property applies.

VerticalDirection

Variant; input/output


VerticalTextPosition property [ActiveX and VBA Reference: AAR]

VerticalTextPosition Property

Specifies the vertical position of text in relation to the dimension line.

See Also | Example

Signature

object.VerticalTextPosition

object

Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Leader
The object or objects this property applies to.

VerticalTextPosition

acDimVerticalJustification enum; read-write

acVertCentered | Centers the dimension text between the extension lines.
acAbove | Places the dimension text above the dimension line except when the dimension line is not horizontal and text inside the extension lines is forced horizontal (DIMTIH = 1). The distance from the dimension line to the baseline of the lowest line of text is the current DIMGAP value.
acOutside | Places the dimension text on the side of the dimension line farthest from the defining points.
acJIS | Places the dimension text to conform to Japanese Industrial Standards (JIS).

System variables

This property overrides the value of the DIMTAD system variable for the given dimension, leader, or tolerance object.

Remarks

The initial value for this property is acVertCentered.


Vertices property [ActiveX and VBA Reference: AAR]

Vertices property

Gets the vertices in the section line.

See Also | Example

Signature

object.Vertices

object

Section
The object or objects to which this property applies.

Vertices

Variant; input/output


ViewingDirection property [ActiveX and VBA Reference: AAR]

ViewingDirection property

Specifies the viewing direction for the section plane.

See Also | Example

Signature

object.ViewingDirection

object

Section
The object or objects to which this property applies.

ViewingDirection

Variant; input/output


ViewportDefault property [ActiveX and VBA Reference: AAR]

ViewportDefault Property

Specifies if the layer is to be frozen in new viewports.

See Also | Example

Signature

object.ViewportDefault

object

Layer
The object or objects this property applies to.

ViewportDefault

Boolean; read-write

TRUE: The layer is frozen in new viewports.

FALSE: The layer is not frozen in new viewports.


ViewportOn property [ActiveX and VBA Reference: AAR]

ViewportOn Property

Specifies the display status of the viewport.

See Also | Example

Signature

object.ViewportOn

object

PViewport
The object or objects this property applies to.

ViewportOn

Boolean; read-write

TRUE: The viewport is on.

FALSE: The viewport is off.

Remarks

To turn the display control of a viewport on or off use the Display method.


Viewports property [ActiveX and VBA Reference: AAR]

Viewports Property

Gets the Viewports collection for the document.

See Also | Example

Signature

object.Viewports

object

Document
The object or objects this property applies to.

Viewports

Viewports collection; read-only
The Viewports collection for the document.


Views property [ActiveX and VBA Reference: AAR]

Views Property

Gets the Views collection for the document.

See Also | Example

Signature

object.Views

object

Document
The object or objects this property applies to.

Views

Views collection; read-only
The Views collection for the document.


ViewToPlot property [ActiveX and VBA Reference: AAR]

ViewToPlot Property

Specifies the name of the view to plot.

See Also | Example

Signature

object.ViewToPlot

object

Layout, PlotConfiguration
The object or objects this property applies to.

ViewToPlot

String; read-write
The name of the view to plot.

Remarks

To specify a plot to a view, set the PlotType property for the layout or plot configuration to acView.


VisibilityEdge1 property [ActiveX and VBA Reference: AAR]

VisibilityEdge1 Property

Specifies the visibility of a 3DFace edge 1.

See Also | Example

Signature

object.VisibilityEdge1

object

3DFace
The object or objects this property applies to.

VisibilityEdge1

Boolean; read-write

TRUE: The edge is visible.

FALSE: The edge is invisible.

Remarks

You can also use the GetInvisibleEdge and SetInvisibleEdge methods to query or set the visibility of an edge. Because these methods use an index to specify the edge, they are useful when iterating through all the edges of a face.


VisibilityEdge2 property [ActiveX and VBA Reference: AAR]

VisibilityEdge2 Property

Specifies the visibility of a 3DFace edge 2.

See Also | Example

Signature

object.VisibilityEdge2

object

3DFace
The object or objects this property applies to.

VisibilityEdge2

Boolean; read-write

TRUE: The edge is visible.

FALSE: The edge is invisible.

Remarks

You can also use the GetInvisibleEdge and SetInvisibleEdge methods to query or set the visibility of an edge. Because these methods use an index to specify the edge, they are useful when iterating through all the edges of a face.


VisibilityEdge3 property [ActiveX and VBA Reference: AAR]

VisibilityEdge3 Property

Specifies the visibility of a 3DFace edge 3.

See Also | Example

Signature

object.VisibilityEdge3

object

3DFace
The object or objects this property applies to.

VisibilityEdge3

Boolean; read-write

TRUE: The edge is visible.

FALSE: The edge is invisible.

Remarks

You can also use the GetInvisibleEdge and SetInvisibleEdge methods to query or set the visibility of an edge. Because these methods use an index to specify the edge, they are useful when iterating through all the edges of a face.


VisibilityEdge4 property [ActiveX and VBA Reference: AAR]

VisibilityEdge4 Property

Specifies the visibility of a 3DFace edge 4.

See Also | Example

Signature

object.VisibilityEdge4

object

3DFace
The object or objects this property applies to.

VisibilityEdge4

Boolean; read-write

TRUE: The edge is visible.

FALSE: The edge is invisible.

Remarks

You can also use the GetInvisibleEdge and SetInvisibleEdge methods to query or set the visibility of an edge. Because these methods use an index to specify the edge, they are useful when iterating through all the edges of a face.


Visible property [ActiveX and VBA Reference: AAR]

Visible Property

Specifies the visibility of an object or the application.

See Also | Example

Signature

object.Visible

object

All Drawing objects, Application, AttributeReference, Group, Toolbar
The object or objects this property applies to.

Visible

Boolean; read-write (write-only for the Group object)

TRUE: The object or application is visible.

FALSE: The object or application is not visible.

Remarks

If you specify an object to be invisible, it will be invisible regardless of the application visible setting. Other factors can also cause an object to be invisible; for example, an object will not be displayed if its layer is off or frozen.

Specifying the application to be invisible allows you to run tasks in the background without having to see the component.


VIsolineDensity property [ActiveX and VBA Reference: AAR]

VIsolineDensity property

Specifies the number of V isolines that are displayed.

See Also | Example

Signature

object.VIsolineDensity

object

Surface
The object or objects to which this property applies.

VIsolineDensity

Long; input/output


Volume property [ActiveX and VBA Reference: AAR]

Volume Property

Gets the volume of the solid.

See Also | Example

Signature

object.Volume

object

3DSolid
The object or objects this property applies to.

Volume

Double; read-only
The volume of the solid.


Weights property [ActiveX and VBA Reference: AAR]

Weights Property

Gets the weight vector for spline.

See Also | Example

Signature

object.Weights

object

Spline
The object or objects this property applies to.

Weights

Variant (three-element array of doubles); read-write
The weight vector of the spline.


Width property [ActiveX and VBA Reference: AAR]

Width Property

Specifies the width of the OLE object box.

Signature

object.Width

object

OLE
The object or objects this property applies to.

Width

Double
Read-write
This must be a positive, non-negative number.


Width property [ActiveX and VBA Reference: AAR]

Width Property

Specifies the width of the table.

See Also | Example

Signature

object.Width

Object

Table
The object or objects this property applies to.

Width

Double; read-write
The table width.


Width property [ActiveX and VBA Reference: AAR]

Width Property

Specifies the width of the text boundary, view, image, toolbar, or main application window.

See Also | Example

Signature

object.Width

object

Application, DwfUnderlay, MText, PViewport, Raster, TextStyle, Toolbar, View, Viewport
The object or objects this property applies to.

Width

Double; read-write (except for the Toolbar and Raster objects which are read-only)
The width of the given object. This value must be a positive, non-negative number.

Remarks

MText: Specifies the width of the text boundary in the current units. AutoCAD wraps the text within the text boundary, therefore the width must be a positive number large enough to accommodate the text. If the width is not large enough, the text may be difficult to read or may not be visible at all.

Width

TextStyle: Sets the character spacing. Entering a value of less than 1.0 condenses the text. Entering a value of greater than 1.0 expands it. The maximum value is 100.

Viewport: The width of a viewport is the X axis measurement of the viewport frame.

View: The width of a view is the X axis measurement of the area within a viewport that is used to display the model.

Raster: The width of the raster image in pixels.


WindowLeft property [ActiveX and VBA Reference: AAR]

WindowLeft Property

Specifies the left edge of the application window.

See Also | Example

Signature

object.WindowLeft

object

Application
The object or objects this property applies to.

WindowLeft

Integer; read-write
The left edge of the application window.

Remarks

The left edge of the application is represented by the distance between the left edge of the main application window and the left edge of the screen.

This distance will establish the X coordinate of the upper-left corner of the application. Note that the origin (0, 0) is the top, left corner.


WindowState property [ActiveX and VBA Reference: AAR]

WindowState Property

Specifies the state of the application or document window.

See Also | Example

Signature

object.WindowState

object

Application, Document
The object or objects this property applies to.

WindowState

acWindowState enum; read-write

acMin | The window is minimized.
acMax | The window is maximized.
acNorm | The window is normal (neither minimized nor maximized).


WindowTitle property [ActiveX and VBA Reference: AAR]

WindowTitle Property

Gets the title of the document window.

See Also | Example

Signature

object.WindowTitle

object

Document
The object or objects this property applies to.

WindowTitle

String; read-only
The window title of the document.


WindowTop property [ActiveX and VBA Reference: AAR]

WindowTop Property

Specifies the top edge of the application window.

See Also | Example

Signature

object.WindowTop

object

Application
The object or objects this property applies to.

WindowTop

Integer; read-write
The top edge of the application window.

Remarks

The top edge of the application is determined by the distance from the top edge of the main application window to the top edge of the screen.

This distance will establish the Y coordinate of the upper-left corner of the application. Note that the origin (0, 0) is the top, left corner.


WorkspacePath property [ActiveX and VBA Reference: AAR]

WorkspacePath Property

Specifies the path for the database workspace file.

See Also | Example

Signature

object.WorkspacePath

object

PreferencesFiles
The object or objects this property applies to.

WorkspacePath

String; read-write
The drive, path, and file name of the database workspace file.


XEffectiveScaleFactor property [ActiveX and VBA Reference: AAR]

XEffectiveScaleFactor Property

Specifies the effective XScale factor of the block.

Signature

object.XEffectiveScaleFactor

object

BlockRef, ExternalReference, MInsertBlock
The object or objects this property applies to.

XEffectiveScaleFactor

ACAD_NOUNITS

Remarks

Note To access this property, use the IAcadBlockReference2, IAcadExternalReference2, or IAcadMInsertBlock2 interface.


XRefDatabase property [ActiveX and VBA Reference: AAR]

XRefDatabase Property

Gets the Database object that defines the contents of the block.

See Also | Example

Signature

object.XRefDatabase

object

Block
The object or objects this property applies to.

XRefDatabase

Database object; read-only
The Database object that defines the contents of the block.

Remarks

This property is only available if the IsXRef property for the block equals TRUE.


XRefDemandLoad property [ActiveX and VBA Reference: AAR]

XRefDemandLoad Property

Specifies demand loading of external references.

See Also | Example

Signature

object.XRefDemandLoad

object

PreferencesOpenSave
The object or objects this property applies to.

XRefDemandLoad

acXRefDemandLoad enum; read-write

acDemandLoadDisabled

acDemandLoadEnabled

acDemandLoadEnabledWithCopy

System variables

The value for this property is stored in the XLOADCTL system variable.

Remarks

Demand loading improves performance by loading only the parts of the referenced drawing needed to regenerate the current drawing.

The loading options are:

acDemandLoadDisabled

Turns off demand loading; the entire drawing is loaded.

acDemandLoadEnabled

Turns on demand loading and improves AutoCAD performance. Other users cannot edit the file while it is being referenced.

acDemandLoadEnabledWithCopy

Turns on demand loading but uses a copy of the referenced drawing. Other users can edit the original drawing.

The initial value for this property is acDemandLoadEnabled.


XRefEdit property [ActiveX and VBA Reference: AAR]

XRefEdit Property

Determines if the current drawing can be edited in place when being referenced by another user.

See Also | Example

Signature

object.XRefEdit

object

DatabasePreferences
The object or objects this property applies to.

XRefEdit

Boolean; read-write

TRUE: Allows in-place reference editing.

FALSE: Does not allow in-place reference editing.

System variables

The value of this property is stored in the XEDIT system variable.

Remarks

The initial value of this property is TRUE.


XRefFadeIntensity property [ActiveX and VBA Reference: AAR]

XRefFadeIntensity Property

Controls the dimming intensity for XRefs.

See Also | Example

Signature

object.XRefFadeIntensity

object

PreferencesDisplay
The object or objects this property applies to.

XRefFadeIntensity

Long; read-write
A positive long integer from 1 to 90 representing the percentage of fade for XRefs.

System variables

The value of this property is stored in the XFADECTL system variable.

Remarks

The initial value for this property is 50.


XRefLayerVisibility property [ActiveX and VBA Reference: AAR]

XRefLayerVisibility Property

Determines the visibility of xref-dependent layers and specifies if nested xref path changes are saved.

See Also | Example

Signature

object.XRefLayerVisibility

object

DatabasePreferences
The object or objects this property applies to.

XRefLayerVisibility

Boolean; read-write

TRUE: Xref-dependent layer changes made in the current drawing take precedence.

FALSE: The layer table, as stored in the reference drawing (xref) takes precedence.

System variables

The value of this property is stored in the VISRETAIN system variable.

Remarks

The initial value of this property is TRUE.

When this property is set to TRUE, layer settings are saved with the current drawing's layer table and persist from session to session. Nested xref path changes are saved with the current drawing and persist from session to session.

When this property is set to FALSE, changes made to xref-dependent layers in the current drawing are valid in the current session only, but are not saved with the drawing. When the current drawing is reopened, the layer table is reloaded from the reference drawing and the current drawing reflects those settings. The layer settings affected are: On/Off, Freeze/Thaw, Color, and Linetype. This setting also specifies that changes made to the paths of nested xrefs are for the current session only and are not saved with the drawing.


XScaleFactor property [ActiveX and VBA Reference: AAR]

XScaleFactor Property

Specifies the X scale factor for the block or external reference (xref).

See Also | Example

Signature

object.XScaleFactor

object

BlockRef, ExternalReference; MInsertBlock
The object or objects this property applies to.

XScaleFactor

Double; read-write
A non-zero real number.

Remarks

The initial scale factor is 1.0.


XVector property [ActiveX and VBA Reference: AAR]

XVector Property

Specifies the X direction of the given UCS.

See Also | Example

Signature

object.XVector

object

UCS
The object or objects this property applies to.

XVector

Variant (three-element array of doubles); read-write
A vector specifying the X direction of the given UCS.

System variables

The value of this property is stored in the UCSXDIR system variable.

Remarks

If you change the X vector value on the active UCS, you must reset the active UCS to see the changes. To reset the active UCS, use the ActiveUCS property.


YEffectiveScaleFactor property [ActiveX and VBA Reference: AAR]

YEffectiveScaleFactor Property

Specifies the effective YScale factor of the block.

Signature

object.YEffectiveScaleFactor

object

BlockRef, ExternalReference, MInsertBlock
The object or objects this property applies to.

YEffectiveScaleFactor

ACAD_NOUNITS

Remarks

Note To access this property, use the IAcadBlockReference2, IAcadExternalReference2, or IAcadMInsertBlock2 interface.


YScaleFactor property [ActiveX and VBA Reference: AAR]

YScaleFactor Property

Specifies the Y scale factor for the block or external reference (xref).

See Also | Example

Signature

object.YScaleFactor

object

BlockRef, ExternalReference; MInsertBlock
The object or objects this property applies to.

YScaleFactor

Double; read-write
A non-zero real number.

Remarks

The initial scale factor is 1.0.


YVector property [ActiveX and VBA Reference: AAR]

YVector Property

Specifies the Y direction of the given UCS.

See Also | Example

Signature

object.YVector

object

UCS
The object or objects this property applies to.

YVector

Variant (three-element array of doubles); read-write
A vector specifying the Y direction of the given UCS.

System variables

The value of this property is stored in the UCSYDIR system variable.

Remarks

If you change the Y vector value on the active UCS, you must reset the active UCS to see the changes. To reset the active UCS, use the ActiveUCS property.


ZEffectiveScaleFactor property [ActiveX and VBA Reference: AAR]

ZEffectiveScaleFactor Property

Specifies the effective ZScale factor of the block.

Signature

object.ZEffectiveScaleFactor

object

BlockRef, ExternalReference, MInsertBlock
The object or objects this property applies to.

ZEffectiveScaleFactor

ACAD_NOUNITS

Remarks

Note To access this property, use the IAcadBlockReference2, IAcadExternalReference2, or IAcadMInsertBlock2 interface.


ZScaleFactor property [ActiveX and VBA Reference: AAR]

ZScaleFactor Property

Specifies the Z scale factor for the block or external reference (xref).

See Also | Example

Signature

object.ZScaleFactor

object

BlockRef, ExternalReference; MInsertBlock
The object or objects this property applies to.

ZScaleFactor

Double; read-write
A non-zero real number.

Remarks

The initial scale factor is 1.0.


Objects [ActiveX and VBA Reference: AAR]

Objects

3

3DFace object A 3D triangle or quadrilateral plane section.

3dPolyline object A 3D polyline of straight line segments.

3DSolid object A solid object with free-form surface support.

_DAcadApplicationEvents Interface object The event interface for the AutoCAD application.

_DAcadDocumentEvents Interface object The event interface for the AutoCAD document.

A

AcadState object A special object to use in monitoring the state of AutoCAD from out-of-process applications.

AcCmColor object AutoCAD true color object.

Application object An instance of the AutoCAD application.

Arc object A circular arc.

Attribute object An object appearing as a text string that describes the characteristics of an attribute reference.

AttributeReference object An object containing text that links to a block.

B

Block object A block definition containing a name and a set of objects.

BlockRef object An instance of a block definition inserted into a drawing.

Blocks Collection object The collection of all blocks in the drawing.

C

Circle object A full circle.

D

Database object The contents of an XRef block.

DatabasePreferences object An object that specifies the settings for the current AutoCAD drawing.

DgnUnderlay object Reserved for future use.

Dictionaries Collection object The collection of all dictionaries in the drawing.

Dictionary object A container object for storing and retrieving objects.

Dim3PointAngular object A dimension measuring the angular distance between three points.

DimAligned object A linear dimension, measuring the distance between two points, that is displayed parallel to the points being measured.

DimAngular object A dimension measuring the angular distance between two lines or between the angle of a circular arc.

DimArcLength object A dimension measuring the length of an arc.

DimDiametric object A dimension measuring the diameter of a circle or arc.

DimOrdinate object A dimension measuring the absolute X or Y position of a point from the origin.

DimRadial object A dimension measuring the radius of a circle or arc.

DimRadialLarge object A dimension measuring a large radius, also known as a jogged radius dimension.

DimRotated object A dimension that measures the distance between two points and is displayed at a given rotation.

DimStyle object A group of dimension settings that determines the appearance of a dimension.

DimStyles Collection object The collection of all dimension styles in the drawing.

Document object An AutoCAD drawing.

Documents Collection object The collection of all AutoCAD drawings that are open in the current session.

DwfUnderlay object A source of underlay content.

DynamicBlockReferenceProperty object An object containing the properties of a dynamic block.

E

Ellipse object An elliptical arc or full ellipse.

ExternalReference object An instance of an external reference inserted into a drawing.

ExtrudedSurface object A surface created by extruding an object or a planar face a specified distance and direction.

F

FileDependency object Provides information about entries in the File Dependency List of a drawing file.

G

Group object A named SelectionSet object.

Groups Collection object The collection of all groups in the drawing.

H

Hatch object An area fill consisting of a pattern of lines.

Helix object A helix.

Hyperlink Object A URL and URL description.

I

IAcadDatabase Interface object Provides an interface to the database resident objects in an AutoCAD document.

IAcadDimension Interface object The common interface for AutoCAD dimensions.

IAcadEntity Interface object The standard interface for a basic AutoCAD entity.

IAcadObject Interface object The standard interface for a basic AutoCAD object.

IAcadObjectEvents Interface object The event interface for a basic AutoCAD object.

IDPair object A special object for use with the CopyObjects method that contains the object IDs of both the source and destination objects.

L

Layer object A logical grouping of data, similar to transparent acetate overlays on a drawing.

Layers Collection object The collection of all layers in the drawing.

LayerStateManager object Saves and restores layer settings.

Layout object The plot settings and visual properties of a model space or paper space block.

Layouts Collection object The collection of all layouts in the drawing.

Leader object An object composed of an arrowhead attached to splines or straight line segments.

LightweightPolyline object A 2D line with adjustable width composed of line and arc segments.

Line object A single line segment.

Linetype object The line characteristics consisting of combinations of dashes, dots, and spaces.

Linetypes Collection object The collection of all linetypes in the drawing.

LoftedSurface object A surface created by lofting through a set of two or more curves.

M

Material object The render material characteristics.

Materials object The collection of all materials in the drawing.

MenuBar Collection object A collection of PopupMenu objects representing the current AutoCAD menu bar.

MenuGroup object An AutoCAD menu group.

MenuGroups Collection object A collection of MenuGroup objects representing all the menu groups loaded in the current AutoCAD session.

MInsertBlock object A rectangular array of block references.

MLeader object An object composed of an arrowhead attached to multiple splines or straight line segments.

MLeaderStyle object Adds, modifies, and deletes MLeader styles.

MLine object Multiple parallel lines.

ModelSpace Entities Collection object A special Block object containing all model space entities.

MText object A paragraph of alphanumeric characters that fits within a nonprinting text boundary.

O

OLE object An AutoCAD OLE object.

P

PaperSpace Entities Collection object A special Block object containing all the entities in the active paper space layout.

PlaneSurface object A planar surface.

Plot object The set of methods and properties used for plotting layouts.

PlotConfiguration object A named collection of plot settings.

PlotConfigurations Collection object A collection of named plot settings.

Point object A point marker appearing as a dot, square, circle, X, tick, or plus sign (+); or as a combination of these.

PolyfaceMesh object A three-dimensional polyface mesh.

PolygonMesh object A free-form 3D mesh.

Polyline object A 2D line of adjustable width or a 3D line or mesh of nonadjustable width composed of line and arc segments.

PopupMenu object An AutoCAD cascading menu.

PopupMenuItem object A single menu item on an AutoCAD pull-down menu.

PopupMenus Collection object A collection of PopupMenu objects representing all the popup menus loaded in the MenuGroup.

Preferences object This object specifies the current AutoCAD settings.

PreferencesDisplay object This object contains the options from the Display tab on the Options dialog.

PreferencesDrafting object This object contains the options from the Drafting tab on the Options dialog.

PreferencesFiles object This object contains the options from the Files tab on the Options dialog.

PreferencesOpenSave object This object contains options from the Open and Save tab on the Options dialog.

PreferencesOutput object This object contains the options from the Output tab on the Options dialog.

PreferencesProfiles object This object contains the options from the Profiles tab on the Options dialog.

PreferencesSelection object This object contains the options from the Selection tab on the Options dialog.

PreferencesSystem object This object contains the options from the System tab on the Options dialog.

PreferencesUser object This object contains the options from the User tab on the Options dialog.

PViewport object Rectangular objects created in paper space that display views.

R

Raster object A raster image consisting of a rectangular grid (or raster) of small squares or dots known as pixels.

Ray object A semi-infinite line.

Region object A bounded planar face consisting of lines, circles, arcs, elliptical arcs, and spline curves.

RegisteredApp object An external application that has been added to the drawing.

RegisteredApplications Collection object The collection of all registered applications in the drawing.

RevolvedSurface object A surface created by revolving one or more 2D objects about an axis.

S

Section object A section plane entity created at the intersection of a plane and a solid.

SectionManager object This object manages the collection of section planes in the DWG database.

SectionSettings object A container for section geometry settings.

SectionTypeSettings object The settings that apply to the various types of sections.

SecurityParams object Supplies information necessary for performing security operations on drawing files.

SelectionSet object A group of one or more AutoCAD objects specified for processing as a single unit.

SelectionSets Collection object The collection of all selection sets in the drawing.

ShadowDisplay interface object Interface for AutoCAD entities with shadows.

Shape object An object comprising lines, arcs, and circles defined in an SHX file.

Solid object A solid-filled polygon.

SortentsTable object Contains and manipulates draw order information.

Spline object A quadratic or cubic NURBS (nonuniform rational B-spline) curve.

SubEntity object For internal use only.

SubEntSolidEdge object For internal use only.

SubEntSolidNode object For internal use only.

SubEntSolidVertex object For internal use only.

SummaryInfo object Accesses drawing properties such as the Title, Subject, Author, and Keywords properties.

Surface object A surface entity.

SweptSurface object A surface created by sweeping a 2D curve along a path.

T

Table object AutoCAD table object.

TableStyle object Adds, modifies, and deletes table styles.

Text object A single line of alphanumeric characters.

TextStyle object A named, saved collection of settings that determines the appearance of text characters.

TextStyles Collection object The collection of all text styles in the drawing.

Tolerance object A geometric tolerance contained in a feature control frame.

Toolbar object An AutoCAD toolbar.

ToolbarItem object A single button item on an AutoCAD toolbar.

Toolbars Collection object A collection of Toolbar objects representing all the toolbars loaded in the current AutoCAD session.

Trace object A 2D solid line of specified width.

U

UCS object A user-defined coordinate system that determines the orientation of the X, Y, and Z axes in 3D space.

UCSs Collection object The collection of all user coordinate systems (UCSs) in the drawing.

Utility object A series of methods provided for utility purposes.

V

View object A graphical representation of a 2D drawing or 3D model from a specific location (viewpoint) in space.

Viewport object A bounded area that displays some portion of a drawing's model space.

Viewports Collection object The collection of all viewports in the drawing.

Views Collection object The collection of all views in the drawing.

X

XLine object A construction line that is infinite in both directions.

XRecord object XRecord objects are used to store and manage arbitrary data.


3DFace object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

3DFace object

A 3D triangle or quadrilateral plane section.

VBA class name: | Acad3DFace
Create using: | ModelSpace.Add3DFace PaperSpace.Add3DFace Block.Add3DFace
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

You can specify different Z coordinates for each corner point of a 3DFace object. This differs from a Solid object, which creates a three- or four-sided surface that is parallel to the current UCS and can be extruded.

Six 3DFaces joined together to make a cube

You control which edges of the face are visible through the SetInvisibleEdge method. This allows accurate modeling of objects with holes.

To create a 3DFace, use the Add3DFace method. To edit or query a 3DFace, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetInvisibleEdge

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

RunMacro

ScaleEntity

SetInvisibleEdge

SetXData

TransformBy

Update

Properties

Application

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Visible

VisibilityEdge1

VisibilityEdge2

VisibilityEdge3

VisibilityEdge4

Events

Modified


3dPolyline object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

3dPolyline object

A 3D polyline of straight line segments.

VBA class name: | Acad3DPolyline
Create using: | ModelSpace.Add3DPoly PaperSpace.Add3DPoly Block.Add3DPoly
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To open or close a polyline, use the Closed property.

An open 3D polyline

To create a 3D polyline, use the Add3DPoly method. To edit or query a 3D polyline, use the following methods and properties:

Methods

AppendVertex

ArrayPolar

ArrayRectangular

Copy

Delete

Explode

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Closed

ConstantWidth

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Length

Linetype

LinetypeScale

Lineweight

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Type

Visible

Events

Modified


3DSolid object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

3DSolid object

A solid object with free-form surface support.

VBA class name: | Acad3DSolid
Create using: | On ModelSpace, PaperSpace, and Block objects use: AddBox, AddCone, AddCylinder, AddEllipticalCone, AddEllipticalCylinder, AddExtrudedSolid, AddExtrudedSolidAlongPath, AddRevolvedSolid, AddSphere, AddTorus, or AddWedge.
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

You can make 3D objects by creating basic 3D shapes: boxes, cones, cylinders, spheres, wedges, and toris (donuts). You can then combine these shapes to create more complex solids by joining or subtracting them or finding their intersecting (overlapping) volume. You can also create solids by sweeping a 2D object along a path or revolving it about an axis.

To create a 3DSolid, use one of the following methods: AddBox, AddCone, AddCylinder, AddEllipticalCone, AddEllipticalCylinder, AddExtrudedSolid, AddExtrudedSolidAlongPath, AddRevolvedSolid, AddSphere, AddTorus, AddWedge.

To edit or query a 3DSolid, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Boolean

CheckInterference

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SectionSolid

SetXData

SliceSolid

TransformBy

Update

Properties

Application

Centroid

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

MomentOfInertia

ObjectID

ObjectName

OwnerID

PlotStyleName

PrincipalDirections

PrincipalMoments

ProductOfInertia

RadiiOfGyration

TrueColor

Visible

Volume

Events

Modified


_DAcadApplicationEvents Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

_DAcadApplicationEvents Interface

The event interface for the AutoCAD application.

IAcadObject interface represents the event interface for the AutoCAD application.

Methods

None

Properties

None

Events

AppActivate

AppDeactivate

ARXLoaded

ARXUnloaded

BeginCommand

BeginFileDrop

BeginLisp

BeginModal

BeginOpen

BeginPlot

BeginQuit

BeginSave

EndCommand

EndLisp

EndModal

EndOpen

EndPlot

EndSave

LispCancelled

NewDrawing

SysVarChanged

WindowChanged

WindowMovedOrResized


_DAcadDocumentEvents Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

_DAcadDocumentEvents Interface

The event interface for the AutoCAD document.

IAcadObject interface represents the event interface for the AutoCAD document.

Methods

None

Properties

None

Events

BeginSave

EndSave

BeginCommand

EndCommand

BeginLisp

EndLisp

LispCancelled

SelectionChanged

Activate

Deactivate

BeginRightClick

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginShortcutMenuCommand

BeginShortcutMenuGrip

BeginShortcutMenuOsnap

EndShortcutMenu

BeginDoubleClick

ObjectAdded

ObjectErased

ObjectModified

BeginPlot

EndPlot

WindowMovedOrResized

LayoutSwitched

WindowChanged

BeginClose


AcadState object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

AcadState object

A special object to use in monitoring the state of AutoCAD from out-of-process applications.

VBA class name: | AcadState
Create using: | User-defined variable, returned via the GetAcadState method
Access via: | User-defined variable

The AcadState object is a transient object that is returned from the GetAcadState method. This object is used to check for AutoCAD quiescence from out-of-process applications.

Methods

None

Properties

Application

IsQuiescent


AcCmColor object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

AcCmColor object

AutoCAD true color object.

VBA class name: | AcadAcCmColor
Create using: | GetInterfaceObject ("AutoCAD.AcCmColor.16"), or Dim col As New AcadAcCmColor
Access via: | Not applicable

The AcCmColor object represents colors. You can use the AcCmColor object to set colors and perform other color-related operations on objects.

The object includes properties for colors, color names, color book names, and the color index.

Methods

SetColorBookColor

SetNames

SetRGB

Properties

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red


Application object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Application object

An instance of the AutoCAD application.

VBA class name: | AcadApplication
Create using: | For VB: GetObject("AutoCAD.Application.16") CreateObject("AutoCAD.Application.16") For AutoCAD VBA: Not applicable. The application is always available.
Access via: | Application property

The properties that are associated with the Application object reflect the properties of the main application window. The methods control the loading or listing of the currently loaded external applications and interface objects.

The active document (AutoCAD drawing) can be accessed with the ActiveDocument property.

To access the Application object from VBA, use Thisdrawing.Application. To access the Application object from VB, use the Visual Basic 6 functions GetObject or CreateObject.

If AutoCAD is running, the GetObject function will retrieve the current AutoCAD Application object. When running multiple sessions of AutoCAD, the GetObject function will return the first instance of AutoCAD in the Windows Running Object Table. See the Microsoft Visual Basic 6 documentation for the Running Object Table (ROT) and the GetObject function (for more information about verifying the session returned by GetObject).

Use version-dependent ProgIDs. If a CreateObject or GetObject function uses a version-independent ProgID, change the function to use a version-dependent ProgID. For example, you would change CreateObject ("AutoCAD.Application") to CreateObject ("AutoCAD.Application.16").

The application object is also the Global object for the ActiveX interface. This means that all the methods and properties for the Application object are available in the global name space.

Use the Quit method to end the AutoCAD session.

Methods

Eval

GetAcadState

GetInterfaceObject

ListARX

LoadARX

LoadDVB

Quit

RunMacro

StatusID

UnloadARX

UnloadDVB

Update

ZoomAll

ZoomCenter

ZoomExtents

ZoomPickWindow

ZoomPrevious

ZoomScaled

ZoomWindow

Properties

ActiveDocument

Application

Caption

Documents

FullName

Height

HWND

HWND32

LocaleID

MenuBar

MenuGroups

Name

Path

Preferences

StatusID

VBE

Version

Visible

Width

WindowLeft

WindowState

WindowTop

Events

AppActivate

AppDeactivate

ARXLoaded

ARXUnloaded

BeginCommand

BeginFileDrop

BeginLISP

BeginModal

BeginOpen

BeginPlot

BeginQuit

BeginSave

EndCommand

EndLISP

EndModal

EndOpen

EndPlot

EndSave

LISPCancelled

NewDrawing

SysVarChanged

WindowChanged

WindowMovedOrResized


Arc object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Arc object

A circular arc.

VBA class name: | AcadArc
Create using: | ModelSpace.AddArc PaperSpace.AddArc Block.AddArc
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

An arc is always drawn counterclockwise from the start point to the endpoint. The StartPoint and EndPoint properties of an arc are calculated through the StartAngle, EndAngle, and Radius properties.

 | Center StartPoint |
Radius |  | EndAngle StartAngle EndPoint

To create an arc, use the AddArc method. To edit or query an arc, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

ArcLength

Area

Center

Document

EndAngle

EndPoint

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Radius

StartAngle

StartPoint

Thickness

TotalAngle

TrueColor

Visible

Events

Modified


Attribute object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Attribute object

An object appearing as a text string that describes the characteristics of an attribute reference.

VBA class name: | AcadAttribute
Create using: | ModelSpace.AddAttribute PaperSpace.AddAttribute Block.AddAttribute
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

In AutoCAD, this object is called an attribute definition.

To create an attribute (or attribute definition), use the AddAttribute method. To edit or query an attribute, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

UpdateMTextAttribute

Properties

Alignment

Application

Backward

Constant

Document

FieldLength

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Invisible

Layer

Linetype

LinetypeScale

Lineweight

LockPosition

MTextAttribute

MTextAttributeContent

MTextBoundaryWidth

MTextDrawingDirection

Mode

Normal

ObjectID

ObjectName

ObliqueAngle

OwnerID

PlotStyleName

Preset

PromptString

Rotation

ScaleFactor

StyleName

TagString

TextAlignmentPoint

TextGenerationFlag

TextString

Thickness

TrueColor

UpsideDown

Verify

Visible

Events

Modified


AttributeReference object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

AttributeReference object

An object containing text that links to a block.

VBA class name: | AcadAttributeReference
Create using: | ModelSpace.InsertBlock PaperSpace.InsertBlock Block.InsertBlock
Access via: | Block.GetAttributes

You cannot directly create an attribute reference. Attribute references are added to the drawing when a block containing an attribute definition is inserted into the drawing. To access an attribute reference of an inserted block, use the GetAttributes method. This method returns an array of all attribute references attached to the inserted block.

Once you have obtained an attribute reference, use the following methods and properties to edit or query its values:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

UpdateMTextAttribute

Properties

Alignment

Application

Backward

Constant

Document

FieldLength

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Invisible

Layer

Linetype

LinetypeScale

Lineweight

LockPosition

MTextAttribute

MTextAttributeContent

MTextBoundaryWidth

MTextDrawingDirection

Normal

ObjectID

ObjectName

ObliqueAngle

OwnerID

PlotStyleName

Rotation

ScaleFactor

StyleName

TagString

TextAlignmentPoint

TextGenerationFlag

TextString

Thickness

TrueColor

UpsideDown

Visible

Events

Modified


Block object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Block object

A block definition containing a name and a set of objects.

VBA class name: | AcadBlock
Create using: | Blocks.Add
Access via: | Blocks.Item Layout.Block

There are four types of blocks: the simple block, the XRef block, the layout block, and the dynamic block.

A simple block is a collection of objects that you can associate together to form a single object, or block definition. You can insert, scale, and rotate a simple block in a drawing. You can explode a simple block into its component objects, modify them, and redefine the block definition. Simple blocks can be defined from geometry in the current drawing, or by using another AutoCAD drawing. When you use another drawing to create a block, the new simple block is stored in the current drawing database; it is not updated if the original drawing changes. Inserting an instance of a simple block into the current drawing creates a BlockReference object.

An XRef block is an external link from another drawing to the current drawing. Because the XRef block represents a link to geometry, not the geometry itself, it is updated whenever the original drawing changes. Inserting an instance of an XRef block into the current drawing creates an ExternalReference object.

The layout blocks represent the geometry in the model space and paper space layouts. These blocks have a Layout object associated with them that contains the plot settings and other layout definition information. The block name of the active paper space layout is always *PAPER_SPACE. The other paper space layouts will have blocks named *PAPER_SPACEn, where n is an integer. Block names start with *PAPER_SPACE0, and the Integereger increments by 1 each time a new layout is inserted.

By default, the layout blocks in a new drawing have the following names:
Block Name | Definition
*MODEL_SPACE | The model space layout. There is only one model space layout per drawing. This block corresponds to the ModelSpace collection.
*PAPER_SPACE | The first paper space layout created. If the model space layout is currently active, this block contains the last active paper space layout. This block corresponds to the PaperSpace collection.
*PAPER_SPACE0 | The second paper space layout created. If this layout is activated, its block is renamed *PAPER_SPACE and becomes accessible from the PaperSpace collection; the first layout's block is renamed *PAPER_SPACE0.

When you activate a new layout, it swaps block names with the layout that was formerly active. In this way, the block of the active layout is always named *PAPER_SPACE. For example, suppose Layout1 is active and Layout2 is associated with a block named *PAPER_SPACE0. If you then activate Layout2, it's block is renamed to *PAPER_SPACE, and Layout1's block is renamed to *PAPER_SPACE0.

Dynamic blocks enhance simple blocks by increasing their intelligence potential and adaptability. The internal geometry of a dynamic block instance can be adjusted independently of both its base definition and other instances. This flexibility is the central concept of dynamic blocks. Inserting an instance of a dynamic block into the current drawing creates a BlockReference object. From the block reference, you can get the DynamicBlockReferenceProperty object.

To identify a block's type, use the IsLayout, IsXRef, and IsDynamicBlock properties. If these properties are FALSE, then the block is a simple block. If the IsXRef property is TRUE, then the block is an external reference. If the IsLayout property is TRUE, then the block contains all the geometry associated with a layout. If the IsDynamicBlock property is TRUE, then the block is a dynamic block.

There is no limit to the number of objects a block can contain.

To insert a simple, XRef, or dynamic block into a drawing, use the InsertBlock method. To create a new layout block, use the Add method to add a new layout to the Layouts collection. When the new layout is created, an associated block for the layout will also be created.

To edit or query any of the blocks, use the following methods and properties:

Methods

Add3DFace

Add3DMesh

Add3DPoly

AddArc

AddAttribute

AddBox

AddCircle

AddCone

AddCustomObject

AddCylinder

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

AddEllipse

AddEllipticalCone

AddEllipticalCylinder

AddExtrudedSolid

AddExtrudedSolidALongPath

AddHatch

AddLeader

AddLightWeightPolyline

AddLine

AddMLeader

AddMInsertBlock

AddMLine

AddMText

AddPoint

AddPolyfaceMesh

AddPolyline

AddRaster

AddRay

AddRegion

AddRevolvedSolid

AddShape

AddSolid

AddSphere

AddSpline

AddTable

AddText

AddTolerance

AddTorus

AddTrace

AddWedge

AddXLine

AttachExternalReference

Bind

Delete

Detach

GetExtensionDictionary

GetXData

InsertBlock

Item

Reload

SetXData

Unload

Properties

Application

BlockScaling

Comments

Count

Document

Explodable

Handle

HasExtensionDictionary

IsDynamicBlock

IsLayout

IsXRef

Layout

Material

Name

ObjectID

ObjectName

Origin

OwnerID

Path

Units

XRefDatabase

Events

Modified


BlockRef object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

BlockRef object

An instance of a block definition inserted into a drawing.

VBA class name: | AcadBlockReference
Create using: | ModelSpace.InsertBlock PaperSpace.InsertBlock Block.InsertBlock
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create a block reference, first you must create a block definition, or block, by using the Add method. Once created, you can insert an instance of this block into your drawing using the InsertBlock method.

To add or delete items from the block reference, you must first use the Explode method to break it into its component objects. Even though a block reference is broken into its component objects, the block definition still remains in the drawings block symbol table.

To query or edit an existing block reference, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

ConvertToAnonymousBlock

ConvertToStaticBlock

Copy

Delete

Explode

GetAttributes

GetBoundingBox

GetConstantAttributes

GetDynamicBlockProperties

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ResetBlock

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

EffectiveName

Handle

HasAttributes

HasExtensionDictionary

Hyperlinks

InsertionPoint

InsUnits

InsUnitsFactor

IsDynamicBlock

Layer

Linetype

LinetypeScale

Lineweight

Name

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

XEffectiveScaleFactor

XScaleFactor

YEffectiveScaleFactor

YScaleFactor

ZEffectiveScaleFactor

ZScaleFactor

Events

Modified


Blocks Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Blocks Collection

The collection of all blocks in the drawing.

VBA class name: | AcadBlocks
Create using: | N/A
Access via: | Document.Blocks

To add a new member to the collection, use the Add method. To select a specific block, use the Item method.

There are two special blocks in the collection. One contains the collection of all model space entities, the ModelSpace Collection; the other contains all paper space entities, the PaperSpace Collection.

Although the Blocks collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Blocks collection will result in an error, therefore the Delete method has been removed from the documentation for this collection.

There is no limit to the number of blocks you can create in your drawing. However, there can be only one instance of the Blocks Collection. The Blocks Collection is predefined for each drawing. You can make multiple references to it by using the Blocks property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID


Circle object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Circle object

A full circle.

VBA class name: | AcadCircle
Create using: | ModelSpace.AddCircle PaperSpace.AddCircle Block.AddCircle
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Center

Radius

To create a circle, use the AddCircle method. To edit or query a circle, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Area

Center

Circumference

Diameter

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

PlotStyleName

Radius

Thickness

TrueColor

Visible

Events

Modified


Database object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Database object

The contents of an XRef block.

VBA class name: | AcadDatabase
Create using: | Not applicable
Access via: | Block.XRefDatabase

This object provides access to the contents of an external reference block. It is only available on blocks whose IsXRef property is equal to TRUE.

Methods

CopyObjects

Properties

Application

Blocks

Dictionaries

DimStyles

ElevationModelSpace

ElevationPaperSpace

Groups

HandleToObject

HasExtensionDictionary

Layers

Layouts

Limits

Linetypes

ModelSpace

ObjectIDToObject

OwnerID

PaperSpace

PlotConfigurations

Preferences

RegisteredApplications

SummaryInfo

TextStyles

UserCoordinateSystems

Viewports

Views


DatabasePreferences object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DatabasePreferences object

An object that specifies the settings for the current AutoCAD drawing.

VBA class name: | AcadDatabasePreferences
Create using: | N/A
Access via: | Document.Preferences

Database preferences represent options from the Options dialog that reside in a drawing. Options that reside in the registry can be accessed through the main Preferences object.

The DatabasePreferences object can be referenced from the Preferences property on the Document object.

Methods

None

Properties

AllowLongSymbolNames

Application

ContourlinesPerSurface

DisplaySilhouette

Lineweight

LineweightDisplay

MaxActiveViewports

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap

OLELaunch

RenderSmoothness

SegmentPerPolyline

SolidFill

TextFrameDisplay

XRefEdit

XRefLayerVisibility


DgnUnderlay object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DgnUnderlay object

Reserved for future use.

VBA class name: | AcadDgnUnderlay
Create using: | N/A
Access via: |

Methods

Properties

Events


Dictionaries Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Dictionaries Collection

The collection of all dictionaries in the drawing.

VBA class name: | AcadDictionaries
Create using: | N/A
Access via: | Document.Dictionaries

To add a new member to the collection, use the Add method. To select a specific dictionary, use the Item method.

Although the Dictionaries collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Dictionaries collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of dictionaries that you can create in your drawing. However, there can be only one instance of the Dictionaries Collection. The Dictionaries Collection is predefined for each drawing. You can make multiple references to it by using the Dictionaries property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Dictionary object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Dictionary object

A container object for storing and retrieving objects.

VBA class name: | AcadDictionary
Create using: | Dictionaries.Add
Access via: | Dictionaries.Item

Dictionaries provide a mechanism for storing and retrieving objects with associated string keywords.

The objects in a dictionary may be referenced by their keywords. A dictionary can contain any type of object, including other dictionaries. A dictionary does not perform type checking of entries.

You can create new dictionaries, add entries to an existing dictionary, and get the keyword for a given object or the object for a given keyword. You can change the object that is associated with a given keyword, or rename the keyword for a given object.

This dictionary is similar to a collection in AutoCAD, and is used for custom object implementation. This object does not represent the spellchecking dictionary. The spellchecking dictionary is specified in the Preferences object.

To add a dictionary to the application, use the Add method. To edit or query a dictionary, use the following methods and properties:

Methods

AddObject

AddXRecord

Delete

GetExtensionDictionary

GetName

GetObject

GetXData

Item

Remove

Rename

Replace

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified


Dim3PointAngular object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Dim3PointAngular object

A dimension measuring the angular distance between three points.

VBA class name: | AcadDim3PointAngular
Create using: | ModelSpace.AddDim3PointAngular PaperSpace.AddDim3PointAngular Block.AddDim3PointAngular
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

When creating a three point angular dimension, AutoCAD draws the dimension line arc between the extension lines. The extension lines are drawn from the angle endpoints to the intersection of the dimension line arc.

A 3 point angular dimension

AutoCAD uses the location of the dimension line arc to choose between the minor and major angles specified by the angle vertex and extension lines.

To create a three point angular dimension, use the AddDim3PointAngular method. To edit or query a three point angular dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

AngleFormat

AngleVertex

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

DecimalSeparator

DimensionLineColor

DimensionLinetype

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

DimLineInside

Document

ExtensionLineColor

ExtensionLineExtend

ExtensionLineOffset

ExtensionLineWeight

ExtLine1EndPoint

ExtLine1Linetype

ExtLine1Suppress

ExtLine2EndPoint

ExtLine2Linetype

ExtLine2Suppress

ExtLineFixedLen

ExtLineFixedLenSuppress

Fit

ForceLineInside

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrecision

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceUpperLimit

TrueColor

VerticalTextPosition

Visible

Events

Modified


DimAligned object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimAligned object

A linear dimension, measuring the distance between two points, that is displayed parallel to the points being measured.

VBA class name: | AcadDimAligned
Create using: | ModelSpace.AddDimAligned PaperSpace.AddDimAligned Block.AddDimAligned
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

In aligned dimensions, the dimension line is parallel to the extension line origins. The extension line origins are specified using the ExtLine1Point and ExtLine2Point properties.

To create an aligned dimension use the AddDimAligned method. To edit or query an aligned dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroInches

AltSuppressZeroFeet

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroFeet

AltToleranceSuppressZeroInches

AltUnitsFormat

AltUnits

AltUnitsPrecision

AltUnitsScale

Application

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

DecimalSeparator

DimensionLineColor

DimensionLineExtend

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

DimLineInside

Document

ExtensionLineColor

ExtensionLineExtend

ExtensionLineOffset

ExtensionLineWeight

ExtLine1Point

ExtLine2Point

ExtLine1Suppress

ExtLine2Suppress

ExtLineFixedLen

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimAngular object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimAngular object

A dimension measuring the angular distance between two lines or between the angle of a circular arc.

VBA class name: | AcadDimAngular
Create using: | ModelSpace.AddDimAngular PaperSpace.AddDimAngular Block.AddDimAngular
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

An angular dimension measuring the angle of a circular arc

If you need extension lines, they will be added automatically. The endpoints provided will be used as origin points for the extension lines.

To create an angular dimension, use the AddDimAngular method. To edit or query an angular dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AngleFormat

Application

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

DecimalSeparator

DimensionLineColor

DimensionLinetype

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

DimLineInside

Document

ExtensionLineColor

ExtensionLineExtend

ExtensionLineOffset

ExtensionLineWeight

ExtLine1EndPoint

ExtLine1Linetype

ExtLine1StartPoint

ExtLine1Suppress

ExtLine2EndPoint

ExtLine2Linetype

ExtLine2StartPoint

ExtLine2Suppress

ExtLineFixedLen

ExtLineFixedLenSuppress

Fit

ForceLineInside

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

Rotation

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrecision

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceUpperLimit

TrueColor

VerticalTextPosition

Visible

Events

Modified


DimArcLength object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimArcLength object

A dimension measuring the length of an arc.

VBA class name: | AcadDimArcLength
Create using: | ModelSpace.AddDimArc PaperSpace.AddDimArc Block.AddDimArc
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

An arc length dimension

To edit or query an arc length dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroFeet

AltSuppressZeroInches

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroFeet

AltToleranceSuppressZeroInches

AltUnits

AltUnitsFormat

AltUnitsPrecision

AltUnitsScale

Application

ArcEndParam

ArcPoint

ArcStartParam

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

CenterPoint

DecimalSeparator

DimensionLineColor

DimensionLineExtend

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

DimLineInside

Document

ExtensionLineColor

ExtensionLineExtend

ExtensionLineOffset

ExtensionLineWeight

ExtLine1Point

ExtLine1Suppress

ExtLine2Point

ExtLine2Suppress

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HasLeader

HorizontalTextPosition

Hyperlinks

IsPartial

Layer

Leader1Point

Leader2Point

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

SymbolPosition

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroFeet

ToleranceSuppressZeroInches

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimDiametric object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimDiametric object

A dimension measuring the diameter of a circle or arc.

VBA class name: | AcadDimDiametric
Create using: | ModelSpace.AddDimDiametric PaperSpace.AddDimDiametric Block.AddDimDiametric
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

The position of the text (TextPosition property) determines the location of the dimension line.

Examples of diameter dimensions

To create a diameter dimension, use the AddDimDiametric method. To edit or query a diameter dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroInches

AltSuppressZeroFeet

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroInches

AltToleranceSuppressZeroFeet

AltUnitsFormat

AltUnits

AltUnitsPrecision

AltUnitsScale

Application

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

CenterMarkSize

CenterType

DecimalSeparator

DimensionLineColor

DimensionLinetype

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

Document

ExtensionLineOffset

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

LeaderLength

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimOrdinate object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimOrdinate object

A dimension measuring the absolute X or Y position of a point from the origin.

VBA class name: | AcadDimOrdinate
Create using: | ModelSpace.AddDimOrdinate PaperSpace.AddDimOrdinate Block.AddDimOrdinate
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Ordinate dimensions display the X or Y UCS coordinate of an object along with a simple leader line. The absolute value of the coordinate is used according to the prevailing standards for ordinate dimensions.

An ordinate dimension measuring the absolute X position of a point tangent to a circle

To change the extension lines of an ordinate dimension, change the Rotation and/or TextPosition properties. The extension lines will be recalculated to fit the new requirements.

To create an ordinate dimension, use the AddDimOrdinate method. To edit or query an ordinate dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroInches

AltSuppressZeroFeet

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroInches

AltToleranceSuppressZeroFeet

AltUnitsFormat

AltUnits

AltUnitsPrecision

AltUnitsScale

Application

ArrowheadSize

DecimalSeparator

DimensionLineWeight

Document

ExtensionLineColor

ExtensionLineOffset

ExtLineFixedLen

ExtLineFixedLenSuppress

FractionFormat

Handle

HasExtensionDictionary

Hyperlinks

Layer

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextMovement

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimRadial object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimRadial object

A dimension measuring the radius of a circle or arc.

VBA class name: | AcadDimRadial
Create using: | ModelSpace.AddDimRadial PaperSpace.AddDimRadial Block.AddDimRadial
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Examples of radial dimensions

The position of the text (TextPosition property) determines the location of the dimension line.

To create a radial dimension, use the AddDimRadial method. To edit or query a radial dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroFeet

AltSuppressZeroInches

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroFeet

AltToleranceSuppressZeroInches

AltUnits

AltUnitsFormat

AltUnitsPrecision

AltUnitsScale

Application

ArrowheadBlock

ArrowheadSize

ArrowheadType

CenterMarkSize

CenterType

DecimalSeparator

DimensionLineColor

DimensionLinetype

DimensionLineWeight

DimLineSuppress

Document

ExtensionLineOffset

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

LeaderLength

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroFeet

ToleranceSuppressZeroInches

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimRadialLarge object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimRadialLarge object

A dimension measuring a large radius, also known as a jogged radius dimension.

VBA class name: | AcadDimRadialLarge
Create using: | ModelSpace.AddDimRadialLarge PaperSpace.AddDimRadialLarge Block.AddDimRadialLarge
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A jogged radius dimension

To edit or query a jogged radius dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroFeet

AltSuppressZeroInches

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroFeet

AltToleranceSuppressZeroInches

AltUnits

AltUnitsFormat

AltUnitsPrecision

AltUnitsScale

Application

ArrowheadBlock

ArrowheadSize

ArrowheadType

Center

CenterMarkSize

CenterType

ChordPoint

DecimalSeparator

DimensionLineColor

DimensionLineWeight

DimLineSuppress

Document

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

JogAngle

JogLocation

Layer

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

ObjectName

OverrideCenter

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroFeet

ToleranceSuppressZeroInches

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimRotated object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimRotated object

A dimension that measures the distance between two points and is displayed at a given rotation.

VBA class name: | AcadDimRotated
Create using: | ModelSpace.AddDimRotated PaperSpace.AddDimRotated Block.AddDimRotated
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A linear dimension created at 45 degrees

To change the extension lines of a rotated dimension, change the Rotation and/or TextPosition properties. The extension lines will be recalculated to fit the new requirements.

To create a rotated dimension, use the AddDimRotated method. To edit or query a rotated dimension, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AltRoundDistance

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroInches

AltSuppressZeroFeet

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroInches

AltToleranceSuppressZeroFeet

AltUnitsFormat

AltUnits

AltUnitsPrecision

AltUnitsScale

Application

Arrowhead1Block

Arrowhead1Type

Arrowhead2Block

Arrowhead2Type

ArrowheadSize

DecimalSeparator

DimensionLineColor

DimensionLineExtend

DimensionLinetype

DimensionLineWeight

DimLine1Suppress

DimLine2Suppress

DimLineInside

Document

ExtensionLineColor

ExtensionLineExtend

ExtensionLineOffset

ExtensionLineWeight

ExtLine1Linetype

ExtLine1Suppress

ExtLine2Linetype

ExtLine2Suppress

ExtLineFixedLen

ExtLineFixedLenSuppress

Fit

ForceLineInside

FractionFormat

Handle

HasExtensionDictionary

HorizontalTextPosition

Hyperlinks

Layer

LinearScaleFactor

Linetype

LinetypeScale

Lineweight

Measurement

Normal

ObjectID

OwnerID

PlotStyleName

PrimaryUnitsPrecision

Rotation

RoundDistance

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet

SuppressZeroInches

TextColor

TextGap

TextHeight

TextInside

TextInsideAlign

TextMovement

TextOutsideAlign

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet

ToleranceUpperLimit

TrueColor

UnitsFormat

VerticalTextPosition

Visible

Events

Modified


DimStyle object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimStyle object

A group of dimension settings that determines the appearance of a dimension.

VBA class name: | AcadDimStyle
Create using: | DimStyles.Add
Access via: | DimStyles.Item Document.ActiveDimStyle

The active dimension style determines the appearance of new dimensions that are created in the drawing. To change the style of an existing dimension, use the StyleName property found on the dimension.

To control the settings of the current document overrides, use the dimensioning system variables. See "System Variables" in the AutoCAD Command Reference for a list of dimensioning system variables.

When you change a dimensioning system variable, you are actually setting a document override for the active dimension style; you are not changing the active dimension style itself. This means that all newly created dimensions will still be created with the active dimension style only and will not reflect the overrides from the system variables. The overrides from the system variables will not be recognized on new dimensions until the active dimension style is updated. To change the settings of any dimension style, use the CopyFrom method. This method copies a dimension style configuration, including overrides, from a document, dimension, or other dimension style.

Dimensions created via the AutoCAD user interface are created with the active dimension style plus all document overrides. Dimensions created via ActiveX are created with the active dimension style only. To have the dimensions created via ActiveX take on the document overrides, use the CopyFrom method to copy the dimension style from the document to the active dimension style. This process will copy all existing overrides into the active dimension style.

Methods

CopyFrom

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified


DimStyles Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DimStyles Collection

The collection of all dimension styles in the drawing.

VBA class name: | AcadDimStyles
Create using: | N/A
Access via: | Document.DimStyles

To add a new member to the collection, use the Add method. To select a specific dimension style, use the Item method.

Although the DimStyles collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the DimStyles collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of dimension styles that you can create in your drawing. However, there can be only one instance of the DimStyles Collection. The DimStyles collection is predefined for each drawing. You can make multiple references to it by using the DimStyles property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Document object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Document object

An AutoCAD drawing.

VBA class name: | AcadDocument
Create using: | Documents.Add Documents.Open Document.New
Access via: | Documents.Item Application.ActiveDocument

The active document (AutoCAD drawing) can be accessed using ThisDrawing in VBA, or through the ActiveDocument property in VB. Because AutoCAD works with only one document at a time, and that document represents one database, the active document can be thought of as the current database as well as the current document.

Certain objects in the drawing establish the format, location, or style that new objects being added to the drawing will adopt. These objects include the DimensionStyle, TextStyle, Linetype, Viewport, and Layer objects. A drawing may contain many of these types of objects, but only one may be active at a time. For example, there may be several linetypes available in a drawing, but only one, designated as the active one, will be used when creating a new entity. The Document object contains the references to these active objects. To set an existing object as the active object, use the properties listed below.

The Document object also contains a property (or link) for all the collections. From these collections, you can iterate through every object in the drawing.

To access drawing properties such as Title, Subject, Author, and Keywords, the IAcadSummaryInfo interface, accessible as a property of the Document object, must be used.

Using Paper Space and Model Space

From the Document object, you control the model space and paper space settings. By default, a drawing is opened in the model space, with the tiled viewport setting. Use the ActiveSpace property, MSpace property, and the Display method to control the model space and paper space settings. See the PViewport object for more information about using these properties and methods.

Resetting Active Objects

Changes to most active objects, such as the active layer and active linetype, are displayed immediately. However, several objects must be reset for changes to appear. These objects are the active textstyle, active UCS, and the active viewport. To reset the objects, simply call the ActiveTextStyle, ActiveUCS, or ActiveViewport property, using the updated object.

To create or open a Document object, use the Open method. To edit or query a Document object, use the following methods and properties:

Methods

Activate

AuditInfo

Close

CopyObjects

EndUndoMark

Export

GetVariable

HandleToObject

Import

LoadShapeFile

ObjectIDToObject

Open

PurgeAll

Regen

Save

SaveAs

SendCommand

SetVariable

StartUndoMark

WBlock

Properties

Active

ActiveDimStyle

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveMaterial

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport

Application

Blocks

Database

Dictionaries

DimStyles

ElevationModelSpace

ElevationPaperSpace

FullName

Groups

HWND

HWND32

Layers

Layouts

Limits

Linetypes

ModelSpace

MSpace

Name

ObjectSnapMode

PaperSpace

Path

PickfirstSelectionSet

Plot

PlotConfigurations

Preferences

ReadOnly

RegisteredApplications

Saved

SelectionSets

SummaryInfo

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

WindowState

WindowTitle

Events

Activate

BeginClose

BeginCommand

BeginDocClose

BeginDoubleClick

BeginLISP

BeginPlot

BeginRightClick

BeginSave

BeginShortcutMenuCommand

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginShortcutMenuGrip

BeginShortcutMenuOSnap

Deactivate

EndCommand

EndLISP

EndPlot

EndSave

EndShortcutMenu

LayoutSwitched

LISPCancelled

ObjectAdded

ObjectErased

ObjectModified

SelectionChanged

WindowChanged

WindowMovedOrResized


Documents Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Documents Collection

The collection of all AutoCAD drawings that are open in the current session.

VBA class name: | AcadDocuments
Create using: | N/A
Access via: | Application.Documents

To add a new member to the collection, use the Add or Open methods. To select a specific document, use the Item method. To close a specific document, use the Close method found on the Document object. To close all documents, use the Close method found on this collection.

There is no limit to the number of documents that you can create in your drawing. However, there can be only one instance of the Documents Collection. The Documents Collection is predefined for each application. You can make multiple references to it by using the Documents property. Once done with an object, the reference is automatically released.

Methods

Add

Close

Item

Open

Properties

Application

Count


DwfUnderlay object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DwfUnderlay object

A source of underlay content.

VBA class name: | AcadDwfUnderlay
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Underlays are similar to raster images, except that users can snap to the content of an underlay. The AcadDwfUnderlay class supports DWF files as underlays to AutoCAD drawings.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

AdjustForBackground

Application

ClipBoundary

ClippingEnabled

Contrast

Document

Fade

File

Handle

HasExtensionDictionary

Height

Hyperlinks

ItemName

Layer

Linetype

LinetypeScale

Lineweight

Monochrome

ObjectID

OwnerID

PlotStyleName

Position

Rotation

ScaleFactor

TrueColor

UnderlayLayerOverrideApplied

UnderlayName

UnderlayVisibility

Visible

Width

Events

Modified


DynamicBlockReferenceProperty object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

DynamicBlockReferenceProperty object

An object containing the properties of a dynamic block.

VBA class name: | AcadDynamicBlockReferenceProperty
Create using: | N/A
Access via: | BlockRef.GetDynamicBlockProperties

You cannot create this object; BlockRef.GetDynamicBlockProperties returns a collection of DynamicBlockReferenceProperty objects if the block reference is a dynamic block containing custom properties.

Once you have obtained a dynamic block reference property object, use the following properties to query or edit its values:

Methods

None

Properties

AllowedValues

Description

PropertyName

ReadOnly

Show

UnitsType

Value


Ellipse object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Ellipse object

An elliptical arc or full ellipse.

VBA class name: | AcadEllipse
Create using: | ModelSpace.AddEllipse PaperSpace.AddEllipse Block.AddEllipse
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

The ellipse may be closed or open (elliptical arc). This object represents a true ellipse, not a polyline approximation.

Minor axis |
 | Major axis

To create an ellipse, use the AddEllipse method. To edit or query an ellipse, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Area

Center

Document

EndAngle

EndParameter

EndPoint

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

MajorAxis

MajorRadius

MinorAxis

MinorRadius

Normal

ObjectID

OwnerID

PlotStyleName

RadiusRatio

StartAngle

StartParameter

StartPoint

TrueColor

Visible

Events

Modified


ExternalReference object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

ExternalReference object

An instance of an external reference inserted into a drawing.

VBA class name: | AcadExternalReference
Create using: | ModelSpace.AttachExternalReference PaperSpace.AttachExternalReference Block.AttachExternalReference
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

An external reference (xref) links another drawing to the current drawing. When you insert a drawing as a block, the block definition and all the associated geometry is stored in the current drawing database. It is not updated if the original drawing changes. When you insert a drawing as an xref, however, it is updated when the original drawing changes. A drawing containing xrefs always reflects the most current edits of each externally referenced file.

Like a block reference, AutoCAD displays an xref in the current drawing as a single object. However, an xref does not significantly increase the file size of the current drawing and cannot be exploded. As with block references, you can nest xrefs that are attached to your drawing.

To query or edit an existing external reference, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

Explode

GetAttributes

GetBoundingBox

GetConstantAttributes

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror3D

Mirror

Move

Rotate3D

Rotate

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

Handle

HasAttributes

HasExtensionDictionary

Hyperlinks

InsertionPoint

InsUnits

InsUnitsFactor

Layer

Linetype

LinetypeScale

Lineweight

Name

Normal

ObjectID

ObjectName

OwnerID

Path

PlotStyleName

Rotation

TrueColor

Visible

XEffectiveScaleFactor

XScaleFactor

YEffectiveScaleFactor

YScaleFactor

ZEffectiveScaleFactor

ZScaleFactor

Events

Modified


ExtrudedSurface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

ExtrudedSurface object

A surface created by extruding an object or a planar face a specified distance and direction.

VBA class name: | AcadExtrudedSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object provides access to extruded surfaces in AutoCAD. It lets you manipulate properties of the surface. You cannot create a surface entity via ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Direction

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

SurfaceType

TaperAngle

TrueColor

UIsolineDensity

VIsolineDensity

Visible

Events

Modified


FileDependency object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

FileDependency object

Provides information about entries in the File Dependency List of a drawing file.

VBA class name: | AcadFileDependency
Create using: | FileDependencies.CreateEntry
Access via: | FileDependencies.Item

The FileDependency object describes an entry in the File Dependency List. The files on which a drawing file depends are in its File Dependency List.

Methods

None

Properties

AffectsGraphics

Feature

FileName

FileSize

FingerprintGUID

FoundPath

FullFileName

Index

IsModified

ReferenceCount

TimeStamp

VersionGUID


Group object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Group object

A named SelectionSet object.

VBA class name: | AcadGroup
Create using: | Groups.Add
Access via: | Groups.Item

For more information about selection sets, see the SelectionSet object.

To create a group, use the Add method. To edit or query a group, use the following methods and properties:

Methods

AppendItems

Delete

GetExtensionDictionary

GetXData

Highlight

Item

RemoveItems

SetXData

Update

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Layer

Linetype

LinetypeScale

Material

Name

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Visible

Events

Modified


Groups Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Groups Collection

The collection of all groups in the drawing.

VBA class name: | AcadGroups
Create using: | N/A
Access via: | Document.Groups

To add a new member to the collection, use the Add method. To select a specific group, use the Item method.

Although the Groups collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Groups collection will result in an error, therefore the Delete method has been removed from the documentation for this collection.

There is no limit to the number of groups you can create in your drawing. However, there can be only one instance of the Groups collection. The Groups Collection is predefined for each drawing. You can make multiple references to it by using the Groups property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Hatch object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Hatch object

An area fill consisting of a pattern of lines.

VBA class name: | AcadHatch
Create using: | ModelSpace.AddHatch PaperSpace.AddHatch Block.AddHatch
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create a hatch, first create the Hatch object using the AddHatch method. After the Hatch object has been created, add the outer loop using the AppendOuterLoop method. The outer loop must be closed and must be created before any inner loops can be added. After a valid outer loop has been created, add any inner loops, one at a time, using AppendInnerLoop method.

WARNING! Once the Hatch object has been created, you must add the outer loop to the Hatch object for it to become a valid AutoCAD object. If you attempt any operation other than calling the AppendOuterLoop method, AutoCAD will enter an unpredictable state.

To edit a Hatch object, use the following methods and properties:

Methods

AppendInnerLoop

AppendOuterLoop

ArrayPolar

ArrayRectangular

Copy

Delete

Evaluate

GetBoundingBox

GetExtensionDictionary

GetLoopAt

GetXData

Highlight

InsertLoopAt

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetPattern

SetXData

TransformBy

Update

Properties

Application

Area

AssociativeHatch

Document

Elevation

GradientAngle

GradientCentered

GradientColor1

GradientColor2

GradientName

Handle

HasExtensionDictionary

HatchObjectType

HatchStyle

Hyperlinks

ISOPenWidth

Layer

Linetype

LinetypeScale

Lineweight

Normal

NumberOfLoops

ObjectID

ObjectName

Origin

OwnerID

PatternAngle

PatternDouble

PatternName

PatternScale

PatternSpace

PatternType

PlotStyleName

TrueColor

Visible

Events

Modified


Helix object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Helix object

A helix.

VBA class name: | AcadHelix
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

The Helix object encapsulates a Spline object that helps it maintain its basic shape. You can use ActiveX to query and edit Helix entities in an AutoCAD drawing. However, you cannot create a Helix object with ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

BaseRadius

Constrain

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

Position

TopRadius

TotalLength

TrueColor

TurnHeight

TurnSlope

Turns

Twist

Visible

Events

Modified


Hyperlink Object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Hyperlink object

A URL and URL description.

VBA class name: | AcadHyperlink
Create using: | Hyperlinks.Add
Access via: | Hyperlinks.Item

URL and URL descriptions are stored within the XData of their corresponding object. The Hyperlink objects themselves are not stored with the drawing. This means that every time you request the Hyperlink object for an object, a new Hyperlink object is created and the URL and URL description for that hyperlink is read out of the XData. Because of this, you should be careful to avoid creating multiple Hyperlink objects to reference the same URL information. Updating one of these Hyperlink objects would not update the second object.

To create a hyperlink use the Add method. To edit or query a hyperlink, use the following methods and properties:

Methods

Delete

Properties

Application

URL

URLDescription

URLNamedLocation


IAcadDatabase Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

IAcadDatabase interface

Provides an interface to the database resident objects in an AutoCAD document.

Methods

None

Properties

Application

Blocks

Dictionaries

DimStyles

ElevationModelSpace

ElevationPaperSpace

Groups

HandleToObject

Layers

Layouts

Limits

Linetypes

ModelSpace

ObjectIDToObject

ObjectIDToObject32

OwnerID

PaperSpace

PlotConfigurations

Preferences

RegisteredApplications

TextStyles

UserCoordinateSystems

Viewports

Views


IAcadDimension Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

IAcadDimension Interface

The common interface for AutoCAD dimensions.

IAcadDimension interface represents the common interface for all AutoCAD dimensions.

Methods

None

Properties

DecimalSeparator

Normal

Rotation

ScaleFactor

StyleName

SuppressLeadingZeros

SuppressTrailingZeros

TextColor

TextGap

TextHeight

TextMovement

TextOverride

TextPosition

TextPrefix

TextRotation

TextStyle

TextSuffix

ToleranceDisplay

ToleranceHeightScale

ToleranceJustification

ToleranceLowerLimit

TolerancePrecision

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceUpperLimit

TrueColor

VerticalTextPosition


IAcadEntity Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

IAcadEntity Interface

The standard interface for a basic AutoCAD entity.

IAcadEntity interface represents the default interface for AutoCAD entities.

If you are familiar with the ObjectARX environment you will see that IAcadEntity exposes AcDbEntity functionality.

Methods

ArrayPolar

ArrayRectangular

Copy

GetBoundingBox

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

TransformBy

Update

Properties

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Material

PlotStyleName

TrueColor

Visible


IAcadObject Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

IAcadObject Interface

The standard interface for a basic AutoCAD object.

IAcadObject interface represents the default interface for most AutoCAD objects.

If you are familiar with the ObjectARX environment, you will see that IAcadObject exposes AcDbObject functionality.

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Document

Handle

HasExtensionDictionary

ObjectID

ObjectID32

ObjectName

OwnerID

OwnerID32


IAcadObjectEvents Interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

IAcadObjectEvents Interface

The event interface for a basic AutoCAD object.

IAcadObject interface represents the event interface for most AutoCAD objects.

Methods

None

Properties

None

Events

Modified


IDPair object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

IDPair object

A special object for use with the CopyObjects method that contains the object IDs of both the source and destination objects.

VBA class name: | AcadIDPair
Create using: | User-defined variable, populated through the CopyObjects method
Access via: | User-defined variable

The IDPair object is a transient object that is used as an optional parameter in the CopyObjects method. The CopyObjects method popuplates the IDPair object with the object IDs of the source objects, and the newly created copied objects, thus creating a map between all of the objects that are copied and created.

The IDPair object returns all objects that are copied in the operation. This includes the primary set of objects being copied, as well as any objects owning, or owned by, the primary objects. The IDPair object also contains information about the copy and translation process.

NOTE This object is used for advanced cloning functions. General users should avoid using this optional functionality.

Methods

None

Properties

Application

IsCloned

IsOwnerXlated

IsPrimary

Key

Key32

Value

Value32


Layer object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Layer object

A logical grouping of data, similar to transparent acetate overlays on a drawing.

VBA class name: | AcadLayer
Create using: | Layers.Add
Access via: | Layers.Item Document.ActiveLayer

All new objects are added to the active layer. To make a layer active, use the ActiveLayer property.

To create a layer, use the Add method. To edit or query a layer, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Description

Document

Freeze

Handle

HasExtensionDictionary

LayerOn

Linetype

Lineweight

Lock

Material

Name

ObjectID

ObjectName

OwnerID

PlotStyleName

Plottable

TrueColor

Used

ViewportDefault

Events

Modified


Layers Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Layers Collection

The collection of all layers in the drawing.

VBA class name: | AcadLayers
Create using: | N/A
Access via: | Document.Layers

To add a new member to the collection, use the Add method. To select a specific layer, use the Item method.

Although the Layers collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Layers collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of layers that you can create in your drawing. However, there can be only one instance of the Layers Collection. The Layers Collection is predefined for each drawing. You can make multiple references to it by using the Layers property. Once done with an object, the reference is automatically released.

Methods

Add

GenerateUsageData

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID


LayerStateManager object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

LayerStateManager object

Saves and restores layer settings.

VBA class name: | LayerStateManager
Access via: | GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

Methods

Delete

Export

Import

Rename

Restore

Save

SetDatabase

Properties

Mask

Events

Remarks

The LayerStateManager object provides a set of functions for working with saved layer settings. The LayerStateManager manipulates XRecord objects that define the properties of a layer. These XRecords are stored in the ACAD_LAYERSTATE dictionary, which is an extension dictionary in the drawing's Layers collection. (An extension dictionary is a mechanism for attaching data to objects. Every object can have an extension dictionary.) For more information about how AutoCAD saves layer settings, see "Understand How AutoCAD Saves Layer Settings" in the ActiveX and VBA Developer's Guide.

After you retrieve the LayerStateManager object, you must associate a database with it before you can access the object's methods. Use the SetDatabase method to associate a database with the LayerStateManager object.


Layout object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Layout object

The plot settings and visual properties of a model space or paper space block.

VBA class name: | AcadLayout
Create using: | Layouts.Add
Access via: | Layouts.Item Document.ActiveLayout ModelSpace.Layout PaperSpace.Layout Block.Layout

The representation of a layout is slightly different in ActiveX from that of the AutoCAD user interface. In ActiveX, the content of a standard AutoCAD layout is broken out into two separate objects: Layout object and Block object. The Layout object contains the plot settings and the visual properties of the layout as it appears in the AutoCAD user interface. The Block object contains the geometry for the layout.

Each Layout object is associated with one Block object. To access the Block object associated with a given layout, use the Block property. Conversely, each Block object is associated with one Layout object. To access the Layout object associated with a given Block, use the Layout property for that block.

In ActiveX, in addition to the paper space layouts, model space is considered a layout.

To create a new layout, use the Add method. To edit or query a layout, use the following methods and properties:

Methods

CopyFrom

Delete

GetCustomScale

GetExtensionDictionary

GetPaperMargins

GetPaperSize

GetWindowToPlot

GetXData

SetCustomScale

SetWindowToPlot

SetXData

Properties

Application

Block

CanonicalMediaName

CenterPlot

ConfigName

Document

GetCanonicalMediaNames

GetLocaleMediaName

GetPlotDeviceNames

GetPlotStyleTableNames

Handle

HasExtensionDictionary

ModelType

Name

ObjectID

ObjectName

OwnerID

PaperUnits

PlotHidden

PlotOrigin

PlotRotation

PlotType

PlotViewportBorders

PlotViewportsFirst

PlotWithLineweights

PlotWithPlotStyles

RefreshPlotDeviceInfo

ScaleLineweights

ShowPlotStyles

StandardScale

StyleSheet

TabOrder

UseStandardScale

ViewToPlot

Properties

Modified


Layouts Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Layouts Collection

The collection of all layouts in the drawing.

VBA class name: | AcadLayouts
Create using: | N/A
Access via: | Document.Layouts

To add a new Layout to the collection, use the Add method. When a new layout is created, it is not automatically made current. To make a layout current, use the ActiveLayout property.

You can create a maximum of 255 layouts in your drawing. There can be only one instance of the Layouts Collection. The Layouts Collection is predefined for each document.

To select a specific layout, including the ModelSpace and PaperSpace collections, use the Item method.

Although the Layouts collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Layouts collection will result in an error. The Delete method has been removed from the documentation for this collection.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID


Leader object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Leader object

An object composed of an arrowhead attached to splines or straight line segments.

VBA class name: | AcadLeader
Create using: | ModelSpace.AddLeader PaperSpace.AddLeader Block.AddLeader
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A leader line is an object that can be composed of an arrowhead attached to splines or straight line segments. In some cases, a short horizontal line, called a hook line, dogleg, or landing, connects text and feature control frames to the leader line. The Leader object specifies a complex leader line. In contrast, the Leader property of the DimDiametric and DimRadial objects specifies a simple leader line.

Any annotation attached to the end of the leader line is associated with the Leader object and can be found using the Annotation property.

You can use various dimensioning system variables to format the leader line, such as placing text above the hook line with the DIMTAD system variable. The color of the leader line and arrowhead is controlled by the Color property, or by the DIMCLRD system variable. The arrowhead types are specified by the DIMBLK, or DIMBLK1 system variables when the arrowheads vary. The arrowhead and hook line length is determined by the DIMASZ system variable. The scale is set by the DIMSCALE system variable, and the basic dimension notation is set by the DIMGAP system variable.

Examples of AutoCAD leader objects

To create a leader, use the AddLeader method. To edit or query a leader, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

Evaluate

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Annotation

Application

ArrowheadBlock

ArrowheadSize

ArrowheadType

Coordinate

Coordinates

Document

DimensionLineColor

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

PlotStyleName

ScaleFactor

StyleName

TextGap

TrueColor

Type

VerticalTextPosition

Visible

Events

Modified


LightweightPolyline object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

LightweightPolyline object

A 2D line with adjustable width composed of line and arc segments.

VBA class name: | AcadLWPolyline
Create using: | ModelSpace.AddLightweightPolyline PaperSpace.AddLightweightPolyline Block.AddLightweightPolyline
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create a lightweight polyline, use the AddLightweightPolyline method. To edit or query a lightweight polyline, use the following methods and properties:

Methods

AddVertex

ArrayPolar

ArrayRectangular

Copy

Delete

Explode

GetBoundingBox

GetBulge

GetExtensionDictionary

GetWidth

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetBulge

SetWidth

SetXData

TransformBy

Update

Properties

Application

Area

Closed

ConstantWidth

Coordinate

Coordinates

Document

Elevation

Handle

HasExtensionDictionary

Hyperlinks

Layer

Length

Linetype

LinetypeGeneration

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

PlotStyleName

Thickness

TrueColor

Visible

Events

Modified


Line object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Line object

A single line segment.

VBA class name: | AcadLine
Create using: | ModelSpace.AddLine PaperSpace.AddLine Block.AddLine
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Lines can be one segment or a series of connected segments, but each segment is a separate Line object. Use the Line object if you want to edit individual segments. If you need to draw a series of line segments as a single object, use the LightweightPolyline object.

To create a line, use the AddLine method. To edit or query a line, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Angle

Application

Document

Delta

EndPoint

Handle

HasExtensionDictionary

Hyperlinks

Layer

Length

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

PlotStyleName

StartPoint

Thickness

TrueColor

Visible

Events

Modified


Linetype object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Linetype object

The line characteristics consisting of combinations of dashes, dots, and spaces.

VBA class name: | AcadLinetype
Create using: | Linetypes.Add Linetypes.Load
Access via: | Linetypes.Item Document.ActiveLinetype

You can only create default linetypes programmatically using the Add method. However, you can load an existing linetype to your drawing programmatically using the Load method.

There is no limit to the number of linetypes that can exist in your drawing. However, only one linetype can be active at a time. New objects are created with the linetype that is specified for the active layer. If no linetype has been specified for the active layer, new objects are created with the active linetype. To make a linetype active, use the ActiveLinetype property.

To add an existing linetype to your drawing, use either the Add or Load method. To edit or query a linetype, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Document

Description

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified


Linetypes Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Linetypes Collection

The collection of all linetypes in the drawing.

VBA class name: | AcadLineTypes
Create using: | N/A
Access via: | Document.Linetypes

To add a new member to the collection, use the Add method. To select a specific linetype, use the Item method.

Although the Linetypes collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Linetypes collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of linetypes that you can create in your drawing. However, there can be only one instance of the Linetypes Collection that is predefined for each drawing. You can make multiple references to it by using the Linetypes property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

Load

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


LoftedSurface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

LoftedSurface object

A surface created by lofting through a set of two or more curves.

VBA class name: | AcadLoftedSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

You can use ActiveX to query and edit LoftedSurface entities in AutoCAD drawings. You cannot create a LoftedSurface object with ActiveX. A lofted surface is created in AutoCAD by drawing a solid or surface through a set of two or more cross-section curves. The cross sections define the profile (shape) of the resulting solid or surface. Cross sections (generally, curves or lines) can be open (for example, an arc) or closed (for example, a circle).

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Closed

Document

EndDraftAngle

EndDraftMagnitude

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

NumCrossSections

NumGuidePaths

ObjectID

OwnerID

PlotStyleName

StartDraftAngle

StartDraftMagnitude

SurfaceNormals

SurfaceType

TrueColor

UIsolineDensity

VIsolineDensity

Visible

Events

Modified


Material object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Material object

The render material characteristics.

VBA class name: | AcadMaterial
Create using: | AcadMaterials.Add
Access via: | AcadDocument.ActiveMaterial AcadMaterials.Item

To set the visual properties of a material, use the MATERIALS command in AutoCAD. Use the Material property to retrieve the name of the material applied to Group, Layer, and Block objects, and SubEntSolidFace entities.

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Description

Document

Handle

HasExtensionDictionary

Name

ObjectID

OwnerID

Events

Modified


Materials object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Materials collection

The collection of all materials in the drawing.

VBA class name: | AcadMaterials
Create using: | N/A
Access via: | AcadDatabase.Materials

Use the Materials object to access materials defined in a drawing. You can create new materials by using the Materials.Add method.

Methods

Add

Delete

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

OwnerID

Events

Modified


MenuBar Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MenuBar Collection

A collection of PopupMenu objects representing the current AutoCAD menu bar.

VBA class name: | AcadMenuBar
Create using: | N/A
Access via: | Application.MenuBar

The MenuBar object contains all the menus that are currently displayed on the AutoCAD menu bar. Any menu from a currently loaded menu group can be displayed on the menu bar.

To display a menu on the menu bar, use the InsertInMenuBar method found on the PopupMenu object. To remove a menu from the current menu bar, use the RemoveFromMenuBar method also found on the PopupMenu object.

You cannot create or delete the MenuBar collection. To query the menus currently displayed on the menu bar, use the following methods and properties:

Methods

Item

Properties

Application

Count

Parent


MenuGroup object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MenuGroup object

An AutoCAD menu group.

VBA class name: | AcadMenuGroup
Create using: | MenuGroups.Load
Access via: | MenuGroups.Item

A menu group contains menus and toolbars, some or all of which may be currently displayed in AutoCAD.

Each menu group contains a PopupMenus collection and a Toolbars collection. The PopupMenus collection contains all the menus within the menu group and can be accessed through the Menus property. Likewise, the Toolbars collection contains all the toolbars within the menu group and can be accessed through the Toolbars property.

Menu groups are loaded into the AutoCAD session using the Load method. This method loads a specified customization file that contains the menu group. The menu group is then added to the MenuGroups collection. Once loaded, individual menus can be inserted into the menu bar and toolbars can be displayed. The Load method also provides a mechanism to load the menu group as the base menu in the same manner as the MENU command in AutoCAD. When a menu group is loaded as the base menu, the Type property for that menu group will be set to acBaseMenuGroup.

Methods

Save

SaveAs

Unload

Properties

Application

MenuFileName

Menus

Name

Parent

Toolbars

Type


MenuGroups Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MenuGroups Collection

A collection of MenuGroup objects representing all the menu groups loaded in the current AutoCAD session.

VBA class name: | AcadMenuGroups
Create using: | N/A
Access via: | Application.MenuGroups

The MenuGroups collection contains all the menu groups that are loaded in the current AutoCAD session.

Menu groups contain all the menus that are available to the AutoCAD session, some or all of which may be displayed on the AutoCAD menu bar. In addition to the menus, the menu groups also contain all the toolbars that are available to the current AutoCAD session.

To load a new menu group into this collection, use the Load method.

To unload a menu group from this collection, use the Unload method found on the MenuGroup object. To edit or query the menu groups in this collection, use the following methods and properties:

Methods

Item

Load

Properties

Application

Count

Parent


MInsertBlock object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MInsertBlock object

A rectangular array of block references.

VBA class name: | AcadMInsertBlock
Create using: | ModelSpace.AddMInsertBlock PaperSpace.AddMInsertBlock Block.AddMInsertBlock
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item
Original block | Array of inserted blocks

To add an MInsertBlock to your drawing, use the AddMInsertBlock method. To edit or query the MInsertBlock, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

ConvertToAnonymousBlock

ConvertToStaticBlock

Copy

Delete

Explode

GetAttributes

GetBoundingBox

GetConstantAttributes

GetDynamicBlockProperties

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ResetBlock

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Columns

ColumnSpacing

Document

EffectiveName

Handle

HasAttributes

HasExtensionDictionary

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

Name

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

Rows

RowSpacing

TrueColor

Visible

XEffectiveScaleFactor

XScaleFactor

YEffectiveScaleFactor

YScaleFactor

ZEffectiveScaleFactor

ZScaleFactor

Events

Modified


MLeader object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MLeader object

An object composed of an arrowhead attached to multiple splines or straight line segments.

VBA class name: | AcadMLeader
Create using: | ModelSpace.AddMLeader PaperSpace.AddMLeader Block.AddMLeader
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A multi-leader line is an object that can be composed of an arrowhead attached to multiple splines or straight line segments. In some cases, a short horizontal line, called a hook line, dogleg, or landing, connects text and feature control frames to the multi-leader line. The MLeader object specifies a complex leader line. In contrast, the MLeader property of the DimDiametric and DimRadial objects specifies a simple leader line.

Any annotation attached to the end of the leader line is associated with the MLeader object and can be found using the Annotation property.

You can use various dimensioning system variables to format the multi-leader line, such as placing text above the hook line with the DIMTAD system variable. The color of the leader line and arrowhead is controlled by the Color property, or by the DIMCLRD system variable. The arrowhead types are specified by the DIMBLK, or DIMBLK1 system variables when the arrowheads vary. The arrowhead and hook line length is determined by the DIMASZ system variable. The scale is set by the DIMSCALE system variable, and the basic dimension notation is set by the DIMGAP system variable.

To create an mleader, use the AddMLeader method. To edit or query a leader, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

Evaluate

GetBlockAttributeValue

GetBlockAttributeValue32

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

SetBlockAttributeValue

SetBlockAttributeValue32

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

ArrowheadBlock

ArrowheadSize

ArrowheadType

BlockConnectionType

ContentBlockName

ContentBlockType

Coordinate

Coordinates

Document

DogLegged

DoglegLength

Handle

HasExtensionDictionary

Hyperlinks

LandingGap

Layer

LeaderLineColor

LeaderLineType

LeaderLineWeight

LeaderType

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

PlotStyleName

ScaleFactor

StyleName

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLeftAttachmentType

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRightAttachmentType

TextRotation

TextString

TextStyleName

TextWidth

TrueColor

Type

Visible

Events

Modified


MLeaderStyle object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MLeaderStyle object

Adds, modifies, and deletes MLeader styles.

VBA class name: | AcadMLeaderStyle
Create using: | Dim customObj as AcadMLeaderStyle
Access via: | Dim customObj as AcadMLeaderStyle

You can use the MLeaderStyle object to store MLeader formatting. The object controls the initial formatting of a newly created MLeader object.

You can see an implementation of the MLeaderStyle object by following this example.

Methods

OverwritePropChanged

Properties

AlignSpace

Annotative

ArrowSymbol

ArrowSize

BitFlags

Block

BlockColor

BlockConnectionType

BlockScale

BreakSize

ContentType

Description

DrawLeaderOrderType

DrawMLeaderOrderType

DoglegLength

EnableBlockRotation

EnableBlockScale

EnableDogleg

EnableFrameText

EnableLanding

FirstSegmentAngleConstraint

LeaderLineColor

LeaderLineType

LeaderLineTypeId

LeaderLineWeight

MaxLeaderSegmentsPoints

Name

SecondSegmentAngleConstraint

ScaleFactor

TextAlignmentType

TextAngleType

TextColor

TextHeight

TextString

Events


MLine object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MLine object

Multiple parallel lines.

VBA class name: | AcadMLine
Create using: | ModelSpace.AddMLine PaperSpace.AddMLine Block.AddMLine
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

MLines can be comprised of up to 16 lines.

To add an MLine to your drawing, use the AddMLine method. To edit or query the MLine, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Justification

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

ObjectName

OwnerID

PlotStyleName

StyleName

TrueColor

Visible

Events

Modified


ModelSpace Entities Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

ModelSpace Collection

A special Block object containing all model space entities.

VBA class name: | AcadModelSpace
Create using: | N/A
Access via: | Document.ModelSpace

This collection represents all the objects in model space. To add new objects to model space, use the Add* methods listed below.

Because this collection is actually a block, it possesses several block characteristics. For example, this collection has a Layout object associated with it. In addition, all the objects in this collection can also be found in the Blocks collection under a block named *MODEL_SPACE. Both the block named *MODEL_SPACE and the ModelSpace collection actually point to the same data. The ModelSpace collection was created to provide a faster and easier means of accessing the data in model space.

You cannot create or delete a ModelSpace collection. There is always one ModelSpace collection provided in the drawing.

To edit or query the ModelSpace collection, use the following methods and properties:

Methods

Add3DFace

Add3DMesh

Add3DPoly

AddArc

AddAttribute

AddBox

AddCircle

AddCone

AddCustomObject

AddCylinder

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

AddEllipse

AddEllipticalCone

AddEllipticalCylinder

AddExtrudedSolid

AddExtrudedSolidALongPath

AddHatch

AddLeader

AddLightWeightPolyline

AddLine

AddMLeader

AddMLine

AddMText

AddPoint

AddPolyfaceMesh

AddPolyline

AddRaster

AddRay

AddRegion

AddRevolvedSolid

AddShape

AddSolid

AddSphere

AddSpline

AddTable

AddText

AddTolerance

AddTorus

AddTrace

AddWedge

AddXLine

AttachExternalReference

InsertBlock

Item

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Layout

Name

Events

Modified


MText object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

MText object

A paragraph of alphanumeric characters that fits within a nonprinting text boundary.

VBA class name: | AcadMtext
Create using: | ModelSpace.AddMText PaperSpace.AddMText Block.AddMText
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

You define the text boundary, which specifies the width and alignment of the paragraph. Each MText object is a single object, regardless of the number of lines it contains. The text boundary, although not plotted or printed, remains part of the object's framework.

MText objects use word wrap to break long lines into paragraphs. AutoCAD automatically breaks lines at the edge of the text boundary, as specified by the Width property.

Note that RTF text isn't recognized. Text from other programs with embedded formatting will lose formatting when imported into an mtext paragraph.

To create an MText object use the AddMText method. To edit or query an MText object, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

FieldCode

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

AttachmentPoint

BackgroundFill

Document

DrawingDirection

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Layer

LineSpacingDistance

LineSpacingFactor

LineSpacingStyle

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

StyleName

TextString

TrueColor

Visible

Width

Events

Modified


OLE object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

OLE object

An AutoCAD OLE object.

VBA class name: | AcadOle
Create using: | Not applicable
Access via: | Not applicable

The OLE object allows you to use VBA to insert information from another application into AutoCAD.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

LockAspectRatio

ObjectID

ObjectName

OleItemType

OlePlotQuality

OleSourceApp

OwnerID

PlotStyleName

Rotation

ScaleHeight

ScaleWidth

TrueColor

Visible

Width

Events

Modified


PaperSpace Entities Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PaperSpace Collection

A special Block object containing all the entities in the active paper space layout.

VBA class name: | AcadPaperSpace
Create using: | N/A
Access via: | Document.PaperSpace

This collection represents all the objects in the active paper space layout. If a different paper space layout is made active, the data in the PaperSpace collection will be changed to reflect the data in the new active paper space layout.

Because this collection is actually a block, it possesses several block characteristics. For example, this collection has a Layout object associated with it that contains all of the plot settings and visible attributes of the paper space layout. Additionally, all the objects in the PaperSpace collection can be found in the Blocks collection under a block named *PAPER_SPACE. Both the block named *PAPER_SPACE and the PaperSpace collection actually point to the same data. The PaperSpace collection was created to provide a faster and easier means of accessing the data in active paper space layout.

Paper space layouts are used for creating a finished layout for printing or plotting the drawing, as opposed to doing drafting or design work, which is accomplished in model space. Although both 2D and 3D objects can exist in paper space, commands that render a 3D viewpoint are disabled.

You cannot create or delete the PaperSpace collection. To edit or query the PaperSpace collection, use the following methods and properties:

Methods

Add3DFace

Add3DMesh

Add3DPoly

AddArc

AddAttribute

AddBox

AddCircle

AddCone

AddCustomObject

AddCylinder

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

AddEllipse

AddEllipticalCone

AddEllipticalCylinder

AddExtrudedSolid

AddExtrudedSolidALongPath

AddHatch

AddLeader

AddLightWeightPolyline

AddLine

AddMLeader

AddMLine

AddMText

AddPoint

AddPolyfaceMesh

AddPolyline

AddPViewport

AddRaster

AddRay

AddRegion

AddRevolvedSolid

AddShape

AddSolid

AddSphere

AddSpline

AddTable

AddText

AddTolerance

AddTorus

AddTrace

AddWedge

AddXLine

AttachExternalReference

InsertBlock

Item

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Layout

Name

Events

Modified


PlaneSurface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PlaneSurface object

A planar surface.

VBA class name: | AcadPlaneSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object provides access to planar surfaces in AutoCAD. You cannot create a surface entity via ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

SurfaceType

TrueColor

UIsolineDensity

VIsolineDensity

Visible

Events

Modified


Plot object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Plot object

The set of methods and properties used for plotting layouts.

VBA class name: | AcadPlot
Create using: | N/A
Access via: | Document.Plot

This object contains the methods and properties that initiate a plot of specified layouts. You can choose to:

  • Display a plot preview
  • Plot to a file
  • Plot to a plot device

To plot in the foreground using VBA, you must set the BACKGROUNDPLOT system variable to 0. Otherwise, plotting occurs in the background.

To specify the layouts to plot, use the SetLayoutsToPlot method. This method must be called before each PlotToDevice or PlotToFile method. If SetLayoutsToPlot is not called, or is called with a NULL input, the active layout will be plotted.

The NumberOfCopies property specifies the number of copies to plot. If this property is not reset before each PlotToDevice call, the last value specified in the NumberOfCopies property will be used.

You cannot create a configured plotter (PC3) file using ActiveX. To create a PC3 file, use the Add-a-Plotter wizard in AutoCAD. If you want to use a PC3 file for plotting, the file should be located in the Plotters folder. For more information, see the AutoCAD user documentation.

Methods

DisplayPlotPreview

PlotToDevice

PlotToFile

SetLayoutsToPlot

StartBatchMode

Properties

Application

QuietErrorMode

NumberOfCopies

BatchPlotProgress


PlotConfiguration object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PlotConfiguration object

A named collection of plot settings.

VBA class name: | AcadPlotConfiguration
Create using: | PlotConfigurations.Add
Access via: | PlotConfigurations.Item

A plot configuration is similar to a layout; as both contain identical plot information. The difference is that a layout is associated with a Block object containing the geometry to plot. A plot configuration is not associated with a particular Block object. A plot configuration is simply a named collection of plot settings available for use with any geometry.

To create a new plot configuration, use the Add method. To edit or query a plot configuration, use the following methods and properties:

Methods

Delete

CopyFrom

GetCanonicalMediaNames

GetCustomScale

GetExtensionDictionary

GetLocaleMediaName

GetPaperMargins

GetPaperSize

GetPlotDeviceNames

GetPlotStyleTableNames

GetWindowToPlot

GetXData

SetCustomScale

SetWindowToPlot

SetXData

Properties

Application

CanonicalMediaName

CenterPlot

ConfigName

Document

Handle

HasExtensionDictionary

ModelType

Name

ObjectID

ObjectName

OwnerID

PaperUnits

PlotHidden

PlotOrigin

PlotRotation

PlotType

PlotViewportBorders

PlotViewportsFirst

PlotWithLineweights

PlotWithPlotStyles

RefreshPlotDeviceInfo

ScaleLineweights

ShowPlotStyles

StandardScale

StyleSheet

UseStandardScale

ViewToPlot

Events

Modified


PlotConfigurations Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PlotConfigurations Collection

A collection of named plot settings.

VBA class name: | AcadPlotConfigurations
Create using: | N/A
Access via: | Document.PlotConfigurations

A plot configuration is similar to a layout; as both contain identical plot information. The difference is that a layout is associated with a Block object containing the geometry to plot. A plot configuration is not associated with a particular Block object. A plot configuration is simply a named collection of plot settings available for use with any geometry.

Although the PlotConfigurations collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete this collection will result in an error. The Delete method has been removed from the documentation for this collection.

To create a new plot configuration, use the Add method. To edit or query a plot configuration, use the following methods and properties:

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Point object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Point object

A point marker appearing as a dot, square, circle, X, tick, or plus sign (+); or as a combination of these.

VBA class name: | AcadPoint
Create using: | ModelSpace.AddPoint PaperSpace.AddPoint Block.AddPoint
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

You can specify a full 3D location for a point. The current elevation is assumed if you omit the Z coordinate.

Points can act as nodes to which you can snap objects. Also, the Coordinates property provides an array that can be used in any method requiring a point as an input parameter.

Controlling the Appearance of Points

The PDMODE and PDSIZE system variables control the appearance of point objects. PDMODE values 0, 2, 3, and 4 specify a figure to draw through the point. A value of 1 selects nothing to be displayed.

Adding 32, 64, or 96 to the values above selects a shape to draw around the point in addition to the figure drawn through it:

PDSIZE controls the size of the point figures, except for PDMODE values 0 and 1. A 0 setting generates the point at 5 percent of the graphics area height. A positive PDSIZE value specifies an absolute size for the point figures. A negative value is interpreted as a percentage of the viewport size. The size of all points is recalculated when the drawing is regenerated.

After you change PDMODE and PDSIZE, the appearance of existing points changes the next time AutoCAD regenerates the drawing.

Creating and Editing Points

To create a point, use the AddPoint method. To edit or query a point, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

Thickness

TrueColor

Visible

Events

Modified


PolyfaceMesh object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PolyfaceMesh object

A three-dimensional polyface mesh.

VBA class name: | AcadPolyfaceMesh
Create using: | ModelSpace.AddPolyfaceMesh PaperSpace.AddPolyfaceMesh Block.AddPolyfaceMesh
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create a polyface mesh, use the AddPolyfaceMesh method. To edit or query a polyface mesh, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

NumberOfFaces

NumberOfVertices

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Visible

Events

Modified


PolygonMesh object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PolygonMesh object

A free-form 3D mesh.

VBA class name: | AcadPolygonMesh
Create using: | ModelSpace.AddPolygonMesh PaperSpace.AddPolygonMesh Block.AddPolygonMesh
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A PolygonMesh object is an M x N mesh where M represents the number of vertices in a row of the mesh and N represents the number of vertices in a column of the mesh.

A mesh can be open or closed in either or both the M and N directions. A mesh that is closed in a given direction is considered to be continuous from the last row or column on to the first row or column.

To create a PolygonMesh use the Add3DMesh method. To edit or query a PolygonMesh, use the following methods and properties:

Methods

AppendVertex

ArrayPolar

ArrayRectangular

Copy

Delete

Explode

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

MClose

MDensity

MVertexCount

NClose

NDensity

NVertexCount

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Type

Visible

Events

Modified


Polyline object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Polyline object

A 2D line of adjustable width or a 3D line or mesh of nonadjustable width composed of line and arc segments.

VBA class name: | AcadPolyline
Create using: | ModelSpace.AddPolyline PaperSpace.AddPolyline Block.AddPolyline
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object is an earlier version of the LightweightPolyline object.

This object exists for backward compatibility only. Use the new LightweightPolyline object to create polylines with an optimized format that saves memory and disk space.

Methods

AppendVertex

ArrayPolar

ArrayRectangular

Copy

Delete

Explode

GetBoundingBox

GetBulge

GetExtensionDictionary

GetWidth

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetBulge

SetWidth

SetXData

TransformBy

Update

Properties

Application

Area

Closed

Coordinate

Coordinates

Document

Elevation

Hyperlinks

Handle

HasExtensionDictionary

Layer

Length

Linetype

LinetypeGeneration

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Thickness

TrueColor

Type

Visible

Events

Modified


PopupMenu object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PopupMenu object

An AutoCAD cascading menu.

VBA class name: | AcadPopupMenu
Create using: | PopupMenus.Add
Access via: | PopupMenus.Item MenuBar.Item

There are two types of AutoCAD menus:

  • Pull-down menus (menus accessed from the AutoCAD menu bar)
  • Shortcut menus (menus accessed from a mouse right-click)

A pull-down menu can contain up to 999 menu items. A shortcut menu can contain up to 499 menu items. If the number of menu items in a menu exceed these limits, AutoCAD ignores the extra items. If a pull-down or shortcut menu is taller than the available space on the graphics screen, it is truncated to fit on the screen.

The shortcut menu is a special menu in the base menu group. You can identify the shortcut menu by using the ShortcutMenu property.

To create a new menu, use the Add method to add a new PopupMenu object to the PopupMenus collection. To create a new shortcut menu, you must first delete any existing shortcut menu. There can be only one shortcut menu per menu group. If there is no other shortcut menu in a menu group, you can then add a menu with the label "POP0". This label will tell AutoCAD that you want to create a shortcut menu.

You can add new menu entries or separators to the menu using the AddMenuItem and AddSeparator methods. You can create submenus using the AddSubmenu method.

You can add the menu to the menu bar using the InsertInMenuBar method. Conversly, you can remove menus from the menu bar by using the RemoveFromMenuBar method.

To edit or query a menu, use the following methods and properties:

Methods

AddMenuItem

AddSeparator

AddSubmenu

InsertInMenuBar

Item

RemoveFromMenuBar

Properties

Application

Count

Name

NameNoMnemonic

OnMenuBar

Parent

ShortcutMenu

TagString


PopupMenuItem object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PopupMenuItem object

A single menu item on an AutoCAD pull-down menu.

VBA class name: | AcadPopupMenuItem
Create using: | PopupMenu.AddMenuItem PopupMenu.AddSeparator PopupMenu.AddSubmenu
Access via: | PopupMenu.Item

A popup menu item represents an entry in a menu. There are three types of popup menu items available:

  • Simple menu item (a menu that contains no submenu items)
  • Separator (a border that appears on a menu)
  • Submenu (a menu containing submenu items)

Simple menu items have an index, a label, a tag, and a macro. The index is the position on the menu where the individual menu item is located. The label is a string that defines the content and formatting of the menu item as it appears to the user. The tag is a string consisting of alphanumeric and underscore (_) characters. This tag uniquely identifies the menu item within a given menu. Menu items may have identical labels within the menu, but they cannot have identical tags. The end user does not see the tag. The macro is a series of commands that execute specific actions when a menu item is selected.

Submenu items also have an index, a label, and a tag. They do not have a macro associated with them. Instead, they have an entire PopupMenu object associated with them. This PopupMenu object is the menu that appears when the user selects the submenu item. To find a PopupMenu object associated with a submenu item, use the SubMenu property.

Separators have only an index. The index for a separator specifies where on the menu the separator is to appear.

To add a new menu item, use the AddMenuItem, AddSeparator, or AddSubmenu methods. To edit or query an existing menu item, use the following methods and properties:

Methods

Delete

Properties

Application

Caption

Check

Enable

EndSubMenuLevel

HelpString

Index

Label

Macro

Parent

SubMenu

TagString

Type


PopupMenus Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PopupMenus Collection

A collection of PopupMenu objects representing all the popup menus loaded in the MenuGroup.

VBA class name: | AcadPopupMenus
Create using: | N/A
Access via: | MenuGroup.Menus

The PopupMenus collection represents all the menus loaded in the current AutoCAD session, some or all of which may be currently displayed in AutoCAD. To load an existing menu into the current session, load the menu group containing the menu using the Load method. To create a new menu, use the Add method.

To display a menu on the AutoCAD menu bar, use the InsertMenuInMenuBar method. To remove a menu from the menu bar, use the RemoveMenuFromMenuBar method.

To edit or query the PopupMenu objects in the collection, use the following methods and properties:

Methods

Add

InsertMenuInMenuBar

Item

RemoveMenuFromMenuBar

Properties

Application

Count

Parent


Preferences object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Preferences object

This object specifies the current AutoCAD settings.

VBA class name: | AcadPreferences
Create using: | N/A
Access via: | Application.Preferences

The Preferences object holds all the options from the Options dialog that reside in the registry. Options that reside in the drawing can be found through the DatabasePreferences object.

The Preferences object is divided into separate objects, with each representing a tab on the Options dialog.

The Preferences object can be referenced from the Preferences property on the Application object.

Methods

None

Properties

Application

Drafting

Display

Files

OpenSave

Output

Profiles

Selection

System

User


PreferencesDisplay object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesDisplay object

This object contains the options from the Display tab on the Options dialog.

VBA class name: | AcadPreferencesDisplay
Create using: | N/A
Access via: | Application.Preferences.Display

This object holds all the options from the Display tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

None

Properties

Application

AutoTrackingVecColor

CursorSize

DisplayLayoutTabs

DisplayScreenMenu

DisplayScrollBars

DockedVisibleLines

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

HistoryLines

ImageFrameHighlight

LayoutCreateViewport

LayoutCrosshairColor

LayoutDisplayMargins

LayoutDisplayPaper

LayoutDisplayPaperShadow

LayoutShowPlotSetup

MaxAutoCADWindow

ModelCrosshairColor

ShowRasterImage

TextFontSize

TextFont

TextFontStyle

TextWinBackgrndColor

TextWinTextColor

TrueColorImages

XRefFadeIntensity


PreferencesDrafting object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesDrafting object

This object contains the options from the Drafting tab on the Options dialog.

VBA class name: | AcadPreferencesDrafting
Create using: | N/A
Access via: | Application.Preferences.Drafting

This object holds all the options from the Drafting tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

None

Properties

AlignmentPointAcquisition

Application

AutoSnapAperture

AutoSnapApertureSize

AutoSnapMagnet

AutoSnapMarker

AutoSnapMarkerColor

AutoSnapMarkerSize

AutoSnapToolTip

AutoTrackToolTip

FullScreenTrackingVector

PolarTrackingVector


PreferencesFiles object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesFiles object

This object contains the options from the Files tab on the Options dialog.

VBA class name: | AcadPreferencesFiles
Create using: | N/A
Access via: | Application.Preferences.Files

This object holds all the options from the Files tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

GetProjectFilePath

SetProjectFilePath

Properties

Application

AltFontFile

AltTabletMenuFile

AutoSavePath

ColorBookPath

ConfigFile

CustomDictionary

DefaultInternetURL

DriversPath

FontFileMap

HelpFilePath

LogFilePath

MainDictionary

MenuFile

PageSetupOverridesTemplateFile

PlotLogFilePath

PostScriptPrologFile

PrinterConfigPath

PrinterDescPath

PrinterStyleSheetPath

PrintFile

PrintSpoolerPath

PrintSpoolExecutable

QNewTemplateFile

SupportPath

TempFilePath

TemplateDWGPath

TempXRefPath

TextEditor

TextureMapPath

ToolPalettePath

WorkspacePath


PreferencesOpenSave object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesOpenSave object

This object contains options from the Open and Save tab on the Options dialog.

VBA class name: | AcadPreferencesOpenSave
Create using: | N/A
Access via: | Application.Preferences.OpenSave

This object holds options from the Open and Save tab on the Options dialog. They are stored in the registry.

Methods

None

Properties

Application

AutoAudit

AutoSaveInterval

CreateBackup

DemandLoadARXApp

FullCRCValidation

IncrementalSavePercent

LogFileOn

MRUNumber

ProxyImage

SaveAsType

SavePreviewThumbnail

ShowProxyDialogBox

TempFileExtension

XRefDemandLoad


PreferencesOutput object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesOutput object

This object contains the options from the Output tab on the Options dialog.

VBA class name: | AcadPreferencesOutput
Create using: | N/A
Access via: | Application.Preferences.Output

This object holds all the options from the Output tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

None

Properties

Application

AutomaticPlotLog

ContinuousPlotLog

DefaultOutputDevice

DefaultPlotToFilePath

DefaultPlotStyleForLayer

DefaultPlotStyleForObjects

OLEQuality

PlotLegacy

PlotPolicy

PrinterPaperSizeAlert

PrinterSpoolAlert

UseLastPlotSettings


PreferencesProfiles object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesProfiles object

This object contains the options from the Profiles tab on the Options dialog.

VBA class name: | AcadPreferencesProfiles
Create using: | N/A
Access via: | Application.Preferences.Profiles

This object holds all the options from the Profiles tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

CopyProfile

DeleteProfile

ExportProfile

GetAllProfileNames

ImportProfile

RenameProfile

ResetProfile

Properties

ActiveProfile

Application


PreferencesSelection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesSelection object

This object contains the options from the Selection tab on the Options dialog.

VBA class name: | AcadPreferencesSelection
Create using: | N/A
Access via: | Application.Preferences.Selection

This object holds all the options from the Selection tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

dNone

Properties

Application

DisplayGrips

DisplayGripsWithinBlocks

GripColorSelected

GripColorUnselected

GripSize

PickAdd

PickAuto

PickBoxSize

PickDrag

PickFirst

PickGroup


PreferencesSystem object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesSystem object

This object contains the options from the System tab on the Options dialog.

VBA class name: | AcadPreferencesSystem
Create using: | N/A
Access via: | Application.Preferences.System

This object holds all the options from the System tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

None

Properties

Application

BeepOnError

DisplayOLEScale

EnableStartupDialog

LoadAcadLspInAllDocuments

ShowWarningMessages

StoreSQLIndex

TablesReadOnly


PreferencesUser object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PreferencesUser object

This object contains the options from the User tab on the Options dialog.

VBA class name: | AcadPreferencesUser
Create using: | N/A
Access via: | Application.Preferences.User

This object holds all the options from the User tab on the Options dialog stored in the registry. All options that are stored with the drawing can be found on the DatabasePreferences object.

Methods

None

Properties

ADCInsertUnitsDefaultSource

ADCInsertUnitsDefaultTarget

Application

HyperlinkDisplayCursor

HyperlinkDisplayTooltip

KeyboardAccelerator

KeyboardPriority

SCMCommandMode

SCMDefaultMode

SCMEditMode

SCMTimeMode

SCMTimeValue

ShortCutMenuDisplay


PViewport object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

PViewport object

Rectangular objects created in paper space that display views.

VBA class name: | AcadPViewport
Create using: | PaperSpace.AddPViewport
Access via: | PaperSpace.Item Document.ActivePViewport

The functionality of the PViewport object is slightly different from what is used in the AutoCAD user interface. Users familiar with AutoCAD paper space viewport functionality will find the following information helpful.

In ActiveX Automation, the ActiveSpace property is used to control the TILEMODE system variable. Setting ThisDrawing.ActiveSpace = acModelSpace is equivalent to setting TILEMODE = 1, and setting ThisDrawing.ActiveSpace = acPaperSpace is equivalent to setting TILEMODE = 0.

Similarly, the MSpace property is the equivalent of both the MSPACE and PSPACE commands in AutoCAD. Setting ThisDrawing.MSpace = True is the same as using the MSPACE command, and setting ThisDrawing.MSpace = False is the same as using the PSPACE command.

In addition, the ActiveX Automation user is required to use the Display method before setting the MSpace property to TRUE. The Display method initializes certain graphic settings that must be set before switching to model space. In AutoCAD this is done "behind the scenes." However, in the ActiveX Automation interface, the programmer must take care of this initialization.

NOTE Remember, you must turn on the display using the Display method for at least one PViewport object before you can set the MSpace property to TRUE. Failure to turn on the display will result in an error being returned when you try to set the MSpace property.

The ActiveSpace and MSpace properties are found on the Document object.

To create a PViewport object, use the AddPViewport method. To edit or query a paper space viewport object, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Display

Delete

GetBoundingBox

GetExtensionDictionary

GetGridSpacing

GetSnapSpacing

GetXData

Highlight

LayerPropertyOverrides

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetGridSpacing

SetSnapSpacing

SetXData

SyncModelView

TransformBy

Update

Properties

Application

ArcSmoothness

Center

Clipped

CustomScale

Direction

DisplayLocked

Document

GridOn

Handle

HasExtensionDictionary

HasSheetView

Height

Hyperlinks

LabelBlockId

LabelBlockId32

Layer

LensLength

Linetype

LinetypeScale

Lineweight

ModelView

ObjectID

ObjectName

OwnerID

PlotStyleName

RemoveHiddenLines

ShadePlot

SheetView

SnapBasePoint

SnapOn

SnapRotationAngle

StandardScale

Target

TrueColor

TwistAngle

UCSIconAtOrigin

UCSIconOn

UCSPerViewport

ViewportOn

Visible

Width

Events

Modified


Raster object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Raster object

A raster image consisting of a rectangular grid (or raster) of small squares or dots known as pixels.

VBA class name: | AcadRasterImage
Create using: | ModelSpace.AddRaster PaperSpace.AddRaster Block.AddRaster
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create a raster image use the AddRaster method. To edit or query a raster image, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

ClipBoundary

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Brightness

ClippingEnabled

Contrast

Document

Fade

Handle

HasExtensionDictionary

Height

Hyperlinks

ImageFile

ImageHeight

ImageVisibility

ImageWidth

Layer

Linetype

LinetypeScale

Lineweight

Name

ObjectID

ObjectName

Origin

OwnerID

PlotStyleName

Rotation

ScaleFactor

ShowRotation

Transparency

TrueColor

Visible

Width

Events

Modified


Ray object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Ray object

A semi-infinite line.

VBA class name: | AcadRay
Create using: | ModelSpace.AddRay PaperSpace.AddRay Block.AddRay
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Rays are commonly used as construction lines. A ray has a finite starting point and extends to infinity.

To create a ray, use the AddRay method. To edit or query a ray, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

BasePoint

DirectionVector

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

SecondPoint

TrueColor

Visible

Events

Modified


Region object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Region object

A bounded planar face consisting of lines, circles, arcs, elliptical arcs, and spline curves.

VBA class name: | AcadRegion
Create using: | ModelSpace.AddRegion PaperSpace.AddRegion Block.AddRegion
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Each object in the region retains its layer, linetype, and color. AutoCAD deletes the original objects after converting them to regions and does not hatch the regions by default.

You can explode a region into the individual loops by using the Explode method. The Boolean method allows you to create composite 3D solids or regions from the intersection, union, or subtraction of a solid or region from another solid or region.

To create a region, use the AddRegion method. To edit or query a region, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Boolean

Copy

Delete

Explode

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Area

Centroid

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

MomentOfInertia

Normal

ObjectID

ObjectName

OwnerID

Perimeter

PlotStyleName

PrincipalDirections

PrincipalMoments

ProductOfInertia

RadiiOfGyration

TrueColor

Visible

Events

Modified


RegisteredApp object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

RegisteredApplication object

An external application that has been added to the drawing.

VBA class name: | AcadRegisteredApplication
Create using: | RegisteredApplications.Add
Access via: | RegisteredApplications.Item

To be recognized by AutoCAD, an application must register the name or names that it uses. The application name needs to be registered only once per drawing.

Application names are saved with the extended data of each entity that uses them. Every instance of extended data referenced in a drawing must have its application registered in the drawing.

To register an application, add it to the RegisteredApplications Collection using the Add method. To edit or query a RegisteredApplication object, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified


RegisteredApplications Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

RegisteredApplications Collection

The collection of all registered applications in the drawing.

VBA class name: | AcadRegisteredApplications
Create using: | N/A
Access via: | Document.RegisteredApplications

To add a new member to the collection, use the Add method. To select a specific registered application, use the Item method. To delete a specific registered application, use the Delete method found on the RegisteredApplication object.

Although this collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete this collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of registered applications that you can create in your drawing. However, there can be only one instance of the RegisteredApplications Collection. The RegisteredApplications Collection is predefined for each drawing. You can make multiple references to it by using the RegisteredApplications property.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


RevolvedSurface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

RevolvedSurface object

A surface created by revolving one or more 2D objects about an axis.

VBA class name: | AcadRevolvedSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object provides access to revolved surfaces in AutoCAD. It lets you manipulate the properties of the surface. You cannot create a surface entity via ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

AxisDirection

AxisPosition

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

RevolutionAngle

SurfaceType

TrueColor

UIsolineDensity

VIsolineDensity

Visible

Events

Modified


Section object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Section object

A section plane entity created at the intersection of a plane and a solid.

VBA class name: | AcadSection
Create using: | AcadBlock.AddSection
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

The Section object represents a cross section through a 3D solid. The result can be a two-dimensional object that represents the shape of the section. To create a Section object, use Block.AddSection.

Methods

AddVertex

ArrayPolar

ArrayRectangular

Copy

CreateJog

Delete

GenerateSectionGeometry

GetBoundingBox

GetExtensionDictionary

GetSettings

GetXData

Highlight

HitTest

IntersectWith

Mirror

Mirror3D

Move

Offset

RemoveVertex

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

BottomHeight

Coordinate

Document

Elevation

Handle

HasExtensionDictionary

Hyperlinks

IndicatorFillColor

IndicatorTransparency

Layer

Linetype

LinetypeScale

Lineweight

LiveSectionEnabled

Name

Normal

NumVertices

ObjectID

OwnerID

PlotStyleName

State

TopHeight

TrueColor

VerticalDirection

Vertices

ViewingDirection

Visible

Events

Modified


SectionManager object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SectionManager object

This object manages the collection of section planes in the DWG database.

VBA class name: | AcadSectionManager
Create using: | N/A
Access via: | AcadDatabase.SectionManager

SectionManager objects cannot be created through ActiveX. You can obtain the SectionManager object for a database from the Database.SectionManager property. However, the SectionManager object is available in a drawing only after a section plane has been created.

Methods

Delete

GetExtensionDictionary

GetLiveSection

GetUniqueSectionName

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

OwnerID

Events

Modified


SectionSettings object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SectionSettings object

A container for section geometry settings.

VBA class name: | AcadSectionSettings
Create using: | N/A
Access via: | AcadSection.GetSettings

Methods

Delete

GetExtensionDictionary

GetSectionTypeSettings

GetXData

SetXData

Properties

Application

CurrentSectionType

Document

Handle

HasExtensionDictionary

ObjectID

OwnerID

Events

Modified


SectionTypeSettings object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SectionTypeSettings object

The settings that apply to the various types of sections.

VBA class name: | AcadSectionTypeSettings
Create using: | N/A
Access via: | SectionSettings.GetSectionTypeSettings

Types of sections include live sections, 2D sections, and 3D sections. Geometry that is generated during section creation falls into one of five categories: intersection boundary, intersection fill, background geometry, foreground geometry, and curve tangency lines. Properties of the SectionTypeSettings object control the AutoCAD characteristics of these five categories for each of the three types.

Properties

BackgroundLinesColor

BackgroundLinesHiddenLine

BackgroundLinesLayer

BackgroundLinesLinetype

BackgroundLinesLinetypeScale

BackgroundLinesLineweight

BackgroundLinesPlotStyleName

BackgroundLinesVisible

CurveTangencyLinesColor

CurveTangencyLinesLayer

CurveTangencyLinesLinetype

CurveTangencyLinesLinetypeScale

CurveTangencyLinesLineweight

CurveTangencyLinesPlotStyleName

CurveTangencyLinesVisible

DestinationBlock

DestinationFile

ForegroundLinesColor

ForegroundLinesEdgeTransparency

ForegroundLinesFaceTransparency

ForegroundLinesHiddenLine

ForegroundLinesLayer

ForegroundLinesLinetype

ForegroundLinesLinetypeScale

ForegroundLinesLineweight

ForegroundLinesPlotStyleName

ForegroundLinesVisible

GenerationOptions

IntersectionBoundaryColor

IntersectionBoundaryDivisionLines

IntersectionBoundaryLayer

IntersectionBoundaryLinetype

IntersectionBoundaryLinetypeScale

IntersectionBoundaryLineweight

IntersectionBoundaryPlotStyleName

IntersectionFillColor

IntersectionFillFaceTransparency

IntersectionFillHatchAngle

IntersectionFillHatchPatternName

IntersectionFillHatchPatternType

IntersectionFillHatchScale

IntersectionFillHatchSpacing

IntersectionFillLayer

IntersectionFillLinetype

IntersectionFillLinetypeScale

IntersectionFillLineweight

IntersectionFillPlotStyleName

IntersectionFillVisible

SourceObjects


SecurityParams object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SecurityParams object

Supplies information necessary for performing security operations on drawing files.

VBA class name:

SecurityParams

Create using:

GetInterfaceObject("AutoCAD.SecurityParams.16"), or
Dim sp As New AcadSecurityParams

Access via:

Not applicable

The SecurityParams object stores settings used for drawing security. You can use the SecurityParams object to encrypt and digitally sign drawing files.

The object includes properties for information about cryptography providers and other settings for drawing security. Additional information about cryptography providers is available on MSDN.

Methods

None

Properties

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


SelectionSet object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SelectionSet object

A group of one or more AutoCAD objects specified for processing as a single unit.

VBA class name: | AcadSelectionSet
Create using: | SelectionSets.Add
Access via: | SelectionSets.Item Document.ActiveSelectionSet

To delete a selection set, or delete items from a selection set, use one of the following methods:

Clear: The Clear method empties the selection set. The selection set will still exist, but won't contain any items. The items that previously resided in the selection still exist, but they no longer reside in the selection set.

RemoveItems: The RemoveItems method removes one or more items from a selection set. The removed items still exist, but they no longer reside in the selection set.

Erase: The Erase method deletes all items in a selection set. The selection set still exists, but won't contain any items. The items that previously resided in the selection set no longer exist.

Delete: The Delete method deletes a selection set object, but not the objects in the selection set. While the selection set itself will not exist after the call to the Delete method, the items previously in the selection set will still exist.

To create a selection set, use the Add method. To edit or query a selection set, use the following methods and properties:

Methods

AddItems

Clear

Delete

Erase

Highlight

Item

RemoveItems

Select

SelectAtPoint

SelectByPolygon

SelectOnScreen

Update

Properties

Application

Count

Name


SelectionSets Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SelectionSets Collection

The collection of all selection sets in the drawing.

VBA class name: | AcadSelectionSets
Create using: | N/A
Access via: | Document.SelectionSets

To add a new member to the collection, use the Add method. To select a specific selection set, use the Item method. To delete a specific selection set, use the Delete method found in the SelectionSet object. You can create up to 128 selection sets in your drawing.

There can be only one instance of the SelectionSets Collection. The SelectionSets Collection is predefined for each drawing. You can make multiple references to it by using the SelectionSets property. Once done with an object, the reference is automatically released.

Methods

Add

Item

Properties

Application

Count


ShadowDisplay interface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0">

ShadowDisplay Interface

Interface for AutoCAD entities with shadows.

Properties

ShadowDisplay

EnableShadowDisplay

This interface encapsulates the Shadow display property shown in the Properties palette for shadow-enabled entities. Entities that can display shadows include 3D entities such as Acad3DSolid, Acad3DFace, and Acad3DPolyline. 2D entities, such as AcadLine, can display shadows only if they can have thickness and if their thickness is non-zero.


Shape object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Shape object

An object comprising lines, arcs, and circles defined in an SHX file.

VBA class name: | AcadShape
Create using: | ModelSpace.AddShape PaperSpace.AddShape Block.AddShape
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Before inserting a shape, you must load the file containing the desired shape. To load a shape file, use the LoadShapeFile method. To insert the shape into the drawing, use the AddShape method. To edit or query a shape, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

Name

Normal

ObjectID

ObjectName

ObliqueAngle

OwnerID

PlotStyleName

Rotation

ScaleFactor

Thickness

TrueColor

Visible

Events

Modified


Solid object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Solid object

A solid-filled polygon.

VBA class name: | AcadSolid
Create using: | ModelSpace.AddSolid PaperSpace.AddSolid Block.AddSolid
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Solids are only filled when the FILLMODE system variable is on. To set or query a system variable, use the SetVariable and GetVariable methods, respectively.

To create a solid, use the AddSolid method. To edit or query a solid, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

OwnerID

Thickness

TrueColor

Visible

Events

Modified


SortentsTable object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SortentsTable object

Contains and manipulates draw order information.

VBA class name: | AcadSortentsTable
Create using: | Dictionary.AddObject
Access via: | object.GetExtensionDictionary

The SortentsTable object contains draw order information. To access draw order information, use the following methods and properties:

Methods

Block

Delete

GetExtensionDictionary

GetFullDrawOrder

GetRelativeDrawOrder

GetXData

MoveAbove

MoveBelow

MoveToBottom

MoveToTop

SetRelativeDrawOrder

SetXData

SwapObjects

Properties

Application

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Spline object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Spline object

A quadratic or cubic NURBS (nonuniform rational B-spline) curve.

VBA class name: | AcadSpline
Create using: | ModelSpace.AddSpline PaperSpace.AddSpline Block.AddSpline
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

A spline is a smooth curve passing through a given set of points. AutoCAD uses a particular type of spline known as a nonuniform rational B-spline (NURBS) curve. A NURBS curve produces a smooth curve between control points. Splines are useful for creating irregular-shaped curves, for example, drawing contour lines for geographic information system (GIS) applications or automobile design.

You create splines by specifying coordinate points. You can close the spline so the start point and endpoint are coincident and tangent. You can also change the spline-fitting tolerance. Fit tolerance refers to how closely the spline fits the set of fit points you specify. The lower the tolerance, the more closely the spline fits the points. At zero tolerance, the spline passes through the points.

To create a spline, use the AddSpline method. To edit or query a spline, use the following methods and properties:

Methods

AddFitPoint

ArrayPolar

ArrayRectangular

Copy

DeleteFitPoint

ElevateOrder

Delete

GetBoundingBox

GetControlPoint

GetExtensionDictionary

GetFitPoint

GetWeight

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

PurgeFitData

Reverse

Rotate

Rotate3D

ScaleEntity

SetControlPoint

SetFitPoint

SetWeight

SetXData

TransformBy

Update

Properties

Application

Area

Closed

ControlPoints

Degree

Document

EndTangent

FitPoints

FitTolerance

Handle

HasExtensionDictionary

Hyperlinks

IsPeriodic

IsPlanar

IsRational

Knots

Layer

Linetype

LinetypeScale

Lineweight

NumberOfControlPoints

NumberOfFitPoints

ObjectID

OwnerID

StartTangent

TrueColor

Visible

Weights

Events

Modified


SubEntity object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SubEntity object

For internal use only.

VBA class name: | AcadSubEntity
Create using: | N/A
Access via: |

Methods

Properties

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectName

PlotStyleName

color

Events


SubEntSolidEdge object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SubEntSolidEdge object

For internal use only.

VBA class name: | AcadSubEntSolidEdge
Create using: | N/A
Access via: |

Methods

Properties

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectName

PlotStyleName

color

Events


SubEntSolidNode object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SubEntSolidNode object

For internal use only.

VBA class name: | AcadSubEntSolidNode
Create using: | N/A
Access via: |

Methods

Properties

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectName

PlotStyleName

color

Events


SubEntSolidVertex object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SubEntSolidVertex object

For internal use only.

VBA class name: | AcadSubEntSolidVertex
Create using: | N/A
Access via: |

Methods

Properties

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectName

PlotStyleName

color

Events


SummaryInfo object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SummaryInfo object

Accesses drawing properties such as the Title, Subject, Author, and Keywords properties.

VBA class name: | AcadSummaryInfo
Create using: | N/A
Access via: | Document.SummaryInfo

You can use the SummaryInfo object to access the properties of a drawing. You can also use the SummaryInfo object to specify custom properties.

The object includes properties for specifying the title, subject, author, and keywords of a drawing.

Methods

AddCustomInfo

GetCustomByIndex

GetCustomByKey

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

SetCustomByIndex

SetCustomByKey

Properties

Author

Comments

HyperlinkBase

Keywords

LastSavedBy

RevisionNumber

Subject

Title


Surface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Surface object

A surface entity.

VBA class name: | AcadSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object provides access to surfaces in AutoCAD. It lets you manipulate properties of the surface. You cannot create a surface entity via ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

SurfaceType

TrueColor

UIsolineDensity

VIsolineDensity

Visible

Events

Modified


SweptSurface object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

SweptSurface object

A surface created by sweeping a 2D curve along a path.

VBA class name: | AcadSweptSurface
Create using: | N/A
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object provides access to swept surfaces in AutoCAD. It lets you manipulate properties of the surface. You cannot create a surface entity via ActiveX.

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Bank

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Length

Linetype

LinetypeScale

Lineweight

ObjectID

OwnerID

PlotStyleName

ProfileRotation

scale

SurfaceType

TrueColor

Twist

UIsolineDensity

VIsolineDensity

Visible

scale

Events

Modified


Table object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Table object

AutoCAD table object.

VBA class name: | AcadTable
Create using: | Dim customObj as AcadTable
Access via: | AcadTable

A table contains data in rows and columns. You can use the Table object to add and modify tables in a drawing.

To add a table to a drawing, use the AddTable method. After you add a table, you can modify the number of columns, the number of rows, and other settings.

All methods that change the Table object do the following:

  1. Open the Table object in write mode
  2. Modify the Table object based on the input parameters
  3. Close the Table object, which recomputes the Table

Recomputing large tables consumes a lot of time and memory because the Table object is reconstructed from scratch. If you are making multiple calls to update a table, you can improve performance by setting RegenerateTableSuppressed before and after making the modifications.

Methods

ArrayPolar

ArrayRectangular

CreateContent

ClearSubSelection

ClearTableStyleOverrides

Copy

Delete

DeleteCellContent

DeleteColumns

DeleteContent

DeleteRows

EnableMergeAll

FormatValue

GenerateLayout

GetAlignment

GetAlignment2

GetAttachmentPoint

GetAutoScale

GetAutoScale2

GetBackgroundColor

GetBackgroundColorNone

GetBlockAttributeValue

GetBlockAttributeValue2

GetBlockAttributeValue232

GetBlockRotation

GetBlockScale

GetBlockTableRecordId

GetBlockTableRecordId2

GetBlockTableRecordId32

GetBoundingBox

GetCellAlignment

GetCellBackgroundColor

GetCellBackgroundColorNone

GetCellContentColor

GetCellContentColor2

GetCellDataType

GetCellExtents

GetCellFormat

GetCellGridColor

GetCellGridLineWeight

GetCellGridVisibility

GetCellState

GetCellStyle

GetCellStyleOverrides

GetCellTextHeight

GetCellTextStyle

GetCellType

GetCellValue

GetColumnName

GetColumnWidth

GetContentColor

GetCustomData

GetDataFormat

GetDataLink

GetDataLink32

GetExtensionDictionary

GetFieldId

GetFieldId2

GetFieldId32

GetFormat

GetFormula

GetGridColor

GetGridColor2

GetGridDoubleLineSpacing

GetGridLineStyle

GetGridLineType

GetGridLineType32

GetGridLineWeight

GetGridVisibility

GetGridVisibility2

GetHasDataLink

GetHasFormula

GetMargin

GetMinimumColumnWidth

GetMinimumRowHeight

GetOverride

GetRotation

GetRowHeight

GetRowType

GetScale

GetSubSelection

GetText

GetTextHeight

GetTextHeight2

GetTextRotation

GetTextString

GetTextStyle

GetTextStyle2

GetValue

GetXData

Highlight

HitTest

InsertColumns

InsertColumnsAndInherit

InsertRows

InsertRowsAndInherit

IntegerersectWith

IsContentEditable

IsEmpty

IsFormatEditable

IsMergeAllEnabled

IsMergedCell

Material

MergeCells

Mirror

Mirror3D

Move

Move Content

RecomputeTableBlock

ReselectSubRegion

Rotate

Rotate3D

ScaleEntity

Select

SelectSubRegion

SetAlignment

SetAlignment2

SetAutoScale

SetAutoScale2

SetBackgroundColor

SetBackgroundColorNone

SetBlockAttributeValue

SetBlockAttributeValue2

SetBlockAttributeValue232

SetBlockRotation

SetBlockScale

SetBlockTableRecordId

SetBlockTableRecordId2

SetBlockTableRecordId32

SetCellAlignment

SetCellBackgroundColor

SetCellBackgroundColorNone

SetCellContentColor

SetCellContentColor2

SetCellDataType

SetCellFormat

SetCellGridColor

SetCellGridLineWeight

SetCellGridVisibility

SetCellTextHeight

SetCellState

SetCellStyle

SetCellTextStyle

SetCellType

SetCellValue

SetColumnName

SetColumnWidth

SetContentColor

SetCustomData

SetDataFormat

SetDataLink

SetDataLink32

SetFieldId

SetFieldId2

SetFieldId32

SetFormat

SetFormula

SetGridColor

SetGridColor2

SetGridDoubleLineSpacing

SetGridLineStyle

SetGridLineType

SetGridLineType32

SetGridLineWeight

SetGridVisibility

SetGridVisibility2

SetMargin

SetOverride

SetRotation

SetRowHeight

SetScale

SetSubSelection

SetText

SetTextHeight

SetTextHeight2

SetTextRotation

SetTextString

SetTextStyle

SetTextStyle2

SetToolTip

SetValue

SetXData

TransformBy

UnmergeCells

Update

Properties

AllowManualHeights

AllowManualPositions

Application

BreaksEnabled

BreakSpacing

Columns

ColumnWidth

Direction

Document

FlowDirection

Handle

HasExtensionDictionary

HasSubSelection

HeaderSuppressed

Height

HorzCellMargin

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

MinimumTableHeight

MinimumTableWidth

ObjectID

ObjectName

OwnerID

PlotStyleName

RegenerateTableSuppressed

RepeatTopLabels

RepeatBottomLabels

RowHeight

Rows

StyleName

TableBreakFlowDirection

TableStyleOverrides

TitleSuppressed

TrueColor

VertCellMargin

Visible

Width

Events

Modified


TableStyle object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

TableStyle object

Adds, modifies, and deletes table styles.

VBA class name: | AcadTableStyle
Create using: | Dim customObj as AcadTableStyle
Access via: | AcadTableStyle

You can use the TableStyle object to store table formatting, such as grid visibility, lineweight, and color. The object controls the initial formatting of a newly created Table object.

The TableStyle object includes methods for specifying the colors, margins, and other attributes of table styles.

Methods

CreateCellStyle

CreateCellStyleFromStyle

Delete

DeleteCellStyle

EnableMergeAll

GetAlignment

GetAlignment2

GetBackgroundColor

GetBackgroundColorNone

GetCellClass

GetColor

GetDataType

GetDataType2

GetExtensionDictionary

GetFormat

GetFormat2

GetGridColor

GetGridColor2

GetGridLineWeight

GetGridVisibility

GetIsCellStyleInUse

GetIsMergeAllEnabled

GetRotation

GetTextHeight

GetTextHeight2

GetTextStyle

GetTextStyle2

GetUniqueCellStyleName

GetXData

NumCellStyles

RenameCellStyle

SetAlignment

SetAlignment2

SetBackgroundColor

SetBackgroundColorNone

SetCellClass

SetColor

SetDataType

SetDataType2

SetFormat

SetFormat2

SetGridColor

SetGridColor2

SetGridLineWeight

SetGridVisibility

SetRotation

SetTextHeight

SetTextHeight2

SetTextStyle

SetTextStyle2

SetXData

Properties

Application

BitFlags

Description

Document

FlowDirection

Handle

HasExtensionDictionary

HeaderSuppressed

HorzCellMargin

Name

ObjectID

ObjectName

OwnerID

TitleSuppressed

VertCellMargin

Events

Modified


Text object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Text object

A single line of alphanumeric characters.

VBA class name: | AcadText
Create using: | ModelSpace.AddText PaperSpace.AddText Block.AddText
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

This object differs from the MText object in that it creates only a single line of text. The MText object creates a paragraph of text.

Note that RTF text isn't recognized. Text from other programs with embedded formatting will lose formatting when imported into an mtext paragraph.

To create a Text object, use the AddText method. To edit or query a Text object, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

FieldCode

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Alignment

Backward

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

ObliqueAngle

OwnerID

PlotStyleName

Rotation

ScaleFactor

StyleName

TextAlignmentPoint

TextGenerationFlag

TextString

Thickness

TrueColor

UpsideDown

Visible

Events

Modified


TextStyle object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

TextStyle object

A named, saved collection of settings that determines the appearance of text characters.

VBA class name: | AcadTextStyle
Create using: | TextStyles.Add
Access via: | TextStyles.Item Document.ActiveTextStyle

To control the settings on a text style, use the properties below, or the text style system variables. See "System Variables" in the AutoCAD Command Reference for a list of text style system variables.

The active text style (set with the ActiveTextStyle property) determines the appearance of new text created in the drawing, and existing text that has no distinct text style specified.

If changes are made to the active TextStyle, the new TextStyle object must be reset as the active TextStyle, and the Regen method must be called for the changes to appear. To reset the active TextStyle, simply call the ActiveTextStyle property again with the updated TextStyle object.

To specify a distinct text style for an object so it will not change along with the active text style, use the StyleName property for the specific object.

Methods

Delete

GetExtensionDictionary

GetFont

GetXData

SetFont

SetXData

Properties

Application

BigFontFile

Document

FontFile

Handle

HasExtensionDictionary

Height

LastHeight

Name

ObjectID

ObjectName

ObliqueAngle

OwnerID

TextGenerationFlag

Width

Events

Modified


TextStyles Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

TextStyles Collection

The collection of all text styles in the drawing.

VBA class name: | AcadTextStyles
Create using: | N/A
Access via: | Document.TextStyles

To add a new member to the collection, use the Add method. To select a specific text style, use the Item method. To delete a specific text style, use the Delete method found on the TextStyle object.

Although the TextStyles collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the TextStyles collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of text styles that you can create in your drawing. However, there can be only one instance of the TextStyles Collection. The TextStyles Collection is predefined for each drawing. You can make multiple references to it by using the TextStyles property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Tolerance object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Tolerance object

A geometric tolerance contained in a feature control frame.

VBA class name: | AcadTolerance
Create using: | ModelSpace.AddTolerance PaperSpace.AddTolerance Block.AddTolerance
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

Tolerances are influenced by several system variables: DIMCLRD controls the color of the feature control frame; DIMCLRT controls the color of the tolerance text; DIMGAP controls the gap between the feature control frame and the text; DIMTXT controls the size of the tolerance text; and DIMTXSTY controls the style of the tolerance text.

System variables can be set and queried using the SetVariable and GetVariable methods.

To create a tolerance, use the AddTolerance method. To edit or query a tolerance, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Arrowhead1Type

DecimalSeparator

DimensionLineColor

DirectionVector

Document

FractionFormat

Handle

HasExtensionDictionary

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

PrimaryUnitsPrecision

ScaleFactor

StyleName

TextColor

TextHeight

TextString

TextStyle

TrueColor

Visible

Events

Modified


Toolbar object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Toolbar object

An AutoCAD toolbar.

VBA class name: | AcadToolbar
Create using: | Toolbars.Add
Access via: | Toolbars.Item

Toolbars provide access to frequently used or custom commands, settings, macros, and modes. You can add tools to the AutoCAD default toolbars or create your own toolbars. You can also remove toolbar items or entire toolbars, and reposition toolbars.

To create a new toolbar, use the Add method. The Add method will create an empty toolbar to which you can add toolbar buttons. To add a toolbar button to a toolbar, use the AddToolbarButton method. You can add separators to your toolbar using the AddSeparator method. Both the AddToolbarbutton and AddSeparator methods return a ToolbarItem object representing an individual button on the toolbar. Use the ToolbarItem object to add functionality to the toolbar button, or to create flyout toolbar buttons.

You can change the position of toolbars by docking them along the top, bottom, or sides of the AutoCAD screen, or you can float toolbars anywhere on the screen. To dock a toolbar, use the Dock method. To float a toolbar, use the Float method. To check the current positioning of a toolbar, use the DockStatus property. If you do not want the toolbar to be visible at all, use the Visible property to hide it.

To edit or query a toolbar, use the following methods and properties:

Methods

AddToolbarButton

AddSeparator

Delete

Dock

Float

Item

Properties

Application

Count

DockStatus

FloatingRows

Height

HelpString

LargeButtons

Left

Name

Parent

TagString

Top

Visible

Width


ToolbarItem object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

ToolbarItem object

A single button item on an AutoCAD toolbar.

VBA class name: | AcadToolbarItem
Create using: | Toolbar.AddToolbarButton Toolbar.AddSeparator
Access via: | Toolbar.Item

A toolbar item represents a single button or separator on a toolbar. Toolbar buttons can contain a macro to be executed when they are selected by the user, or they can contain a nested toolbar called a flyout. Separators cannot contain macros or flyouts.

To add or change the macro associated with a toolbar button, use the Macro property. To create a flyout toolbar button, first set the Flyout property to acToolbarFlyout. Then use the AttachToolbarToFlyout method to attach an existing Toolbar object to the button.

You can change the bitmap associated with a button by using the SetBitmaps method. This method allows you to set both the large and small button bitmaps.

To edit or query a toolbar button, use the following methods and properties:

Methods

AttachToolbarToFlyout

Delete

GetBitmaps

SetBitmaps

Properties

Application

Flyout

HelpString

Index

Macro

Name

Parent

TagString

Type


Toolbars Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Toolbars Collection

A collection of Toolbar objects representing all the toolbars loaded in the current AutoCAD session.

VBA class name: | AcadToolbars
Create using: | N/A
Access via: | MenuGroup.Toolbars

The Toolbars collection represents all the toolbars loaded in the current AutoCAD session, some or all of which may be currently displayed in AutoCAD. To load an existing toolbar into the current session, load the menu group that contains the toolbar using the Load method. To create a new toolbar, use the Add method.

To display large buttons for all toolbars, set the LargeButtons property to TRUE. This property changes the toolbar buttons for all the toolbars loaded in the current AutoCAD session.

To edit or query the Toolbar objects in the collection, use the following methods and properties:

Methods

Add

Item

Properties

Application

Count

LargeButtons

Parent


Trace object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Trace object

A 2D solid line of specified width.

VBA class name: | AcadTrace
Create using: | ModelSpace.AddTrace PaperSpace.AddTrace Block.AddTrace
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

The endpoints of a trace are always on the centerline and are always cut square. AutoCAD automatically calculates the correct bevels for connection to adjacent trace segments.

Traces are solid-filled when the Fill mode is on. When the Fill mode is off, only the outline of a trace appears. To set the Fill mode, use the system variable FILLMODE. The system variable TRACEWID stores the current width used for a Trace object. To query a system variable, use the GetVariable method. To set a system variable, use the SetVariable method.

To create a trace, use the AddTrace method. To edit or query a trace, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

Coordinate

Coordinates

Document

Handle

HasExtensionDictionary

Layer

Linetype

LinetypeScale

Lineweight

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Thickness

TrueColor

Visible

Events

Modified


UCS object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

User Coordinate System object

A user-defined coordinate system that determines the orientation of the X, Y, and Z axes in 3D space.

VBA class name: | AcadUCS
Create using: | UCSs.Add
Access via: | UCSs.Item Document.ActiveUCS

You define a UCS to change the location of the (0, 0, 0) origin point and the orientation of the XY plane and the Z axis. You can locate and orient a UCS anywhere in 3D space, and you can define as many UCSs as you require.

All coordinates in ActiveX Automation are entered in the world coordinate system (WCS). Use the GetUCSMatrix method to return the transformation matrix of a given UCS. Use this transformation matrix to find the equivalent WCS coordinates.

Use the UCSIconOn property to turn the UCS icon on or off for a given viewport.

To make a UCS active, use the ActiveUCS property on the Document object. If changes are made to the active UCS, the new UCS object must be reset as the active UCS for the changes to appear. To reset the active UCS, simply call the ActiveUCS property again with the updated UCS object.

To add a new UCS to the drawing, use the Add method off the UCSs Collection. To edit or query an existing UCS, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetUCSMatrix

GetXData

SetXData

Properties

Application

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

Origin

OwnerID

XVector

YVector

Events

Modified


UCSs Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

UCSs Collection

The collection of all user coordinate systems (UCSs) in the drawing.

VBA class name: | AcadUCSs
Create using: | N/A
Access via: | Document.UserCoordinateSystems

To add a new member to the collection, use the Add method. To select a specific UCS, use the Item method. To delete a specific UCS, use the Delete method found on the UCS object.

Although the UCSs collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the UCSs collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of UCSs that you can create in your drawing. However, there can be only one instance of the UCSs collection. The UCSs Collection is predefined for each drawing. You can make multiple references to the UCSs Collection by using the UserCoordinateSystems property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Utility object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Utility object

A series of methods provided for utility purposes.

VBA class name: | AcadUtility
Create using: | N/A
Access via: | Document.Utility

Methods

AngleFromXAxis

AngleToReal

AngleToString

CreateTypedArray

DistanceToReal

GetAngle

GetCorner

GetDistance

GetEntity

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetRemoteFile

GetString

GetSubEntity

InitializeUserInput

IsRemoteFile

IsURL

LaunchBrowserDialog

PolarPoint

Prompt

PutRemoteFile

RealToString

SendModelessOperationEnded

SendModelessOperationStart

TranslateCoordinates

Properties

None


View object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

View object

A graphical representation of a 2D drawing or 3D model from a specific location (viewpoint) in space.

VBA class name: | AcadView
Create using: | Views.Add
Access via: | Views.Item

The line of sight is drawn from the viewpoint (represented by the Center property) to the target point. The Height and Width properties crop the view. Note that these properties do not change the viewport size, only the size of the view visible within the viewport.

Note that the Delete method for a view is found on the View object, not the Views Collection. This is due to programming requirements specific to the View object.

To add a view, use the Add method from the Views Collection object. To edit or query a view, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Properties

Application

CategoryName

Center

Direction

Document

Handle

HasExtensionDictionary

HasVpAssociation

Height

LayerState

Name

LayoutID

ObjectID

ObjectName

OwnerID

Target

Width

Events

Modified


Viewport object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Viewport object

A bounded area that displays some portion of a drawing's model space.

VBA class name: | AcadViewport
Create using: | Viewports.Add
Access via: | Viewports.Item Document.ActiveViewport

The ActiveSpace property (equivalent to the TILEMODE system variable) determines the type of viewport used.

No editing or view changes can be performed unless the viewport is active. To make a viewport active, use the ActiveViewport property on the Document object.

Once changes have been completed, the viewport must be reset as the active viewport for the changes to appear. To reset the active viewport, simply call the ActiveViewport property again with the updated Viewport object.

Methods

Delete

GetExtensionDictionary

GetGridSpacing

GetSnapSpacing

GetXData

SetGridSpacing

SetSnapSpacing

SetView

SetXData

Split

Properties

Application

ArcSmoothness

Center

Direction

Document

GridOn

Handle

HasExtensionDictionary

Height

LowerLeftCorner

Name

ObjectID

ObjectName

OrthoOn

OwnerID

SnapBasePoint

SnapOn

SnapRotationAngle

Target

UCSIconAtOrigin

UCSIconOn

UpperRightCorner

Width

Events

Modified


Viewports Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Viewports Collection

The collection of all viewports in the drawing.

VBA class name: | AcadViewports
Create using: | N/A
Access via: | Document.Viewports

To add a new member to the collection, use the Add method. To select a specific viewport, use the Item method. To delete a specific viewport, use the DeleteConfiguration method or the Delete method found on the Viewport object.

The number of viewports you can have active at one time is controlled by the MAXACTVP system variable. There can be only one instance of the Viewports Collection. The Viewports Collection is predefined for each drawing. You can make multiple references to it by using the Viewports property. Once done with an object, the reference is automatically released.

Methods

Add

DeleteConfiguration

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


Views Collection object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

Views Collection

The collection of all views in the drawing.

VBA class name: | AcadViews
Create using: | N/A
Access via: | Document.Views

To add a new member to the collection, use the Add method. To select a specific view, use the Item method. To delete a specific view, use the Delete method found on the View object.

Although the Views collection inherits a Delete method, you cannot actually delete the collection. Attempting to delete the Views collection will result in an error. The Delete method has been removed from the documentation for this collection.

There is no limit to the number of views that you can create in your drawing. However, there can be only one instance of the Views Collection. The Views Collection is predefined for each drawing. You can make multiple references to it by using the Views property. Once done with an object, the reference is automatically released.

Methods

Add

GetExtensionDictionary

GetXData

Item

SetXData

Properties

Application

Count

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified


XLine object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

XLine object

A construction line that is infinite in both directions.

VBA class name: | AcadXline
Create using: | ModelSpace.AddXline PaperSpace.AddXline Block.AddXline
Access via: | ModelSpace.Item PaperSpace.Item Block.Item SelectionSet.Item Group.Item

To create an XLine, use the AddXLine method. To edit or query an XLine, use the following methods and properties:

Methods

ArrayPolar

ArrayRectangular

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Properties

Application

BasePoint

DirectionVector

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

ObjectName

OwnerID

PlotStyleName

SecondPoint

TrueColor

Visible

Events

Modified


XRecord object [ActiveX and VBA Reference: AAR]

 codebase="hhctrl.ocx#Version=4,73,8561,0"> codebase="hhctrl.ocx#Version=4,73,8561,0" > codebase="hhctrl.ocx#Version=4,73,8561,0" >

XRecord object

XRecord objects are used to store and manage arbitrary data.

VBA class name: | AcadXRecord
Create using: | Dictionary.AddXRecord
Access via: | Dictionary.Item

This object is similar in concept to XData but is not limited by size or order.

Unlike XData, XRecords work with the standard AutoCAD group codes that are all below 1000 in value. All the standard AutoCAD group codes are supported. This means that, in addition to all the normally used data types, an XRecord is capable of storing object IDs, which allows XRecords to own other objects including other XRecords.

The following group codes are common to all XRecord objects:

100

Subclass marker (AcDbXrecord)

1-369 (except 5 and 105 and 210-239)

These values can be used by an application in any way.

XRecord obects are saved with the drawing and are directly accessible by other ObjectARX and LISP programs. So, if data security is an issue for your application, you should be careful when storing information in XRecords.

NOTE XRecord objects are designed to work in such a way as to not offend Releases 13c0 through 13c3. However, if read into a pre-Release 13c4 level of AutoCAD, XRecord objects disappear.

To create an XRecord, use the AddXRecord method. To edit or query an XRecord, use the following methods and properties:

Methods

Delete

GetExtensionDictionary

GetXData

GetXRecordData

SetXData

SetXRecordData

Properties

Application

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

TranslateIDs

Events

Modified


Code Examples [][AAR - ActiveX and VBA Reference: AAR]

Code Examples

The example code in the ActiveX and VBA Reference demonstrates how to combine Visual Basic for Applications with the power of the AutoCAD ActiveX interface to create customized applications.

The code can be copied from the Help files and pasted directly into the AutoCAD VBA environment. To execute the code, the currently active AutoCAD drawing must be a blank drawing open in model space.


Action Example [ActiveX and VBA Reference: AAR]

Action Example

Using Programming Languages other than VBA

Sub Example_Action()
    ' This example encrypts and saves a file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp

End Sub


Activate Example [: AAR]

Activate Event Example

Using Programming Languages other than VBA

Private Sub AcadDocument_Activate()
    ' This example intercepts a drawing Activate event.
    '
    ' This event is triggered when a drawing window becomes active.
    '
    ' To trigger this example event: Either open a new drawing or switch from
    ' one drawing window to another

    MsgBox "You have just activated a drawing!"
End Sub


Activate Example [ActiveX and VBA Reference: AAR]

Activate Example

Using Programming Languages other than VBA

Sub Example_ActivateMethod()
    ' This example creates two new drawings and activates each drawing in turn.

    Dim NewDrawing1 As AcadDocument
    Dim Newdrawing2 As AcadDocument
    Set NewDrawing1 = ThisDrawing.Application.Documents.Add("")
    Set Newdrawing2 = ThisDrawing.Application.Documents.Add("")

    Dim drawing As AcadDocument
    For Each drawing In ThisDrawing.Application.Documents
        drawing.Activate
        MsgBox "Drawing " & drawing.name & " is active."
    Next drawing
End Sub


Active Example [ActiveX and VBA Reference: AAR]

Active Example

Using Programming Languages other than VBA

Sub Example_Active()
    ' This example creates two new drawings and determines
    ' which of the drawings is the active drawing.

    Dim NewDrawing1 As AcadDocument
    Dim Newdrawing2 As AcadDocument
    Set NewDrawing1 = ThisDrawing.Application.Documents.Add("")
    Set Newdrawing2 = ThisDrawing.Application.Documents.Add("")

    Dim activeStatus As String
    Dim drawing As AcadDocument
    activeStatus = ""
    For Each drawing In ThisDrawing.Application.Documents
    If drawing.Active Then
            activeStatus = activeStatus & drawing.name & " is active." & vbCrLf
    Else
            activeStatus = activeStatus & drawing.name & " is not active." & vbCrLf
    End If
    Next drawing
    MsgBox activeStatus
End Sub


ActiveDimStyle Example [ActiveX and VBA Reference: AAR]

ActiveDimStyle Example

Using Programming Languages other than VBA

Sub Example_ActiveDimStyle()
    ' This example returns the current dimension style
    ' and then sets a new style.
    ' Finally, it returns the style to the previous setting.
    Dim newDimStyle As AcadDimStyle
    Dim currDimStyle As AcadDimStyle

    ' Return current dimension style of active document
    Set currDimStyle = ThisDrawing.ActiveDimStyle
    MsgBox "The current dimension style is " & currDimStyle.name, vbInformation, "ActiveDimStyle Example"

    ' Create a dimension style and makes it current
    Set newDimStyle = ThisDrawing.DimStyles.Add("TestDimStyle")
    ThisDrawing.ActiveDimStyle = newDimStyle    ' set current dimension style to newDimStyle
    MsgBox "The new dimension style is " & newDimStyle.name, vbInformation, "ActiveDimStyle Example"

    ' Reset the dimension style to its previous setting
    ThisDrawing.ActiveDimStyle = currDimStyle
    MsgBox "The dimension style is reset to " & currDimStyle.name, vbInformation, "ActiveDimStyle Example"
End Sub


ActiveDocument Example [ActiveX and VBA Reference: AAR]

ActiveDocument Example

Using Programming Languages other than VBA

Sub Example_ActiveDocument()
    Dim activeDoc As AcadDocument
    ' Returns current document in AutoCAD
    Set activeDoc = ThisDrawing.Application.ActiveDocument
    MsgBox "The active document is: " & activeDoc.name, vbInformation, "ActiveDocument Example"
End Sub


ActiveLayer Example [ActiveX and VBA Reference: AAR]

ActiveLayer Example

Using Programming Languages other than VBA

Sub Example_ActiveLayer()
    ' This example returns the current layer
    ' and then adds a new layer.
    ' Finally, it returns the layer to the previous setting.
    Dim currLayer As AcadLayer
    Dim newLayer As AcadLayer

    ' Return the current layer of the active document
    Set currLayer = ThisDrawing.ActiveLayer
    MsgBox "The current layer is " & currLayer.name, vbInformation, "ActiveLayer Example"

    ' Create a Layer and make it the active layer
    Set newLayer = ThisDrawing.Layers.Add("TestLayer")
    ThisDrawing.ActiveLayer = newLayer
    MsgBox "The new layer is " & newLayer.name, vbInformation, "ActiveLayer Example"

    ' Reset the layer to its previous setting
    ThisDrawing.ActiveLayer = currLayer
    MsgBox "The active layer is reset to " & currLayer.name, vbInformation, "ActiveLayer Example"
End Sub


ActiveLayout Example [ActiveX and VBA Reference: AAR]

ActiveLayout Example

Using Programming Languages other than VBA

Sub Example_ActiveLayout()
    ' This example cycles through the documents collection
    ' and uses the ActiveLayout object to list the active layout
    ' for all open documents.

    Dim DOC As AcadDocument
    Dim msg As String

    ' If there are no open documents, then exit
    If Documents.count = 0 Then
        MsgBox "There are no open documents!"
        Exit Sub
    End If

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Cycle through documents and determine the active layout name using the
    ' ActiveLayout property of the document object
    For Each DOC In Documents
        msg = msg & DOC.WindowTitle & ": " & DOC.ActiveLayout.name
    Next

    ' Display results
    MsgBox "The active layouts for the open drawings are: " & msg
End Sub


ActiveLinetype Example [ActiveX and VBA Reference: AAR]

ActiveLinetype Example

Using Programming Languages other than VBA

Sub Example_ActiveLinetype()
    ' This example finds the current linetype. It then sets
    ' the new linetype to be the first entry in the linetype
    ' collection that is not equal to the current linetype.
    ' Finally, it resets the active linetype to the original
    ' setting.

    Dim currLineType As AcadLineType
    Dim newLineType As AcadLineType

    ' Find the current LineType of the active document
    Set currLineType = ThisDrawing.ActiveLinetype
    MsgBox "The current linetype is " & currLineType.name, vbInformation, "ActiveLinetype Example"

    ' Set the current Linetype to anything else in the collection
    Dim entry
    Dim found As Boolean
    For Each entry In ThisDrawing.Linetypes
        If StrComp(entry.name, currLineType.name, 1) <> 0 Then
            Set newLineType = entry
            found = True
            Exit For
        End If
    Next
    If found Then
        ThisDrawing.ActiveLinetype = newLineType
        MsgBox "The new linetype is " & newLineType.name, vbInformation, "ActiveLinetype Example"
        ' Reset the linetype to the previous setting
        ThisDrawing.ActiveLinetype = currLineType
        MsgBox "The active linetype is reset to " & currLineType.name, vbInformation, "ActiveLinetype Example"
    End If
End Sub


ActiveProfile Example [ActiveX and VBA Reference: AAR]

ActiveProfile Example

Using Programming Languages other than VBA

Sub Example_ActiveProfile()
    ' This example returns the current setting of
    ' ActiveProfile.

    Dim preferences As AcadPreferences
    Dim currActiveProfile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ActiveProfile value
    currActiveProfile = preferences.Profiles.ActiveProfile
    MsgBox "The current value for ActiveProfile is " & currActiveProfile, vbInformation, "ActiveProfile Example"
End Sub


ActivePViewPort Example [ActiveX and VBA Reference: AAR]

ActivePViewport Example

Using Programming Languages other than VBA

Sub Example_ActivePViewport()

    Dim newPViewport As AcadPViewport
    Dim centerPoint(0 To 2) As Double
    Dim height As Double
    Dim width As Double
    height = 5#
    width = 5#
    centerPoint(0) = 5#: centerPoint(1) = 5#: centerPoint(2) = 0#

    ' Create a paper space Viewport object
    ThisDrawing.ActiveSpace = acPaperSpace
    Set newPViewport = ThisDrawing.PaperSpace.AddPViewport(centerPoint, width, height)
    ZoomAll
    newPViewport.DISPLAY (True)

    ' Before making a paper space Viewport active,
    ' the mspace property needs to be True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = newPViewport
End Sub


ActiveSelectionSet Example [ActiveX and VBA Reference: AAR]

ActiveSelectionSet Example

Using Programming Languages other than VBA

Sub Example_ActiveSelectionSet()
    Dim sset As AcadSelectionSet
    ' The following example returns current selection set from current drawing
    Set sset = ThisDrawing.ActiveSelectionSet
End Sub


ActiveSpace Example [ActiveX and VBA Reference: AAR]

ActiveSpace Example

Using Programming Languages other than VBA

Sub Example_ActiveSpace()
    ' This example toggles the ActiveSpace property from
    ' paper space to model space.
    ' Display the current setting for TILEMODE
    MsgBox "TILEMODE = " & ThisDrawing.ActiveSpace, vbInformation, "ActiveSpace Example"

    ' Changes active document to paper space
    ThisDrawing.ActiveSpace = acPaperSpace
    MsgBox "TILEMODE = " & ThisDrawing.ActiveSpace, vbInformation, "ActiveSpace Example"

    ' Changes active document to model space
    ThisDrawing.ActiveSpace = acModelSpace
    MsgBox "TILEMODE = " & ThisDrawing.ActiveSpace, vbInformation, "ActiveSpace Example"
End Sub


ActiveTextStyle Example [ActiveX and VBA Reference: AAR]

ActiveTextStyle Example

Using Programming Languages other than VBA

Sub Example_ActiveTextStyle()
    ' This example returns the current text style
    ' and then sets a new style.
    ' Finally, it returns the style to the previous setting.
    Dim newTextStyle As AcadTextStyle
    Dim currTextStyle As AcadTextStyle

    ' Return current text style of active document
    Set currTextStyle = ThisDrawing.ActiveTextStyle
    MsgBox "The current text style is " & currTextStyle.name, vbInformation, "ActiveTextStyle Example"

    ' Create a text style and make it current
    Set newTextStyle = ThisDrawing.TextStyles.Add("TestTextStyle")
    ThisDrawing.ActiveTextStyle = newTextStyle
    MsgBox "The new text style is " & newTextStyle.name, vbInformation, "ActiveTextStyle Example"

    ' Reset the text style to its previous setting
    ThisDrawing.ActiveTextStyle = currTextStyle
    MsgBox "The text style is reset to " & currTextStyle.name, vbInformation, "ActiveTextStyle Example"
End Sub


ActiveUCS Example [ActiveX and VBA Reference: AAR]

ActiveUCS Example

Using Programming Languages other than VBA

Sub Example_ActiveUCS()
    ' This example returns the current saved UCS (or saves a new one dynamically)
    ' and then sets a new UCS.
    ' Finally, it returns the UCS to the previous setting.

    Dim newUCS As AcadUCS
    Dim currUCS As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxis(0 To 2) As Double
    Dim yAxis(0 To 2) As Double

    ' Get the current saved UCS of the active document. If the current UCS is
    ' not saved, then add a new UCS to the UserCoordinateSystems collection
    If ThisDrawing.GetVariable("UCSNAME") = "" Then
        ' Current UCS is not saved so get the data and save it
        With ThisDrawing
            Set currUCS = .UserCoordinateSystems.Add( _
                            .GetVariable("UCSORG"), _
                            .Utility.TranslateCoordinates(.GetVariable("UCSXDIR"), acUCS, acWorld, 0), _
                            .Utility.TranslateCoordinates(.GetVariable("UCSYDIR"), acUCS, acWorld, 0), _
                            "OriginalUCS")
        End With
    Else
        Set currUCS = ThisDrawing.ActiveUCS  'current UCS is saved
    End If

    MsgBox "The current UCS is " & currUCS.name, vbInformation, "ActiveUCS Example"

    ' Create a UCS and make it current
    origin(0) = 0: origin(1) = 0: origin(2) = 0
    xAxis(0) = 1: xAxis(1) = 1: xAxis(2) = 0
    yAxis(0) = -1: yAxis(1) = 1: yAxis(2) = 0
    Set newUCS = ThisDrawing.UserCoordinateSystems.Add(origin, xAxis, yAxis, "TestUCS")
    ThisDrawing.ActiveUCS = newUCS
    MsgBox "The new UCS is " & newUCS.name, vbInformation, "ActiveUCS Example"

    ' Reset the UCS to its previous setting
    ThisDrawing.ActiveUCS = currUCS
    MsgBox "The UCS is reset to " & currUCS.name, vbInformation, "ActiveUCS Example"
End Sub


ActiveViewport Example [ActiveX and VBA Reference: AAR]

ActiveViewport Example

Using Programming Languages other than VBA

Sub Example_ActiveViewport()
    ' This example returns the current viewport.
    ' It creates a new viewport and makes it active, and
    ' Then it splits the viewport into four windows.
    ' It then takes one of the four windows, and splits that
    ' window horizontally into half.
    Dim currViewport As AcadViewport
    Dim newViewport As AcadViewport

    ' Returns current viewport of active document
    Set currViewport = ThisDrawing.ActiveViewport
    MsgBox "The current viewport is " & currViewport.name, vbInformation, "ActiveViewport Example"

    ' Create a new viewport and make it active
    Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT")
    ThisDrawing.ActiveViewport = newViewport
    MsgBox "The new active viewport is " & newViewport.name, vbInformation, "ActiveViewport Example"

    ' Split the viewport in four windows
    newViewport.Split acViewport4

    ' Make the newly split viewport active
    ThisDrawing.ActiveViewport = newViewport

    ' Note that current drawing layout will show four windows.
    ' However, only one of the windows will be active.
    ' The following code sets the lower-left corner window
    ' to be the active window and then splits that
    ' window into two horizontal windows.
    Dim entry
    For Each entry In ThisDrawing.Viewports
        If entry.name = "TESTVIEWPORT" Then
            Dim lowerLeft
            lowerLeft = entry.LowerLeftCorner
            If lowerLeft(0) = 0 And lowerLeft(1) = 0 Then
                Set newViewport = entry
                Exit For
            End If
        End If
    Next
    newViewport.Split acViewport2Horizontal
    ThisDrawing.ActiveViewport = newViewport
End Sub


ADCInsertUnitsDefaultSource Example [ActiveX and VBA Reference: AAR]

ADCInsertUnitsDefaultSource Example

Using Programming Languages other than VBA

Sub Example_ADCInsertUnitsDefaultSource()
    ' This example reads and modifies the ADCInsertUnitsDefaultSource
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.ADCInsertUnitsDefaultSource
    MsgBox "The ADCInsertUnitsDefaultSource preference is set to: " & originalValue

    ' Modify the ADCInsertUnitsDefaultSource preference by toggling the value
    ACADPref.ADCInsertUnitsDefaultSource = acInsertUnitsMillimeters

    MsgBox "The ADCInsertUnitsDefaultSource preference has been set to: " & ACADPref.ADCInsertUnitsDefaultSource

    ' Reset the preference back to its original value
    ACADPref.ADCInsertUnitsDefaultSource = originalValue
    MsgBox "The ADCInsertUnitsDefaultSource preference was reset back to: " & originalValue
End Sub


ADCInsertUnitsDefaultTarget Example [ActiveX and VBA Reference: AAR]

ADCInsertUnitsDefaultTarget Example

Using Programming Languages other than VBA

Sub Example_ADCInsertUnitsDefaultTarget()
    ' This example reads and modifies the ADCInsertUnitsDefaultTarget
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.ADCInsertUnitsDefaultTarget
    MsgBox "The ADCInsertUnitsDefaultTarget preference is set to: " & originalValue

    ' Modify the ADCInsertUnitsDefaultTarget preference by toggling the value
    ACADPref.ADCInsertUnitsDefaultTarget = acInsertUnitsMillimeters

    MsgBox "The ADCInsertUnitsDefaultTarget preference has been set to: " & ACADPref.ADCInsertUnitsDefaultTarget

    ' Reset the preference back to its original value
    ACADPref.ADCInsertUnitsDefaultTarget = originalValue
    MsgBox "The ADCInsertUnitsDefaultTarget preference was reset back to: " & originalValue
End Sub


Add Example [ActiveX and VBA Reference: AAR]

Add Example

Using Programming Languages other than VBA

Sub Example_Add()
    ' This example adds a block, dictionary, dimension style,
    ' group, layer, registered application, selection set,
    ' textstyle, view, viewport and UCS using the Add method.

    GoSub ADDBLOCK
    GoSub ADDDICTIONARY
    GoSub ADDDIMSTYLE
    GoSub ADDGROUP
    GoSub ADDLAYER
    GoSub ADDREGISTEREDAPP
    GoSub ADDSELECTIONSET
    GoSub ADDTEXTSTYLE
    GoSub ADDVIEW
    GoSub ADDVIEWPORT
    GoSub ADDUCS
    GoSub ADDMATERIAL
    Exit Sub

ADDBLOCK:
    ' Create a new block called "New_Block"
    Dim blockObj As AcadBlock

    ' Define the block
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#

    ' Add the block to the blocks collection
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "New_Block")
    MsgBox blockObj.name & " has been added." & vbCrLf & _
            "Origin: " & blockObj.origin(0) & ", " & blockObj.origin(1) _
            & ", " & blockObj.origin(2), , "Add Example"
    Return

ADDDICTIONARY:
    ' Create a new dictionary called "New_Dictionary"
    Dim dictObj As AcadDictionary

    ' Add the dictionary to the dictionaries collection
    Set dictObj = ThisDrawing.Dictionaries.Add("New_Dictionary")
    MsgBox dictObj.name & " has been added.", , "Add Example"
    Return

ADDDIMSTYLE:
    ' Create a new dimension style called "New_Dimstyle" in current drawing
    Dim DimStyleObj As AcadDimStyle

    ' Add the dimstyle to the dimstyles collection
    Set DimStyleObj = ThisDrawing.DimStyles.Add("New_Dimstyle")
    MsgBox DimStyleObj.name & " has been added.", , "Add Example"
    Return

ADDGROUP:
    ' Create a new group called "New_Group" in current drawing
    Dim groupObj As AcadGroup

    ' Add the group to the groups collection
    Set groupObj = ThisDrawing.Groups.Add("New_Group")
    MsgBox groupObj.name & " has been added.", , "Add Example"
    Return

ADDLAYER:
    ' This example creates a new layer called "New_Layer"
    Dim layerObj As AcadLayer

    ' Add the layer to the layers collection
    Set layerObj = ThisDrawing.Layers.Add("New_Layer")

    ' Make the new layer the active layer for the drawing
    ThisDrawing.ActiveLayer = layerObj

    ' Display the status of the new layer
     MsgBox layerObj.name & " has been added." & vbCrLf & _
            "LayerOn Status: " & layerObj.LayerOn & vbCrLf & _
            "Freeze Status: " & layerObj.Freeze & vbCrLf & _
            "Lock Status: " & layerObj.Lock & vbCrLf & _
            "Color: " & layerObj.Color, , "Add Example"
    Return

ADDREGISTEREDAPP:
    ' Create a registered application named "New_RegApp" in current drawing
    Dim RegAppObj As AcadRegisteredApplication

    ' Add the registered application to the registered applications collection
    Set RegAppObj = ThisDrawing.RegisteredApplications.Add("New_RegApp")
    MsgBox RegAppObj.name & " has been added.", , "Add Example"
    Return

ADDSELECTIONSET:
    ' Create a selectionset named "New_SelectionSet" in current drawing
    Dim ssetObj As AcadSelectionSet

    ' Add the selection set to the selection sets collection
    Set ssetObj = ThisDrawing.SelectionSets.Add("New_SelectionSet")
    MsgBox ssetObj.name & " has been added." & vbCrLf & _
           "The number of items in the selection set is " & ssetObj.count _
           , , "Add Example"
    Return

ADDTEXTSTYLE:
    ' Create a textstyle named "New_Textstyle" in current drawing
    Dim txtStyleObj As AcadTextStyle

    ' Add the textstyle to the textstyles collection
    Set txtStyleObj = ThisDrawing.TextStyles.Add("New_Textstyle")
    MsgBox txtStyleObj.name & " has been added." & vbCrLf & _
           "Height: " & txtStyleObj.height & vbCrLf & _
           "Width: " & txtStyleObj.width, , "Add Example"
    Return

ADDVIEW:
    ' Create a view named "New_View" in current drawing
    Dim viewObj As AcadView

    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.name & " has been added." & vbCrLf & _
           "Height: " & viewObj.height & vbCrLf & _
           "Width: " & viewObj.width, , "Add Example"
    Return

ADDVIEWPORT:
    ' Create a viewport named "New_Viewport" in current drawing
    Dim vportObj As AcadViewport

    ' Add the viewport to the viewports collection
    Set vportObj = ThisDrawing.Viewports.Add("New_Viewport")
    MsgBox vportObj.name & " has been added." & vbCrLf & _
           "GridOn Status: " & vportObj.GridOn & vbCrLf & _
           "OrthoOn Status: " & vportObj.OrthoOn & vbCrLf & _
           "SnapOn Status: " & vportObj.SnapOn, , "Add Example"
    Return

ADDUCS:
    ' Create a UCS named "New_UCS" in current drawing
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPnt(0 To 2) As Double
    Dim yAxisPnt(0 To 2) As Double

    ' Define the UCS
    origin(0) = 4#: origin(1) = 5#: origin(2) = 3#
    xAxisPnt(0) = 5#: xAxisPnt(1) = 5#: xAxisPnt(2) = 3#
    yAxisPnt(0) = 4#: yAxisPnt(1) = 6#: yAxisPnt(2) = 3#

    ' Add the UCS to the UserCoordinatesSystems collection
    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "New_UCS")
    MsgBox ucsObj.name & " has been added." & vbCrLf & _
            "Origin: " & ucsObj.origin(0) & ", " & ucsObj.origin(1) _
            & ", " & ucsObj.origin(2), , "Add Example"
    Return

ADDMATERIAL:
    Dim oMaterial As AcadMaterial
    Dim oMaterials As AcadMaterials
    Set oMaterial = ThisDrawing.Materials.Add("TestMaterial")
    oMaterial.Description = "This example demonstrates how to add a material to a database."
    ThisDrawing.ActiveMaterial = oMaterial
        ' Display the status of the new layer
    MsgBox oMaterial.Name & " has been added." & vbCrLf & _
            "Name: " & oMaterial.Name & vbCrLf & vbCrLf & _
            "Description: " & vbCrLf & vbCrLf & _
            oMaterial.Description
    Return

End Sub


Add3DFace Example [ActiveX and VBA Reference: AAR]

Add3DFace Example

Using Programming Languages other than VBA

Sub Example_Add3DFace()
    ' This example creates a 3D face in model space.

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double

    ' Define the four coordinates of the face
    point1(0) = 0#: point1(1) = 0#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 0#: point2(2) = 1#
    point3(0) = 1#: point3(1) = 10#: point3(2) = 0#
    point4(0) = 5#: point4(1) = 5#: point4(2) = 1#

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ZoomAll

End Sub


Add3DMesh Example [ActiveX and VBA Reference: AAR]

Add3DMesh Example

Using Programming Languages other than VBA

Sub Example_Add3DMesh()
    ' This example creates a 4 X 4 polygonmesh in model space.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 2: points(4) = 0: points(5) = 1
    points(6) = 4: points(7) = 0: points(8) = 0
    points(9) = 6: points(10) = 0: points(11) = 1
    points(12) = 0: points(13) = 2: points(14) = 0
    points(15) = 2: points(16) = 2: points(17) = 1
    points(18) = 4: points(19) = 2: points(20) = 0
    points(21) = 6: points(22) = 2: points(23) = 1
    points(24) = 0: points(25) = 4: points(26) = 0
    points(27) = 2: points(28) = 4: points(29) = 1
    points(30) = 4: points(31) = 4: points(32) = 0
    points(33) = 6: points(34) = 4: points(35) = 0
    points(36) = 0: points(37) = 6: points(38) = 0
    points(39) = 2: points(40) = 6: points(41) = 1
    points(42) = 4: points(43) = 6: points(44) = 0
    points(45) = 6: points(46) = 6: points(47) = 0

    mSize = 4: nSize = 4

    ' creates a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the polygonmesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


Add3DPoly Example [ActiveX and VBA Reference: AAR]

Add3DPoly Example

Using Programming Languages other than VBA

Sub Example_Add3DPoly()

    Dim polyObj As Acad3DPolyline
    Dim points(0 To 8) As Double

    ' Create the array of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 10: points(4) = 10: points(5) = 10
    points(6) = 30: points(7) = 20: points(8) = 30

    ' Create a 3DPolyline in model space
    Set polyObj = ThisDrawing.ModelSpace.Add3DPoly(points)
    ZoomAll

End Sub


AddArc Example [ActiveX and VBA Reference: AAR]

AddArc Example

Using Programming Languages other than VBA

Sub Example_AddArc()
    ' This example creates an arc in model space.

    Dim arcObj As AcadArc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngleInDegree As Double
    Dim endAngleInDegree As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#
    startAngleInDegree = 10#
    endAngleInDegree = 230#

    ' Convert the angles in degrees to angles in radians
    Dim startAngleInRadian As Double
    Dim endAngleInRadian As Double
    startAngleInRadian = startAngleInDegree * 3.141592 / 180#
    endAngleInRadian = endAngleInDegree * 3.141592 / 180#

    ' Create the arc object in model space
    Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
    ZoomAll
End Sub


AddAttribute Example [ActiveX and VBA Reference: AAR]

AddAttribute Example

Using Programming Languages other than VBA

Sub Example_AddAttribute()
    ' This example creates an attribute definition in model space.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "NEW_TAG"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

End Sub


AddBox Example [ActiveX and VBA Reference: AAR]

AddBox Example

Using Programming Languages other than VBA

Sub Example_AddBox()
    ' This example creates a box in model space.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddCircle Example [ActiveX and VBA Reference: AAR]

AddCircle Example

Using Programming Languages other than VBA

Sub Example_AddCircle()
    ' This example creates a circle in model space.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll

End Sub


AddCone Example [ActiveX and VBA Reference: AAR]

AddCone Example

Using Programming Languages other than VBA

Sub Example_AddCone()
    ' This example creates a cone in model space.

    Dim coneObj As Acad3DSolid
    Dim radius As Double
    Dim center(0 To 2) As Double
    Dim height As Double

    ' Define the cone
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    radius = 5#
    height = 20#

    ' Create the Cone (3DSolid) object in model space
    Set coneObj = ThisDrawing.ModelSpace.AddCone(center, radius, height)

    ' Change the viewing direction of the viewport to better see the cone
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll
End Sub


AddCustomInfo Example [ActiveX and VBA Reference: AAR]

AddCustomInfo Example

Using Programming Languages other than VBA

Sub Example_AddCustomInfo()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


AddCustomObject Example [ActiveX and VBA Reference: AAR]

AddCustomObject Example

Using Programming Languages other than VBA

Sub Example_AddCustomObject()
    ' This example adds a custom object to model space.

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX Application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Once the application has been loaded successfully,
    ' add the custom object to model space.
    Dim customObj As AcadObject
    Set customObj = ThisDrawing.ModelSpace.AddCustomObject("MyNewObject")

End Sub


AddCylinder Example [ActiveX and VBA Reference: AAR]

AddCylinder Example

Using Programming Languages other than VBA

Sub AddCylinder()
    ' This example creates a cylinder in model space.

    Dim cylinderObj As Acad3DSolid
    Dim radius As Double
    Dim center(0 To 2) As Double
    Dim height As Double

    ' Define the cylinder
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    radius = 5#
    height = 20#

    ' Create the Cylinder (3DSolid) object in model space
    Set cylinderObj = ThisDrawing.ModelSpace.AddCylinder(center, radius, height)

    ' Change the viewing direction of the viewport to better see the cylinder
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll
End Sub


AddDim3PointAngular Example [ActiveX and VBA Reference: AAR]

AddDim3PointAngular Example

Using Programming Languages other than VBA

Sub Example_AddDim3PointAngular()
    ' This example creates a Dim3PointAngular object in model space

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 2: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    MsgBox "A Dim3PointAngular object has been created."

End Sub


AddDimAligned Example [ActiveX and VBA Reference: AAR]

AddDimAligned Example

Using Programming Languages other than VBA

Sub Example_AddDimAligned()
    ' This example creates an aligned dimension in model space.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 5#: point2(2) = 0#
    location(0) = 5#: location(1) = 7#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
End Sub


AddDimAngular Example [ActiveX and VBA Reference: AAR]

AddDimAngular Example

Using Programming Languages other than VBA

Sub Example_AddDimAngular()
    ' This example creates an angular dimension in model space.

    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#

    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll

End Sub


AddDimArc Example [ActiveX and VBA Reference: AAR]

AddDimArc Example

Using Programming Languages other than VBA

Sub Example_AddDimArc()
    Dim PI As Double: PI = 3.141592
    Dim oMS As AcadModelSpace
    Set oMS = ThisDrawing.ModelSpace

    Dim ptCenter(2) As Double
    Dim oA As AcadArc
    Set oA = oMS.AddArc(ptCenter, 10, PI / 3, PI * 3 / 4)

    Dim ptArcPoint(2) As Double
    ptArcPoint(0) = 0: ptArcPoint(1) = 15

    Dim oAcadDimArcLength As AcadDimArcLength
    Set oAcadDimArcLength = oMS.AddDimArc(oA.Center, oA.startPoint, oA.endPoint, ptArcPoint)

    Update
    ZoomExtents
End Sub


AddDimDiametric Example [ActiveX and VBA Reference: AAR]

AddDimDiametric Example

Using Programming Languages other than VBA

Sub Example_AddDimDiametric()
    ' This example creates a diametric dimension in model space.

    Dim dimObj As AcadDimDiametric
    Dim chordPoint(0 To 2) As Double
    Dim farChordPoint(0 To 2) As Double
    Dim leaderLength As Double

    ' Define the dimension
    chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
    farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
    leaderLength = 1#

    ' Create the diametric dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
    ZoomAll

End Sub


AddDimOrdinate Example [ActiveX and VBA Reference: AAR]

AddDimOrdinate Example

Using Programming Languages other than VBA

Sub Example_AddDimOrdinate()
    ' This example creates an ordinate dimension in model space.

    Dim dimObj As AcadDimOrdinate
    Dim definingPoint(0 To 2) As Double
    Dim leaderEndPoint(0 To 2) As Double
    Dim useXAxis As Long

    ' Define the dimension
    definingPoint(0) = 5#: definingPoint(1) = 5#: definingPoint(2) = 0#
    leaderEndPoint(0) = 10#: leaderEndPoint(1) = 5#: leaderEndPoint(2) = 0#
    useXAxis = 5#

    ' Create an ordinate dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimOrdinate(definingPoint, leaderEndPoint, useXAxis)
    ZoomAll

End Sub


AddDimRadial Example [ActiveX and VBA Reference: AAR]

AddDimRadial Example

Using Programming Languages other than VBA

Sub Example_AddDimRadial()
    ' This example creates a radial dimension in model space.

    Dim dimObj As AcadDimRadial
    Dim center(0 To 2) As Double
    Dim chordPoint(0 To 2) As Double
    Dim leaderLen As Integer

    ' Define the dimension
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    chordPoint(0) = 5#: chordPoint(1) = 5#: chordPoint(2) = 0#
    leaderLen = 5

    ' Create the radial dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRadial(center, chordPoint, leaderLen)
    ZoomAll
End Sub


AddDimRadialLarge Example [ActiveX and VBA Reference: AAR]

AddDimRadialLarge Example

Using Programming Languages other than VBA

Sub Example_AddDimRadialLarge()
    Dim PI As Double: PI = 3.141592
    Dim oMS As AcadModelSpace
    Set oMS = ThisDrawing.ModelSpace

    Dim ptCenter(2) As Double
    Dim oA As AcadArc
    Set oA = oMS.AddArc(ptCenter, 10, PI / 3, PI * 3 / 4)

    Dim ptChordPoint(2) As Double
    ptChordPoint(0) = 0: ptChordPoint(1) = 10: ptChordPoint(2) = 0

    Dim ptOverrideCenter(2) As Double
    ptOverrideCenter(0) = -3: ptOverrideCenter(1) = -6: ptOverrideCenter(2) = 0

    Dim ptJogPoint(2) As Double
    ptJogPoint(0) = 0: ptJogPoint(1) = 5: ptJogPoint(2) = 0

    Dim oDimRadialLarge As AcadDimRadialLarge
    Set oDimRadialLarge = oMS.AddDimRadialLarge(oA.Center, ptChordPoint, ptOverrideCenter, ptJogPoint, PI / 4)

    Dim ptTextPosition(2) As Double
    ptTextPosition(0) = 0: ptTextPosition(1) = 6: ptTextPosition(2) = 0
    oDimRadialLarge.TextPosition = ptTextPosition

    Update
    ZoomExtents
End Sub


AddDimRotated Example [ActiveX and VBA Reference: AAR]

AddDimRotated Example

Using Programming Languages other than VBA

Sub Example_AddDimRotated()
    ' This example creates a rotated dimension in model space.

    Dim dimObj As AcadDimRotated
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim rotAngle As Double

    ' Define the dimension
    point1(0) = 0#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 5#: point2(2) = 0#
    location(0) = 0#: location(1) = 0#: location(2) = 0#
    rotAngle = 120
    rotAngle = rotAngle * 3.141592 / 180#       ' covert to Radians

    ' Create the rotated dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRotated(point1, point2, location, rotAngle)
    ZoomAll
End Sub


AddEllipse Example [ActiveX and VBA Reference: AAR]

AddEllipse Example

Using Programming Languages other than VBA

Sub Example_AddEllipse()
    ' This example creates an ellipse in model space.

    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
    ZoomAll

End Sub


AddEllipticalCone Example [ActiveX and VBA Reference: AAR]

AddEllipticalCone Example

Using Programming Languages other than VBA

Sub Example_AddEllipticalCone()
    ' This example creates an elliptical cone in model space.

    Dim coneObj As Acad3DSolid
    Dim center(0 To 2) As Double
    Dim majorRadius As Double
    Dim minorRadius As Double
    Dim height As Double

    ' Define the elliptical cone
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    majorRadius = 10#
    minorRadius = 5#
    height = 20#

    ' Create the elliptical cone in model space
    Set coneObj = ThisDrawing.ModelSpace.AddEllipticalCone(center, majorRadius, minorRadius, height)

    ' Change the viewing direction of the viewport to better see the cone
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddEllipticalCylinder Example [ActiveX and VBA Reference: AAR]

AddEllipticalCylinder Example

Using Programming Languages other than VBA

Sub Example_AddEllipticalCylinder()
    ' This example creates an elliptical cylinder in model space.

    Dim cylinderObj As Acad3DSolid
    Dim center(0 To 2) As Double
    Dim majorRadius As Double
    Dim minorRadius As Double
    Dim height As Double

    ' Define the elliptical cylinder
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    majorRadius = 5#
    minorRadius = 2.5
    height = 10#

    ' Create the elliptical cylinder in model space
    Set cylinderObj = ThisDrawing.ModelSpace.AddEllipticalCylinder(center, majorRadius, minorRadius, height)

    ' Change the viewing direction of the viewport to better see the cylinder
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddExtrudedSolid Example [ActiveX and VBA Reference: AAR]

AddExtrudedSolid Example

Using Programming Languages other than VBA

Sub Example_AddExtrudedSolid()
    ' This example extrudes a solid from a region.
    ' The region is created from an arc and a line.

    Dim curves(0 To 1) As AcadEntity

    ' Define the arc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
    radius = 2#
    startAngle = 0
    endAngle = 3.141592
    Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)

    ' Define the line
    Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)

    ' Create the region
    Dim regionObj As Variant
    regionObj = ThisDrawing.ModelSpace.AddRegion(curves)

    ' Define the extrusion
    Dim height As Double
    Dim taperAngle As Double
    height = 3
    taperAngle = 0

    ' Create the solid
    Dim solidObj As Acad3DSolid
    Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddExtrudedSolidAlongPath Example [ActiveX and VBA Reference: AAR]

AddExtrudedSolidAlongPath Example

Using Programming Languages other than VBA

Sub Example_AddExtrudedSolidAlongPath()
    ' This example extrudes a solid from a region
    ' along a path defined by a spline.
    ' The region is created from an arc and a line.

    Dim curves(0 To 1) As AcadEntity

    ' Define the arc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
    radius = 2#
    startAngle = 0
    endAngle = 3.141592
    Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)

    ' Define the line
    Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)

    ' Create the region
    Dim regionObj As Variant
    regionObj = ThisDrawing.ModelSpace.AddRegion(curves)

    ' Define the extrusion path (spline object)
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    ' Define the Spline Object
    startTan(0) = 10: startTan(1) = 10: startTan(2) = 10
    endTan(0) = 10: endTan(1) = 10: endTan(2) = 10
    fitPoints(0) = 0: fitPoints(1) = 10: fitPoints(2) = 10
    fitPoints(0) = 10: fitPoints(1) = 10: fitPoints(2) = 10
    fitPoints(0) = 15: fitPoints(1) = 10: fitPoints(2) = 10
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ' Create the solid
    Dim solidObj As Acad3DSolid
    Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj(0), splineObj)
    ZoomAll

End Sub


AddFitPoint Example [ActiveX and VBA Reference: AAR]

AddFitPoint Example

Using Programming Languages other than VBA

Sub Example_AddFitPoint()
    ' This example creates a spline object in model space.
    ' It then adds a fit point to the spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create the spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll
    MsgBox "The Spline has " & splineObj.NumberOfFitPoints & " fit points.", , "AddFitPoint Example"

    ' Define the new fit point
    Dim newFitPoint(0 To 2) As Double
    newFitPoint(0) = 8: newFitPoint(1) = 5: newFitPoint(2) = 0

    ' Add the new fit point at the first index in the spline's array of points
    splineObj.AddFitPoint 1, newFitPoint
    ThisDrawing.Regen True
    MsgBox "A fit point has been added at Index:1  WCS: 8, 5, 0" & vbCrLf & "The Spline has " & splineObj.NumberOfFitPoints & " fit points.", , "AddFitPoint Example"

End Sub


AddHatch Example [ActiveX and VBA Reference: AAR]

AddHatch Example

Using Programming Languages other than VBA

Sub Example_AddHatch()
    ' This example creates an associative gradient hatch in model space.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    hatchObj.GradientColor1 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
End Sub


AddItems Example [ActiveX and VBA Reference: AAR]

AddItems Example

Using Programming Languages other than VBA

Sub Example_AddItems()
    ' This example creates a selection set and several objects.
    ' It then adds the objects to the selection set.

    ' Create the new selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET")

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection.
    ' Collect the objects found into an array of objects
    ' to be added to the selection set.
    ReDim ssobjs(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects to the selection set
    ssetObj.AddItems ssobjs

    ThisDrawing.Regen acActiveViewport

End Sub


AddLeader Example [ActiveX and VBA Reference: AAR]

AddLeader Example

Using Programming Languages other than VBA

Sub Example_AddLeader()
    ' This example creates a leader in model space.
    ' The leader is not attached to any annotation object
    ' in this example.

    Dim leaderObj As AcadLeader
    Dim points(0 To 8) As Double
    Dim leaderType As Integer
    Dim annotationObject As AcadObject

    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    points(6) = 4: points(7) = 5: points(8) = 0
    leaderType = acLineWithArrow
    Set annotationObject = Nothing

    ' Create the leader object in model space
    Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
    ZoomAll

End Sub


AddLightWeightPolyline Example [ActiveX and VBA Reference: AAR]

AddLightweightPolyline Example

Using Programming Languages other than VBA

Sub Example_AddLightWeightPolyline()
    ' This example creates a lightweight polyline in model space.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 9) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ZoomAll

End Sub


AddLine Example [ActiveX and VBA Reference: AAR]

AddLine Example

Using Programming Languages other than VBA

Sub Example_AddLine()
    ' This example adds a line in model space

    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    ' Define the start and end points for the line
    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    ' Create the line in model space
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

End Sub


AddMenuItem Example [ActiveX and VBA Reference: AAR]

AddMenuItem Example

Using Programming Languages other than VBA

Sub Example_AddMenuItem()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


AddMInsertBlock Example [ActiveX and VBA Reference: AAR]

AddMInsertBlock Example

Using Programming Languages other than VBA

Sub Example_AddMInsertBlock()
    ' This example creates a new Block in the current drawing, adds a
    ' Circle object to the new block, and uses the newly created block
    ' to create a rectangular array of block references using AddMInsertBlock

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock

    ' Define the Circle object that will be inserted into the block
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle object
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block object
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)

    ThisDrawing.Application.ZoomAll

    MsgBox "A rectangular array has been created from the original block."

End Sub


AddMLeader Example [ActiveX and VBA Reference: AAR]

AddMLeader Example

Using Programming Languages other than VBA

Sub Example_AddMLeader()
    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

End Sub


AddMLine Example [ActiveX and VBA Reference: AAR]

AddMLine Example

Using Programming Languages other than VBA

Sub Example_AddMLine()
   ' This example adds an Mline in model space

    Dim mLineObj As AcadMLine
    Dim vertexList(0 To 17) As Double

    ' Define data for new object
    vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
    vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
    vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
    vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
    vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
    vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 6

    ' Create the line in model space
    Set mLineObj = ThisDrawing.ModelSpace.AddMLine(vertexList)

    ThisDrawing.Application.ZoomAll

    MsgBox "A new MLine has been added to the drawing."
End Sub


AddMtext Example [ActiveX and VBA Reference: AAR]

AddMText Example

Using Programming Languages other than VBA

Sub Example_AddMtext()
    ' This example creates an MText object in model space.

    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text String for the mtext Object"

    ' Creates the mtext Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

End Sub


AddObject Example [ActiveX and VBA Reference: AAR]

AddObject Example

Using Programming Languages other than VBA

Sub Example_AddObject()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

End Sub


AddPoint Example [ActiveX and VBA Reference: AAR]

AddPoint Example

Using Programming Languages other than VBA

Sub Example_AddPoint()
    ' This example creates a point in model space.
    Dim pointObj As AcadPoint
    Dim location(0 To 2) As Double

    ' Define the location of the point
    location(0) = 5#: location(1) = 5#: location(2) = 0#

    ' Create the point
    Set pointObj = ThisDrawing.ModelSpace.AddPoint(location)
    ZoomAll

End Sub


AddPolyfaceMesh Example [ActiveX and VBA Reference: AAR]

AddPolyfaceMesh Example

Using Programming Languages other than VBA

Sub Example_AddPolyfaceMesh()

    Dim vertexList(0 To 17) As Double

    'Data
    vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
    vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
    vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
    vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
    vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
    vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 1

    Dim FaceList(0 To 7) As Integer

    FaceList(0) = 1
    FaceList(1) = 2
    FaceList(2) = 5
    FaceList(3) = 4
    FaceList(4) = 2
    FaceList(5) = 3
    FaceList(6) = 6
    FaceList(7) = 5

    Dim obj As AcadPolyfaceMesh
    Set obj = ModelSpace.AddPolyfaceMesh(vertexList, FaceList)
    obj.Update

    ' Change the viewing direction of the viewport to
    ' better see the polyface mesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll
End Sub


AddPolyline Example [ActiveX and VBA Reference: AAR]

AddPolyline Example

Using Programming Languages other than VBA

Sub Example_AddPolyline()
    ' This example creates a polyline in model space.

    Dim plineObj As AcadPolyline
    Dim points(0 To 14) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ZoomAll

End Sub


AddPViewport Example [ActiveX and VBA Reference: AAR]

AddPViewport Example

Using Programming Languages other than VBA

Sub Example_AddPViewport()
    ' This example creates a new paper space viewport

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the paper space viewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)

    ThisDrawing.Regen acAllViewports

End Sub


AddRaster Example [ActiveX and VBA Reference: AAR]

AddRaster Example

Using Programming Languages other than VBA

Sub Example_AddRaster()
    ' This example adds a raster image in model space.

    ' This example uses a file named "raster.jpg."
    ' You should change this example to use
    ' a raster file on your computer.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage
    imageName = "C:\raster.jpg"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotationAngle = 0

    On Error Resume Next
    ' Creates a raster image in model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    If Err.Description = "File error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If
    ZoomExtents
End Sub


AddRay Example [ActiveX and VBA Reference: AAR]

AddRay Example

Using Programming Languages other than VBA

Sub Example_AddRay()
    ' This example creates a ray in model space.

    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double

    ' Define the ray
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 4#: SecondPoint(1) = 4#: SecondPoint(2) = 0#

    ' Creates a Ray object in model space
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)
    ZoomAll

End Sub


AddRegion Example [ActiveX and VBA Reference: AAR]

AddRegion Example

Using Programming Languages other than VBA

Sub Example_AddRegion()
    ' This example creates a region from an arc and a line.

    Dim curves(0 To 1) As AcadEntity

    ' Define the arc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
    radius = 2#
    startAngle = 0
    endAngle = 3.141592
    Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)

    ' Define the line
    Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)

    ' Create the region
    Dim regionObj As Variant
    regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
    ZoomAll

End Sub


AddRevolvedSolid Example [ActiveX and VBA Reference: AAR]

AddRevolvedSolid Example

Using Programming Languages other than VBA

Sub Example_AddRevolvedSolid()
    ' This example creates a solid from a region
    ' rotated around an axis.
    ' The region is created from an arc and a line.
    Dim curves(0 To 1) As AcadEntity

    ' Define the arc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
    radius = 2#
    startAngle = 0
    endAngle = 3.141592
    Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)

    ' Define the line
    Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)

    ' Create the region
    Dim regionObj As Variant
    regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
    ZoomAll
    MsgBox "Revolve the region to create the solid.", , "AddRevolvedSolid Example"

    ' Define the rotation axis
    Dim axisPt(0 To 2) As Double
    Dim axisDir(0 To 2) As Double
    Dim angle As Double
    axisPt(0) = 7: axisPt(1) = 2.5: axisPt(2) = 0
    axisDir(0) = 11: axisDir(1) = 1: axisDir(2) = 3
    angle = 6.28

    ' Create the solid
    Dim solidObj As Acad3DSolid
    Set solidObj = ThisDrawing.ModelSpace.AddRevolvedSolid(regionObj(0), axisPt, axisDir, angle)
    ZoomAll

     ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll
    MsgBox "Solid created.", , "AddRevolvedSolid Example"

End Sub


AddSeparator Example [ActiveX and VBA Reference: AAR]

AddSeparator Example

Using Programming Languages other than VBA

Sub Example_AddSeparator()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' and a separator into it. The menu is then displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Add a separator to the end of the menu
    Dim newMenuSeparator As AcadPopupMenuItem
    Set newMenuSeparator = newMenu.AddSeparator("")

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


AddShape Example [ActiveX and VBA Reference: AAR]

AddShape Example

Using Programming Languages other than VBA

Sub Example_AddShape()
    ' This example creates a BAT shape from the ltypeshp.shx file.

    ' Load the shape file containing the shape you wish to create.
    ' Note: Replace the ltypeshp.shx file name
    ' with a valid shape file for your system.
    On Error GoTo ERRORHANDLER
    ThisDrawing.LoadShapeFile ("C:/Program Files/AutoCAD/Support/ltypeshp.shx")

    Dim shapeObj As AcadShape
    Dim shapeName As String
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotation As Double

    ' "diode" is defined in es.shx file
    shapeName = "BAT"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotation = 0#       ' Radians

    ' Create the diode shape object in model space
    Set shapeObj = ThisDrawing.ModelSpace.AddShape(shapeName, insertionPoint, scalefactor, rotation)
    Exit Sub

ERRORHANDLER:
    MsgBox "Cannot find the shape file.", , "AddShape Example"

End Sub


AddSolid Example [ActiveX and VBA Reference: AAR]

AddSolid Example

Using Programming Languages other than VBA

Sub Example_AddSolid()
    ' This example creates a solid in model space.

    Dim solidObj As AcadSolid
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double

    ' Define the solid
    point1(0) = 0#: point1(1) = 1#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 1#: point2(2) = 0#
    point3(0) = 8#: point3(1) = 8#: point3(2) = 0#
    point4(0) = 4#: point4(1) = 6#: point4(2) = 0#

    ' Create the solid object in model space
    Set solidObj = ThisDrawing.ModelSpace.AddSolid(point1, point2, point3, point4)
    ZoomAll

End Sub


AddSphere Example [ActiveX and VBA Reference: AAR]

AddSphere Example

Using Programming Languages other than VBA

Sub Example_AddSphere()
    ' This example creates a sphere in model space.

    Dim sphereObj As Acad3DSolid
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    centerPoint(0) = 5#: centerPoint(1) = 5#: centerPoint(2) = 0#
    radius = 5#
    Set sphereObj = ThisDrawing.ModelSpace.AddSphere(centerPoint, radius)

     ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddSpline Example [ActiveX and VBA Reference: AAR]

AddSpline Example

Using Programming Languages other than VBA

Sub Example_AddSpline()
    ' This example creates a spline object in model space.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

End Sub


AddSubMenu Example [ActiveX and VBA Reference: AAR]

AddSubMenu Example

Using Programming Languages other than VBA

Sub Example_AddSubMenu()
    ' This example creates a new menu called TestMenu and inserts a submenu item
    ' called NewFile. It then creates a menu item, called open,
    ' on the submenu.

    ' The menu is then displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add the submenu
    Dim FileSubMenu As AcadPopupMenu
    Set FileSubMenu = newMenu.AddSubMenu("", "NewFile")

    ' Add a menu item to the sub menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = FileSubMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


AddTable Example [ActiveX and VBA Reference: AAR]

AddTable Example

Using Programming Languages other than VBA

Sub Example_AddTable()
    ' This example adds a table in model space

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Set MyTable = MyModelSpace.Addtable(pt, 5, 5, 10, 30)
    ZoomExtents

End Sub


AddText Example [ActiveX and VBA Reference: AAR]

AddText Example

Using Programming Languages other than VBA

Sub Example_AddText()
    ' This example creates a text object in model space.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll

End Sub


AddTolerance Example [ActiveX and VBA Reference: AAR]

AddTolerance Example

Using Programming Languages other than VBA

Sub Example_AddTolerance()
    ' This example creates a tolerance object in model space.

    Dim toleranceObj As AcadTolerance
        Dim textString As String
        Dim insertionPoint(0 To 2) As Double
        Dim direction(0 To 2) As Double

        ' Define the tolerance object
        textString = "{\Fgdt;r}%%vasdf{\Fgdt;l}%%vdf%%vxc%%v12{\Fgdt;m}%%vsd" & vbCrLf & _
    "{\Fgdt;t}%%vdfd%%v3dd{\Fgdt;l}%%vv%%v%%vxc{\Fgdt;m}" & vbCrLf & _
    "123"
        insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
        direction(0) = 1#: direction(1) = 1#: direction(2) = 0#

        ' Create the tolerance object in model space
        Set toleranceObj = ThisDrawing.ModelSpace.AddTolerance(textString, insertionPoint, direction)
        ZoomAll

End Sub


AddToolbarButton Example [ActiveX and VBA Reference: AAR]

AddToolbarButton Example

Using Programming Languages other than VBA

Sub Example_AddToolbarButton()
    ' This example creates a new toolbar called TestToolbar and inserts a
    ' toolbar button into it. The toolbar is then displayed.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add a button to the new toolbar
    Dim newButton As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton = newToolBar.AddToolbarButton("", "NewButton", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

End Sub


AddTorus Example [ActiveX and VBA Reference: AAR]

AddTorus Example

Using Programming Languages other than VBA

Sub Example_AddTorus()
    ' This example creates a torus in model space.

    Dim torusObj As Acad3DSolid
    Dim centerPoint(0 To 2) As Double
    Dim torusRadius As Double
    Dim tubeRadius As Double

    ' Define the torus
    centerPoint(0) = 5: centerPoint(1) = 5: centerPoint(2) = 0
    torusRadius = 15
    tubeRadius = 5

    ' Create the torus
    Set torusObj = ThisDrawing.ModelSpace.AddTorus(centerPoint, torusRadius, tubeRadius)

     ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddTrace Example [ActiveX and VBA Reference: AAR]

AddTrace Example

Using Programming Languages other than VBA

Sub Example_AddTrace()
    ' This example creates a trace in model space.

    Dim traceObj As AcadTrace
    Dim tracePts(0 To 11) As Double       ' 4 (3D) points

    ' Define the points of the trace
    tracePts(0) = 1: tracePts(1) = 1: tracePts(2) = 0
    tracePts(3) = 3: tracePts(4) = 3: tracePts(5) = 0
    tracePts(6) = 5: tracePts(7) = 3: tracePts(8) = 0
    tracePts(9) = 5: tracePts(10) = 1: tracePts(11) = 0

    ' Turn on the system variable (FILLMODE)
    ' to fill the outline of the trace
    ThisDrawing.SetVariable "FILLMODE", 1

    ' Create the trace object in model space
    Set traceObj = ThisDrawing.ModelSpace.AddTrace(tracePts)
    ZoomAll

End Sub


AddVertex Example [ActiveX and VBA Reference: AAR]

AddVertex Example

Using Programming Languages other than VBA

Sub Example_AddVertex()
    ' This example creates a lightweight polyline in model space.
    ' It then adds a vertex to the polyline.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 9) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ZoomAll
    MsgBox "Add a vertex to the end of the polyline.", , "AddVertex Example"

    ' Define the new vertex
    Dim newVertex(0 To 1) As Double
    newVertex(0) = 4: newVertex(1) = 1

    ' Add the vertex to the polyline
    plineObj.AddVertex 5, newVertex
    plineObj.Update
    MsgBox "Vertex added.", , "AddVertex Example"

End Sub


AddWedge Example [ActiveX and VBA Reference: AAR]

AddWedge Example

Using Programming Languages other than VBA

Sub Example_AddWedge()
    ' This example creates a wedge in model space.

    Dim wedgeObj As Acad3DSolid
    Dim center(0 To 2) As Double
    Dim length As Double
    Dim width As Double
    Dim height As Double

    ' Define the wedge
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 10#: width = 15#: height = 20#

    ' Create the wedge in model space
    Set wedgeObj = ThisDrawing.ModelSpace.AddWedge(center, length, width, height)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


AddXLine Example [ActiveX and VBA Reference: AAR]

AddXLine Example

Using Programming Languages other than VBA

Sub Example_AddXLine()
    ' This example creates an XLine in model space.

    Dim xlineObj As AcadXline
    Dim basePoint(0 To 2) As Double
    Dim directionVec(0 To 2) As Double

    ' Define the xline
    basePoint(0) = 2#: basePoint(1) = 2#: basePoint(2) = 0#
    directionVec(0) = 1#: directionVec(1) = 1#: directionVec(2) = 0#

    ' Create the xline in model space
    Set xlineObj = ThisDrawing.ModelSpace.AddXline(basePoint, directionVec)
    ZoomAll

End Sub


AddXRecord Example [ActiveX and VBA Reference: AAR]

AddXRecord Example

Using Programming Languages other than VBA

Sub Example_AddXRecord()
    ' This example creates a new XRecord if one doesn't exist,
    ' appends data to the XRecord, and then reads it back.  To see data being added,
    ' run the example more than once.

    Dim TrackingDictionary As AcadDictionary, TrackingXRecord As AcadXRecord
    Dim XRecordDataType As Variant, XRecordData As Variant
    Dim ArraySize As Long, iCount As Long
    Dim DataType As Integer, Data As String, msg As String

    ' Unique identifiers to distinguish this XRecordData from other XRecordData
    Const TYPE_STRING = 1
    Const TAG_DICTIONARY_NAME = "ObjectTrackerDictionary"
    Const TAG_XRECORD_NAME = "ObjectTrackerXRecord"

    ' Connect to the dictionary in which to store the XRecord
    On Error GoTo CREATE
    Set TrackingDictionary = ThisDrawing.Dictionaries(TAG_DICTIONARY_NAME)
    Set TrackingXRecord = TrackingDictionary.GetObject(TAG_XRECORD_NAME)
    On Error GoTo 0

    ' Get current XRecordData
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData

    ' If there is no array yet then create one
    If VarType(XRecordDataType) And vbArray = vbArray Then
        ArraySize = UBound(XRecordDataType) + 1       ' Get the size of the data elements returned
        ArraySize = ArraySize + 1                        ' Increase to hold new data

        ReDim Preserve XRecordDataType(0 To ArraySize)
        ReDim Preserve XRecordData(0 To ArraySize)
    Else
        ArraySize = 0
        ReDim XRecordDataType(0 To ArraySize) As Integer
        ReDim XRecordData(0 To ArraySize) As Variant
    End If

    ' Append new XRecord Data
    '
    ' For this sample we only append the current time to the XRecord
    XRecordDataType(ArraySize) = TYPE_STRING: XRecordData(ArraySize) = CStr(Now)
    TrackingXRecord.SetXRecordData XRecordDataType, XRecordData

    ' Read back all XRecordData entries
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData
    ArraySize = UBound(XRecordDataType)

    ' Retrieve and display stored XRecordData
    For iCount = 0 To ArraySize
        ' Get information for this element
        DataType = XRecordDataType(iCount)
        Data = XRecordData(iCount)

        If DataType = TYPE_STRING Then
            msg = msg & Data & vbCrLf
        End If
    Next

    MsgBox "The data in the XRecord is: " & vbCrLf & vbCrLf & msg, vbInformation

    Exit Sub

CREATE:
    ' Create the objects that hold this XRecordData
    If TrackingDictionary Is Nothing Then  ' Make sure to have tracking object
        Set TrackingDictionary = ThisDrawing.Dictionaries.Add(TAG_DICTIONARY_NAME)
        Set TrackingXRecord = TrackingDictionary.AddXRecord(TAG_XRECORD_NAME)
    End If

    Resume
End Sub


AffectsGraphics Example [ActiveX and VBA Reference: AAR]

AffectsGraphics Example

Using Programming Languages other than VBA

Sub Example_AffectsGraphics()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


Algorithm Example [ActiveX and VBA Reference: AAR]

Algorithm Example

Using Programming Languages other than VBA

Sub Example_Algorithm()
    ' This example encrypts and saves a file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp

End Sub


Alignment Example [ActiveX and VBA Reference: AAR]

Alignment Example

Using Programming Languages other than VBA

Sub Example_Alignment()
   ' This example creates a text object in model space and
   ' demonstrates setting the alignment of the new text string

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double, alignmentPoint(0 To 2) As Double
    Dim height As Double
    Dim oldPDMODE As Integer
    Dim pointObj As AcadPoint

    ' Define the new Text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    alignmentPoint(0) = 3: alignmentPoint(1) = 3: alignmentPoint(2) = 0
    height = 0.5

    ' Create the Text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)

    oldPDMODE = ThisDrawing.GetVariable("PDMODE")   ' Record existing point style

    ' Create a crosshair over the text alignment point
    ' to better visualize the alignment process
    Set pointObj = ThisDrawing.ModelSpace.AddPoint(alignmentPoint)

    ThisDrawing.SetVariable "PDMODE", 2             ' Set point style to crosshair

    ThisDrawing.Application.ZoomAll

    ' Set the text alignment to a value other than acAlignmentLeft, which is the default.
    ' Create a point that will act as an alignment reference point
    textObj.Alignment = acAlignmentRight

    ' Create the text alignment reference point and the text will automatically
    ' align to the right of this point, because the text
    ' alignment was set to acAlignmentRight
    textObj.TextAlignmentPoint = alignmentPoint
    ThisDrawing.Regen acActiveViewport
    MsgBox "The Text object is now aligned to the right of the alignment point"

    ' Center the text to the alignment point
    textObj.Alignment = acAlignmentCenter
    ThisDrawing.Regen acActiveViewport
    MsgBox "The Text object is now centered to the alignment point"

    ' Reset point style
    ThisDrawing.SetVariable "PDMODE", oldPDMODE
End Sub


AlignmentPointAcquisition Example [ActiveX and VBA Reference: AAR]

AlignmentPointAcquisition Example

Using Programming Languages other than VBA

Sub Example_AlignmentPointAcquisition()
    ' This example reads and modifies the preference value that controls
    ' how AutoAlignment points are acquired. When finished, this example resets
    ' the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AlignmentPointAcquisition
    MsgBox "The AlignmentPointAcquisition preference is: " & originalValue

    ' Toggle and display the AlignmentPointAcquisition preference
    If ACADPref.AlignmentPointAcquisition = acAlignPntAcquisitionAutomatic Then
        ACADPref.AlignmentPointAcquisition = acAlignPntAcquisitionShiftToAcquire
    Else
        ACADPref.AlignmentPointAcquisition = acAlignPntAcquisitionAutomatic
    End If

    newValue = ACADPref.AlignmentPointAcquisition
    MsgBox "The AlignmentPointAcquisition preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AlignmentPointAcquisition = originalValue
    MsgBox "The AlignmentPointAcquisition preference was reset back to: " & originalValue
End Sub


AllowLongSymbolNames Example [ActiveX and VBA Reference: AAR]

AllowLongSymbolNames Example

Using Programming Languages other than VBA

Sub Example_AllowLongSymbolNames()
    ' This example reads and modifies the preference value that controls
    ' whether symbol names include extended character sets or more
    ' than 31 characters.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.AllowLongSymbolNames
    MsgBox "The AllowLongSymbolNames preference is set to: " & originalValue

    ' Modify the AllowLongSymbolNames preference by toggling the value
    ACADPref.AllowLongSymbolNames = Not (ACADPref.AllowLongSymbolNames)
    newValue = ACADPref.AllowLongSymbolNames
    MsgBox "The AllowLongSymbolNames preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AllowLongSymbolNames = originalValue
    MsgBox "The AllowLongSymbolNames preference was reset back to: " & originalValue
End Sub


AltFontFile Example [ActiveX and VBA Reference: AAR]

AltFontFile Example

Using Programming Languages other than VBA

Sub Example_AltFontFile()
    ' This example returns the current setting of
    ' AltFontFile. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currAltFontFile As String
    Dim newAltFontFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current AltFontFile value
    currAltFontFile = preferences.Files.AltFontFile
    MsgBox "The current value for AltFontFile is " & currAltFontFile, vbInformation, "AltFontFile Example"

    ' Change the value for AltFontFile
    newAltFontFile = "C:/AutoCAD/Fonts/gothice.shx"
    preferences.Files.AltFontFile = newAltFontFile
    MsgBox "The new value for AltFontFile is " & newAltFontFile, vbInformation, "AltFontFile Example"

    ' Reset AltFontFile to its original value
    preferences.Files.AltFontFile = currAltFontFile
    MsgBox "The AltFontFile value is reset to " & currAltFontFile, vbInformation, "AltFontFile Example"

 End Sub


AltRoundDistance Example [ActiveX and VBA Reference: AAR]

AltRoundDistance Example

Using Programming Languages other than VBA

Sub Example_AltRoundDistance()
   ' This example creates an aligned dimension in model space and
   ' uses AltRoundDistance to set the alternate unit display
   ' of the dimension to rounded values

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 10.123: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

    MsgBox "Press any key to round the alternate dimension unit display to .5"

    ' Round the distance of the alternate dimension to 0.50 of a unit
    dimObj.AltRoundDistance = 0.5
    ThisDrawing.Regen acAllViewports

    MsgBox "Alternate dimension units have been rounded to: " & dimObj.AltRoundDistance
End Sub


AltSuppressLeadingZeros Example [ActiveX and VBA Reference: AAR]

AltSuppressLeadingZeros Example

Using Programming Languages other than VBA

Sub Example_AltSuppressLeadingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses AltSuppressLeadingZeros to toggle the display of leading zeros
   ' in the alternate dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of leading zeros in the alternate dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of leading zeros for the alternate dimension value
            dimObj.AltSuppressLeadingZeros = Not (dimObj.AltSuppressLeadingZeros)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltSuppressTrailingZeros Example [ActiveX and VBA Reference: AAR]

AltSuppressTrailingZeros Example

Using Programming Languages other than VBA

Sub Example_AltSuppressTrailingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses AltSuppressTrailingZeros to toggle the display of trailing zeros
   ' in the alternate dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 7: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of trailing zeros in the alternate dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of trailing zeros for the alternate dimension value
            dimObj.AltSuppressTrailingZeros = Not (dimObj.AltSuppressTrailingZeros)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltSuppressZeroFeet Example [ActiveX and VBA Reference: AAR]

AltSuppressZeroFeet Example

Using Programming Languages other than VBA

Sub Example_AltSuppressZeroFeet()
   ' This example creates an aligned dimension in model space and
   ' uses AltSuppressZeroFeet to suppress or view the display of
   ' zero feet in the alternate dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ' Set the dimension display to a style that works with AltSuppressZeroFeet
    dimObj.AltUnitsFormat = acDimLArchitectural
    dimObj.AltUnitsScale = 2    ' Set the alternate unit scale to be a multiple of 2

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero feet in the alternate dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero feet for the alternate dimension value
            dimObj.AltSuppressZeroFeet = Not (dimObj.AltSuppressZeroFeet)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltSuppressZeroInches Example [ActiveX and VBA Reference: AAR]

AltSuppressZeroInches Example

Using Programming Languages other than VBA

Sub Example_AltSuppressZeroInches()
   ' This example creates an aligned dimension in model space and
   ' uses AltSuppressZeroInches to suppress or view the display of
   ' zero inches in the alternate dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 12: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ' Set the dimension display to a style that works with AltSuppressZeroInches
    dimObj.AltUnitsFormat = acDimLArchitectural
    dimObj.AltUnitsScale = 2    ' Set the alternate unit scale to be a multiple of 2

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero inches in the alternate dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero inches for the alternate dimension value
            dimObj.AltSuppressZeroInches = Not (dimObj.AltSuppressZeroInches)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltTabletMenu Example [ActiveX and VBA Reference: AAR]

AltTabletMenuFile Example

Using Programming Languages other than VBA

Sub Example_AltTabletMenuFile()
    ' This example returns the current setting of
    ' AltTabletMenuFile. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currAltTabletMenuFile As String
    Dim newAltTabletMenuFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current AltTabletMenuFile value
    currAltTabletMenuFile = preferences.Files.AltTabletMenuFile
    If currAltTabletMenuFile = "" Then
        MsgBox "AltTabletMenuFile is not currently set.", vbInformation, "AltTabletMenuFile Example"
    Else
        MsgBox "The current value for AltTabletMenuFile is " & currAltTabletMenuFile, vbInformation, "AltTabletMenuFile Example"
    End If

    ' Change the value for AltTabletMenuFile
    newAltTabletMenuFile = "d:\acad\support\acad"
    preferences.Files.AltTabletMenuFile = newAltTabletMenuFile
    MsgBox "The new value for AltTabletMenuFile is " & newAltTabletMenuFile, vbInformation, "AltTabletMenuFile Example"

    ' Reset AltTabletMenuFile to its original value
    preferences.Files.AltTabletMenuFile = currAltTabletMenuFile
    If currAltTabletMenuFile = "" Then
        MsgBox "AltTabletMenuFile is reset to Null.", vbInformation, "AltTabletMenuFile Example"
    Else
        MsgBox "The AltTabletMenuFile value is reset to " & currAltTabletMenuFile, vbInformation, "AltTabletMenuFile Example"
    End If

 End Sub


AltTextPrefix Example [ActiveX and VBA Reference: AAR]

AltTextPrefix Example

Using Programming Languages other than VBA

Sub Example_AltTextPrefix()
   ' This example creates an aligned dimension in model space and
   ' uses AltTextPrefix to allow the user to change the text prefix for the
   ' alternate dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim prefix As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

    ' Allow the user to change the text prefix for the alternate dimension
    prefix = InputBox("Enter a new text prefix for the alternate dimension", "Alternate Dimension Prefix", "PREFIX:")
    dimObj.AltTextPrefix = prefix   ' Commit changes to prefix

    ThisDrawing.Regen acAllViewports

    ' Read back and display the alternate dimension text prefix
    prefix = dimObj.AltTextPrefix
    If prefix <> "" Then
        MsgBox "The prefix of the alternate dimension has been changed to: " & prefix
    Else
        MsgBox "The prefix of the alternate dimension has been removed"
    End If
End Sub


AltTextSuffix Example [ActiveX and VBA Reference: AAR]

AltTextSuffix Example

Using Programming Languages other than VBA

Sub Example_AltTextSuffix()
   ' This example creates an aligned dimension in model space and
   ' uses AltTextSuffix to allow the user to change the text suffix for the
   ' alternate dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim suffix As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

    ' Allow the user to change the text suffix for the alternate dimension
    suffix = InputBox("Enter a new text suffix for the alternate dimension", "Alternate Dimension Suffix", ":SUFFIX")
    dimObj.AltTextSuffix = suffix   ' Commit changes to suffix

    ThisDrawing.Regen acAllViewports

    ' Read back and display the alternate dimension text suffix
    suffix = dimObj.AltTextSuffix
    If suffix <> "" Then
        MsgBox "The suffix of the alternate dimension has been changed to: " & suffix
    Else
        MsgBox "The suffix of the alternate dimension has been removed"
    End If
End Sub


AltTolerancePrecision Example [ActiveX and VBA Reference: AAR]

AltTolerancePrecision Example

Using Programming Languages other than VBA

Sub Example_AltTolerancePrecision()
   ' This example creates an aligned dimension in model space and
   ' uses AltTolerancePrecision to allow the user to change the
   ' precision of the alternate dimension tolerance

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim oldTolerance As String, newTolerance As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True
    dimObj.ToleranceDisplay = acTolLimits

    ThisDrawing.Application.ZoomAll

    ' Store old tolerance value as default for input box
    oldTolerance = dimObj.AltTolerancePrecision

    ' Allow the user to change the precision for the alternate dimension tolerance
    newTolerance = InputBox("Enter a new tolerance precision for the alternate dimension.  The value must range from 0 to 8.", "Alternate Dimension Tolerance Precision", oldTolerance)

    Select Case newTolerance
        Case 0: newTolerance = acDimPrecisionZero
        Case 1: newTolerance = acDimPrecisionOne
        Case 2: newTolerance = acDimPrecisionTwo
        Case 3: newTolerance = acDimPrecisionThree
        Case 4: newTolerance = acDimPrecisionFour
        Case 5: newTolerance = acDimPrecisionFive
        Case 6: newTolerance = acDimPrecisionSix
        Case 7: newTolerance = acDimPrecisionSeven
        Case 8: newTolerance = acDimPrecisionEight
        Case Else
            MsgBox "The alternate tolerance precision has not been changed."
            Exit Sub
    End Select

    dimObj.AltTolerancePrecision = newTolerance   ' Commit changes to tolerance precision

    ThisDrawing.Regen acAllViewports

    ' Read back and display the alternate dimension tolerance precision
    newTolerance = dimObj.AltTolerancePrecision
    MsgBox "The tolerance precision has been set to " & newTolerance & " decimal places"
End Sub


AltToleranceSuppressLeadingZeros Example [ActiveX and VBA Reference: AAR]

AltToleranceSuppressLeadingZeros Example

Using Programming Languages other than VBA

Sub Example_AltToleranceSuppressLeadingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses AltToleranceSuppressLeadingZeros to toggle the display of leading zeros
   ' in the alternate dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set up alternate unit tolerance display
    dimObj.AltUnits = True
    dimObj.ToleranceDisplay = acTolLimits

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of leading zeros in the alternate dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of leading zeros for the alternate dimension tolerance value
            dimObj.AltToleranceSuppressLeadingZeros = Not (dimObj.AltToleranceSuppressLeadingZeros)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltToleranceSuppressTrailingZeros Example [ActiveX and VBA Reference: AAR]

AltToleranceSuppressTrailingZeros Example

Using Programming Languages other than VBA

Sub Example_AltToleranceSuppressTrailingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses AltToleranceSuppressTrailingZeros to toggle the display of trailing zeros
   ' in the alternate dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 7: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set up alternate unit tolerance display
    dimObj.AltUnits = True
    dimObj.ToleranceDisplay = acTolLimits

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of trailing zeros in the alternate dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of trailing zeros for the alternate dimension tolerance value
            dimObj.AltToleranceSuppressTrailingZeros = Not (dimObj.AltToleranceSuppressTrailingZeros)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltToleranceSuppressZeroFeet Example [ActiveX and VBA Reference: AAR]

AltToleranceSuppressZeroFeet Example

Using Programming Languages other than VBA

Sub Example_AltToleranceSuppressZeroFeet()
   ' This example creates an aligned dimension in model space and
   ' uses AltToleranceSuppressZeroFeet to suppress or view the display of
   ' zero feet in the alternate dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set up alternate unit tolerance display
    dimObj.AltUnits = True
    dimObj.ToleranceDisplay = acTolLimits

    ' Set the dimension display to a style that works with AltToleranceSuppressZeroFeet
    dimObj.AltUnitsFormat = acDimLArchitectural
    dimObj.AltUnitsScale = 2    ' Set the alternate unit scale to be a multiple of 2

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero feet in the alternate dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero feet for the alternate dimension value
            dimObj.AltToleranceSuppressZeroFeet = Not (dimObj.AltToleranceSuppressZeroFeet)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltToleranceSuppressZeroInches Example [ActiveX and VBA Reference: AAR]

AltToleranceSuppressZeroInches Example

Using Programming Languages other than VBA

Sub Example_AltToleranceSuppressZeroInches()
   ' This example creates an aligned dimension in model space and
   ' uses AltToleranceSuppressZeroInches to suppress or view the display of
   ' zero inches in the alternate dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 12: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set up alternate unit tolerance display
    dimObj.AltUnits = True
    dimObj.ToleranceDisplay = acTolLimits

    ' Set the dimension display to a style that works with AltToleranceSuppressZeroInches
    dimObj.AltUnitsFormat = acDimLArchitectural
    dimObj.AltUnitsScale = 2    ' Set the alternate unit scale to be a multiple of 2

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero inches in the alternate dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero inches for the alternate dimension tolerance value
            dimObj.AltToleranceSuppressZeroInches = Not (dimObj.AltToleranceSuppressZeroInches)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


AltUnits Example [ActiveX and VBA Reference: AAR]

AltUnits Example

Using Programming Languages other than VBA

Sub Example_AltUnits()
   ' This example creates an aligned dimension in model space and
   ' uses AltUnits to toggle the alternate dimension units on and off

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Toggle alternate unit display

Toggle:
    Select Case MsgBox("Press OK to toggle the display of alternate dimensions", vbOKCancel)
        Case vbOK
            ' Toggle the alternate dimension display
            dimObj.AltUnits = Not (dimObj.AltUnits)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    ' Display status of alternate units display
    If dimObj.AltUnits Then
        MsgBox "Alternate units display is on."
    Else
        MsgBox "Alternate units display is off."
    End If

    GoTo Toggle

End Sub


AltUnitsFormat Example [ActiveX and VBA Reference: AAR]

AltUnitsFormat Example

Using Programming Languages other than VBA

Sub Example_AltUnitsFormat()
   ' This example creates an aligned dimension in model space and
   ' uses AltUnitsFormat to cycle through some common unit formats
   ' for the alternate dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Enable unit display of alternate units
    dimObj.AltUnits = True

    dimObj.AltUnitsFormat = acDimScientific     ' Change format to Scientific
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to Scientific"

    dimObj.AltUnitsFormat = acDimDecimal        ' Change format to Decimal
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to Decimal"

    dimObj.AltUnitsFormat = acDimArchitectural  ' Change format to Architectural
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to Architectural"

    dimObj.AltUnitsFormat = acDimWindowsDesktop ' Change format to Windows Desktop
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to Windows Desktop"

End Sub


AltUnitsPrecision Example [ActiveX and VBA Reference: AAR]

AltUnitsPrecision Example

Using Programming Languages other than VBA

Sub Example_AltUnitsPrecision()
   ' This example creates an aligned dimension in model space and
   ' uses AltUnitsPrecision to allow the user to change the
   ' precision of the alternate dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim oldPrecision As String, newPrecision As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable alternate unit display
    dimObj.AltUnits = True

    ThisDrawing.Application.ZoomAll

    ' Store old Precision value as default for input box
    oldPrecision = dimObj.AltUnitsPrecision

    ' Allow the user to change the precision for the alternate dimension
    newPrecision = InputBox("Enter a new precision for the alternate dimension.  The value must range from 0 to 8.", "Alternate Dimension Precision", oldPrecision)

    Select Case newPrecision
        Case 0: newPrecision = acDimPrecisionZero
        Case 1: newPrecision = acDimPrecisionOne
        Case 2: newPrecision = acDimPrecisionTwo
        Case 3: newPrecision = acDimPrecisionThree
        Case 4: newPrecision = acDimPrecisionFour
        Case 5: newPrecision = acDimPrecisionFive
        Case 6: newPrecision = acDimPrecisionSix
        Case 7: newPrecision = acDimPrecisionSeven
        Case 8: newPrecision = acDimPrecisionEight
        Case Else
            MsgBox "The alternate precision has not been changed."
            Exit Sub
    End Select

    dimObj.AltUnitsPrecision = newPrecision   ' Commit changes to precision

    ThisDrawing.Regen acAllViewports

    ' Read back and display the alternate dimension precision
    newPrecision = dimObj.AltUnitsPrecision
    MsgBox "The alternate dimension precision has been set to " & newPrecision & " decimal places"
End Sub


AltUnitsScale Example [ActiveX and VBA Reference: AAR]

AltUnitsScale Example

Using Programming Languages other than VBA

Sub Example_AltUnitsScale()
   ' This example creates an aligned dimension in model space and
   ' uses AltUnitsScale to cycle through some common scales
   ' for the alternate dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Enable display of alternate units
    dimObj.AltUnits = True

    ' Cycle through some common dimension scales

    dimObj.AltUnitsScale = 1         ' Change scale to Inches
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to inches"

    dimObj.AltUnitsScale = 25.4     ' Change scale to Millimeters (default)
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to millimeters"

    dimObj.AltUnitsScale = 2.54      ' Change scale to Centimeters
    ThisDrawing.Regen acAllViewports
    MsgBox "The alternate dimension units are now set to centimeters"

End Sub


Angle Example [ActiveX and VBA Reference: AAR]

Angle Example

Using Programming Languages other than VBA

Sub Example_Angle()
   ' This example adds a line in model space and returns the angle of the new line

    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double, endPoint(0 To 2)  As Double

    ' Define the start and end points for the line
    startPoint(0) = 1: startPoint(1) = 1: startPoint(2) = 0
    endPoint(0) = 5: endPoint(1) = 5: endPoint(2) = 0

    ' Create the line in model space
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ThisDrawing.Application.ZoomAll

    MsgBox "The angle of the new Line is: " & lineObj.angle
End Sub


Angle Example [ActiveX and VBA Reference: AAR]

Unknown Example

Using Programming Languages other than VBA

No example is available.


AngleFormat Example [ActiveX and VBA Reference: AAR]

AngleFormat Example

Using Programming Languages other than VBA

Sub Example_AngleFormat()
    ' This example creates a Dim3PointAngular object in model space
    ' and sets its Angle Format to some common values

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Cycle through some common angle formats

    DimPointAngularObj.AngleFormat = acDegreeMinuteSeconds
    ThisDrawing.Regen acAllViewports
    MsgBox "The angle format of the new Dim3PointAngular object is now set to degree/minute/second"

    DimPointAngularObj.AngleFormat = acGrads
    ThisDrawing.Regen acAllViewports
    MsgBox "The angle format of the new Dim3PointAngular object is now set to grads"

    DimPointAngularObj.AngleFormat = acRadians
    ThisDrawing.Regen acAllViewports
    MsgBox "The angle format of the new Dim3PointAngular object is now set to radians"

End Sub


AngleFromXAxis Example [ActiveX and VBA Reference: AAR]

AngleFromXAxis Example

Using Programming Languages other than VBA

Sub Example_AngleFromXAxis()
    ' This example finds the angle, in radians, between the X axis
    ' and a line defined by two points.

    Dim pt1(0 To 2) As Double
    Dim pt2(0 To 2) As Double
    Dim retAngle As Double

    pt1(0) = 2: pt1(1) = 5: pt1(2) = 0
    pt2(0) = 5: pt2(1) = 2: pt2(2) = 0

    ' Return the angle
    retAngle = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)

    ' Create the line for a visual reference
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
    ZoomAll

    ' Display the angle found
    MsgBox "The angle in radians between the X axis and the line is " & retAngle, , "AngleFromXAxis Example"

End Sub


AngleToReal Example [ActiveX and VBA Reference: AAR]

AngleToReal Example

Using Programming Languages other than VBA

Sub Example_AngleToReal()
    ' This example passes several different strings representing
    ' an angle in different units to be converted to radians.

    Dim angAsStr As String
    Dim unit As Integer
    Dim angAsReal As Double

    ' Convert the angle given in degrees unit to a real
    angAsStr = "45"
    unit = acDegrees
    angAsReal = ThisDrawing.Utility.AngleToReal(angAsStr, unit)
    MsgBox "45 degrees converts to " & angAsReal & " radians.", , "AngleAsReal Example"

    ' Convert the angle given in degrees/minutes/seconds unit to Radians
    angAsStr = "45d0' 0"""
    unit = acDegreeMinuteSeconds
    angAsReal = ThisDrawing.Utility.AngleToReal(angAsStr, unit)
    MsgBox "45 degrees, 0 minutes, 0 seconds converts to " & angAsReal & " radians.", , "AngleAsReal Example"

    ' Convert the angle given in grads unit to Radians
    angAsStr = "50"
    unit = acGrads
    angAsReal = ThisDrawing.Utility.AngleToReal(angAsStr, unit)
    MsgBox "50 grads converts to " & angAsReal & " radians.", , "AngleAsReal Example"

End Sub


AngleToString Example [ActiveX and VBA Reference: AAR]

AngleToString Example

Using Programming Languages other than VBA

Sub Example_AngleToString()
    ' This example converts a radian value to several different
    ' strings representing the value in different units.

    Dim angAsRad As Double
    Dim unit As Integer
    Dim precision As Long
    Dim angAsString As String
    angAsRad = 0.785398163397448
    unit = acDegrees
    precision = 6

    ' Convert the radian value to degrees with a precision of 6
    angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision)
    MsgBox "0.785398163397448 radians =  " & angAsString & " degrees", , "AngleAsString Example"

    ' Convert the radian value to degrees/Minutes/Seconds with a precision of 6
    unit = acDegreeMinuteSeconds
    angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision)
    MsgBox "0.785398163397448 radians =  " & angAsString, , "AngleAsString Example"

    ' Convert the radian value to grads with a precision of 6
    unit = acGrads
    angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision)
    MsgBox "0.785398163397448 radians =  " & angAsString, , "AngleAsString Example"

End Sub


AngleVertex Example [ActiveX and VBA Reference: AAR]

AngleVertex Example

Using Programming Languages other than VBA

Sub Example_AngleVertex()
    ' This example creates a Dim3PointAngular object in model space
    ' and then alters its angle vertex

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double, NewAngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim CurrentVertex As Variant

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    NewAngleVertex(0) = 1: NewAngleVertex(1) = 1: NewAngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Display current vertex
    CurrentVertex = DimPointAngularObj.AngleVertex
    MsgBox "The angle vertex of the new object is set to:" & vbCrLf & _
            CurrentVertex(0) & vbCrLf & _
            CurrentVertex(1) & vbCrLf & _
            CurrentVertex(2)

    ' Alter vertex setting for this object
    DimPointAngularObj.AngleVertex = NewAngleVertex
    ThisDrawing.Regen acAllViewports

    ' Display new vertex settings
    CurrentVertex = DimPointAngularObj.AngleVertex
    MsgBox "The angle vertex of the object has been reset to:" & vbCrLf & _
            CurrentVertex(0) & vbCrLf & _
            CurrentVertex(1) & vbCrLf & _
            CurrentVertex(2)

End Sub


Annotation Example [ActiveX and VBA Reference: AAR]

Annotation Example

Using Programming Languages other than VBA

Sub Example_Annotation()
    ' This example creates a leader in model space with an associated
    ' annotation and then checks for the existence of an
    ' Annotation object for the new Leader

    Dim leaderObj As AcadLeader, MTextObj As AcadMText
    Dim points(0 To 8) As Double, insertionPoint(0 To 2) As Double, width As Double
    Dim leaderType As Integer
    Dim annotationObject As Object
    Dim textString As String, msg As String

    ' Define the new MText object
    textString = "Hello, World."
    insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
    width = 2

    ' Create the MText object in model space
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, width, textString)

    ' Data for Leader
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    points(6) = 4: points(7) = 5: points(8) = 0
    leaderType = acLineWithArrow

    ' Create the Leader object in model space and Associate new MText object
    ' with new Leader by making the MText object the annotation for the Leader
    Set annotationObject = MTextObj
    Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
    ThisDrawing.Application.ZoomAll

    ' Display whether or not this particular Leader has an associated Annotation
    msg = IIf(leaderObj.Annotation Is Nothing, "does not have", "has")
    MsgBox "The new Leader object " & msg & " an associated Annotation object."
End Sub


AppActivate Example [: AAR]

AppActivate Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example initializes the public variable (ACADApp), which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept a generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we get it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_AppActivate()
    ' This example intercepts an Application AppActivate event.
    '
    ' This event is triggered when the AutoCAD application receives focus
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Switch focus from AutoCAD to another Windows application
    '     and then back again.

      MsgBox "AutoCAD was just activated!"
End Sub


AppDeactivate Example [: AAR]

AppDeactivate Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example initializes the public variable (ACADApp), which will be used
    ' to intercept AcadApplication Events.
    '
    ' The VBA WithEvents statement makes it possible to intercept a generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we get it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_AppDeactivate()
    ' This example intercepts an Application AppDeactivate event.
    '
    ' This event is triggered when the AutoCAD application loses focus
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Switch focus from AutoCAD to another Windows application.

      MsgBox "AutoCAD just lost focus!"
End Sub


AppendInnerLoop Example [ActiveX and VBA Reference: AAR]

AppendInnerLoop Example

Using Programming Languages other than VBA

Sub Example_AppendInnerLoop()
    ' This example creates an associative hatch in model space, and then appends an outer loop to the hatch.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append a circle as the inner loop for the hatch.
    Dim innerLoop(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

End Sub


AppendItems Example [ActiveX and VBA Reference: AAR]

AppendItems Example

Using Programming Languages other than VBA

Sub Example_AppendItems()
    ' This example creates a group and several objects.
    ' It then appends the objects to the group.

    ' Create the new group
    Dim groupObj As AcadGroup
    Set groupObj = ThisDrawing.Groups.Add("TEST_GROUP")

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection.
    ' Collect the objects found into an array of objects
    ' to be added to the group.
    ReDim appendObjs(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set appendObjs(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects to the group
    groupObj.AppendItems appendObjs

    ThisDrawing.Regen acActiveViewport

End Sub


AppendOuterLoop Example [ActiveX and VBA Reference: AAR]

AppendOuterLoop Example

Using Programming Languages other than VBA

Sub Example_AppendOuterLoop()
    ' This example creates an associative hatch in model space, and then creates an outer loop for the hatch.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 1
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ZoomAll

End Sub


AppendVertex Example [ActiveX and VBA Reference: AAR]

AppendVertex Example

Using Programming Languages other than VBA

Sub Example_AppendVertex()
    ' This example creates a polyline in model space.
    ' It then appends a vertex to the polyline.

    Dim plineObj As AcadPolyline
    Dim points(0 To 14) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ZoomAll
    MsgBox "Append the vertex 4, 1, 0.", , "AppendVertex Example"

    Dim newVertex(0 To 2) As Double
    newVertex(0) = 4: newVertex(1) = 1: newVertex(2) = 0
    plineObj.AppendVertex newVertex
    ZoomAll
    MsgBox "The vertex 4, 1, 0 as been appended.", , "AppendVertex Example"

End Sub


Application Example [ActiveX and VBA Reference: AAR]

Application Example

Using Programming Languages other than VBA

Sub Example_Application()
    ' This example creates a line and then uses the
    ' Application property of the line to return the
    ' application name.
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim myApp As AcadApplication

    ' Create a new line reference
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Update

    ' Return the application for the object
    Set myApp = lineObj.Application

    ' Display the name of the application
    MsgBox "The application name is: " & myApp.name, vbInformation, "Application Example"
End Sub


ArcLength Example [ActiveX and VBA Reference: AAR]

ArcLength Example

Using Programming Languages other than VBA

Sub Example_ArcLength()
    ' This example creates an Arc in model space and returns the length of the new Arc
    Dim arcObj As AcadArc
    Dim centerPoint(0 To 2)  As Double
    Dim radius As Double
    Dim startAngleInDegree As Double, endAngleInDegree As Double
    Dim startAngleInRadian As Double, endAngleInRadian As Double

    ' Define the Arc
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#
    startAngleInDegree = 10#: endAngleInDegree = 230#

    ' Convert the angles in degrees to angles in radians
    startAngleInRadian = startAngleInDegree * 3.141592 / 180#
    endAngleInRadian = endAngleInDegree * 3.141592 / 180#

    ' Create the arc object in model space
    Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
    ThisDrawing.Application.ZoomAll

    ' Return length of new arc
    MsgBox "The length of the new Arc is: " & arcObj.ArcLength
End Sub


ArcSmoothness Example [ActiveX and VBA Reference: AAR]

ArcSmoothness Example

Using Programming Languages other than VBA

Sub Example_ArcSmoothness()
    ' This example returns the current setting of
    ' ArcSmoothness. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currArcSmoothness As Integer
    Dim newArcSmoothness As Integer

    ' Retrieve the current ArcSmoothness value
    currArcSmoothness = ThisDrawing.ActiveViewport.ArcSmoothness
    MsgBox "The current value for ArcSmoothness is " & currArcSmoothness, vbInformation, "ArcSmoothness Example"

    ' Change the value for ArcSmoothness
    newArcSmoothness = 2001
    ThisDrawing.ActiveViewport.ArcSmoothness = newArcSmoothness
    MsgBox "The new value for ArcSmoothness is " & newArcSmoothness, vbInformation, "ArcSmoothness Example"

    ' Reset ArcSmoothness to its original value
    ThisDrawing.ActiveViewport.ArcSmoothness = currArcSmoothness
    MsgBox "The ArcSmoothness value is reset to " & currArcSmoothness, vbInformation, "ArcSmoothness Example"
End Sub


Area Example [ActiveX and VBA Reference: AAR]

Area Example

Using Programming Languages other than VBA

Sub Example_Area()
    ' This example creates a polyline object and
    ' then uses the area property to find the
    ' area of that polyline.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    Dim plineArea As Double

    ' Establish the points for the Polyline
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5

    ' Create the polyline in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)

    ' Close the polyline and update display of it
    plineObj.Closed = True
    plineObj.Update
    ZoomAll

    ' Get the area of the polyline
    plineArea = plineObj.Area

    MsgBox "The area of the new Polyline is: " & plineArea, vbInformation, "Area Example"
End Sub


ArrayPolar Example [ActiveX and VBA Reference: AAR]

ArrayPolar Example

Using Programming Languages other than VBA

Sub Example_ArrayPolar()
    ' This example creates a circle and then performs a polar array
    ' on that circle.

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 2#: center(1) = 2#: center(2) = 0#
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll
    MsgBox "Perform the polar array on the circle.", , "ArrayPolar Example"

    ' Define the polar array
    Dim noOfObjects As Integer
    Dim angleToFill As Double
    Dim basePnt(0 To 2) As Double
    noOfObjects = 4
    angleToFill = 3.14          ' 180 degrees
    basePnt(0) = 4#: basePnt(1) = 4#: basePnt(2) = 0#

    ' The following example will create 4 copies of an object
    ' by rotating and copying it about the point (3,3,0).
    Dim retObj As Variant
    retObj = circleObj.ArrayPolar(noOfObjects, angleToFill, basePnt)

    ZoomAll
    MsgBox "Polar array completed.", , "ArrayPolar Example"

End Sub


ArrayRectangular Example [ActiveX and VBA Reference: AAR]

ArrayRectangular Example

Using Programming Languages other than VBA

Sub Example_ArrayRectangular()
    ' This example creates a circle and then performs
    ' a rectangular array on that circle.

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 2#: center(1) = 2#: center(2) = 0#
    radius = 0.5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ThisDrawing.Application.ZoomAll
    MsgBox "Perform the rectangular array on the circle.", , "ArrayRectangular Example"

    ' Define the rectangular array
    Dim numberOfRows As Long
    Dim numberOfColumns As Long
    Dim numberOfLevels As Long
    Dim distanceBwtnRows As Double
    Dim distanceBwtnColumns As Double
    Dim distanceBwtnLevels As Double
    numberOfRows = 5
    numberOfColumns = 5
    numberOfLevels = 2
    distanceBwtnRows = 1
    distanceBwtnColumns = 1
    distanceBwtnLevels = 1

    ' Create the array of objects
    Dim retObj As Variant
    retObj = circleObj.ArrayRectangular(numberOfRows, numberOfColumns, numberOfLevels, distanceBwtnRows, distanceBwtnColumns, distanceBwtnLevels)

    ZoomAll
    MsgBox "Rectangular array completed.", , "ArrayRectangular Example"

End Sub


Arrowhead1Block Example [ActiveX and VBA Reference: AAR]

Arrowhead1Block Example

Using Programming Languages other than VBA

Sub Example_ArrowHead1Block()
    ' This example creates an aligned dimension object in model space
    ' and then alters the visible appearance (shape) of the arrowhead
    ' using the ArrowHeadBlock property.
    ' Use the ArrowHeadBlock property to set the arrowhead to an existing
    ' block object containing a custom Circle object

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim BlockName As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ZoomAll

    ' Set arrowhead type to user-defined to allow
    ' the use of a block as the new arrowhead
    'dimObj.ArrowheadType = acArrowUserDefined
    DimPointAngularObj.Arrowhead1Block = "CBlock"
    DimPointAngularObj.Arrowhead2Block = "CBlock"
    ZoomAll

    ' Read and display current arrowhead block name
    BlockName = DimPointAngularObj.Arrowhead1Block

    MsgBox "The arrowhead block name for this object is: " & BlockName

End Sub


Arrowhead1Type Example [ActiveX and VBA Reference: AAR]

Arrowhead1Type Example

Using Programming Languages other than VBA

Sub Example_ArrowHead1Type()
    ' This example creates a Dim3PointAngular object in model space
    ' and then alters the visible appearance (shape) of its arrowheads
    ' using the ArrowHead1Type and ArrowHead2Type properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for the first arrow of this object is: " & DimPointAngularObj.Arrowhead1Type & vbCrLf & _
           "The arrowhead type for the second arrow of this object is: " & DimPointAngularObj.Arrowhead2Type

    ' Alter the arrowhead type property for both arrows of this object
    DimPointAngularObj.Arrowhead1Type = acArrowBoxBlank
    DimPointAngularObj.Arrowhead2Type = acArrowBoxBlank
    ThisDrawing.Regen acAllViewports

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for the first arrow of this object is now set to: " & DimPointAngularObj.Arrowhead1Type & vbCrLf & _
           "The arrowhead type for the second arrow of this object is now set to: " & DimPointAngularObj.Arrowhead2Type
End Sub


Arrowhead2Block Example [ActiveX and VBA Reference: AAR]

Arrowhead2Block Example

Using Programming Languages other than VBA

Sub Example_ArrowHead2Block()
    ' This example creates an aligned dimension object in model space
    ' and then alters the visible appearance (shape) of the arrowhead
    ' using the ArrowHeadBlock property.
    ' Use the ArrowHeadBlock property to set the arrowhead to an existing
    ' block object containing a custom Circle object

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim BlockName As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ZoomAll

    ' Set arrowhead type to user-defined to allow
    ' the use of a block as the new arrowhead
    'dimObj.ArrowheadType = acArrowUserDefined
    DimPointAngularObj.Arrowhead1Block = "CBlock"
    DimPointAngularObj.Arrowhead2Block = "CBlock"
    ZoomAll

    ' Read and display current arrowhead block name
    BlockName = DimPointAngularObj.Arrowhead2Block

    MsgBox "The arrowhead block name for this object is: " & BlockName

End Sub


Arrowhead2Type Example [ActiveX and VBA Reference: AAR]

Arrowhead2Type Example

Using Programming Languages other than VBA

Sub Example_ArrowHead2Type()
    ' This example creates a Dim3PointAngular object in model space
    ' and then alters the visible appearance (shape) of its arrowheads
    ' using the ArrowHead1Type and ArrowHead2Type properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for the first arrow of this object is: " & DimPointAngularObj.Arrowhead1Type & vbCrLf & _
           "The arrowhead type for the second arrow of this object is: " & DimPointAngularObj.Arrowhead2Type

    ' Alter the arrowhead type property for both arrows of this object
    DimPointAngularObj.Arrowhead1Type = acArrowBoxBlank
    DimPointAngularObj.Arrowhead2Type = acArrowBoxBlank
    ThisDrawing.Regen acAllViewports

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for the first arrow of this object is now set to: " & DimPointAngularObj.Arrowhead1Type & vbCrLf & _
           "The arrowhead type for the second arrow of this object is now set to: " & DimPointAngularObj.Arrowhead2Type
End Sub


ArrowheadBlock Example [ActiveX and VBA Reference: AAR]

ArrowheadBlock Example

Using Programming Languages other than VBA

Sub Example_ArrowHeadBlock()
    ' This example creates a radial dimension object in model space
    ' and then alters the visible appearance (shape) of the arrowhead
    ' using the ArrowHeadBlock property.
    ' Use the ArrowHeadBlock property to set the arrowhead to an existing
    ' block object containing a custom Circle object

    Dim dimObj As AcadDimRadial
    Dim center(0 To 2) As Double
    Dim chordPoint(0 To 2) As Double
    Dim leaderLen As Integer
    Dim BlockName As String

    ' Define the dimension
    center(0) = 0#: center(1) = 0#: center(2) = 0#
    chordPoint(0) = 5#: chordPoint(1) = 5#: chordPoint(2) = 0#
    leaderLen = 5

    ' Create the radial dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRadial(center, chordPoint, leaderLen)
    ZoomAll

    ' Set arrowhead type to user-defined to allow
    ' the use of a block as the new arrowhead
    'dimObj.ArrowheadType = acArrowUserDefined
    dimObj.ArrowheadBlock = "CBlock"
    ZoomAll

    ' Read and display current arrowhead block name
    BlockName = dimObj.ArrowheadBlock

    MsgBox "The arrowhead block name for this object is: " & BlockName

End Sub


ArrowheadSize Example [ActiveX and VBA Reference: AAR]

ArrowheadSize Example

Using Programming Languages other than VBA

Sub Example_ArrowHeadSize()
    ' This example creates a Dim3PointAngular object in model space
    ' and then alters the visible appearance (size) of its arrowheads
    ' using the ArrowHeadSize property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead size
    MsgBox "The arrowhead size for this object is currently set to: " & DimPointAngularObj.ArrowheadSize

    ' Alter the arrowhead size property for this object
    DimPointAngularObj.ArrowheadSize = 0.5
    ThisDrawing.Regen acAllViewports

    ' Read and display new arrowhead size setting
    MsgBox "The arrowhead size for this object is now set to: " & DimPointAngularObj.ArrowheadSize
End Sub


ArrowheadType Example [ActiveX and VBA Reference: AAR]

ArrowheadType Example

Using Programming Languages other than VBA

Sub Example_ArrowHeadType()
    ' This example creates a Leader object in model space with an associated Annotation
    ' and then alters the visible appearance (shape) of its arrowhead
    ' using the ArrowHeadType property

    Dim leaderObj As AcadLeader, MTextObj As AcadMText
    Dim points(0 To 8) As Double, insertionPoint(0 To 2) As Double, iTextWidth As Double
    Dim leaderType As Integer
    Dim annotationObject As Object
    Dim textString As String

    ' Define the new MText object
    textString = "Hello, World."
    insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
    iTextWidth = 2

    ' Create the MText object in model space
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, iTextWidth, textString)

    ' Data for Leader
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    points(6) = 4: points(7) = 5: points(8) = 0
    leaderType = acLineWithArrow

    ' Create the Leader object in model space and Associate new MText object
    ' with new Leader by making the MText object the annotation for the Leader
    Set annotationObject = MTextObj
    Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for this object is: " & leaderObj.ArrowheadType

    ' Alter the arrowhead type property for this object
    leaderObj.ArrowheadType = acArrowBoxBlank
    ThisDrawing.Application.ZoomAll

    ' Read and display current arrowhead type
    MsgBox "The arrowhead type for this object is now set to: " & leaderObj.ArrowheadType
End Sub


ARXLoaded Example [: AAR]

ARXLoaded Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example initializes the public variable (ACADApp), which will be used
    ' to intercept AcadApplication Events.
    '
    ' The VBA WithEvents statement makes it possible to intercept a generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we get it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_ARXLoaded(ByVal AppName As String)
    ' This example intercepts an Application ARXLoaded event.
    ' This event is triggered when AutoCAD loads an ObjectARX application.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Load an ARX application into AutoCAD.

    ' Use the "AppName" variable to notify the user which ARX application was loaded
      MsgBox "AutoCAD just loaded the ARX application: " & AppName

End Sub


ARXUnloaded Example [: AAR]

ARXUnloaded Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_ARXUnloaded(ByVal AppName As String)
    ' This example intercepts an Application ARXUnloaded event.
    '
    ' This event is triggered when the AutoCAD unloads an ARX application
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Unload an ARX application that is already loaded into AutoCAD

    ' Use the "AppName" variable to notify the user which ARX application was unloaded
      MsgBox "AutoCAD just unloaded the ARX application: " & AppName

End Sub


AssociativeHatch Example [ActiveX and VBA Reference: AAR]

AssociativeHatch Example

Using Programming Languages other than VBA

Sub Example_AssociativeHatch()
    ' This example creates a hatch in model space.
    ' It then reports whether the hatch is associative.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Return whether the hatch is associative.
    Dim hatchAssoc As Boolean
    hatchAssoc = hatchObj.AssociativeHatch
    MsgBox "The HatchStyle is " & IIf(hatchObj.AssociativeHatch, "associative.", "not associative."), , "AssociativeHatch Example"

End Sub


AttachExternalReference Example [ActiveX and VBA Reference: AAR]

AttachExternalReference Example

Using Programming Languages other than VBA

Sub Example_AttachExternalReference()
    ' This example displays all the blocks in the current drawing
    ' before and after adding an external reference.
    '
    ' This example uses the "city map.dwg" found in the Sample
    ' directory. If you do not have this drawing, or if it is
    ' in a different directory, insert a valid path and file name
    ' for the PathName variable below.

    Dim InsertPoint(0 To 2) As Double
    Dim insertedBlock As AcadExternalReference
    Dim tempBlock As AcadBlock
    Dim msg As String, PathName As String

    ' Define external reference to be inserted
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    PathName = "c:\program files\autocad\sample\city map.dwg"

    ' Display current Block information for this drawing
    GoSub ListBlocks

    ' Add the external reference to the drawing
    Set insertedBlock = ThisDrawing.ModelSpace.AttachExternalReference(PathName, "XREF_IMAGE", InsertPoint, 1, 1, 1, 0, False)

    ThisDrawing.Application.ZoomAll

    ' Display new Block information for this drawing
    GoSub ListBlocks

    Exit Sub

ListBlocks:
    msg = vbCrLf    ' Reset message

    For Each tempBlock In ThisDrawing.Blocks
        msg = msg & tempBlock.name & vbCrLf     ' Add Block to list
    Next

    MsgBox "The current blocks in this drawing are: " & msg

    Return
End Sub


AttachmentPoint Example [ActiveX and VBA Reference: AAR]

AttachmentPoint Example

Using Programming Languages other than VBA

Sub Example_AttachmentPoint()
    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    Dim count As Integer
    Dim attachPoint As String
    Dim corner(0 To 2) As Double

    corner(0) = 3#: corner(1) = 3#: corner(2) = 0#
    width = 10
    text = "Hello, World."
    ' Creates a MText object in model space
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)

    For count = 1 To 9
        MTextObj.AttachmentPoint = count

        ' Gets the attachment point of an MText object
        attachPoint = Choose(MTextObj.AttachmentPoint, "TopLeft", "TopCenter", "TopRight", "MiddleLeft", "MiddleCenter", "MiddleRight", "BottomLeft", "BottomCenter", "BottomRight")

        ThisDrawing.Regen True
        MsgBox "The attachment point of the MText is now: " & attachPoint, vbInformation, "AttachmentPoint Example"
    Next
End Sub


AttachToolbarToFlyout Example [ActiveX and VBA Reference: AAR]

AttachToolbarToFlyout Example

Using Programming Languages other than VBA

Sub Example_AttachToolbarToFlyout()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar(TestMenu) with a Toolbar button that will act
    ' as a flyout.  It then sets the Flyout menu to an existing Toolbar menu.
    ' The Toolbar will automatically be displayed and will display the UCS menu
    ' as a flyout.

    Dim currMenuGroup As acadMenuGroup
    Dim newToolBar As AcadToolbar, newToolBarFlyoutButton As AcadToolbarItem

    On Error GoTo ERRORTRAP

    ' Use MenuGroups property to obtain reference to main AutoCAD menu
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    ' Create a new Toolbar in this group
    Set newToolBar = currMenuGroup.Toolbars.Add("TestMenu")

    ' Add new button to TestMenu that will link to the Flyout menu
    '
    ' * NOTE: Set the macro name to the name of the flyout toolbar because
    ' setting it to an empty string causes an error.  The paremeter
    ' is actually ignored when the style is flyout, but must have any value other than "".
    Set newToolBarFlyoutButton = newToolBar.AddToolbarButton(newToolBar.count + 1, "Flyout", "Flyout", "UCS", True)

    ' Link the existing toolbar "UCS" as the flyout for the new toolbar button
    '
    ' * NOTE: To change the flyout, simply change the MenuGroup and Toolbar name below
    newToolBarFlyoutButton.AttachToolbarToFlyout "ACAD", "UCS"

    MsgBox "A new Toolbar with a flyout has been added to the AutoCAD menu system!"

    Exit Sub

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description
End Sub


AuditInfo Example [ActiveX and VBA Reference: AAR]

AuditInfo Example

Using Programming Languages other than VBA

Sub Example_AuditInfo()
    ' This example has AutoCAD audit
    ' and fix any problems found

    ThisDrawing.AuditInfo True

    MsgBox "Auditing has been requested." & vbCrLf & _
           "The fix error flag is set to " & fixErrs, , "AuditInfo Example"
End Sub


Author Example [ActiveX and VBA Reference: AAR]

Author Example

Using Programming Languages other than VBA

Sub Example_Author()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


AutoAudit Example [ActiveX and VBA Reference: AAR]

AutoAudit Example

Using Programming Languages other than VBA

Sub Example_AutoAudit()
    ' This example returns the current setting of
    ' AutoAudit. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currAutoAudit As Boolean
    Dim newAutoAudit As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current AutoAudit value
    currAutoAudit = preferences.OpenSave.AutoAudit
    MsgBox "The current value for AutoAudit is " & currAutoAudit, vbInformation, "AutoAudit Example"

    ' Toggle the value for AutoAudit
    newAutoAudit = Not (currAutoAudit)
    preferences.OpenSave.AutoAudit = newAutoAudit
    MsgBox "The new value for AutoAudit is " & newAutoAudit, vbInformation, "AutoAudit Example"

    ' Reset AutoAudit to its original value
    preferences.OpenSave.AutoAudit = currAutoAudit
    MsgBox "The AutoAudit value is reset to " & currAutoAudit, vbInformation, "AutoAudit Example"
End Sub


AutomaticPlotLog Example [ActiveX and VBA Reference: AAR]

AutomaticPlotLog Example

Using Programming Languages other than VBA

Sub Example_AutomaticPlotLog()
    ' This example sets the AutoCAD Options dialog box
    ' setting Automatically Save Plot and Publish Log to True.

    Dim MyPreference As IAcadPreferencesOutput2
    Set MyPreference = AcadApplication.Preferences.Output
    MyPreference.AutomaticPlotLog = True

End Sub


AutoSaveInterval Example [ActiveX and VBA Reference: AAR]

AutoSaveInterval Example

Using Programming Languages other than VBA

Sub Example_AutoSaveInterval()
    ' This example returns the current setting of
    ' AutoSaveInterval. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currAutoSaveInterval As Integer
    Dim newAutoSaveInterval As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current AutoSaveInterval value
    currAutoSaveInterval = preferences.OpenSave.AutoSaveInterval
    MsgBox "The current value for AutoSaveInterval is " & currAutoSaveInterval, vbInformation, "AutoSaveInterval Example"

    ' Change the value for AutoSaveInterval
    If currAutoSaveInterval = 0 Then
        newAutoSaveInterval = 10
    Else
        newAutoSaveInterval = 0
    End If
    preferences.OpenSave.AutoSaveInterval = newAutoSaveInterval
    MsgBox "The new value for AutoSaveInterval is " & newAutoSaveInterval, vbInformation, "AutoSaveInterval Example"

    ' Reset AutoSaveInterval to its original value
    preferences.OpenSave.AutoSaveInterval = currAutoSaveInterval
    MsgBox "The AutoSaveInterval value is reset to " & currAutoSaveInterval, vbInformation, "AutoSaveInterval Example"

 End Sub


AutoSavePath Example [ActiveX and VBA Reference: AAR]

AutoSavePath Example

Using Programming Languages other than VBA

Sub Example_AutoSavePath()
    ' This example returns the current setting of
    ' AutoSavePath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currAutoSavePath As String
    Dim newAutoSavePath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current AutoSavePath value
    currAutoSavePath = preferences.Files.AutoSavePath
    If currAutoSavePath = "" Then
        MsgBox "AutoSavePath is not currently set.", vbInformation, "AutoSavePath Example"
    Else
        MsgBox "The current value for AutoSavePath is " & currAutoSavePath, vbInformation, "AutoSavePath Example"
    End If

    ' Change the value for AutoSavePath
    newAutoSavePath = "C:\AutoCAD\"
    preferences.Files.AutoSavePath = newAutoSavePath
    MsgBox "The new value for AutoSavePath is " & newAutoSavePath, vbInformation, "AutoSavePath Example"

    ' Reset AutoSavePath to its original value
    preferences.Files.AutoSavePath = currAutoSavePath
    If currAutoSavePath = "" Then
        MsgBox "AutoSavePath is reset to Null.", vbInformation, "AutoSavePath Example"
    Else
        MsgBox "The AutoSavePath value is reset to " & currAutoSavePath, vbInformation, "AutoSavePath Example"
    End If
End Sub


AutoSnapAperture Example [ActiveX and VBA Reference: AAR]

AutoSnapAperture Example

Using Programming Languages other than VBA

Sub Example_AutoSnapAperture()
    ' This example reads and modifies the preference value that controls
    ' the display of the AutoSnap aperture.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapAperture
    MsgBox "The AutoSnapAperture preference is set to: " & originalValue

    ' Modify the AutoSnapAperture preference by toggling the value
    ACADPref.AutoSnapAperture = Not (originalValue)
    newValue = ACADPref.AutoSnapAperture
    MsgBox "The AutoSnapAperture preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapAperture = originalValue
    MsgBox "The AutoSnapAperture preference was reset back to: " & originalValue
End Sub


AutoSnapApertureSize Example [ActiveX and VBA Reference: AAR]

AutoSnapApertureSize Example

Using Programming Languages other than VBA

Sub Example_AutoSnapApertureSize()
    ' This example reads and modifies the preference value that controls
    ' the size of the AutoSnap aperture. When finished, this example resets
    ' the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapApertureSize
    MsgBox "The AutoSnapApertureSize preference is: " & originalValue

    ' Modify the AutoSnapApertureSize preference by setting it to 25
    ACADPref.AutoSnapApertureSize = 25
    newValue = ACADPref.AutoSnapApertureSize
    MsgBox "The AutoSnapApertureSize preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapApertureSize = originalValue
    MsgBox "The AutoSnapApertureSize preference was reset back to: " & originalValue
End Sub


AutoSnapMagnet Example [ActiveX and VBA Reference: AAR]

AutoSnapMagnet Example

Using Programming Languages other than VBA

Sub Example_AutoSnapMagnet()
    ' This example reads and modifies the preference value that controls
    ' the AutoSnap magnet.  When finished, this example resets the
    ' preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapMagnet
    MsgBox "The AutoSnapMagnet preference is set to: " & originalValue

    ' Modify the AutoSnapMagnet preference by toggling the value
    ACADPref.AutoSnapMagnet = Not (originalValue)
    newValue = ACADPref.AutoSnapMagnet
    MsgBox "The AutoSnapMagnet preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapMagnet = originalValue
    MsgBox "The AutoSnapMagnet preference was reset back to: " & originalValue
End Sub


AutoSnapMarker Example [ActiveX and VBA Reference: AAR]

AutoSnapMarker Example

Using Programming Languages other than VBA

Sub Example_AutoSnapMarker()
    ' This example reads and modifies the preference value that controls
    ' the AutoSnap marker.  When finished, this example resets the
    ' preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapMarker
    MsgBox "The AutoSnapMarker preference is set to: " & originalValue

    ' Modify the AutoSnapMarker preference by toggling the value
    ACADPref.AutoSnapMarker = Not (originalValue)
    newValue = ACADPref.AutoSnapMarker
    MsgBox "The AutoSnapMarker preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapMarker = originalValue
    MsgBox "The AutoSnapMarker preference was reset back to: " & originalValue
End Sub


AutoSnapMarkerColor Example [ActiveX and VBA Reference: AAR]

AutoSnapMarkerColor Example

Using Programming Languages other than VBA

Sub Example_AutoSnapMarkerColor()
    ' This example reads and modifies the preference value that controls
    ' the color of the AutoSnap marker. When finished, this example resets
    ' the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapMarkerColor
    MsgBox "The AutoSnapMarkerColor preference is: " & originalValue

    ' Modify the AutoSnapMarkerColor preference by setting it to red
    ACADPref.AutoSnapMarkerColor = acRed
    newValue = ACADPref.AutoSnapMarkerColor
    MsgBox "The AutoSnapMarkerColor preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapMarkerColor = originalValue
    MsgBox "The AutoSnapMarkerColor preference was reset back to: " & originalValue
End Sub


AutoSnapMarkerSize Example [ActiveX and VBA Reference: AAR]

AutoSnapMarkerSize Example

Using Programming Languages other than VBA

Sub Example_AutoSnapMarkerSize()
    ' This example reads and modifies the preference value that controls
    ' the size of the AutoSnap marker. When finished, this example resets
    ' the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapMarkerSize
    MsgBox "The AutoSnapMarkerSize preference is: " & originalValue

    ' Modify the AutoSnapMarkerSize preference by setting it to 10
    ACADPref.AutoSnapMarkerSize = 10
    newValue = ACADPref.AutoSnapMarkerSize
    MsgBox "The AutoSnapMarkerSize preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapMarkerSize = originalValue
    MsgBox "The AutoSnapMarkerSize preference was reset back to: " & originalValue
End Sub


AutoSnapToolTip Example [ActiveX and VBA Reference: AAR]

AutoSnapToolTip Example

Using Programming Languages other than VBA

Sub Example_AutoSnapToolTip()
    ' This example reads and modifies the preference value that controls
    ' the AutoSnap tooltips.  When finished, this example resets the
    ' preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoSnapTooltip
    MsgBox "The AutoSnapToolTip preference is set to: " & originalValue

    ' Modify the AutoSnapToolTip preference by toggling the value
    ACADPref.AutoSnapTooltip = Not (originalValue)
    newValue = ACADPref.AutoSnapTooltip
    MsgBox "The AutoSnapToolTip preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoSnapTooltip = originalValue
    MsgBox "The AutoSnapToolTip preference was reset back to: " & originalValue
End Sub


AutoTrackingVecColor Example [ActiveX and VBA Reference: AAR]

AutoTrackingVecColor Example

Using Programming Languages other than VBA

Sub Example_AutoTrackingVecColor()
    ' This example reads and modifies the preference value that controls
    ' the color of the AutoTrack vector. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.AutoTrackingVecColor
    MsgBox "The AutoTrackingVecColor preference is: " & originalValue

    ' Modify the AutoTrackingVecColor preference by making it red
    ACADPref.AutoTrackingVecColor = vbRed
    newValue = ACADPref.AutoTrackingVecColor
    MsgBox "The AutoTrackingVecColor preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoTrackingVecColor = originalValue
    MsgBox "The AutoTrackingVecColor preference was reset back to: " & originalValue
End Sub


AutoTrackToolTip Example [ActiveX and VBA Reference: AAR]

AutoTrackToolTip Example

Using Programming Languages other than VBA

Sub Example_AutoTrackToolTip()
    ' This example reads and modifies the preference value that controls
    ' the display of the AutoTrack tooltips.  When finished, this example resets the
    ' preference value back to its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.AutoTrackTooltip
    MsgBox "The AutoTrackToolTip preference is set to: " & originalValue

    ' Modify the AutoTrackToolTip preference by toggling the value
    ACADPref.AutoTrackTooltip = Not (originalValue)
    newValue = ACADPref.AutoTrackTooltip
    MsgBox "The AutoTrackToolTip preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AutoTrackTooltip = originalValue
    MsgBox "The AutoTrackToolTip preference was reset back to: " & originalValue
End Sub


BackgroundFill Example [ActiveX and VBA Reference: AAR]

BackgroundFill Example

Using Programming Languages other than VBA

Sub Example_BackgroundFill()
   ' This example creates a circle and an MText object, and masks part of the
   ' circle with the MText object

    'Draw a circle
    Dim circleObj As AcadCircle
    Dim CircleReference(0 To 2) As Double
    Dim radius As Double
    CircleReference(0) = 0
    CircleReference(1) = 0
    CircleReference(2) = 0
    radius = 5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(CircleReference, radius)
    ZoomAll
    MsgBox ("A circle has been drawn.")

    'Create an MText object with the BackgroundFill property set to True
    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    width = 10
    text = "This is the text for the MText object"
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(CircleReference, width, text)
    MTextObj.BackgroundFill = True
    ZoomAll

End Sub


Backward Example [ActiveX and VBA Reference: AAR]

Backward Example

Using Programming Languages other than VBA

Sub Example_Backward()
   ' This example creates a text object in model space and
   ' uses the Backward property to flip the text horizontally

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the new Text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the Text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)

    ThisDrawing.Application.ZoomAll

    MsgBox "The Text oject is now forward"

    textObj.Backward = True
    ThisDrawing.Regen acActiveViewport

    MsgBox "The Text object is now backward"
End Sub


BasePoint Example [ActiveX and VBA Reference: AAR]

BasePoint Example

Using Programming Languages other than VBA

Sub Example_BasePoint()
    ' This example creates a ray object. It then finds the
    ' base point of the ray, changes the base point, and
    ' queries the new base point.
    Dim basePoint(0 To 2) As Double
    Dim directionVec(0 To 2) As Double
    Dim rayObj As AcadRay

    ' Establish the base point and directional vector for the ray
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    directionVec(0) = 1#: directionVec(1) = 1#: directionVec(2) = 0#

    ' Create a Ray object in model space
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, directionVec)

    ThisDrawing.Regen True
    MsgBox "A new Ray has been added.", vbInformation

    ' Define a new base point
    Dim newBase(0 To 2) As Double
    newBase(0) = 4#: newBase(1) = 2#: newBase(2) = 0#

    ' Update the ray using the new base point
    rayObj.basePoint = newBase

    ' Query the new basepoint for the Ray
    Dim currBase As Variant      ' Note that return from basepoint property is Variant and not a SafeArray
    Dim msg As String
    currBase = rayObj.basePoint
    msg = currBase(0) & ", " & currBase(1) & ", " & currBase(2)

    ThisDrawing.Regen True
    MsgBox "We've just changed the basepoint of the new Ray to: " & msg, vbInformation
End Sub


BatchPlotProgress Example [ActiveX and VBA Reference: AAR]

BatchPlotProgress Example

Using Programming Languages other than VBA

Sub Example_BatchPlotProgress()
' This property is obsolete and may be removed
' in a future (post-AutoCAD 2005) version.


BeepOnError Example [ActiveX and VBA Reference: AAR]

BeepOnError Example

Using Programming Languages other than VBA

Sub Example_BeepOnError()
    ' This example returns the current setting of
    ' BeepOnError. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currBeepOnError As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current BeepOnError value
    currBeepOnError = preferences.System.BeepOnError
    MsgBox "The current value for BeepOnError is " & preferences.System.BeepOnError, vbInformation, "BeepOnError Example"

    ' Change the value for BeepOnError
    preferences.System.BeepOnError = Not (currBeepOnError)
    MsgBox "The new value for BeepOnError is " & preferences.System.BeepOnError, vbInformation, "BeepOnError Example"

    ' Reset BeepOnError to its original value
    preferences.System.BeepOnError = currBeepOnError
    MsgBox "The BeepOnError value is reset to " & preferences.System.BeepOnError, vbInformation, "BeepOnError Example"
End Sub


BeginClose Example [: AAR]

BeginClose Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginClose()
    ' This example intercepts a drawing BeginClose event.
    '
    ' This event is triggered when a drawing receives a request to close.
    '
    ' To trigger this example event: Close an open drawing

    MsgBox "A drawing has just been closed!"
End Sub


BeginCommand Example [: AAR]

BeginCommand Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
    ' This example intercepts a drawing BeginCommand event.
    '
    ' This event is triggered when a drawing receives
    ' any command compatible with this event.
    '
    ' To trigger this example event: Issue any command to an open drawing from
    ' either the command line, VBA, the AutoCAD menus, the AutoCAD toolbars, or LISP.

    ' Use the "CommandName" variable to determine which command was started
    MsgBox "A drawing has just been issued a " & CommandName & " command."
End Sub


BeginDocClose Example [: AAR]

BeginDocClose Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginDocClose(Cancel As Boolean)
    ' This example prevents a drawing from closing.
    Cancel = True
    MsgBox "Please do not close this drawing."

End Sub


BeginDoubleClick Example [: AAR]

BeginDoubleClick Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginDoubleClick(ByVal PickPoint As Variant)
    ' This example intercepts a drawing BeginDoubleClick event.
    '
    ' This event is triggered when a drawing receives
    ' a double mouse click in its working area.
    '
    ' To trigger this example event: Position the mouse over the working area of
    ' a drawing window and double-click the left mouse button

    ' Use the "PickPoint" variable to determine where on the drawing the user clicked
    MsgBox "A drawing has just been double-clicked at:" & vbCrLf & _
            PickPoint(0) & vbCrLf & _
            PickPoint(1) & vbCrLf & _
            PickPoint(2)
End Sub


BeginFileDrop Example [: AAR]

BeginFileDrop Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_BeginFileDrop(ByVal FileName As String, Cancel As Boolean)
    ' This example intercepts an Application BeginFileDrop event.
    '
    ' This event is triggered when a drawing file is dragged into AutoCAD.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Drag an AutoCAD drawing file into the AutoCAD application from either
    '     the Windows Desktop or Windows Explorer

    ' Use the "Cancel" variable to stop the loading of the dragged file, and the "FileName"
    ' variable to notifiy the user which file is about to be dragged in.
    If MsgBox("AutoCAD is about to load " & FileName & vbCrLf & "Do you want to continue loading this file?", vbYesNoCancel + vbQuestion) <> vbYes Then
        Cancel = True
    End If
End Sub


BeginLisp Example [: AAR]

BeginLisp Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
    ' This example intercepts a drawing BeginLisp event.
    '
    ' This event is triggered when a drawing receives
    ' a request to evaluate a LISP expression.
    '
    ' To trigger this example event: Start the evaluation of a LISP expression

    ' Use the "FirstLine" variable to help the user determine which LISP expression is running
    MsgBox "A LISP expression has just started to be evaluated.  The first line of the expression is: " & FirstLine

End Sub


BeginModal Example [: AAR]

BeginModal Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_BeginModal()
    ' This example intercepts an Application BeginModal event.  We use a Beep instead of
    ' a message box to notify the user when the event is triggered, since a message box
    ' is a modal entity and would cause continuous BeginModal/EndModal events to be triggered.
    '
    ' This event is triggered when AutoCAD displays a modal dialog.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Use AutoCAD to begin a modal dialog operation.
    '     For example, use AutoCAD to display a modal file dialog by using File/New

    Beep  ' A modal dialog is about to be displayed!
End Sub


BeginOpen Example [: AAR]

BeginOpen Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_BeginOpen(FileName As String)
    ' This example intercepts an Application BeginOpen event.
    '
    ' This event is triggered when a drawing is opened by AutoCAD.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Use AutoCAD to open an existing drawing

    ' Use the "FileName" variable to determine which drawing file is being opened
    MsgBox "A drawing is about to be loaded from: " & FileName
End Sub


BeginPlot Example [: AAR]

BeginPlot Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginPlot(ByVal DrawingName As String)
    ' This example intercepts a drawing BeginPlot event.
    '
    ' This event is triggered when a drawing receives a plot request.
    '
    ' To trigger this example event: Plot an open drawing

    ' Use the "DrawingName" variable to determine which drawing is about to plot
    MsgBox "A drawing has just received a request to plot for: " & DrawingName

End Sub


BeginQuit Example [: AAR]

BeginQuit Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_BeginQuit(Cancel As Boolean)
    ' This example intercepts an Application BeginQuit event.
    '
    ' This event is triggered when AutoCAD receives a request to shut down.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Close the AutoCAD application

    ' Use the "Cancel" variable to stop the shut down of the application
    If MsgBox("AutoCAD is about to shut down.  Do you want to continue with the shutdown?", vbYesNoCancel + vbQuestion) <> vbYes Then
        Cancel = True
    End If
End Sub


BeginRightClick Example [: AAR]

BeginRightClick Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginRightClick(ByVal PickPoint As Variant)
    ' This example intercepts a drawing BeginRightClick event.
    '
    ' This event is triggered when a drawing receives
    ' a right mouse click in its working area.
    '
    ' To trigger this example event: Position the cursor over the working area of
    ' a drawing window and click the right mouse button.

    ' Use the "PickPoint" variable to determine where on the drawing the user clicked
    MsgBox "A drawing has just been right-clicked at:" & vbCrLf & _
            PickPoint(0) & vbCrLf & _
            PickPoint(1) & vbCrLf & _
            PickPoint(2)

End Sub


BeginSave Example [: AAR]

BeginSave Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginSave(ByVal FileName As String)
    ' This example intercepts a drawing BeginSave event.
    '
    ' This event is triggered when a drawing receives a request to be saved.
    '
    ' To trigger this example event: Save an open drawing

    ' Use the "FileName" variable to determine where the drawing file is being saved
    MsgBox "A drawing is about to be saved to: " & FileName
End Sub


BeginShortcutMenuCommand Example [ActiveX and VBA Reference: AAR]

BeginShortcutMenuCommand Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginShortcutMenuCommand(ShortcutMenu As AutoCAD.IAcadPopupMenu, ByVal Command As String)
    ' This example intercepts a shortcut menu start while you are in the command mode.
    '
    MsgBox "You have just initiated a shortcut menu in command mode!"

End Sub


BeginShortcutMenuDefault Example [ActiveX and VBA Reference: AAR]

BeginShortcutMenuDefault Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginShortcutMenuDefault(ShortcutMenu As AutoCAD.IAcadPopupMenu)
    ' This example intercepts a shortcut menu start while you are in the default mode.
    '
    MsgBox "You have just initiated a shortcut menu in default mode!"
End Sub


BeginShortcutmenuEdit Example [ActiveX and VBA Reference: AAR]

BeginShortcutmenuEdit Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginShortcutMenuEdit(ShortcutMenu As AutoCAD.IAcadPopupMenu, SelectionSet As AutoCAD.IAcadSelectionSet)
    ' This example intercepts a shortcut menu start while you are in the edit mode.
    '
    MsgBox "You have just initiated a shortcut menu in edit mode!"
End Sub


BeginShortcutMenuGrip Example [ActiveX and VBA Reference: AAR]

BeginShortcutMenuGrip Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginShortcutMenuGrip(ShortcutMenu As AutoCAD.IAcadPopupMenu)
    ' This example intercepts a shortcut menu start while you are in the grip mode.
    '
    MsgBox "You have just initiated a shortcut menu in grip mode!"
End Sub


BeginShortcutMenuOSnap Example [ActiveX and VBA Reference: AAR]

BeginShortcutMenuOSnap Example

Using Programming Languages other than VBA

Private Sub AcadDocument_BeginShortcutMenuOSnap(ShortcutMenu As AutoCAD.IAcadPopupMenu)
    ' This example intercepts a shortcut menu start while you are in the osnap mode.
    '
    MsgBox "You have just initiated a shortcut menu in osnap mode!"
End Sub


BigFontFile Example [ActiveX and VBA Reference: AAR]

BigFontFile Example

Using Programming Languages other than VBA

Sub Example_BigFontFile()
    ' This example returns the current setting of
    ' BigFontFile. It then changes the value.

    Dim textStyle1 As AcadTextStyle
    Dim currBigFontFile As String
    Dim newBigFontFile As String

    Set textStyle1 = ThisDrawing.ActiveTextStyle

    ' Retrieve the current BigFontFile value
    currBigFontFile = textStyle1.BigFontFile
    MsgBox "The current value for BigFontFile is " & currBigFontFile, vbInformation, "BigFontFile Example"

    ' Change the value for BigFontFile
    newBigFontFile = "C:/AutoCAD/Fonts/bigfont.shx"
    textStyle1.BigFontFile = newBigFontFile
    MsgBox "The new value for BigFontFile is " & newBigFontFile, vbInformation, "BigFontFile Example"

End Sub


Bind Example [ActiveX and VBA Reference: AAR]

Bind Example

Using Programming Languages other than VBA

Sub Example_Bind()
    On Error GoTo ERRORHANDLER

    ' Define external reference to be inserted
    Dim xrefHome As AcadBlock
    Dim xrefInserted As AcadExternalReference
    Dim insertionPnt(0 To 2) As Double
    Dim PathName As String
    insertionPnt(0) = 1
    insertionPnt(1) = 1
    insertionPnt(2) = 0
    PathName = "c:/AutoCAD/sample/City map.dwg"

    ' Add the external reference
    Set xrefInserted = ThisDrawing.ModelSpace. _
            AttachExternalReference(PathName, "XREF_IMAGE", _
            insertionPnt, 1, 1, 1, 0, False)
    ZoomAll
    MsgBox "The external reference is attached."

    ' Bind the external reference definition
    ThisDrawing.Blocks.Item(xrefInserted.name).Bind False
    MsgBox "The external reference is bound."
    Exit Sub

ERRORHANDLER:
    MsgBox Err.Description
End Sub


BitFlags Example [ActiveX and VBA Reference: AAR]

BitFlags Example

Using Programming Languages other than VBA

Sub Example_BitFlags()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


Block Attribute Example [ActiveX and VBA Reference: AAR]

Block Attribute Example

Using Programming Languages other than VBA

Sub Example_Blockttribute()
    ' This example creates an MLeader object and gets and sets values for
    ' the block attribute type.

    Dim points(0 To 5) As Double

    points(0) = 0: points(1) = 4: points(2) = 0
    points(3) = 1.5: points(4) = 5: points(5) = 0

    Dim i As Long

    Dim oML As AcadMLeader
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.ContentType = acBlockContent
    oML.ContentBlockType = acBlockBox

    Dim sBlock As String

    sBlock = oML.ContentBlockName

    Dim o As AcadEntity
    For Each o In ThisDrawing.Blocks(sBlock)
        If o.ObjectName = "AcDbAttributeDefinition" Then
            Call oML.SetBlockAttributeValue(o.ObjectID, "123")
            MsgBox oML.GetBlockAttributeValue(o.ObjectID)
        End If
    Next o
    Update
    ZoomExtents

End Sub


Block Example [ActiveX and VBA Reference: AAR]

Block Example

Using Programming Languages other than VBA

Sub Example_Block()
    ' This example finds the name of the block associated with a layout.

    Dim xBlock As AcadBlock
    Set xBlock = ThisDrawing.ActiveLayout.Block

    MsgBox "The active layout corresponds to block: " & xBlock.name
End Sub


BlockConnectionType Example [ActiveX and VBA Reference: AAR]

BlockConnectionType Example

Using Programming Languages other than VBA

Sub Example_BlockConnectionType()
    ' This example creates an MLeader object and gets and sets values for
    ' the block connection type.

      Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.BlockConnectionType = acConnectBase

End Sub


Blocks Example [ActiveX and VBA Reference: AAR]

Blocks Example

Using Programming Languages other than VBA

Sub Example_Blocks()
    ' This example first finds the Blocks collection
    ' using the Blocks property. It then adds a new
    ' block to the Blocks collection.

    Dim blkColl As AcadBlocks
    Dim newBlock As AcadBlock
    Dim insertionPnt(0 To 2) As Double

    ' Get the Blocks collection
    Set blkColl = ThisDrawing.Blocks

    ' Define the insertion point for the new block
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#

    ' Add the new block into the Blocks collection
    Set newBlock = blkColl.Add(insertionPnt, "TEST")
    MsgBox "A block called " & newBlock.name & " has been added to the blocks collection", vbInformation, "Blocks Example"
End Sub


Blue Example [ActiveX and VBA Reference: AAR]

Blue Example

Using Programming Languages other than VBA

Sub Example_Blue()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    MsgBox "Red = " & retcolor.Red
    MsgBox "Green = " & retcolor.Green
    MsgBox "Blue = " & retcolor.Blue
End Sub


BookName Example [ActiveX and VBA Reference: AAR]

BookName Example

Using Programming Languages other than VBA

Sub Example_BookName()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName
    MsgBox "ColorName=" & col.ColorName
End Sub


Boolean Example [ActiveX and VBA Reference: AAR]

Boolean Example

Using Programming Languages other than VBA

Sub Example_Boolean()
    ' This example creates a box and a cylinder in model space.
    ' It then performs a Boolean operation on the two solids.

    Dim boxObj As Acad3DSolid
    Dim boxLength As Double, boxWidth As Double, boxHeight As Double
    Dim boxCenter(0 To 2) As Double
    boxCenter(0) = 5#: boxCenter(1) = 5#: boxCenter(2) = 0
    boxLength = 10#: boxWidth = 7: boxHeight = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(boxCenter, boxLength, boxWidth, boxHeight)

    ' Define the cylinder
    Dim cylinderObj As Acad3DSolid
    Dim cylinderCenter(0 To 2) As Double
    Dim cylinderRadius As Double
    Dim cylinderHeight As Double
    cylinderCenter(0) = 0#: cylinderCenter(1) = 0#: cylinderCenter(2) = 0#
    cylinderRadius = 5#
    cylinderHeight = 20#

    ' Create the Cylinder (3DSolid) object in model space
    Set cylinderObj = ThisDrawing.ModelSpace.AddCylinder(cylinderCenter, cylinderRadius, cylinderHeight)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Perform an intersection on the two solids
    MsgBox "Perform an intersection on the two solids.", vbOKOnly, "Boolean Example"
    boxObj.Boolean acIntersection, cylinderObj
    ThisDrawing.Regen True

    MsgBox "Intersection complete.", , "Boolean Example"

End Sub


BreakHeight Example [ActiveX and VBA Reference: AAR]

BreakHeight Example

Using Programming Languages other than VBA

Sub Example_BreakHeight()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment2 AcRowType.acDataRow + AcRowType.acTitleRow, AcRowType.acDataCol + AcRowType.acTitleCol, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow, acTitleCol) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment2(acTitleRow, acTitleCol) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

      customObj.SetBreakHeight 1, 3.2

End Sub


Breaks Example [ActiveX and VBA Reference: AAR]

Breaks Example

Using Programming Languages other than VBA

Sub Example_ContentChange()
     ' This example adds a table in model space and sets the breaks

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As IAcadTable2
    Dim cName As String
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

    MyTable.BreaksEnabled = True
    MyTable.BreakSpacing = 3.2
    MyTable.TableBreakHeight = 4.2

    ZoomExtents

End Sub


Brightness Example [ActiveX and VBA Reference: AAR]

Brightness Example

Using Programming Languages other than VBA

Sub Example_Brightness()
    ' This example inserts a raster image and finds the current
    ' brightness of the image. It then changes the brightness
    ' of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have this image, or if it is located
    ' in a different directory, insert a valid path and file name
    ' for the imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double, rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:/AutoCAD/sample/downtown.jpg"

    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "File error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current brightness
    ThisDrawing.Regen True
    MsgBox "The brightness is currently set to: " & raster.Brightness, vbInformation

    ' Change the brightness to 5
    raster.Brightness = 5
    ThisDrawing.Regen True
    MsgBox "The brightness is now set to: " & raster.Brightness, vbInformation
End Sub


CanonicalMediaName Example [ActiveX and VBA Reference: AAR]

CanonicalMediaName Example

Using Programming Languages other than VBA

Sub Example_CanonicalMediaName()
    ' This example finds the name of the media for the active layout

    Dim MediaName As String
    MediaName = ThisDrawing.ActiveLayout.CanonicalMediaName

    If MediaName = "" Then
        MsgBox "There is no media set for the active layout."
    Else
        MsgBox "The media for the active layout is: " & MediaName
    End If
End Sub


Caption Example [ActiveX and VBA Reference: AAR]

Caption Example

Using Programming Languages other than VBA

Sub Example_Caption()
    ' This example returns the caption for the current
    ' AutoCAD session.

    ' Get the Caption property
    Dim strCaption As String
    strCaption = ThisDrawing.Application.Caption
    MsgBox "The caption for this session is " & ThisDrawing.Application.Caption, , "Caption Example"

End Sub


CategoryName Example [ActiveX and VBA Reference: AAR]

CategoryName Example

Using Programming Languages other than VBA

Sub Example_CategoryName()
    ' This example demonstrates the
    ' CategoryName, LayoutId, LayerState,
    ' and HasVpAssociation properties of the View object

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

    ' Create a view named "New_View" in current drawing
    Dim viewObj As IAcadView2

    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.Name & " has been added." & vbCrLf & _
           "Height: " & viewObj.Height & vbCrLf & _
           "Width: " & viewObj.Width, , "Example"

    viewObj.CategoryName = "My View Category"
    viewObj.LayerState = "My Layer State"

    viewObj.LayoutId = ThisDrawing.Layouts(1).ObjectID

    MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
            viewObj.LayoutId & " is the Layout ID." & vbCrLf & _
            viewObj.LayerState & " is the Layer state."

    If viewObj.HasVpAssociation = True Then
        MsgBox "The view is associated with a paper space viewport."
    Else
        MsgBox "The view is not associated with a paper space viewport."

   End If
End Sub


CellClass Example [ActiveX and VBA Reference: AAR]

CellClass Example

Using Programming Languages other than VBA

Sub Example_CellClasses()
' This example creates a TableStyle object and sets values for
    ' the style classes and formatting.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As IAcadTableStyle2
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.CreateCellStyle ("NewTestStyle")
      Dim cellTestFormat As String

      Call customObj.SetCellClass("NewTestStyle", 4)

      Call customObj.SetRotation("NewTestStyle", 8.4)

      MsgBox "The cell class is " & customObj.GetCellClass("NewTestStyle") & _
             " the cell rotation is " & customObj.GetRotation("NewTestStyle")
End Sub


CellManipulation Example [ActiveX and VBA Reference: AAR]

CellManipulation Example

Using Programming Languages other than VBA

Sub Example_CellManipulation()
     ' This example adds a table in model space and sets and gets a column name

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As IAcadTable2
    Dim cName As String
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

    Call MyTable.SetCellDataType(2, 2, acLong, acUnitDistance)
    Call MyTable.SetCellFormat(1, 3, "testFormat")
    Call MyTable.SetCellState(4, 3, acCellStateContentLocked)
    Call MyTable.SetCellValue(1, 4, 5)

    MsgBox MyTable.GetCellValue(1, 4) & " is the test cell's value "

    ZoomExtents

End Sub


CellStyle Example [ActiveX and VBA Reference: AAR]

CellStyle Example

Using Programming Languages other than VBA

Sub Example_CellStyle()
' This example creates a TableStyle object and sets values for
    ' the style name and formatting.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As IAcadTableStyle2
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.CreateCellStyle ("NewTestStyle")
      Dim cellTestFormat As String

      Call customObj.SetFormat2("NewTestStyle", "test format")
      Call customObj.GetFormat2("NewTestStyle", cellTestFormat)

      MsgBox "Cell Style Name = " & cellTestFormat

      Call customObj.RenameCellStyle("NewTestStyle", "NewTestStyle2")
      Call customObj.GetFormat2("NewTestStyle2", cellTestFormat)

      MsgBox "Cell Style Name = " & cellTestFormat

      Dim uniqueStyleName As String

      uniqueStyleName = customObj.GetUniqueCellStyleName("testbase")

      MsgBox "Cell Style Name = " & uniqueStyleName

      If customObj.GetIsCellStyleInUse("testbase") = False Then
        MsgBox "That cell style is not being used!"
      End If

      Call customObj.CreateCellStyleFromStyle("TestStyleFromStyle", "NewTestStyle2")

      Call customObj.DeleteCellStyle("NewTestStyle2")

      Dim numOfStyles As Long
      numOfStyles = customObj.NumCellStyles
End Sub


Center Example [ActiveX and VBA Reference: AAR]

Center Example

Using Programming Languages other than VBA

Sub Example_Center()

    Dim circObj As AcadCircle
    Dim currCenterPt(0 To 2) As Double
    Dim newCenterPt(0 To 2) As Double
    Dim radius As Double

    ' Define the initial center point and radius for the circle
    currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
    radius = 3

    ' Create the circle in model space
    Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
    ZoomAll
    MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center Example"

    ' Change the center point of the circle
    newCenterPt(0) = 25: newCenterPt(1) = 25: newCenterPt(2) = 0
    circObj.center = newCenterPt
    circObj.Update

    ' Query the results of the new center position
    ' Notice the output from the center property is a variant
    Dim centerPoint As Variant
    centerPoint = circObj.center
    MsgBox "The center point of the circle is " & centerPoint(0) & ", " & centerPoint(1) & ", " & centerPoint(2), vbInformation, "Center Example"
End Sub


CenterMarkSize Example [ActiveX and VBA Reference: AAR]

CenterMarkSize Example

Using Programming Languages other than VBA

Sub Example_CenterMarkSize()
    ' This example creates a diametric dimension in model space.
    ' It then changes the type of center for the dimension to
    ' center mark, and adjusts the size of the center mark.

    Dim dimObj As AcadDimDiametric
    Dim chordPoint(0 To 2) As Double
    Dim farChordPoint(0 To 2) As Double
    Dim leaderLength As Double

    ' Define the dimension
    chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
    farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
    leaderLength = 1#

    ' Create the diametric dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
    ZoomAll

    ' Change the center type to center mark and set the size of the center mark
    dimObj.CenterType = acCenterMark
    dimObj.CenterMarkSize = 0.1
    dimObj.Update
    MsgBox "The center mark size is: " & dimObj.CenterMarkSize

    dimObj.CenterMarkSize = dimObj.CenterMarkSize * 2
    dimObj.Update
    MsgBox "The center mark size is: " & dimObj.CenterMarkSize
End Sub


CenterPlot Example [ActiveX and VBA Reference: AAR]

CenterPlot Example

Using Programming Languages other than VBA

Sub Example_CenterPlot()
    ' This example will access the Layouts collection for the current drawing
    ' and display whether the plot for this layout is to be centered on the media.
    ' It will then toggle the state of CenterPlot for "Layout1" and re-display the
    ' CenterPlot state for each Layout.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim IsCentered As String

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    ' Display current layout information
    GoSub DISPLAY

    ' Toggle centered state for Layout1
    Layouts("Layout1").PlotType = acDisplay
    Layouts("Layout1").CenterPlot = Not (Layouts("Layout1").CenterPlot)
    ThisDrawing.Regen acAllViewports

    ' Display new layout information
    GoSub DISPLAY

    Exit Sub

DISPLAY:
    msg = ""    ' Clear message

    ' Determine whether this layout is centered on the media during a plot
    For Each Layout In Layouts
        IsCentered = IIf(Layout.CenterPlot, " are centered ", " are not centered ")

        ' Format for display
        msg = msg & "Objects for " & Layout.name & IsCentered & "on the media during a plot." & vbCrLf
    Next

    ' Display layout information
    MsgBox msg

    Return
End Sub


CenterType Example [ActiveX and VBA Reference: AAR]

CenterType Example

Using Programming Languages other than VBA

Sub Example_CenterType()
    ' This example creates a diametric dimension in model space.
    ' It then changes the type of center for the dimension.

    Dim dimObj As AcadDimDiametric
    Dim chordPoint(0 To 2) As Double
    Dim farChordPoint(0 To 2) As Double
    Dim leaderLength As Double

    ' Define the dimension
    chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
    farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
    leaderLength = 1#

    ' Create the diametric dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
    ZoomAll

    ' Set the center to be none
    dimObj.CenterType = acCenterNone
    dimObj.Update
    MsgBox "The dimension center type is set to none."

    ' Change the center type to center mark
    dimObj.CenterType = acCenterMark
    dimObj.Update
    MsgBox "The dimension center type is set to center mark."

    ' Change the center type to center line
    dimObj.CenterType = acCenterLine
    dimObj.Update
    MsgBox "The dimension center type is set to center line."
End Sub


Centroid Example [ActiveX and VBA Reference: AAR]

Centroid Example

Using Programming Languages other than VBA

Sub Example_Centroid()
    ' This example creates a box in model space.
    ' It then returns the Centroid for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the Centroid for the box
    Dim Centroid As Variant
    Centroid = boxObj.Centroid
    MsgBox "The Centroid for the box is " & Centroid(0) & ", " & Centroid(1), , "Centroid Example"

End Sub


Check Example [ActiveX and VBA Reference: AAR]

Check Example

Using Programming Languages other than VBA

Sub Example_Check()
    ' This example creates a new menu called TestMenu and inserts two menu items
    ' into it. The second menu item is then checked.
    ' The menu is displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add two menu items to the new menu
    Dim Menu1 As AcadPopupMenuItem
    Dim Menu2 As AcadPopupMenuItem
    Dim MenuSeparator As AcadPopupMenuItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set Menu1 = newMenu.AddMenuItem(newMenu.count + 1, "Open1", openMacro)
    Set MenuSeparator = newMenu.AddSeparator("")
    Set Menu2 = newMenu.AddMenuItem(newMenu.count + 1, "Open2", openMacro)

    ' Disable the new menu item
    Menu2.Check = True

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


CheckInterference Example [ActiveX and VBA Reference: AAR]

CheckInterference Example

Using Programming Languages other than VBA

Sub Example_CheckInterference()
    ' This example creates a box and a cylinder in model space.
    ' It then finds the interference between the two solids and
    ' creates a new solid from that interference.

    ' For ease of viewing, different colors are used for the box, the
    ' cylinder, and the interference solid.

    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")

    Dim boxObj As Acad3DSolid
    Dim boxLength As Double, boxWidth As Double, boxHeight As Double
    Dim boxCenter(0 To 2) As Double
    boxCenter(0) = 5#: boxCenter(1) = 5#: boxCenter(2) = 0
    boxLength = 10#: boxWidth = 7: boxHeight = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(boxCenter, boxLength, boxWidth, boxHeight)
    Call color.SetRGB(80, 100, 244)
    boxObj.TrueColor = color

    ' Define the cylinder
    Dim cylinderObj As Acad3DSolid
    Dim cylinderCenter(0 To 2) As Double
    Dim cylinderRadius As Double
    Dim cylinderHeight As Double
    cylinderCenter(0) = 0#: cylinderCenter(1) = 0#: cylinderCenter(2) = 0#
    cylinderRadius = 5#
    cylinderHeight = 20#

    ' Create the Cylinder (3DSolid) object in model space
    Set cylinderObj = ThisDrawing.ModelSpace.AddCylinder(cylinderCenter, cylinderRadius, cylinderHeight)
    Call color.SetRGB(244, 150, 50)
    cylinderObj.TrueColor = color

    ' Find the interference between the two solids and create a new solid from it
    Dim solidObj As Acad3DSolid
    Set solidObj = boxObj.CheckInterference(cylinderObj, True)
    Call color.SetRGB(200, 150, 244)
    solidObj.TrueColor = color

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' You can now delete the box and cylinder in AutoCAD to
    ' see the interference solid more clearly.

End Sub


Circumference Example [ActiveX and VBA Reference: AAR]

Circumference Example

Using Programming Languages other than VBA

Sub Example_Circumference()
    ' This example creates a Circle object in model space and
    ' returns the circumference of the Circle

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the new Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    MsgBox "The circumference of the new Circle is: " & circleObj.Circumference

End Sub


Clear Example [ActiveX and VBA Reference: AAR]

Clear Example

Using Programming Languages other than VBA

Sub Example_Clear()
    ' This example creates a selection set and several objects.
    ' It then adds the objects to the selection set. It then
    ' clears the objects from the selection set.

    ' Create the new selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET")

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection.
    ' Collect the objects found into an array of objects
    ' to be added to the selection set.
    ReDim ssobjs(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects to the selection set
    ssetObj.AddItems ssobjs
    GoSub LISTOBJS

    ' Clear the selection set
    ssetObj.Clear

    ThisDrawing.Regen acActiveViewport
    GoSub LISTOBJS

Exit Sub

LISTOBJS:

        ' List all the objects in the selection set
        If ssetObj.count = 0 Then
            MsgBox "The selection set is empty"
        Else
            For I = 0 To ssetObj.count - 1
                MsgBox "The selection set contains: " & ssetObj.Item(I).ObjectName
            Next
        End If
        Return

End Sub


ClipBoundary Example [ActiveX and VBA Reference: AAR]

ClipBoundary Example

Using Programming Languages other than VBA

Sub Example_ClipBoundary()
    ' This example adds a raster image in model space.
    ' It then clips the image based on a clip boundary.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have the image, or if it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage

    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
    scalefactor = 2#
    rotationAngle = 0

    On Error Resume Next
    ' Creates a raster image in model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    If Err.Description = "Filer error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ZoomAll
    MsgBox "Clip the image?", , "ClipBoundary Example"

    ' Establish the clip boundary with an array of points
    Dim clipPoints(0 To 9) As Double
    clipPoints(0) = 6: clipPoints(1) = 6.75
    clipPoints(2) = 7: clipPoints(3) = 6
    clipPoints(4) = 6: clipPoints(5) = 5
    clipPoints(6) = 5: clipPoints(7) = 6
    clipPoints(8) = 6: clipPoints(9) = 6.75

    ' Clip the image
    rasterObj.clipBoundary clipPoints

    ' Enable the display of the clip
    rasterObj.ClippingEnabled = True
    ThisDrawing.Regen acActiveViewport
    MsgBox "The image has been clipped.", , "ClipBoundary Example"
End Sub


Clipped Example [ActiveX and VBA Reference: AAR]

Clipped Example

Using Programming Languages other than VBA

Sub Example_Clipped()
    ' This example scans the current drawing paper space Viewports
    ' and displays whether or not any of them are clipped.

    Dim pviewportObj As Object
    Dim msg As String, ClippedState As String

    ' Make sure this drawing contains paper space viewports before continuing
    If ThisDrawing.PaperSpace.count = 0 Then
        MsgBox "There are no paper space viewports in the current drawing."
        Exit Sub
    End If

    ' Go through each PViewport object in the drawing paper space
    ' and determine whether the paper space viewport is clipped or not

    For Each pviewportObj In ThisDrawing.PaperSpace

        ' Determine if this is a paper space viewport
        If TypeName(pviewportObj) = "IAcadPViewport" Then

            ' Determine if this paper space viewport is clipped
            ClippedState = IIf(pviewportObj.Clipped, " is clipped", " is not clipped")
            msg = msg & "PViewport ID " & pviewportObj.objectID & ClippedState & vbCrLf

        End If

    Next

    ' Display clipped state of paper space Viewports
    MsgBox msg
End Sub


ClippingEnabled Example [ActiveX and VBA Reference: AAR]

ClippingEnabled Example

Using Programming Languages other than VBA

Sub Example_ClippingEnabled()
    ' This example adds a raster image in model space.
    ' It then clips the image based on a clip boundary,
    ' and toggles the display of the clipping.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage

    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
    scalefactor = 2#
    rotationAngle = 0

    On Error Resume Next
    ' Creates a raster image in model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    If Err.Description = "Filer error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ZoomAll
    MsgBox "Clip the image?", , "ClipBoundary Example"

    ' Establish the clip boundary with an array of points
    Dim clipPoints(0 To 9) As Double
    clipPoints(0) = 6: clipPoints(1) = 6.75
    clipPoints(2) = 7: clipPoints(3) = 6
    clipPoints(4) = 6: clipPoints(5) = 5
    clipPoints(6) = 5: clipPoints(7) = 6
    clipPoints(8) = 6: clipPoints(9) = 6.75

    ' Clip the image
    rasterObj.clipBoundary clipPoints

    ' Enable the display of the clip
    rasterObj.ClippingEnabled = True
     ThisDrawing.Regen acActiveViewport
   MsgBox "Turn off the display of the clipped image.", , "ClippingEnabled Example"

    ' Disable the display of the clip
    rasterObj.ClippingEnabled = False
    ThisDrawing.Regen acActiveViewport
    MsgBox "Display off.", , "ClippingEnabled Example"

End Sub


Close Example [ActiveX and VBA Reference: AAR]

Close Example

Using Programming Languages other than VBA

Sub Example_Close()
    ' This example cycles through the documents collection
    ' and closes all open drawings using the Close method.

    Dim DOC As AcadDocument

    ' If there are no open documents, then exit
    If Documents.count = 0 Then
        MsgBox "There are no open documents!"
        Exit Sub
    End If

    ' Close all open documents
    For Each DOC In Documents
        If MsgBox("Do you wish to close the document: " & DOC.WindowTitle, vbYesNo & vbQuestion) = vbYes Then
            If DOC.FullName <> "" Then
                DOC.Close
            Else
                MsgBox DOC.name & " has not been saved yet, so it will not be closed."
            End If
        End If
    Next
End Sub


Closed Example [ActiveX and VBA Reference: AAR]

Closed Example

Using Programming Languages other than VBA

Sub Example_Closed()
    ' This example creates a polyline and then toggles the
    ' setting to Closed.
    Dim plineObj As AcadPolyline
    Dim closedState As String

    ' Create the polyline
    Dim points(8) As Double
    points(0) = 3: points(1) = 7: points(2) = 0
    points(3) = 9: points(4) = 2: points(5) = 0
    points(6) = 3: points(7) = 5: points(8) = 0
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)

    ' Set the closed property to True
    plineObj.Closed = True      ' Close Polyline
    ThisDrawing.Regen (True)
    GoSub DISPLAY

    ' Open the PolyLine by setting the closed property to False
    plineObj.Closed = False      ' Open Polyline
    ThisDrawing.Regen (True)
    GoSub DISPLAY

    Exit Sub

DISPLAY:
    ' Retrieve and display the Closed property
    closedState = IIf(plineObj.Closed, "Closed", "Open")
    MsgBox "The new Polyline is: " & closedState, vbInformation, "Closed Example"
    Return
End Sub


Color Example [ActiveX and VBA Reference: AAR]

Color Example

Using Programming Languages other than VBA

Sub Example_Color()
    ' This example creates a polyline and colors it red.
    ' It then displays the current color setting for the polyline.
    Dim plineObj As AcadPolyline
    Dim currentcolor As Variant

    ' Create Polyline
    Dim points(8) As Double
    points(0) = 3: points(1) = 7: points(2) = 0
    points(3) = 9: points(4) = 2: points(5) = 0
    points(6) = 3: points(7) = 5: points(8) = 0

    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)

    ' First set the color of the object to Red
    plineObj.Color = acRed
    ThisDrawing.Regen (True)

    ' Now retrieve and display the Color property
    currentcolor = plineObj.Color

    ' Translate the color from a number into text
    If currentcolor = 256 Then
        currentcolor = "By Layer"
    Else
        currentcolor = Choose(currentcolor + 1, "By Block", "Red", "Yellow", "Green", "Cyan", "Blue", "Magenta", "White")
    End If

    ' Display
    MsgBox "The Polyline color is: " & currentcolor, vbInformation, "Color Example"
End Sub


ColorBookPath Example [ActiveX and VBA Reference: AAR]

ColorBookPath Example

Using Programming Languages other than VBA

Sub Example_ColorBookPath()
    'This example changes the color book path
    'and then sets it to its original string

    Dim pref As AutoCAD.AcadPreferencesFiles
    Set pref = AcadApplication.Preferences.Files

    Dim defCBPath As String
    Dim changedCBPath As String

    defCBPath = pref.ColorBookPath
    MsgBox "The current color book path is " & defCBPath

    pref.ColorBookPath = "c:\winnt;c:\temp"
    changedCBPath = pref.ColorBookPath
    MsgBox "The changed color book path is " & changedCBPath

    pref.ColorBookPath = defCBPath

End Sub


ColorIndex Example [ActiveX and VBA Reference: AAR]

ColorIndex Example

Using Programming Languages other than VBA

Sub Example_ColorIndex()
    'This example draws a circle and
    'returns the closest color index.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor

    If col.ColorMethod = AutoCAD.acColorMethodByRGB Then
    MsgBox "Closest ColorIndex=" & col.ColorIndex
    End If

End Sub


ColorMethod Example [ActiveX and VBA Reference: AAR]

ColorMethod Example

Using Programming Languages other than VBA

Sub Example_ColorMethod()
    ' This example shows how to change the
    ' ColorMethod property
        Dim col As New AcadAcCmColor
        col.ColorMethod = AutoCAD.acColorMethodForeground

        'Circle number one
        Dim cir1 As AcadCircle
        Dim pt(0 To 2) As Double
        Set cir1 = ThisDrawing.ModelSpace.AddCircle(pt, 2)
        cir1.TrueColor = col
        ZoomAll

        Dim retCol As AcadAcCmColor
        Set retCol = cir1.TrueColor

        'Message box with method and index
        Dim MethodText As String
        MethodText = col.ColorMethod
        MsgBox "ColorMethod=" & MethodText & vbCrLf & "Index=" & col.ColorIndex

        'Circle number two
        Dim cir2 As AcadCircle
        Set cir2 = ThisDrawing.ModelSpace.AddCircle(pt, 6)
        ZoomAll

        col.ColorMethod = AutoCAD.acColorMethodByBlock

        'Message box with method and index
        MethodText = col.ColorMethod
        MsgBox "ColorMethod=" & MethodText & vbCrLf & "Index=" & col.ColorIndex

        'Circle number three
        Dim cir3 As AcadCircle
        Set cir3 = ThisDrawing.ModelSpace.AddCircle(pt, 10)
        ZoomAll

        Dim layColor As AcadAcCmColor
        Set layColor = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
        Call layColor.SetRGB(122, 199, 25)
        ThisDrawing.ActiveLayer.TrueColor = layColor

        col.ColorMethod = AutoCAD.acColorMethodByLayer

        Set retCol = cir3.TrueColor

        'Message box with method and index
        MethodText = col.ColorMethod
        MsgBox "ColorMethod=" & MethodText & vbCrLf & "Index=" & col.ColorIndex
End Sub


ColorName Example [ActiveX and VBA Reference: AAR]

ColorName Example

Using Programming Languages other than VBA

Sub Example_ColorName()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName
    MsgBox "ColorName=" & col.ColorName
End Sub


ColumnName Example [ActiveX and VBA Reference: AAR]

ColumnName Example

Using Programming Languages other than VBA

Sub Example_ContentChange()
     ' This example adds a table in model space and sets and gets a column name

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As IAcadTable2
    Dim cName As String
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

    Call MyTable.SetColumnName(2, "Test Name")
    MsgBox "The column name is: " & vbCrLf & _
           MyTable.GetColumnName(2)

    ZoomExtents

End Sub


Columns Example [ActiveX and VBA Reference: AAR]

Columns Example

Using Programming Languages other than VBA

Sub Example_Columns()
    ' This example creates a new MInsertBlock in the current drawing and
    ' displays the column and row information for the new MInsertBlock

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)

    ThisDrawing.Application.ZoomAll

    ' Display information about the Columns and Rows defined by the MInsertBlock
    MsgBox "The new rectangular array comprises: " & vbCrLf & _
            newMBlock.Columns & " columns with a spacing of " & newMBlock.ColumnSpacing & " and" & vbCrLf & _
            newMBlock.Rows & " rows with a spacing of " & newMBlock.RowSpacing

End Sub


ColumnSpacing Example [ActiveX and VBA Reference: AAR]

ColumnSpacing Example

Using Programming Languages other than VBA

Sub Example_ColumnSpacing()
    ' This example creates a new MInsertBlock in the current drawing and
    ' displays the column and row information for the new MInsertBlock

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)

    ThisDrawing.Application.ZoomAll

    ' Display information about the Columns and Rows defined by the MInsertBlock
    MsgBox "The new rectangular array comprises: " & vbCrLf & _
            newMBlock.Columns & " columns with a spacing of " & newMBlock.ColumnSpacing & " and" & vbCrLf & _
            newMBlock.Rows & " rows with a spacing of " & newMBlock.RowSpacing

End Sub


Comment Example [ActiveX and VBA Reference: AAR]

Comment Example

Using Programming Languages other than VBA

Sub Example_Comment()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True

    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP

    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


Comments Example [ActiveX and VBA Reference: AAR]

Comments Example

Using Programming Languages other than VBA

Sub Example_Comments()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


ConfigFile Example [ActiveX and VBA Reference: AAR]

ConfigFile Example

Using Programming Languages other than VBA

Sub Example_ConfigFile()
    ' This example returns the current setting of ConfigFile.

    Dim preferences As AcadPreferences
    Dim currConfigFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ConfigFile value
    currConfigFile = preferences.Files.ConfigFile
    If currConfigFile = "" Then
        MsgBox "ConfigFile is not currently set.", vbInformation, "ConfigFile Example"
    Else
        MsgBox "The current value for ConfigFile is " & currConfigFile, vbInformation, "ConfigFile Example"
    End If
End Sub


ConfigName Example [ActiveX and VBA Reference: AAR]

ConfigName Example

Using Programming Languages other than VBA

Sub Example_ConfigName()
    ' This example will add a new plot configuration to the current drawing.
    ' It will then list the plotter configuration file name for each Layout
    ' in the current drawing, change the configuration for Layout1 to "DWF Classic.pc3"
    ' and re-display the configuration information for the drawing.
    '
    ' * Note: File names may differ on your system, so be prepared to change
    ' the configuration file name used in the example to a file that exists
    ' on your system.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim ACADPref As AcadPreferencesFiles
    Dim originalValue As Variant

    ' Get the files preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    ' Read and display the original value
    originalValue = ACADPref.PrinterConfigPath

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    ' Display current plotter configuration information
    GoSub DISPLAY_CONFIG

    ' Change plotter configuration file for "Layout1"
    Layouts("Layout1").ConfigName = "DWF Classic.pc3"

    ' Display new plotter configuration information
    GoSub DISPLAY_CONFIG

    Exit Sub

DISPLAY_CONFIG:
    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Format and display current directory for configuration files
    msg = msg & vbTab & "Directories that will be scanned for the plotter configuration files are: " _
                & vbCrLf & vbTab & vbTab & originalValue & vbCrLf & vbCrLf

    ' Get the plotter configuration name of every layout in this drawing
    For Each Layout In Layouts
        ' Format for display
        msg = msg & vbTab & Layout.name & " is using configuration: " & Layout.ConfigName & vbCrLf
    Next

    ' Display paper units information
    MsgBox "The plotter configuration information used in the current drawing is listed below." & msg

    Return
End Sub


Constant Example [ActiveX and VBA Reference: AAR]

Constant Example

Using Programming Languages other than VBA

Sub Example_Constant()
    ' This example creates an attribute definition in model space.
    ' It then queries the attribute to see if it is a constant attribute.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "New Tag"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Query the attribute
    GoSub QUERYSTATUS

    ' Change the attribute
    attributeObj.constant = Not attributeObj.constant
    GoSub QUERYSTATUS

    Exit Sub

QUERYSTATUS:
    If attributeObj.constant Then
        MsgBox "The attribute is a constant attribute."
    Else
        MsgBox "The attribute is not a constant attribute."
    End If
    Return
End Sub


ConstantWidth Example [ActiveX and VBA Reference: AAR]

ConstantWidth Example

Using Programming Languages other than VBA

Sub Example_ConstantWidth()
     ' This example creates a lightweight polyline in model space and
     ' uses the ConstantWidth property to determine if the polyline comprises
     ' equal width segments.  If the segments are not equal,
     ' use the ConstantWidth property to set all the segments to the same
     ' width.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 9) As Double
    Dim msg As String, CWidth As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4

    ' Create a lightweight Polyline object in model space
    '
    ' * Note: Return the new PolyLine object into a Module
    ' level variable, which allows events associated
    ' with that particular object to be intercepted.
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ThisDrawing.Application.ZoomAll

    ' Display segment information before altering the width of segment 1
    GoSub DISPLAYSEGMENTS

    ' Set the first segment width
    plineObj.SetWidth 1, 0.1, 0.3
    ThisDrawing.Regen acAllViewports

    ' Display segment information after altering the width of segment 1
    GoSub DISPLAYSEGMENTS

    ' Make all segments uniform in width
    plineObj.ConstantWidth = 0.1
    ThisDrawing.Regen acAllViewports

    ' Display segment information after making the segments uniform
    GoSub DISPLAYSEGMENTS

    Exit Sub

DISPLAYSEGMENTS:
    On Error Resume Next

    ' Check to see if the segment widths are uniform
    CWidth = plineObj.ConstantWidth

    ' If ConstantWidth returns an error, the
    ' segments are not all the same width
    If Err.Description = "Invalid input" Then
        msg = " are not equal."
    Else
        msg = " are all equal."
    End If
    On Error GoTo 0

    MsgBox "The segments of the new polyline" & msg

    Return
End Sub


ContentBlock Example [ActiveX and VBA Reference: AAR]

ContentBlock Example

Using Programming Languages other than VBA

Sub Example_AddMLeader()

    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double
    Dim name As String
    Dim blType As AcPredefBlockType
    Dim i As Long

    name = "TestName"
    blType = acBlockHexagon

    ' Define the mleader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0

    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.ContentBlockName = "test name"
    oML.ContentBlockType = acBlockHexagon

    ZoomAll

End Sub


ContentChange Example [ActiveX and VBA Reference: AAR]

ContentChange Example

Using Programming Languages other than VBA

Sub Example_ContentChange()
     ' This example adds a table in model space
    ' and manipulates its contents

    ' Note: One content is created for each cell by default;
    ' this function need to be called only to create additional contents.

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As IAcadTable2
    Dim sID As Long
    Dim newSID As Long
    Dim row As Long
    Dim col As Long

    ' Creates arbitrary cell points to check
    row = 2
    col = 2

    ' Creates the table with an arbitrary number of cells
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

    If MyTable.IsEmpty(row, col) Then
        If MyTable.IsContentEditable(row, col) Then
            MsgBox "There is no content in the cell, but it is editable"
        End If
    End If

   ' Create some content in an arbitrary cell
    sID = MyTable.CreateContent(row, col, 8)

    MsgBox "The content ID is " & sID

    'Move the content to another index
    Call MyTable.MoveContent(row, col, sID, 4)

    'Check that the content has been deleted
    Call MyTable.DeleteContent(row, col)

    If MyTable.IsEmpty(row, col) Then
        If MyTable.IsContentEditable(row, col) Then
            MsgBox "There is no content in the cell, but it is editable"
        End If
    End If

    ZoomExtents

End Sub


ContinuousPlotLog Example [ActiveX and VBA Reference: AAR]

ContinuousPlotLog Example

Using Programming Languages other than VBA

Sub Example_ContinuousPlotLog()
' This example changes the AutoCAD Options dialog box
' to specify one log per plot.

    Dim MyPreference As IAcadPreferencesOutput2
    Set MyPreference = AcadApplication.Preferences.Output
    MyPreference.ContinuousPlotLog = False

End Sub


ContourlinesPerSurface Example [ActiveX and VBA Reference: AAR]

ContourLinesPerSurface Example

Using Programming Languages other than VBA

Sub Example_ContourLinesPerSurface()
    ' This example returns the current setting of
    ' ContourLinesPerSurface. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currContourLinesPerSurface As Integer
    Dim newContourLinesPerSurface As Integer

    ' Retrieve the current ContourLinesPerSurface value
    currContourLinesPerSurface = ThisDrawing.preferences.ContourLinesPerSurface
    MsgBox "The current value for ContourLinesPerSurface is " & currContourLinesPerSurface, vbInformation, "ContourLinesPerSurface Example"

    ' Change the value for ContourLinesPerSurface
    newContourLinesPerSurface = 2001
    ThisDrawing.preferences.ContourLinesPerSurface = newContourLinesPerSurface
    MsgBox "The new value for ContourLinesPerSurface is " & newContourLinesPerSurface, vbInformation, "ContourLinesPerSurface Example"

    ' Reset ContourLinesPerSurface to its original value
    ThisDrawing.preferences.ContourLinesPerSurface = currContourLinesPerSurface
    MsgBox "The ContourLinesPerSurface value is reset to " & currContourLinesPerSurface, vbInformation, "ContourLinesPerSurface Example"
End Sub


Contrast Example [ActiveX and VBA Reference: AAR]

Contrast Example

Using Programming Languages other than VBA

Sub Example_Contrast()
    ' This example inserts a raster image and finds the current
    ' Contrast of the image. It then changes the Contrast
    ' of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have the image, or if it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double
    Dim rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "File error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current Contrast
    ThisDrawing.Regen True
    MsgBox "The Contrast is currently set to: " & raster.Contrast, vbInformation

    ' Change the Contrast to 5
    raster.Contrast = 5
    ThisDrawing.Regen True
    MsgBox "The Contrast is now set to: " & raster.Contrast, vbInformation
End Sub


ControlPoints Example [ActiveX and VBA Reference: AAR]

ControlPoints Example

Using Programming Languages other than VBA

Sub Example_ControlPoints()
   ' This example creates a Spline object in model space, reads the control points
   ' of the Spline and then modifies the control points of the Spline.

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim UserMessage As String
    Dim ControlPoints As Variant
    Dim iCount As Long, iPoint As Integer

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0
    fitPoints(3) = 5:   fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ThisDrawing.Application.ZoomAll

    ' Display control points for this Spline
    GoSub DISPLAYPOINTS

    ' Modify control points for this Spline
    ControlPoints(0) = 3
    splineObj.ControlPoints = ControlPoints
    ThisDrawing.Application.ZoomAll

    ' Display new control points for this Spline
    GoSub DISPLAYPOINTS

    Exit Sub

DISPLAYPOINTS:
    ControlPoints = splineObj.ControlPoints

    ' Display in groups of three
    UserMessage = ""
    iPoint = 0
    For iCount = 0 To UBound(ControlPoints) Step 3
        iPoint = iPoint + 1
        UserMessage = UserMessage & iPoint & ")" & vbTab
        UserMessage = UserMessage & ControlPoints(iCount)
        UserMessage = UserMessage & ", " & ControlPoints(iCount + 1)
        UserMessage = UserMessage & ", " & ControlPoints(iCount + 2)
        UserMessage = UserMessage & vbCrLf
    Next

    MsgBox "The " & splineObj.NumberOfControlPoints & " Spline control points are: " & vbCrLf & vbCrLf & UserMessage

    Return
End Sub


Coordinate Example [ActiveX and VBA Reference: AAR]

Coordinate Example

Using Programming Languages other than VBA

Sub Example_Coordinate()
    ' This example creates a polyline in model space and
    ' queries and changes the coordinate in the first index position.

    Dim plineObj As AcadPolyline
    Dim points(0 To 14) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ZoomAll

    ' Find the coordinate in the first index position
    Dim coord As Variant
    coord = plineObj.Coordinate(0)
    MsgBox "The coordinate in the first index position of the polyline is: " & coord(0) & ", " _
        & coord(1) & ", " & coord(2)

    ' Change the coordinate
    coord(0) = coord(0) + 1
    plineObj.Coordinate(0) = coord
    plineObj.Update

    ' Query the new coordinate
    coord = plineObj.Coordinate(0)
    MsgBox "The coordinate in the first index position of the polyline is now: " & coord(0) & ", " _
        & coord(1) & ", " & coord(2)

End Sub


Coordinates Example [ActiveX and VBA Reference: AAR]

Coordinates Example

Using Programming Languages other than VBA

Sub Example_Coordinates()
    ' This example creates a polyline. It then uses the Coordinates
    ' property to return all the coordinates  in the polyline. It then
    ' resets one of the vertices using the Coordinates property.

    Dim plineObj As AcadPolyline

    ' Create Polyline
    Dim points(5) As Double
    points(0) = 3: points(1) = 7: points(2) = 0
    points(3) = 9: points(4) = 2: points(5) = 0
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ThisDrawing.Regen True

    ' Return all the coordinates of the polyline
    Dim retCoord As Variant
    retCoord = plineObj.Coordinates

    ' Display current coordinates for the second vertex
    MsgBox "The current coordinates of the second vertex are: " & points(3) & ", " & points(4) & ", " & points(5), vbInformation, "Coordinates Example"

    ' Modify the coordinate of the second vertex to (5,5,0). Note that in
    ' case of a lightweight Polyline, indices will be different because the points are 2D only.
    points(3) = 5
    points(4) = 5
    points(5) = 0
    plineObj.Coordinates = points

    ' Update display
    ThisDrawing.Regen True

    MsgBox "The new coordinates have been set to " & points(3) & ", " & points(4) & ", " & points(5), vbInformation, "Coordinates Example"
End Sub


Copy Example [ActiveX and VBA Reference: AAR]

Copy Example

Using Programming Languages other than VBA

Sub Example_Copy()
    ' This example creates a circle and then copies
    ' that circle. The new circle is then moved.

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 2#: center(1) = 2#: center(2) = 0#
    radius = 0.5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll
    MsgBox "Copy the circle.", , "Copy Example"

    ' Copy the circle
    Dim copyCircleObj As AcadCircle
    Set copyCircleObj = circleObj.Copy()

    ' Define the points that make up the move vector
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 2: point2(1) = 0: point2(2) = 0

    MsgBox "Move the copied circle 2 units in the X direction.", , "Copy Example"

    ' Move the circle and color it
    copyCircleObj.Move point1, point2

    ZoomAll
    MsgBox "Move completed.", , "Copy Example"

End Sub


CopyFrom Example [ActiveX and VBA Reference: AAR]

CopyFrom Example

Using Programming Languages other than VBA

Sub Example_CopyFrom()
    ' This example will create two new plot configurations, NewPC1 and NewPC2, and will use
    ' the CopyFrom method to duplicate the settings in the first plot configuration
    ' to the second plot configuration.

    Dim PlotConfigurations As AcadPlotConfigurations
    Dim PlotConfiguration As AcadPlotConfiguration
    Dim NewPC1 As AcadPlotConfiguration, NewPC2 As AcadPlotConfiguration

    ' Get PlotConfigurations collection from document object
    Set PlotConfigurations = ThisDrawing.PlotConfigurations

    ' Add NewPC1 and customize some of the properties
    Set NewPC1 = PlotConfigurations.Add("NEW_CONFIGURATION1")
        NewPC1.PlotRotation = ac270degrees
        NewPC1.PlotHidden = True
        NewPC1.PaperUnits = acMillimeters

    ' Add NewPC2 and leave default values intact
    Set NewPC2 = PlotConfigurations.Add("NEW_CONFIGURATION2")

    ' Show NewPC2 settings before we copy information from NewPC1
    GoSub VIEWPC2SETTINGS

    ' Copy setting information from NewPC1 to NewPC2
    NewPC2.CopyFrom NewPC1

    ' Show NewPC2 settings after we copy information from NewPC1
    GoSub VIEWPC2SETTINGS

    Exit Sub

VIEWPC2SETTINGS:
    MsgBox "The settings for NEW_CONFIGURATION2 are: " & vbCrLf & _
            "Plot Rotation: " & NewPC2.PlotRotation & vbCrLf & _
            "Plot Hidden: " & NewPC2.PlotHidden & vbCrLf & _
            "Paper Units: " & NewPC2.PaperUnits

    Return
End Sub


CopyObjects Example [ActiveX and VBA Reference: AAR]

CopyObjects Example

Using Programming Languages other than VBA

Sub Example_CopyObjects()
    ' This example creates a Circle object and uses the CopyObjects
    ' method to make a copy of the new Circle.

    Dim DOC1 As AcadDocument
    Dim circleObj1 As AcadCircle, circleObj2 As AcadCircle
    Dim circleObj1Copy As AcadCircle, circleObj2Copy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius2 As Double
    Dim radius1Copy As Double, radius2Copy As Double
    Dim objCollection(0 To 1) As Object
    Dim retObjects As Variant

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius2 = 7#
    radius1Copy = 1#: radius2Copy = 2#

    ' Create a new drawing
    Set DOC1 = Documents.Add

    ' Add two circles to the drawing
    Set circleObj1 = DOC1.ModelSpace.AddCircle(centerPoint, radius1)
    Set circleObj2 = DOC1.ModelSpace.AddCircle(centerPoint, radius2)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj1
    Set objCollection(1) = circleObj2

    ' Copy object and get back a collection of the new objects (copies)
    retObjects = DOC1.CopyObjects(objCollection)

    ' Get newly created object and apply new properties to the copies
    Set circleObj1Copy = retObjects(0)
    Set circleObj2Copy = retObjects(1)

    circleObj1Copy.radius = radius1Copy
    circleObj2Copy.radius = radius2Copy

    ThisDrawing.Application.ZoomAll

    MsgBox "Circles copied."
End Sub


CopyProfile Example [ActiveX and VBA Reference: AAR]

CopyProfile Example

Using Programming Languages other than VBA

Sub Example_CopyProfile()
    ' This example copies an existing profile.
    ' You can see the new profile under Options/Profiles
    '
    ' *Note: This example relies on the default profile "<<Unnamed Profile>>".
    ' If this profile has already been renamed or removed, be sure to change the
    ' name of the SourceProfile to one that currently exists.

    Dim ACADPref As AcadPreferencesProfiles
    Dim SourceProfile As String, DestinationProfile As String

    ' Use the PreferencesProfiles object
    Set ACADPref = ThisDrawing.Application.preferences.Profiles

    ' Copy the default profile
    On Error GoTo ERRORTRAP

    SourceProfile = "<<Unnamed Profile>>"
    DestinationProfile = "NEW_PROFILE"

    ACADPref.CopyProfile SourceProfile, DestinationProfile

    MsgBox "We have just copied the existing profile " & SourceProfile & " to " & DestinationProfile

    Exit Sub

ERRORTRAP:
    If Err.Description <> "" Then
        MsgBox "The default profile '" & SourceProfile & "' cannot be found, please use a different source profile."
    End If
End Sub


Count Example [ActiveX and VBA Reference: AAR]

Count Example

Using Programming Languages other than VBA

Sub Example_Count()
    ' Use count to retrieve the number of objects in a collection
    ' You might use this value in a loop structure to iterate through the collection

    MsgBox "There are " & ThisDrawing.Layers.count & " layer(s) in the drawing."
    MsgBox "There are " & ThisDrawing.ModelSpace.count & " object(s) in ModelSpace."

    Dim objCount As Integer
    Dim I As Integer
    objCount = ThisDrawing.ModelSpace.count

    Dim mspaceObj As AcadObject
    For I = 0 To objCount - 1
     Set mspaceObj = ThisDrawing.ModelSpace.Item(I)
    MsgBox "The objects in ModelSpace include: " & mspaceObj.ObjectName, vbInformation, "Count Example"
    Next

End Sub


CreateBackup Example [ActiveX and VBA Reference: AAR]

CreateBackup Example

Using Programming Languages other than VBA

Sub Example_CreateBackup()
    ' This example returns the current setting of
    ' CreateBackup. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currCreateBackup As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current CreateBackup value
    currCreateBackup = preferences.OpenSave.CreateBackup
    MsgBox "The current value for CreateBackup is " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"

    ' Change the value for CreateBackup
    preferences.OpenSave.CreateBackup = Not (currCreateBackup)
    MsgBox "The new value for CreateBackup is " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"

    ' Reset CreateBackup to its original value
    preferences.OpenSave.CreateBackup = currCreateBackup
    MsgBox "The CreateBackup value is reset to " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"
End Sub


CreateEntry Example [ActiveX and VBA Reference: AAR]

CreateEntry Example

Using Programming Languages other than VBA

Sub Example_CreateEntry()
    'This example adds an entry to the File Dependency List, returns its Index, updates
    'the entry, and then removes the entry.

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim FDLIndex As Long
    FDLIndex = objFDLCol.CreateEntry("acad:xref", "c:\referenced.dwg", True, True)
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim IndexNumber As Long
    IndexNumber = objFDLCol.IndexOf("acad:xref", "c:\referenced.dwg")
    Dim IndexString As String
    IndexString = CStr(IndexNumber)
    MsgBox ("The index of the new entry is " & IndexString & ".")

    objFDLCol.UpdateEntry (FDLIndex)

    objFDLCol.RemoveEntry FDLIndex, True
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")
 End Sub


CreateTypedArray Example [ActiveX and VBA Reference: AAR]

CreateTypedArray Example

Using Programming Languages other than VBA

Sub Example_CreateTypedArray()
    ' This example creates a spline from variant arrays created
    ' from doubles using the CreateTypedArray method.
    ' Note that this method must be late bound. This is done
    ' by declaring the utility object (utilObj) as Object,
    ' not as AcadUtility.

    Dim splineObj As AcadSpline

    ' Even though these are arrays, they are declared as variants
    Dim startTan As Variant
    Dim endTan As Variant
    Dim fitPoints As Variant

    Dim utilObj As Object   ' Late bound object
    Set utilObj = ThisDrawing.Utility

    ' Define the spline.
    utilObj.CreateTypedArray startTan, vbDouble, 0.5, 0.5, 0
    utilObj.CreateTypedArray endTan, vbDouble, 0.5, 0.5, 0
    utilObj.CreateTypedArray fitPoints, vbDouble, 0, 0, 0, 5, 5, 0, 10, 0, 0

    ' Create the spline
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

End Sub


CursorSize Example [ActiveX and VBA Reference: AAR]

CursorSize Example

Using Programming Languages other than VBA

Sub Example_CursorSize()
    ' This example returns the current setting of
    ' CursorSize. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currCursorSize As Integer
    Dim newCursorSize As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current CursorSize value
    currCursorSize = preferences.DISPLAY.CursorSize
    MsgBox "The current value for CursorSize is " & currCursorSize, vbInformation, "CursorSize Example"

    ' Change the value for CursorSize
    newCursorSize = 10
    preferences.DISPLAY.CursorSize = newCursorSize
    MsgBox "The new value for CursorSize is " & newCursorSize, vbInformation, "CursorSize Example"

    ' Reset CursorSize to its original value
    preferences.DISPLAY.CursorSize = currCursorSize
    MsgBox "The CursorSize value is reset to " & currCursorSize, vbInformation, "CursorSize Example"
End Sub


CustomDictionary Example [ActiveX and VBA Reference: AAR]

CustomDictionary Example

Using Programming Languages other than VBA

Sub Example_CustomDictionary()
    ' This example returns the current setting of
    ' CustomDictionary. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currCustomDictionary As String
    Dim newCustomDictionary As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current CustomDictionary value
    currCustomDictionary = preferences.Files.CustomDictionary
    MsgBox "The current value for CustomDictionary is " & currCustomDictionary, vbInformation, "CustomDictionary Example"

    ' Change the value for CustomDictionary
    newCustomDictionary = "TestCustomDictionary.cus"
    preferences.Files.CustomDictionary = newCustomDictionary
    MsgBox "The new value for CustomDictionary is " & newCustomDictionary, vbInformation, "CustomDictionary Example"

    ' Reset CustomDictionary to its original value
    preferences.Files.CustomDictionary = currCustomDictionary
    MsgBox "The CustomDictionary value is reset to " & currCustomDictionary, vbInformation, "CustomDictionary Example"
End Sub


CustomScale Example [ActiveX and VBA Reference: AAR]

CustomScale Example

Using Programming Languages other than VBA

Sub Example_CustomScale()
   ' This example adds a line in paper space, creates a new paper space viewport, and cycles through some common paper space custom scale sizes
   ' for the new paper space viewport

    Dim lineObj As AcadLine
    Dim PViewPort As AcadPViewport
    Dim startPoint(0 To 2) As Double, endPoint(0 To 2)  As Double
    Dim center(0 To 2) As Double
    Dim width As Double, height As Double

    ' Define the start and end points for the line
    startPoint(0) = 1: startPoint(1) = 1: startPoint(2) = 0
    endPoint(0) = 5: endPoint(1) = 5: endPoint(2) = 0

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40: height = 40

    ' Create the line in paper space
    Set lineObj = ThisDrawing.PaperSpace.AddLine(startPoint, endPoint)

    ' Create the paper space viewport
    Set PViewPort = ThisDrawing.PaperSpace.AddPViewport(center, width, height)

    ' Set the paper space viewport scale to custom
    PViewPort.StandardScale = acVpCustomScale

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Read and display the existing paper space viewport scale setting
    MsgBox "The scale of the new PViewport is: " & PViewPort.CustomScale

    ' Change the custom scale setting to 1:10 scale
    PViewPort.CustomScale = 0.1

    ' Read and display the new paper space viewport scale setting
    MsgBox "The scale of the new PViewport has been changed to: " & PViewPort.CustomScale

End Sub


Database Example [ActiveX and VBA Reference: AAR]

Database Example

Using Programming Languages other than VBA

Sub Example_Database()
    ' This example references the Database object obtained from model space.
    ' Information from the Database object is then displayed

    Dim Database As AcadDatabase

    ' Attach to Database object
    Set Database = ThisDrawing.ModelSpace.Database
    MsgBox "We now have access to the properties and methods of the Database object!"

    ' Retrieve the number of Blocks in this database
    MsgBox "The number of Blocks in this database is: " & Database.Blocks.count

    ' Release object
    Set Database = Nothing
    MsgBox "The Database object has been released!"
End Sub


Deactivate Example [: AAR]

Deactivate Example

Using Programming Languages other than VBA

Private Sub AcadDocument_Deactivate()
    ' This example intercepts a drawing DeActivate event.
    '
    ' This event is triggered when a drawing window looses focus.
    '
    ' To trigger this example event: Open two drawings and switch from
    ' one drawing window to another

    MsgBox "You have just deactivated a drawing!"
End Sub


DecimalSeparator Example [ActiveX and VBA Reference: AAR]

DecimalSeparator Example

Using Programming Languages other than VBA

Sub Example_DecimalSeparator()
    ' This example creates a Dim3PointAngular object in model space
    ' and allows the user to change the decimal separator appearance
    ' using the DecimalSeparator property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim oldSeparator As String, newSeparator As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)

    ' Set precision so that degrees are visible
    DimPointAngularObj.TextPrecision = acDimPrecisionFour

    ThisDrawing.Application.ZoomAll

    ' Read and display current decimal separator
    MsgBox "The decimal separator for this object is currently set to: [" & DimPointAngularObj.DecimalSeparator & "]"

    ' Alter the decimal separator property for this object
    oldSeparator = DimPointAngularObj.DecimalSeparator
    newSeparator = InputBox("Enter a new decimal separator", "Change Decimal Separator", oldSeparator)

    If newSeparator = "" Then
        Exit Sub
    Else
        ' Set new decimal separator, making sure to use only one character
        DimPointAngularObj.DecimalSeparator = Left(newSeparator, 1)
    End If

    ThisDrawing.Regen acAllViewports

    ' Read and display current decimal separator
    MsgBox "The decimal separator for this object is now set to: [" & DimPointAngularObj.DecimalSeparator & "]"
End Sub


DefaultInternetURL Example [ActiveX and VBA Reference: AAR]

DefaultInternetURL Example

Using Programming Languages other than VBA

Sub Example_DefaultInternetURL()
    ' This example returns the current setting of
    ' DefaultInternetURL. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDefaultInternetURL As String
    Dim newDefaultInternetURL As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DefaultInternetURL value
    currDefaultInternetURL = preferences.Files.DefaultInternetURL
    MsgBox "The current value for DefaultInternetURL is " & currDefaultInternetURL, vbInformation, "DefaultInternetURL Example"

    ' Change the value for DefaultInternetURL
    newDefaultInternetURL = "TestDefaultInternetURL"
    preferences.Files.DefaultInternetURL = newDefaultInternetURL
    MsgBox "The new value for DefaultInternetURL is " & newDefaultInternetURL, vbInformation, "DefaultInternetURL Example"

    ' Reset DefaultInternetURL to its original value
    preferences.Files.DefaultInternetURL = currDefaultInternetURL
    MsgBox "The DefaultInternetURL value is reset to " & currDefaultInternetURL, vbInformation, "DefaultInternetURL Example"
End Sub


DefaultOutputDevice Example [ActiveX and VBA Reference: AAR]

DefaultOutputDevice Example

Using Programming Languages other than VBA

Sub Example_DefaultOutputDevice()
    ' This example reads and modifies the preference value that controls
    ' the default output device for new layouts and model space.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Variant, newValue As Variant

    ' Get the output preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.DefaultOutputDevice
    MsgBox "The DefaultOutputDevice preference is: " & originalValue

    ' Modify the DefaultOutputDevice preference by changing it to "LOCALOUTPUT"
    ACADPref.DefaultOutputDevice = "LOCALOUTPUT"
    newValue = ACADPref.DefaultOutputDevice
    MsgBox "The DefaultOutputDevice preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DefaultOutputDevice = originalValue
    MsgBox "The DefaultOutputDevice preference was reset back to: " & originalValue
End Sub


DefaultPlotStyleForLayer Example [ActiveX and VBA Reference: AAR]

DefaultPlotStyleForLayer Example

Using Programming Languages other than VBA

Sub Example_DefaultPlotStyleForLayer()
    ' This example reads and modifies the preference value that controls
    ' the default plot style assigned to layers.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Variant, newValue As Variant

    ' Get the output preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.DefaultPlotStyleForLayer
    MsgBox "The DefaultPlotStyleForLayer preference is: " & originalValue

    ' Toggle and display the DefaultPlotStyleForLayer preference
    If ACADPref.DefaultPlotStyleForLayer = "ByBlock" Then
        ACADPref.DefaultPlotStyleForLayer = "Normal"
    Else
        ACADPref.DefaultPlotStyleForLayer = "ByBlock"
    End If

    newValue = ACADPref.DefaultPlotStyleForLayer
    MsgBox "The DefaultPlotStyleForLayer preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DefaultPlotStyleForLayer = originalValue
    MsgBox "The DefaultPlotStyleForLayer preference was reset back to: " & originalValue
End Sub


DefaultPlotStyleForObjects Example [ActiveX and VBA Reference: AAR]

DefaultPlotStyleForObjects Example

Using Programming Languages other than VBA

Sub Example_DefaultPlotStyleForObjects()
    ' This example reads and modifies the preference value that controls
    ' the default plot style name for newly created objects.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Variant, newValue As Variant

    ' Get the output preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.DefaultPlotStyleForObjects
    MsgBox "The DefaultPlotStyleForObjects preference is: " & originalValue

    ' Toggle and display the DefaultPlotStyleForObjects preference
    If ACADPref.DefaultPlotStyleForObjects = "ByBlock" Then
        ACADPref.DefaultPlotStyleForObjects = "Normal"
    Else
        ACADPref.DefaultPlotStyleForObjects = "ByBlock"
    End If

    newValue = ACADPref.DefaultPlotStyleForObjects
    MsgBox "The DefaultPlotStyleForObjects preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DefaultPlotStyleForObjects = originalValue
    MsgBox "The DefaultPlotStyleForObjects preference was reset back to: " & originalValue
End Sub


DefaultPlotStyleTable Example [ActiveX and VBA Reference: AAR]

DefaultPlotStyleTable Example

Using Programming Languages other than VBA

Sub Example_DefaultPlotStyleTable()
    ' This example reads and modifies the preference value that
    ' specifies the default plot style table to attach to new drawings.
    '
    ' Note: You may want to change the path of the new plot style table below.

    Dim ACADPref As AcadPreferencesOutput
    Dim CurrentFile As String

    Const NewFile = "c:\monochrome.ctb"

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the current plot style table path
    CurrentFile = ACADPref.DefaultPlotStyleTable
    If CurrentFile = "" Then
        MsgBox "There is no current plot style table being used", vbInformation
    Else
        MsgBox "The current plot style table is: " & CurrentFile
    End If

    ' Use a new plot style table
    ACADPref.DefaultPlotStyleTable = NewFile

    ' Read and display the new plot style table path
    CurrentFile = ACADPref.DefaultPlotStyleTable
    MsgBox "The new plot style table is: " & CurrentFile, vbInformation

End Sub


DefaultPlotToFilePath Example [ActiveX and VBA Reference: AAR]

DefaultPlotToFilePath Example

Using Programming Languages other than VBA

Sub Example_DefaultPlotToFilePath()
' Note: Change the path to a valid folder on your system.

    Dim MyPreference As IAcadPreferencesOutput2
    Set MyPreference = AcadApplication.Preferences.Output
    MyPreference.DefaultPlotToFilePath = "C:\Plots"

End Sub


Degree Example [ActiveX and VBA Reference: AAR]

Degree Example

Using Programming Languages other than VBA

Sub Example_Degree()
    ' This example creates a spline and returns the degree
    ' of the spline's polynomial representation.

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ThisDrawing.Regen True
    MsgBox "The degree of this Spline's polynomial representation is: " & splineObj.Degree, vbInformation
End Sub


Delete Example [ActiveX and VBA Reference: AAR]

Delete Example

Using Programming Languages other than VBA

Sub Example_Delete()
    ' This example creates a Layer named "TEST".
    ' It then iterates the Layers collection and displays
    ' the names of the available layers.
    ' It then deletes the layer "TEST", and again iterates
    ' the layers collection and displays the names of
    ' available layers.

    Dim layerObj As AcadLayer

    ' Create the new layer
    Set layerObj = ThisDrawing.Layers.Add("TEST")

    ' Display the names of the layers in the drawing
    GoSub DISPLAYLAYERS

    ' Delete the layer "TEST"
    layerObj.Delete

    ' Display the names of the layers remaining in the drawing
    GoSub DISPLAYLAYERS

    Exit Sub

DISPLAYLAYERS:
    Dim entry As AcadLayer
    Dim layerNames As String
    layerNames = ""
    For Each entry In ThisDrawing.Layers
       layerNames = layerNames & entry.name & ", "
    Next
    MsgBox "The drawing consists of the following layers:" & vbCr & layerNames, , "Delete Example"
    Return

End Sub


DeleteConfiguration Example [ActiveX and VBA Reference: AAR]

DeleteConfiguration Example

Using Programming Languages other than VBA

Sub Example_DeleteConfiguration()
    ' This example creates a new viewport and splits
    ' the viewport into 4 windows.
    ' It then deletes the viewport configuration
    Dim oldViewport As AcadViewport
    Set oldViewport = ThisDrawing.ActiveViewport

    ' Create a new viewport and make it active
    Dim newViewport As AcadViewport
    Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT")
    ThisDrawing.ActiveViewport = newViewport

    ' Split the viewport in 4 windows
    newViewport.Split acViewport4

    ' Make the newly split viewport active
    ThisDrawing.ActiveViewport = newViewport
    MsgBox "The viewport configuration split into 4 windows."

    ' Delete the viewport configuration
    ThisDrawing.ActiveViewport = oldViewport
    ThisDrawing.Viewports.DeleteConfiguration ("TESTVIEWPORT")
    ThisDrawing.Regen acAllViewports
    MsgBox "The viewport configuration has been deleted."
End Sub


DeleteFitPoint Example [ActiveX and VBA Reference: AAR]

DeleteFitPoint Example

Using Programming Languages other than VBA

Sub Example_DeleteFitPoint()
    ' This example creates a spline object in model space.
    ' It then deletes a fit point from the spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll
    MsgBox "Delete the first fit point", , "DeleteFitPoint Example"

    ' Delete the first fit point in the spline
    splineObj.DeleteFitPoint 0
    ThisDrawing.Regen True
    MsgBox "A fit point has been deleted at Index:0", , "DeleteFitPoint Example"

End Sub


DeleteProfile Example [ActiveX and VBA Reference: AAR]

DeleteProfile Example

Using Programming Languages other than VBA

Sub Example_DeleteProfile()
    ' This example deletes a profile.

    Dim preferences As AcadPreferences
    Dim strProfileToDelete As String

    Set preferences = ThisDrawing.Application.preferences

    ' Specify the profile to delete.
    strProfileToDelete = "TestProfile"

    ' Delete the profile
    ' The call will fail if "TestProfile" does not exist or
    ' if "TestProfile" is the current profile.
    On Error GoTo Error
    preferences.Profiles.DeleteProfile strProfileToDelete
    Exit Sub

Error:
        MsgBox "DeleteProfile of " & strProfileToDelete & " failed. " & Err.Description, , "DeleteProfile Example"

End Sub


Delta Example [ActiveX and VBA Reference: AAR]

Delta Example

Using Programming Languages other than VBA

Sub Example_Delta()
   ' This example adds a line in model space and returns the delta of the new line

    Dim lineObj As AcadLine
    Dim lineDelta As Variant
    Dim startPoint(0 To 2) As Double, endPoint(0 To 2) As Double

    ' Define the start and end points for the line
    startPoint(0) = 1: startPoint(1) = 1: startPoint(2) = 0
    endPoint(0) = 5: endPoint(1) = 5: endPoint(2) = 0

    ' Create the line in model space
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ThisDrawing.Application.ZoomAll

    ' Display the delta of the new line
    lineDelta = lineObj.Delta
    MsgBox "The delta of the new Line is: " & vbCrLf & _
                                            "DeltaX:" & lineDelta(0) & vbCrLf & _
                                            "DeltaY:" & lineDelta(1) & vbCrLf & _
                                            "DeltaZ:" & lineDelta(2)
End Sub


DemandLoadARXApp Example [ActiveX and VBA Reference: AAR]

DemandLoadARXApp Example

Using Programming Languages other than VBA

Sub Example_DemandLoadARXApp()
    ' This example returns the current setting of
    ' DemandLoadARXApp. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDemandLoadARXApp As Integer
    Dim constant As String
    Dim newConstant As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DemandLoadARXApp value
    currDemandLoadARXApp = preferences.OpenSave.DemandLoadARXApp
    MsgBox "The current value for DemandLoadARXApp is " & currDemandLoadARXApp, vbInformation, "DemandLoadARXApp Example"

    ' Change the value for DemandLoadARXApp
    newConstant = acDemandLoadCmdInvoke
    preferences.OpenSave.DemandLoadARXApp = acDemandLoadCmdInvoke
    MsgBox "The new value for DemandLoadARXApp is " & newConstant, vbInformation, "DemandLoadARXApp Example"

    ' Reset DemandLoadARXApp to its original value
    preferences.OpenSave.DemandLoadARXApp = currDemandLoadARXApp
    MsgBox "The DemandLoadARXApp value is reset to " & currDemandLoadARXApp, vbInformation, "DemandLoadARXApp Example"
End Sub


Description Example [ActiveX and VBA Reference: AAR]

Description Example

Using Programming Languages other than VBA

Sub Example_Description()
    ' This example returns the description of the active linetype.
    ' It then changes the description of the active linetype.

    Dim currDescription As String

    ' This example modifies the description of a linetype
    currDescription = ThisDrawing.ActiveLinetype.Description
    MsgBox "The description of the active LineType is: " & currDescription, vbInformation, "Description Example"

    ' Change the description of the active linetype
    ThisDrawing.ActiveLinetype.Description = "My favorite LineType"
    MsgBox "The new description of the active LineType is: " & ThisDrawing.ActiveLinetype.Description, vbInformation, "Description Example"

    ' Reset the description of the active linetype
    ThisDrawing.ActiveLinetype.Description = currDescription
    MsgBox "The description of the active LineType is reset to: " & ThisDrawing.ActiveLinetype.Description, vbInformation, "Description Example"
End Sub


Detach Example [ActiveX and VBA Reference: AAR]

Detach Example

Using Programming Languages other than VBA

Sub Example_Detach()
    On Error GoTo ERRORHANDLER

    ' Define external reference to be inserted
    Dim xrefHome As AcadBlock
    Dim xrefInserted As AcadExternalReference
    Dim insertionPnt(0 To 2) As Double
    Dim PathName As String
    insertionPnt(0) = 1
    insertionPnt(1) = 1
    insertionPnt(2) = 0
    PathName = "c:/AutoCAD/sample/City map.dwg"

    ' Add the external reference
    Set xrefInserted = ThisDrawing.ModelSpace. _
            AttachExternalReference(PathName, "XREF_IMAGE", _
            insertionPnt, 1, 1, 1, 0, False)
    ZoomAll
    MsgBox "The external reference is attached."

    ' Detach the external reference definition
    Dim name As String
    name = xrefInserted.name
    ThisDrawing.Blocks.Item(name).Detach
    MsgBox "The external reference is detached."
    Exit Sub

ERRORHANDLER:
    MsgBox Err.Description
End Sub


Diameter Example [ActiveX and VBA Reference: AAR]

Diameter Example

Using Programming Languages other than VBA

Sub Example_Diameter()
    ' This example creates a Circle object in model space and
    ' returns the diameter of the new Circle

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the new Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    MsgBox "The diameter of the new Circle is: " & circleObj.Diameter
End Sub


Dictionaries Example [ActiveX and VBA Reference: AAR]

Dictionaries Example

Using Programming Languages other than VBA

Sub Example_Dictionaries()
    ' This example finds the current dictionary collection and
    ' adds a new dictionary to that collection.

    Dim dict As AcadDictionary
    Set dict = ThisDrawing.Dictionaries.Add("TEST")
    MsgBox "A new dictionary called " & dict.name & " has been added to the dictionaries collection.", vbInformation, "Dictionaries Example"
End Sub


DimensionLineColor Example [ActiveX and VBA Reference: AAR]

DimensionLineColor Example

Using Programming Languages other than VBA

Sub Example_DimensionLineColor()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the dimension line color to red using the DimensionLineColor property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension line color
    MsgBox "The dimension line color for this object is currently set to: " & DimPointAngularObj.DimensionLineColor

    ' Change the dimension line color
    DimPointAngularObj.DimensionLineColor = acRed
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension line color
    MsgBox "The dimension line color for this object is now set to: " & DimPointAngularObj.DimensionLineColor & " (Red)"

End Sub


DimensionLineExtend Example [ActiveX and VBA Reference: AAR]

DimensionLineExtend Example

Using Programming Languages other than VBA

Sub Example_DimensionLineExtend()
   ' This example creates an aligned dimension in model space and
   ' uses DimensionLineExtend to specify the distance the dimension
   ' line extends beyond the extension line when oblique strokes are
   ' drawn instead of arrowheads

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 10.123: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    dimObj.Arrowhead1Type = acArrowOblique
    dimObj.Arrowhead2Type = acArrowOblique

    ThisDrawing.Application.ZoomAll

    MsgBox "A new Dimension has been created.  Press any key to extend the dimension lines."

    ' Round the distance of the alternate dimension to 0.50 of a unit
    dimObj.DimensionLineExtend = 2
    ThisDrawing.Regen acAllViewports

    MsgBox "The dimension lines have been extended to: " & dimObj.DimensionLineExtend
End Sub


DimensionLineWeight Example [ActiveX and VBA Reference: AAR]

DimensionLineWeight Example

Using Programming Languages other than VBA

Sub Example_DimensionLineWeight()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the dimension lineweight to a thicker value
    ' using the DimensionLineWeight property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim oldLWSetting As Boolean
    Dim CurrentSetting As String

    ' Turn on lineweight display so the changes can be seen
    oldLWSetting = ThisDrawing.preferences.LineWeightDisplay
    ThisDrawing.preferences.LineWeightDisplay = True

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension lineweight
    CurrentSetting = DimPointAngularObj.DimensionLineWeight
    Select Case CurrentSetting
        Case acLnWtByLayer: CurrentSetting = "By Layer"
        Case acLnWtByBlock: CurrentSetting = "By Block"
        Case acLnWtByLwDefault: CurrentSetting = "By Default"
        Case Else
    End Select

    MsgBox "The dimension lineweight setting for this object is currently set to: " & CurrentSetting

    ' Change the dimension lineweight
    DimPointAngularObj.DimensionLineWeight = acLnWt100
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension lineweight
    MsgBox "The dimension lineweight setting for this object is now set to: " & DimPointAngularObj.DimensionLineWeight

    ' Return previous lineweight setting
    ThisDrawing.preferences.LineWeightDisplay = oldLWSetting

End Sub


DimLine1Suppress Example [ActiveX and VBA Reference: AAR]

DimLine1Suppress Example

Using Programming Languages other than VBA

Sub Example_DimensionLine1Suppress()
    ' This example creates a Dim3PointAngular object in model space
    ' and suppresses the dimension lines using the DimensionLine1Suppress
    ' and DimensionLine2Suppress properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim Line1Suppressed As String, Line2Suppressed As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current line suppression information
    Line1Suppressed = IIf(DimPointAngularObj.DimLine1Suppress, "is suppressed", "is not suppressed")
    Line2Suppressed = IIf(DimPointAngularObj.DimLine2Suppress, "is suppressed", "is not suppressed")

    MsgBox "Line one of the dimension " & Line1Suppressed & vbCrLf & _
           "Line two of the dimension " & Line2Suppressed

    ' Suppress line one of the dimension
    DimPointAngularObj.DimLine1Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line one of the dimension is now suppressed"

    ' Suppress line two of the dimension
    DimPointAngularObj.DimLine2Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line two of the dimension is now suppressed"

   ' Turn both dimension lines back on
    DimPointAngularObj.DimLine1Suppress = False
    DimPointAngularObj.DimLine2Suppress = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Both dimension lines are now visible again"

End Sub


DimLine2Suppress Example [ActiveX and VBA Reference: AAR]

DimLine2Suppress Example

Using Programming Languages other than VBA

Sub Example_DimensionLine2Suppress()
    ' This example creates a Dim3PointAngular object in model space
    ' and suppresses the dimension lines using the DimensionLine1Suppress
    ' and DimensionLine2Suppress properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim Line1Suppressed As String, Line2Suppressed As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current line suppression information
    Line1Suppressed = IIf(DimPointAngularObj.DimLine1Suppress, "is suppressed", "is not suppressed")
    Line2Suppressed = IIf(DimPointAngularObj.DimLine2Suppress, "is suppressed", "is not suppressed")

    MsgBox "Line one of the dimension " & Line1Suppressed & vbCrLf & _
           "Line two of the dimension " & Line2Suppressed

    ' Suppress line one of the dimension
    DimPointAngularObj.DimLine1Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line one of the dimension is now suppressed"

    ' Suppress line two of the dimension
    DimPointAngularObj.DimLine2Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line two of the dimension is now suppressed"

   ' Turn both dimension lines back on
    DimPointAngularObj.DimLine1Suppress = False
    DimPointAngularObj.DimLine2Suppress = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Both dimension lines are now visible again"

End Sub


DimLineInside Example [ActiveX and VBA Reference: AAR]

DimLineInside Example

Using Programming Languages other than VBA

Sub Example_DimLineInside()
    ' This example creates a DimAligned object in model space
    ' and toggles the dimension lines to be both allowed and disallowed
    ' outside the extension lines

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 6: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current line suppression information
    CurrentValue = IIf(dimObj.DimLineInside, "are not", "are")
    MsgBox "Dimension lines " & CurrentValue & " allowed outside the extension lines"

    ' Suppress the display of dimension lines outside the extension lines
    dimObj.DimLineInside = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension lines are not allowed outside the extension lines"

    ' Allow the display of dimension lines outside the extension lines (default)
    dimObj.DimLineInside = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension lines are allowed outside the extension lines"

End Sub


DimLineSuppress Example [ActiveX and VBA Reference: AAR]

DimLineSuppress Example

Using Programming Languages other than VBA

Sub Example_DimLineSuppress()
   ' This example creates a Radial Dimension in model space and
   ' uses the DimLineSuppress property to toggle the display
   ' of the dimension lines

    Dim dimObj As AcadDimRadial
    Dim center(0 To 2) As Double
    Dim chordPoint(0 To 2) As Double
    Dim leaderLen As Integer

    ' Define the dimension
    center(0) = 0: center(1) = 0: center(2) = 0
    chordPoint(0) = 5: chordPoint(1) = 5: chordPoint(2) = 0
    leaderLen = 5

    ' Create the radial dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRadial(center, chordPoint, leaderLen)
    ThisDrawing.Application.ZoomAll

    MsgBox "The radial dimension has been created.", vbInformation

    dimObj.DimLineSuppress = Not (dimObj.DimLineSuppress)
    ThisDrawing.Application.ZoomAll

    MsgBox "The radial dimension appearance has been modified.", vbInformation
End Sub


DimStyles Example [ActiveX and VBA Reference: AAR]

DimStyles Example

Using Programming Languages other than VBA

Sub Example_DimStyles()
    ' This example adds a new dimension style.
    Dim dimStyle As AcadDimStyle
    Set dimStyle = ThisDrawing.DimStyles.Add("TEST")
    MsgBox "A new dimension style called " & dimStyle.name & " has been added to the Dimstyles collection.", vbInformation, "Dimstyles Example"
End Sub


Direction Example [ActiveX and VBA Reference: AAR]

Direction Example

Using Programming Languages other than VBA

Sub Example_Direction()
    ' This example creates a circle in model space
    ' and changes the thickness of the circle. Once
    ' the thickness has been changed, the direction
    ' of the active viewport is changed so that the
    ' new thickness setting is visible.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ' Change the thickness of the circle
    circleObj.Thickness = 3

    ' Change the direction of the viewport so that you can
    ' view the change made to the thickness. Once you change
    ' the direction, you must reset the active viewport.
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport

End Sub

Sub example_tableDirection()
    Dim oMS As AcadModelSpace
    Set oMS = ThisDrawing.ModelSpace
    Dim oT As AcadTable
    Dim pt(2) As Double
    Set oT = oMS.AddTable(pt, 4, 5, 5, 20)
    ZoomExtents
    Dim vDirection As Variant
    vDirection = oT.Direction
    MsgBox "Table Direction vector is " & vbCrLf & vDirection(0) & "," & vDirection(1) & "," & vDirection(2)

    Dim vNewDirection(2) As Double
    vNewDirection(0) = 0
    vNewDirection(1) = 1
    vNewDirection(2) = 0
    oT.Direction = vNewDirection

    Dim vRetDirection As Variant
    vRetDirection = oT.Direction
    MsgBox "New Table Direction vector is " & vbCrLf & vRetDirection(0) & "," & vRetDirection(1) & "," & vRetDirection(2)
End Sub


DirectionVector Example [ActiveX and VBA Reference: AAR]

DirectionVector Example

Using Programming Languages other than VBA

Sub Example_DirectionVector()
    ' This example creates a ray and then changes the direction vector
    ' for the ray.

    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim newDirectionVec(0 To 2) As Double

    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#

    ' Create a Ray object in model space
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)
    ZoomAll
    MsgBox "The ray has a direction vector of " & rayObj.DirectionVector(0) & ", " & rayObj.DirectionVector(1) & ", " & rayObj.DirectionVector(2), vbInformation, "DirectionVector Example"

    ' Change the direction vector
    newDirectionVec(0) = 3#: newDirectionVec(1) = 1#: newDirectionVec(2) = 0#
    rayObj.DirectionVector = newDirectionVec

    ' Query the new direction vector for the Ray
    Dim retDir As Variant            ' Note that return from DirectionVector property is Variant and not a SafeArray
    retDir = rayObj.DirectionVector

    ThisDrawing.Regen True
    MsgBox "The direction vector of the ray has been changed to " & rayObj.DirectionVector(0) & ", " & rayObj.DirectionVector(1) & ", " & rayObj.DirectionVector(2), vbInformation, "DirectionVector Example"

End Sub


Display Method Example [ActiveX and VBA Reference: AAR]

Display Method Example

Using Programming Languages other than VBA

Sub Example_DisplayMethod()
    ' This example creates a paper space viewport and makes it active.

    Dim newPViewport As AcadPViewport
    Dim centerPoint(0 To 2) As Double
    Dim height As Double
    Dim width As Double
    height = 30#
    width = 40#
    centerPoint(0) = 30#: centerPoint(1) = 30#: centerPoint(2) = 0#

    ' Create a paper space Viewport object
    ThisDrawing.ActiveSpace = acPaperSpace
    Set newPViewport = ThisDrawing.PaperSpace.AddPViewport(centerPoint, width, height)
    ZoomAll
    newPViewport.DISPLAY True

    ' Before making a pViewport active,
    ' the mspace property needs to be True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = newPViewport
End Sub


Display Property Example [ActiveX and VBA Reference: AAR]

Display Property Example

Using Programming Languages other than VBA

Sub Example_Display()
    ' This example obtains a reference to the Display Preferences object
    ' from the Application Preferences object, and reads one of the Display
    ' preferences

    Dim ACADPref As AcadPreferencesDisplay

    ' Obtain a reference to the Display Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    MsgBox "We now have access to the properties and methods of the Display Preferences object!"
    MsgBox "The Display preference CursorSize is set to: " & ACADPref.CursorSize

    ' Release Display Preferences object
    Set ACADPref = Nothing
    MsgBox "We have now released the Display Preferences object!"
End Sub


DisplayGrips Example [ActiveX and VBA Reference: AAR]

DisplayGrips Example

Using Programming Languages other than VBA

Sub Example_DisplayGrips()
    ' This example reads and modifies the preference value that controls
    ' the display of selection set grips for the Stretch, Move, Rotate,
    ' Scale, and Mirror grip modes.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.DisplayGrips
    MsgBox "The DisplayGrips preference is set to: " & originalValue

    ' Modify the DisplayGrips preference by toggling the value
    ACADPref.DisplayGrips = Not (originalValue)
    newValue = ACADPref.DisplayGrips
    MsgBox "The DisplayGrips preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DisplayGrips = originalValue
    MsgBox "The DisplayGrips preference was reset back to: " & originalValue
End Sub


DisplayGripsWithinBlocks Example [ActiveX and VBA Reference: AAR]

DisplayGripsWithinBlocks Example

Using Programming Languages other than VBA

Sub Example_DisplayGripsWithinBlocks()
    ' This example reads and modifies the preference value that controls
    ' the assignment of grips within blocks.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.DisplayGripsWithinBlocks
    MsgBox "The DisplayGripsWithinBlocks preference is set to: " & originalValue

    ' Modify the DisplayGripsWithinBlocks preference by toggling the value
    ACADPref.DisplayGripsWithinBlocks = Not (originalValue)
    newValue = ACADPref.DisplayGripsWithinBlocks
    MsgBox "The DisplayGripsWithinBlocks preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DisplayGripsWithinBlocks = originalValue
    MsgBox "The DisplayGripsWithinBlocks preference was reset back to: " & originalValue
End Sub


DisplayLayoutTabs Example [ActiveX and VBA Reference: AAR]

DisplayLayoutTabs Example

Using Programming Languages other than VBA

Sub Example_DisplayLayoutTabs()
    ' This example reads and modifies the preference value that controls
    ' the display of the Model and layout tabs. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.DisplayLayoutTabs
    MsgBox "The DisplayLayoutTabs preference is set to: " & originalValue

    ' Modify the DisplayLayoutTabs preference by toggling the value
    ACADPref.DisplayLayoutTabs = Not (originalValue)
    newValue = ACADPref.DisplayLayoutTabs
    MsgBox "The DisplayLayoutTabs preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DisplayLayoutTabs = originalValue
    MsgBox "The DisplayLayoutTabs preference was reset back to: " & originalValue
End Sub


DisplayLocked Example [ActiveX and VBA Reference: AAR]

DisplayLocked Example

Using Programming Languages other than VBA

Sub Example_DisplayLocked()
    ' This example scans the current drawing paper space Viewports
    ' and displays whether or not any of them are locked.

    Dim pviewportObj As Object
    Dim msg As String, ClippedState As String

    ' Make sure this drawing contains paper space viewports before continuing
    If ThisDrawing.PaperSpace.count = 0 Then
        MsgBox "There are no paper space viewports in the current drawing."
        Exit Sub
    End If

    ' Go through each paper space viewport object in the drawing paper space
    ' and determine whether or not it is locked

    For Each pviewportObj In ThisDrawing.PaperSpace

        ' Determine whether this is a paper space viewport
        If TypeName(pviewportObj) = "IAcadPViewport" Then

            ' Determine whether this paper space viewport is locked
            ClippedState = IIf(pviewportObj.Clipped, " is locked", " is not locked")
            msg = msg & "PViewport ID " & pviewportObj.objectID & ClippedState & vbCrLf

        End If

    Next

    ' Display locked state of paper space Viewports
    MsgBox msg
End Sub


DisplayOLEScale Example [ActiveX and VBA Reference: AAR]

DisplayOLEScale Example

Using Programming Languages other than VBA

Sub Example_DisplayOLEScale()
    ' This example reads and modifies the preference value that controls
    ' whether the OLE scaling dialog is displayed when OLE objects are
    ' inserted into a drawing.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSystem
    Dim originalValue As Variant, newValue As Variant

    ' Get the system preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    ' Read and display the original value
    originalValue = ACADPref.DisplayOLEScale
    MsgBox "The DisplayOLEScale preference is set to: " & originalValue

    ' Modify the DisplayOLEScale preference by toggling the value
    ACADPref.DisplayOLEScale = Not (ACADPref.DisplayOLEScale)
    newValue = ACADPref.DisplayOLEScale
    MsgBox "The DisplayOLEScale preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DisplayOLEScale = originalValue
    MsgBox "The DisplayOLEScale preference was reset back to: " & originalValue
End Sub


DisplayPlotPreview Example [ActiveX and VBA Reference: AAR]

DisplayPlotPreview Example

Using Programming Languages other than VBA

Sub Example_DisplayPlotPreview()
    ' This example creates a circle and then performs
    ' a plot preview.

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 2: center(1) = 2: center(2) = 0
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll

    ' Preview the plot of the circle
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview

End Sub


DisplayScreenMenu Example [ActiveX and VBA Reference: AAR]

DisplayScreenMenu Example

Using Programming Languages other than VBA

Sub Example_DisplayScreenMenu()
    ' This example returns the current setting of
    ' DisplayScreenMenu. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDisplayScreenMenu As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DisplayScreenMenu value
    currDisplayScreenMenu = preferences.DISPLAY.DisplayScreenMenu
    MsgBox "The current value for DisplayScreenMenu is " & preferences.DISPLAY.DisplayScreenMenu, vbInformation, "DisplayScreenMenu Example"

    ' Change the value for DisplayScreenMenu
    preferences.DISPLAY.DisplayScreenMenu = Not (currDisplayScreenMenu)
    MsgBox "The new value for DisplayScreenMenu is " & preferences.DISPLAY.DisplayScreenMenu, vbInformation, "DisplayScreenMenu Example"

    ' Reset DisplayScreenMenu to its original value
    preferences.DISPLAY.DisplayScreenMenu = currDisplayScreenMenu
    MsgBox "The DisplayScreenMenu value is reset to " & preferences.DISPLAY.DisplayScreenMenu, vbInformation, "DisplayScreenMenu Example"
End Sub


DisplayScrollBars Example [ActiveX and VBA Reference: AAR]

DisplayScrollBars Example

Using Programming Languages other than VBA

Sub Example_DisplayScrollBars()
    ' This example returns the current setting of
    ' DisplayScrollBars. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDisplayScrollBars As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DisplayScrollBars value
    currDisplayScrollBars = preferences.DISPLAY.DisplayScrollBars
    MsgBox "The current value for DisplayScrollBars is " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"

    ' Change the value for DisplayScrollBars
    preferences.DISPLAY.DisplayScrollBars = Not (currDisplayScrollBars)
    MsgBox "The new value for DisplayScrollBars is " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"

    ' Reset DisplayScrollBars to its original value
    preferences.DISPLAY.DisplayScrollBars = currDisplayScrollBars
    MsgBox "The DisplayScrollBars value is reset to " & preferences.DISPLAY.DisplayScrollBars, vbInformation, "DisplayScrollBars Example"
End Sub


DisplaySilhouette Example [ActiveX and VBA Reference: AAR]

DisplaySilhouette Example

Using Programming Languages other than VBA

Sub Example_DisplaySilhouette()
    ' This example returns the current setting of
    ' DisplaySilhouette. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currDisplaySilhouette As Boolean

    ' Retrieve the current DisplaySilhouette value
    currDisplaySilhouette = ThisDrawing.preferences.DisplaySilhouette
    MsgBox "The current value for DisplaySilhouette is " & preferences.DisplaySilhouette, vbInformation, "DisplaySilhouette Example"

    ' Change the value for DisplaySilhouette
    ThisDrawing.preferences.DisplaySilhouette = Not (currDisplaySilhouette)
    MsgBox "The new value for DisplaySilhouette is " & preferences.DisplaySilhouette, vbInformation, "DisplaySilhouette Example"

    ' Reset DisplaySilhouette to its original value
    ThisDrawing.preferences.DisplaySilhouette = currDisplaySilhouette
    MsgBox "The DisplaySilhouette value is reset to " & preferences.DisplaySilhouette, vbInformation, "DisplaySilhouette Example"
End Sub


DistanceToReal Example [ActiveX and VBA Reference: AAR]

DistanceToReal Example

Using Programming Languages other than VBA

Sub Example_DistanceToReal()
    ' This example passes several different distances in
    ' different units to be converted to real values.

    Dim distAsString As String
    Dim unit As Long
    Dim distAsReal As Double

    ' Convert the distance to a real in scientific units
    unit = acScientific
    distAsString = "1.75E+01"
    distAsReal = ThisDrawing.Utility.DistanceToReal(distAsString, unit)
    MsgBox "1.75E+01 converts to " & distAsReal & " in scientific units.", , "DistanceToReal Example"

    ' Convert the distance to a real in decimal units
    unit = acDecimal
    distAsString = "17.5"
    distAsReal = ThisDrawing.Utility.DistanceToReal(distAsString, unit)
    MsgBox "1.75 converts to " & distAsReal & " in decimal units.", , "DistanceToReal Example"

    ' Convert the distance to a real in engineering units
    unit = acEngineering
    distAsString = "1'-5.50"""
    distAsReal = ThisDrawing.Utility.DistanceToReal(distAsString, unit)
    MsgBox "1'-5.50"" converts to " & distAsReal & " in engineering units.", , "DistanceToReal Example"

    ' Convert the distance to a real in architectural units
    unit = acArchitectural
    distAsString = "1'-5 1/2"""
    distAsReal = ThisDrawing.Utility.DistanceToReal(distAsString, unit)
    MsgBox "1'-5 1/2"" converts to " & distAsReal & " in architectural units.", , "DistanceToReal Example"

    ' Convert the distance to a real in fractional units
    unit = acFractional
    distAsString = "17 1/2"
    distAsReal = ThisDrawing.Utility.DistanceToReal(distAsString, unit)
    MsgBox "1'-5 1/2"" converts to " & distAsReal & " in fractional units.", , "DistanceToReal Example"

End Sub


Dock Example [ActiveX and VBA Reference: AAR]

Dock Example

Using Programming Languages other than VBA

Sub Example_Dock()
    ' This example creates a new toolbar called TestToolbar and inserts three
    ' buttons into it. The toolbar is then displayed as a floating toolbar,
    ' and then as a docked toolbar.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add three buttons to the new toolbar.
    ' All three buttons will have the same macro attached.
    Dim newButton1 As AcadToolbarItem
    Dim newButton2 As AcadToolbarItem
    Dim newButton3 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)
    Set newButton2 = newToolBar.AddToolbarButton("", "NewButton2", "Open a file.", openMacro)
    Set newButton3 = newToolBar.AddToolbarButton("", "NewButton3", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    ' Dock the toolbar to the left of the screen.
    newToolBar.Dock acToolbarDockLeft
    MsgBox "The toolbar is docked to the left."

    ' Dock the toolbar to the right of the screen.
    newToolBar.Dock acToolbarDockRight
    MsgBox "The toolbar is docked to the right."

    ' Dock the toolbar at the top of the screen.
    newToolBar.Dock acToolbarDockTop
    MsgBox "The toolbar is docked at the top."

    ' Dock the toolbar at the bottom of the screen.
    newToolBar.Dock acToolbarDockBottom
    MsgBox "The toolbar is docked at the bottom."

End Sub


DockedVisibleLines Example [ActiveX and VBA Reference: AAR]

DockedVisibleLines Example

Using Programming Languages other than VBA

Sub Example_DockedVisibleLines()
    ' This example returns the current setting of
    ' DockedVisibleLines. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDockedVisibleLines As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DockedVisibleLines value
    currDockedVisibleLines = preferences.DISPLAY.DockedVisibleLines
    MsgBox "The current value for DockedVisibleLines is " & preferences.DISPLAY.DockedVisibleLines, vbInformation, "DockedVisibleLines Example"

    ' Change the value for DockedVisibleLines
    preferences.DISPLAY.DockedVisibleLines = 15
    MsgBox "The new value for DockedVisibleLines is " & preferences.DISPLAY.DockedVisibleLines, vbInformation, "DockedVisibleLines Example"

    ' Reset DockedVisibleLines to its original value
    preferences.DISPLAY.DockedVisibleLines = currDockedVisibleLines
    MsgBox "The DockedVisibleLines value is reset to " & preferences.DISPLAY.DockedVisibleLines, vbInformation, "DockedVisibleLines Example"
End Sub


DockStatus Example [ActiveX and VBA Reference: AAR]

DockStatus Example

Using Programming Languages other than VBA

Sub Example_DockStatus()
    ' This example creates a new toolbar called "TestToolbar" and inserts three
    ' buttons into it. The toolbar is then displayed as a floating toolbar,
    ' and then as a docked toolbar.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add three buttons to the new toolbar.
    ' All three buttons will have the same macro attached.
    Dim newButton1 As AcadToolbarItem
    Dim newButton2 As AcadToolbarItem
    Dim newButton3 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)
    Set newButton2 = newToolBar.AddToolbarButton("", "NewButton2", "Open a file.", openMacro)
    Set newButton3 = newToolBar.AddToolbarButton("", "NewButton3", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    ' Dock the toolbar to the left of the screen.
    newToolBar.Dock acToolbarDockLeft
    GoSub QUERYSTATUS

    ' Float the toolbar
    newToolBar.Float 200, 200, 1
    GoSub QUERYSTATUS

    Exit Sub

QUERYSTATUS:
    ' Query the toolbar to see if it is docked.
    If newToolBar.DockStatus = acToolbarFloating Then
        MsgBox "The toolbar is floating."
    Else
        MsgBox "The toolbar is docked."
    End If
    Return

End Sub


Document Example [ActiveX and VBA Reference: AAR]

Document Example

Using Programming Languages other than VBA

Sub Example_Document()
    ' This example creates a circle in model space and then
    ' finds the name of the document that the circle resides in.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll

    ' Find the document name for the circle
    Dim currDoc As AcadDocument
    Set currDoc = circleObj.Document

    MsgBox "The circle resides in: " & currDoc.name

End Sub


Documents Example [ActiveX and VBA Reference: AAR]

Documents Example

Using Programming Languages other than VBA

Sub Example_Documents()
    ' This example obtains a reference to the Documents collection
    ' and displays information about the loaded documents.

    Dim Document As AcadDocument
    Dim msg As String
    msg = vbCrLf

    ' Cycle through the Documents collection and retrieve the names
    ' of the loaded documents
    For Each Document In Documents
        msg = msg & Document.name & vbCrLf
    Next

    ' Display loaded document information
    If Documents.count > 0 Then
        MsgBox "The loaded documents are: " & msg
    Else
        MsgBox "There are no loaded documents!"
    End If
End Sub


DogLeg Example [ActiveX and VBA Reference: AAR]

DogLeg Example

Using Programming Languages other than VBA

Sub Example_AddMLeader()
    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.DogLegged = True
    oML.DoglegLength = 1.3

    MsgBox "The dog-leg length is  " & oML.DoglegLength

    ZoomAll

End Sub


Drafting Example [ActiveX and VBA Reference: AAR]

Drafting Example

Using Programming Languages other than VBA

Sub Example_Drafting()
    ' This example obtains a reference to the Drafting Preferences object
    ' from the Application Preferences object, and reads one of the Drafting
    ' preferences

    Dim ACADPref As AcadPreferencesDrafting

    ' Obtain a reference to the Drafting Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    MsgBox "We now have access to the properties and methods of the Drafting Preferences object!"
    MsgBox "The Drafting preference AutoSnapTooltip is set to: " & ACADPref.AutoSnapTooltip

    ' Release Drafting Preferences object
    Set ACADPref = Nothing
    MsgBox "We have now released the Drafting Preferences object!"
End Sub


DrawingDirection Example [ActiveX and VBA Reference: AAR]

DrawingDirection Example

Using Programming Languages other than VBA

Sub Example_DrawingDirection()
    ' This example changes the drawing direction for an MText object
    ' in model space.

    Dim MTextObj As AcadMText
    Dim corner1(0 To 2) As Double
    Dim width As Double
    Dim text As String

    ' Define the MText object
    corner1(0) = 0#: corner1(1) = 6#: corner1(2) = 0#
    width = 7
    text = "This is a text String."

    ' Create the MText object in model space
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner1, width, text)
    ZoomAll

    'Change the drawing direction of the MText object
    MTextObj.DrawingDirection = acLeftToRight
    ZoomAll
    MsgBox "The DrawingDirection of the text is left to right.", vbInformation, "DrawingDirection Example"

    MTextObj.DrawingDirection = acTopToBottom
    ZoomAll
    MsgBox "The DrawingDirection of the text is top to bottom.", vbInformation, "DrawingDirection Example"

    ' Return the drawing direction
    Dim retDirection As Integer
    retDirection = MTextObj.DrawingDirection

End Sub


DriversPath Example [ActiveX and VBA Reference: AAR]

DriversPath Example

Using Programming Languages other than VBA

Sub Example_DriversPath()
    ' This example returns the current setting of
    ' DriversPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currDriversPath As String
    Dim newDriversPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current DriversPath value
    currDriversPath = preferences.Files.DriversPath
    MsgBox "The current value for DriversPath is " & currDriversPath, vbInformation, "DriversPath Example"

    ' Change the value for DriversPath
    newDriversPath = "TestDriversPath"
    preferences.Files.DriversPath = newDriversPath
    MsgBox "The new value for DriversPath is " & newDriversPath, vbInformation, "DriversPath Example"

    ' Reset DriversPath to its original value
    preferences.Files.DriversPath = currDriversPath
    MsgBox "The DriversPath value is reset to " & currDriversPath, vbInformation, "DriversPath Example"
End Sub


ElevateOrder Example [ActiveX and VBA Reference: AAR]

ElevateOrder Example

Using Programming Languages other than VBA

Sub Example_ElevateOrder()
    ' This example creates a spline object in model space.
    ' It then elevates the order of the spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll
    MsgBox "The current order of the spline is " & splineObj.Degree + 1, , "ElevateOrder Example"

    ' Elevate the order of the spline
    splineObj.ElevateOrder (splineObj.Degree + 10)
    ThisDrawing.Regen True
    MsgBox "The order of the spline has been raised to " & splineObj.Degree + 1, , "ElevateOrder Example"

End Sub


Elevation Example [ActiveX and VBA Reference: AAR]

Elevation Example

Using Programming Languages other than VBA

Sub Example_Elevation()
    ' This example creates an associative hatch in model space.
    ' The elevation for that hatch is then changed.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim arcObj As AcadArc
    Dim lineObj As AcadLine
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set arcObj = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set lineObj = ThisDrawing.ModelSpace.AddLine(arcObj.startPoint, arcObj.endPoint)

    Set outerLoop(0) = arcObj
    Set outerLoop(1) = lineObj

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Change the viewing direction of the viewport to better see the elevation
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Find the current elevation for the hatch
    Dim currElevation As Double
    currElevation = hatchObj.Elevation
    MsgBox "The current elevation is " & hatchObj.Elevation, , "Elevation Example"

    ' Set the hatch elevation to 3
    hatchObj.Elevation = 3#
    hatchObj.Evaluate
    ZoomAll
    MsgBox "The elevation is now " & hatchObj.Elevation, , "Elevation Example"

End Sub


ElevationModelSpace Example [ActiveX and VBA Reference: AAR]

ElevationModelSpace Example

Using Programming Languages other than VBA

Sub Example_ElevationModelSpace()
    ' This example changes the model space elevation of the current drawing
    ' and then resets it to the original value again.

    Dim currElevation As Double

    currElevation = ThisDrawing.ElevationModelSpace
    MsgBox "The current model space elevation is " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"

    ' Change the elevation
    ThisDrawing.ElevationModelSpace = currElevation + 2
    MsgBox "The new model space elevation is " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"

    ' Reset the elevation to its original value
    ThisDrawing.ElevationModelSpace = currElevation
    MsgBox "The model space elevation is reset to " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"

End Sub


ElevationPaperSpace Example [ActiveX and VBA Reference: AAR]

ElevationPaperSpace Example

Using Programming Languages other than VBA

Sub Example_ElevationPaperSpace()
    ' This example changes the paper space elevation of the current drawing
    ' and then resets it to the original value.

    Dim currElevation As Double

    currElevation = ThisDrawing.ElevationPaperSpace
    MsgBox "The current paper space elevation is " & ThisDrawing.ElevationPaperSpace, vbInformation, "ElevationpaperSpace Example"

    ' Change the elevation
    ThisDrawing.ElevationPaperSpace = currElevation + 2
    MsgBox "The new paper space elevation is " & ThisDrawing.ElevationPaperSpace, vbInformation, "ElevationpaperSpace Example"

    ' Reset the elevation to its original value
    ThisDrawing.ElevationPaperSpace = currElevation
    MsgBox "The paper space elevation is reset to " & ThisDrawing.ElevationPaperSpace, vbInformation, "ElevationPaperSpace Example"

End Sub


Enable Example [ActiveX and VBA Reference: AAR]

Enable Example

Using Programming Languages other than VBA

Sub Example_Enable()
    ' This example creates a new menu called TestMenu and inserts two menu items
    ' into it. The second menu item is then disabled.
    ' The menu is displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add two menu items to the new menu
    Dim MenuEnable As AcadPopupMenuItem
    Dim MenuDisable As AcadPopupMenuItem
    Dim MenuSeparator As AcadPopupMenuItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set MenuEnable = newMenu.AddMenuItem(newMenu.count + 1, "OpenEnabled", openMacro)
    Set MenuSeparator = newMenu.AddSeparator("")
    Set MenuDisable = newMenu.AddMenuItem(newMenu.count + 1, "OpenDisabled", openMacro)

    ' Disable the new menu item
    MenuDisable.Enable = False

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


EnableMergeAll Example [ActiveX and VBA Reference: AAR]

EnableMergeAll Example

Using Programming Languages other than VBA

Sub Example_EnableMergeAll()
' This example creates a TableStyle object and sets values for
    ' the style cell merging.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As IAcadTableStyle2
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.CreateCellStyle ("NewTestStyle2")
      Call customObj.EnableMergeAll("NewTestStyle2", False)

      If customObj.GetIsMergeAllEnabled("NewTestStyle2") = False Then
        MsgBox "Merge all is not enabled!"
      End If
End Sub


EnableStartupDialog Example [ActiveX and VBA Reference: AAR]

EnableStartupDialog Example

Using Programming Languages other than VBA

Sub Example_EnableStartupDialog()
    ' This example returns the current setting of
    ' EnableStartupDialog. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currEnableStartupDialog As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current EnableStartupDialog value
    currEnableStartupDialog = preferences.System.EnableStartupDialog
    MsgBox "The current value for EnableStartupDialog is " & preferences.System.EnableStartupDialog, vbInformation, "EnableStartupDialog Example"

    ' Change the value for EnableStartupDialog
    preferences.System.EnableStartupDialog = Not (currEnableStartupDialog)
    MsgBox "The new value for EnableStartupDialog is " & preferences.System.EnableStartupDialog, vbInformation, "EnableStartupDialog Example"

    ' Reset EnableStartupDialog to its original value
    preferences.System.EnableStartupDialog = currEnableStartupDialog
    MsgBox "The EnableStartupDialog value is reset to " & preferences.System.EnableStartupDialog, vbInformation, "EnableStartupDialog Example"
End Sub


EndAngle Example [ActiveX and VBA Reference: AAR]

EndAngle Example

Using Programming Languages other than VBA

Sub Example_EndAngle()
    ' This example creates an ellipse and enters the start and
    ' end angles to create an elliptical arc.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    'Enter a start angle of 45 degrees, and an end angle of 270 degrees
    ellObj.startAngle = 45 * (3.14 / 180)
    ellObj.endAngle = 270 * (3.14 / 180)
    ZoomAll
    MsgBox "This ellipse has a start angle of " & ellObj.startAngle * (180 / 3.14) & " and the end angle of " & ellObj.endAngle * (180 / 3.14) & " degrees.", vbInformation, "EndAngle Example"
End Sub


EndCommand Example [: AAR]

EndCommand Example

Using Programming Languages other than VBA

Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
    ' This example intercepts a drawing EndCommand event.
    '
    ' This event is triggered when a drawing receives
    ' any command compatible with this event.
    '
    ' To trigger this example event: Issue any command to an open drawing from
    ' either the command line, VBA, the ACAD menus, the ACAD toolbars, or LISP.
    ' When the command is finished, this event will be triggered.

    ' Use the "CommandName" variable to determine which command just finished
    MsgBox "A drawing has just finished a " & CommandName & " command."

End Sub


EndLisp Example [: AAR]

EndLisp Example

Using Programming Languages other than VBA

Private Sub AcadDocument_EndLisp()
    ' This example intercepts a drawing BeginLisp event.
    '
    ' This event is triggered when a drawing finishes
    ' a the evaluation of a LISP expression.
    '
    ' To trigger this example event: Start the evaluation of a LISP expression and
    ' wait for it to finish being evaluated

    MsgBox "A LISP expression has just finished being evaluated!"

End Sub


EndModal Example [: AAR]

EndModal Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_EndModal()
    ' This example intercepts an Application EndModal event.  We use a Beep instead of
    ' a message box to notify the user when the event is triggered, since a message box
    ' is a modal entity and would cause continuous BeginModal/EndModal events to be triggered.
    '
    ' This event is triggered when AutoCAD finishes displaying a modal dialog.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Use AutoCAD to begin a modal dialog operation and then dismiss the dialog.
    '     For example, use AutoCAD to display a modal file dialog by using File/New and then
    '     close the dialog by selecting Cancel

    Beep  ' The modal dialog was just closed!

End Sub


EndOpen Example [: AAR]

EndOpen Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_EndOpen(ByVal FileName As String)
    ' This example intercepts an Application EndOpen event.
    '
    ' This event is triggered when AutoCAD finishes opening a drawing.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Use AutoCAD to open an existing drawing and wait until the
    '     operation finishes

    ' Use the "FileName" variable to determine which drawing file is being opened
    MsgBox "A drawing was just loaded from: " & FileName
End Sub


EndParameter Example [ActiveX and VBA Reference: AAR]

EndParameter Example

Using Programming Languages other than VBA

Sub Example_EndParameter()
    ' This example creates an ellipse and enters the start and
    ' end parameters to create an elliptical arc.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ' Enter a start parameter of 1.57, and an end parameter of 6.28
    ellObj.StartParameter = 1.57
    ellObj.EndParameter = 6.28
    ZoomAll

    ' Find the start and end parameters for the ellipse
    MsgBox "The ellipse has a start parameter of " & ellObj.StartParameter & " and an end parameter of " & ellObj.EndParameter, vbInformation, "EndParameter Example"
End Sub


EndPlot Example [: AAR]

EndPlot Example

Using Programming Languages other than VBA

Private Sub AcadDocument_EndPlot(ByVal DrawingName As String)
    ' This example intercepts a drawing EndPlot event.
    '
    ' This event is triggered when a drawing finishes a plot request.
    '
    ' To trigger this example event: Plot an open drawing and wait for the plot to finish

    ' Use the "DrawingName" variable to determine which drawing just finished plotting
    MsgBox "A drawing has just finished a plot request!"
End Sub


EndPoint Example [ActiveX and VBA Reference: AAR]

EndPoint Example

Using Programming Languages other than VBA

Sub Example_EndPoint()
    ' This example creates an elliptical arc and then
    ' finds the coordinates of its start and end points.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    Dim startPoint As Variant
    Dim endPoint As Variant

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ' Enter a start angle of 45 degrees, and an end angle of 270 degrees
    ellObj.startAngle = 45 * (3.14 / 180)
    ellObj.endAngle = 270 * (3.14 / 180)
    ZoomAll

    ' Find the start and endpoints for the ellipse
    startPoint = ellObj.startPoint
    endPoint = ellObj.endPoint
    MsgBox "This ellipse has a start point of " & startPoint(0) & ", " & startPoint(1) & ", " & startPoint(2) & " and an endpoint of " & endPoint(0) & ", " & endPoint(1) & ", " & endPoint(2), vbInformation, "EndPoint Example"
End Sub


EndSave Example [: AAR]

EndSave Example

Using Programming Languages other than VBA

Private Sub AcadDocument_EndSave(ByVal FileName As String)
    ' This example intercepts a drawing EndSave event.
    '
    ' This event is triggered when a drawing finishes a save request.
    '
    ' To trigger this example event: Save an open drawing and wait for the save to complete

    ' Use the "FileName" variable to determine where the drawing file was saved
    MsgBox "A drawing has just been saved to: " & FileName
End Sub


EndShortcutMenu Example [: AAR]

EndShortcutMenu Example

Using Programming Languages other than VBA

Private Sub AcadDocument_EndShortcutMenu(ShortcutMenu As AutoCAD.IAcadPopupMenu)
    ' This example intercepts a drawing EndShortcutMenu event.
    '
    ' This event is triggered when the user closes a drawing shortcut menu.
    '
    ' To trigger this example event: Right click the mouse in the working area of a drawing,
    ' wait for the shortcut menu to be displayed and then dismiss the shortcut menu

    MsgBox "A shortcut menu was just closed!"
End Sub


EndTangent Example [ActiveX and VBA Reference: AAR]

EndTangent Example

Using Programming Languages other than VBA

Sub Example_EndTangent()
    ' This example creates a spline. It then queries the current setting for
    ' the EndTangent, and then changes the EndTangent to a new value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim msg As String

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ZoomAll
    GoSub GETPOINTS
    MsgBox "The EndTangent for the spline is " & msg, vbInformation, "EndTangent Example"

    ' Change the end tangent of Spline to (1.5,0.707,2)
    Dim newTan(0 To 2) As Double
    newTan(0) = 1.5: newTan(1) = 0.707: newTan(2) = 2
    splineObj.EndTangent = newTan

    ThisDrawing.Regen True
    GoSub GETPOINTS
    MsgBox "The EndTangent has been changed to " & msg, vbInformation, "EndTangent Example"

    Exit Sub

GETPOINTS:
    msg = ""
    ' Get the coordinates from the end tangent
    Dim count As Integer
    For count = 0 To 2
        msg = msg & Format(splineObj.EndTangent(count), "0.###") & ", "
    Next
    msg = VBA.Left(msg, Len(msg) - 2)
    Return
End Sub


EndUndoMark Example [ActiveX and VBA Reference: AAR]

EndUndoMark Example

Using Programming Languages other than VBA

Sub Example_EndUndoMark()
    ' This example creates a series of lines, each one with an undo marker
    ' defined for it. After lines are created you can switch to AutoCAD and type
    ' the Undo command, and only one line at a time will be undone. If StartUndoMark
    ' call is not made, an undo in AutoCAD will undo all the lines at once.

    Dim line As AcadLine
    Dim stPnt(0 To 2) As Double
    Dim endPnt(0 To 2) As Double
    stPnt(0) = 1: stPnt(1) = 2: stPnt(2) = 0
    endPnt(0) = 2: stPnt(1) = 1: stPnt(2) = 0

    ' Create the lines
    Dim j As Integer
    For j = 0 To 3
        ThisDrawing.StartUndoMark
        Set line = ThisDrawing.ModelSpace.AddLine(stPnt, endPnt)
        stPnt(0) = stPnt(0) + 3
        endPnt(0) = endPnt(0) + 3
        ThisDrawing.EndUndoMark
    Next
    ZoomAll

End Sub


EntityColor Example [ActiveX and VBA Reference: AAR]

EntityColor Example

Using Programming Languages other than VBA

Sub Example_EntityColor()
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Dim y As Long
    y = MakeLong(MakeWord(194, 122), MakeWord(133, 144))
    color.EntityColor = y
    Dim line As AcadLine
    Set line = CreateLine
    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    Dim x As Long
    x = retcolor.EntityColor

    Dim BreakLong(3) As Byte
    BreakLong(0) = x And &HFF&
    BreakLong(1) = (x And &HFF00&) \ &H100&
    BreakLong(2) = (x And &HFF0000) \ &H10000
    BreakLong(3) = (x And &H7F000000) \ &H1000000
    If x < 0 Then BreakLong(3) = BreakLong(3) Or &H80

    MsgBox "ColorMethod = " & BreakLong(3) & vbCrLf & _
     "Red = " & BreakLong(2) & vbCrLf & _
     "Green = " & BreakLong(1) & vbCrLf & _
     "Blue = " & BreakLong(0)
End Sub

Private Function CreateLine() As AcadLine
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    Set CreateLine = lineObj
    ZoomAll
End Function

Private Function MakeLong(WordHi As Variant, WordLo As Integer) As Long

   ' High word is coerced to a variant on the call, to allow
   ' it to overflow the limits of multiplication, which shifts
   ' it left.

   MakeLong = (WordHi * &H10000) + (WordLo And &HFFFF&)
End Function

Private Function MakeWord(ByteHi As Byte, ByteLo As Byte) As Integer
   ' If the high byte would push the final result out of the
   ' signed integer range, it must be slid back.

   If ByteHi > &H7F Then
      MakeWord = ((ByteHi * &H100&) + ByteLo) - &H10000
   Else
      MakeWord = (ByteHi * &H100&) + ByteLo
   End If
End Function


Erase Example [ActiveX and VBA Reference: AAR]

Erase Example

Using Programming Languages other than VBA

Sub Example_Erase()
    ' This example creates a selection set and several objects.
    ' It then adds the objects to the selection set, and then
    ' erases the objects from the selection set.

    ' Create the new selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET")

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection.
    ' Collect the objects found into an array of objects
    ' to be added to the selection set.
    ReDim ssobjs(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects to the selection set
    ssetObj.AddItems ssobjs

    GoSub LISTOBJS

    ' Erase the objects in the selection set
    ssetObj.Erase

    GoSub LISTOBJS

    ' exit the subroutine

Exit Sub

LISTOBJS:

        ' List all the objects in the selection set
        If ssetObj.count = 0 Then
            MsgBox "The selection set is empty"
        Else
            For I = 0 To ssetObj.count - 1
                MsgBox "The selection set contains: " & ssetObj.Item(I).ObjectName
            Next
        End If
        Return
End Sub


Eval Example [ActiveX and VBA Reference: AAR]

Eval Example

Using Programming Languages other than VBA

Sub Example_Eval()
    ' This example shows how to can use Eval to run a VBA code fragment
    ' without having to create a Module or procedure.

    Dim VBACode As String

    ' Create VBA code fragment
    VBACode = "MsgBox ""Simple code fragment"""

    ' Use Eval method to evaluate the small VBA script
    Eval (VBACode)
End Sub


Evaluate Example [ActiveX and VBA Reference: AAR]

Evaluate Example

Using Programming Languages other than VBA

Sub Example_Evaluate()
    ' This example creates an associative hatch in model space.
    ' It uses the Evaluate method to calculate the hatch
    ' lines for the given boundary.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer boundary for the hatch. (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True

End Sub


Explode Example [ActiveX and VBA Reference: AAR]

Explode Example

Using Programming Languages other than VBA

Sub Example_Explode()
    ' This example creates a lightweight polyline in model space.
    ' It then explodes the polyline.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 1

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)

    ' Set the bulge on one segment to vary the
    ' type of objects in the polyline
    plineObj.SetBulge 3, -0.5
    ZoomAll

    ' Explode the polyline
    MsgBox "Explode the polyline?", , "Explode Example"
    Dim explodedObjects As Variant
    explodedObjects = plineObj.Explode

    ' Loop through the exploded objects
    Dim I As Integer
    For I = 0 To UBound(explodedObjects)
        explodedObjects(I).Update
        MsgBox "Exploded Object " & I & ": " & explodedObjects(I).ObjectName, , "Explode Example"
        explodedObjects(I).Color = acByLayer
        explodedObjects(I).Update
    Next

End Sub


Export Example [ActiveX and VBA Reference: AAR]

Export Example

Using Programming Languages other than VBA

Sub Example_Export()
    ' This example exports the current drawing to DXF format.
    ' Note that a valid selection set must be provided, even
    ' though the contents of the selection set are ignored.

    ' Define the name for the exported file
    Dim exportFile As String
    exportFile = "C:\AutoCAD\DXFExprt"     ' Adjust path to match your system

    ' Create an empty selection set
    Dim sset As AcadSelectionSet
    Set sset = ThisDrawing.SelectionSets.Add("TEST")

    ' Export the current drawing to the file specified above.
    ThisDrawing.Export exportFile, "DXF", sset

End Sub


ExportProfile Example [ActiveX and VBA Reference: AAR]

ExportProfile Example

Using Programming Languages other than VBA

Sub Example_ExportProfile()
    ' This example exports the active profile to a new name.

    Dim preferences As AcadPreferences
    Dim currActiveProfile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ActiveProfile value
    currActiveProfile = preferences.Profiles.ActiveProfile
    MsgBox "The current ActiveProfile is: " & preferences.Profiles.ActiveProfile, , "ExportProfile Example"

    ' Export the active profile
    preferences.Profiles.ExportProfile currActiveProfile, "TestProfile.arg"
    MsgBox "The ActiveProfile has been exported to: TestProfile.arg", , "ExportProfile Example"

End Sub


ExtensionLineColor Example [ActiveX and VBA Reference: AAR]

ExtensionLineColor Example

Using Programming Languages other than VBA

Sub Example_ExtensionLineColor()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the extension line color to red using the ExtensionLineColor property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension line color
    MsgBox "The extension line color for this object is currently set to: " & DimPointAngularObj.ExtensionLineColor

    ' Change the extension line color
    DimPointAngularObj.ExtensionLineColor = acRed
    ThisDrawing.Regen acAllViewports

    ' Read and display current extension line color
    MsgBox "The extension line color for this object is now set to: " & DimPointAngularObj.ExtensionLineColor & " (Red)"

End Sub


ExtensionLineExtend Example [ActiveX and VBA Reference: AAR]

ExtensionLineExtend Example

Using Programming Languages other than VBA

Sub Example_ExtensionLineExtend()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the length of the extension line to extend 1.5 units past
    ' the dimension using the ExtensionLineExtend property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current extension line extend length
    MsgBox "The extension line currently extends " & DimPointAngularObj.ExtensionLineExtend & " units past the dimension"

    ' Change the extension line extend length to extend 1.5
    ' units past the dimension
    DimPointAngularObj.ExtensionLineExtend = 1.5
    ThisDrawing.Regen acAllViewports

    ' Read and display current extension line extend length
    MsgBox "The extension line now extends " & DimPointAngularObj.ExtensionLineExtend & " units past the dimension"

End Sub


ExtensionLineOffset Example [ActiveX and VBA Reference: AAR]

ExtensionLineOffset Example

Using Programming Languages other than VBA

Sub Example_ExtensionLineOffset()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the offset of the extension lines using the
    ' ExtensionLineOffset property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current offset of the extension lines from the control points
    MsgBox "The extension lines are currently offset " & DimPointAngularObj.ExtensionLineOffset & " units"

    ' Change the extension lines offset distance from the control points
    DimPointAngularObj.ExtensionLineOffset = 1.5
    ThisDrawing.Regen acAllViewports

    ' Read and display current offset of the extension lines from the control points
    MsgBox "The extension lines are now offset " & DimPointAngularObj.ExtensionLineOffset & " units"

End Sub


ExtensionLineWeight Example [ActiveX and VBA Reference: AAR]

ExtensionLineWeight Example

Using Programming Languages other than VBA

Sub Example_ExtensionLineWeight()
    ' This example creates a Dim3PointAngular object in model space
    ' and changes the extension lineweight to a thicker value
    ' using the ExtensionLineWeight property

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim oldLWSetting As Boolean
    Dim CurrentSetting As String

    ' Turn on lineweight display to see the changes
    oldLWSetting = ThisDrawing.preferences.LineWeightDisplay
    ThisDrawing.preferences.LineWeightDisplay = True

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current extension lineweight
    CurrentSetting = DimPointAngularObj.ExtensionLineWeight
    Select Case CurrentSetting
        Case acLnWtByLayer: CurrentSetting = "By Layer"
        Case acLnWtByBlock: CurrentSetting = "By Block"
        Case acLnWtByLwDefault: CurrentSetting = "By Default"
        Case Else
    End Select

    MsgBox "The extension lineweight for this object is currently set to: " & CurrentSetting

    ' Change the extension lineweight
    DimPointAngularObj.ExtensionLineWeight = acLnWt100
    ThisDrawing.Regen acAllViewports

    ' Read and display current extension lineweight
    MsgBox "The extension line weight for this object is now set to: " & DimPointAngularObj.ExtensionLineWeight

    ' Return previous lineweight setting
    ThisDrawing.preferences.LineWeightDisplay = oldLWSetting

End Sub


ExtLine1EndPoint Example [ActiveX and VBA Reference: AAR]

ExtLine1EndPoint Example

Using Programming Languages other than VBA

Sub Example_ExtLine1EndPoint()
    ' This example creates an angular dimension. It then changes
    ' the location of the ExtLine1EndPoint.

    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#

    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll
    MsgBox "The current value of ExtLine1EndPoint is " & dimObj.ExtLine1EndPoint(0) & ", " & dimObj.ExtLine1EndPoint(1) & ", " & dimObj.ExtLine1EndPoint(2), vbInformation, "ExtLine1EndPoint Example"

    ' Change the endpoint of the first extension line
    SecondPoint(0) = 0: SecondPoint(1) = 3: SecondPoint(2) = 0
    dimObj.ExtLine1EndPoint = SecondPoint
    dimObj.Update

    ' Return the endpoint of the first extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine1EndPoint
    MsgBox "The new value of ExtLine1EndPoint is " & dimObj.ExtLine1EndPoint(0) & ", " & dimObj.ExtLine1EndPoint(1) & ", " & dimObj.ExtLine1EndPoint(2), vbInformation, "ExtLine1EndPoint Example"
End Sub


ExtLine1Point Example [ActiveX and VBA Reference: AAR]

ExtLine1Point Example

Using Programming Languages other than VBA

Sub Example_ExtLine1Point()
    ' This example creates an aligned dimension and then changes the
    ' ExtLine1Point property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 5#: point2(2) = 0#
    location(0) = 5#: location(1) = 7#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    MsgBox "The current value for ExtLine1Point is " & dimObj.ExtLine1Point(0) & ", " & dimObj.ExtLine1Point(1) & ", " & dimObj.ExtLine1Point(2), vbInformation, "ExtLine1Point Example"

    ' Change the endpoint of the first extension line
    point1(0) = 2: point1(1) = 5: point1(2) = 0
    dimObj.ExtLine1Point = point1
    dimObj.Update

    ' Return the endpoint of the first extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine1Point

    MsgBox "The new value for ExtLine1Point is " & dimObj.ExtLine1Point(0) & ", " & dimObj.ExtLine1Point(1) & ", " & dimObj.ExtLine1Point(2), vbInformation, "ExtLine1Point Example"
End Sub


ExtLine1StartPoint Example [ActiveX and VBA Reference: AAR]

ExtLine1StartPoint Example

Using Programming Languages other than VBA

Sub Example_ExtLine1StartPoint()
    ' This example creates an angular dimension. It then changes
    ' the location of the ExtLine1StartPoint.

    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#

    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll
    MsgBox "The current value of ExtLine1StartPoint is " & dimObj.ExtLine1StartPoint(0) & ", " & dimObj.ExtLine1StartPoint(1) & ", " & dimObj.ExtLine1StartPoint(2), vbInformation, "ExtLine1StartPoint Example"

    ' Change the start point of the first extension line
    FirstPoint(0) = 0: FirstPoint(1) = 3: FirstPoint(2) = 0
    dimObj.ExtLine1StartPoint = FirstPoint
    dimObj.Update

    ' Return the start point of the first extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine1StartPoint
    MsgBox "The new value of ExtLine1StartPoint is " & dimObj.ExtLine1StartPoint(0) & ", " & dimObj.ExtLine1StartPoint(1) & ", " & dimObj.ExtLine1StartPoint(2), vbInformation, "ExtLine1StartPoint Example"
End Sub


ExtLine1Suppress Example [ActiveX and VBA Reference: AAR]

ExtLine1Suppress Example

Using Programming Languages other than VBA

Sub Example_ExtLine1Suppress()
    ' This example creates a Dim3PointAngular object in model space
    ' and suppresses the extension lines using the ExtLine1Suppress
    ' and ExtLine2Suppress properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim Line1Suppressed As String, Line2Suppressed As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current extension line suppression information
    Line1Suppressed = IIf(DimPointAngularObj.ExtLine1Suppress, "is suppressed", "is not suppressed")
    Line2Suppressed = IIf(DimPointAngularObj.ExtLine2Suppress, "is suppressed", "is not suppressed")

    MsgBox "Line one of the extension " & Line1Suppressed & vbCrLf & _
           "Line two of the extension " & Line2Suppressed

    ' Suppress line one of the extension
    DimPointAngularObj.ExtLine1Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line one of the extension is now suppressed"

    ' Suppress line two of the extension
    DimPointAngularObj.ExtLine2Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line two of the extension is now suppressed"

   ' Turn both extension lines back on
    DimPointAngularObj.ExtLine1Suppress = False
    DimPointAngularObj.ExtLine2Suppress = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Both extension lines are now visible again"

End Sub


ExtLine2EndPoint Example [ActiveX and VBA Reference: AAR]

ExtLine2EndPoint Example

Using Programming Languages other than VBA

Sub Example_ExtLine2EndPoint()
    ' This example creates an angular dimension. It then changes
    ' the location of the ExtLine2EndPoint.

    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#

    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll
    MsgBox "The current value of ExtLine2EndPoint is " & dimObj.ExtLine2EndPoint(0) & ", " & dimObj.ExtLine2EndPoint(1) & ", " & dimObj.ExtLine2EndPoint(2), vbInformation, "ExtLine2EndPoint Example"

    ' Change the endpoint of the second extension line
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    dimObj.ExtLine2EndPoint = SecondPoint
    dimObj.Update

    ' Return the endpoint of the second extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine2EndPoint
    MsgBox "The new value of ExtLine2EndPoint is " & dimObj.ExtLine2EndPoint(0) & ", " & dimObj.ExtLine2EndPoint(1) & ", " & dimObj.ExtLine2EndPoint(2), vbInformation, "ExtLine2EndPoint Example"
End Sub


ExtLine2Point Example [ActiveX and VBA Reference: AAR]

ExtLine2Point Example

Using Programming Languages other than VBA

Sub Example_ExtLine2Point()
    ' This example creates an aligned dimension and then changes the
    ' ExtLine2Point property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 5#: point2(2) = 0#
    location(0) = 5#: location(1) = 7#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    MsgBox "The current value for ExtLine2Point is " & dimObj.ExtLine2Point(0) & ", " & dimObj.ExtLine2Point(1) & ", " & dimObj.ExtLine2Point(2), vbInformation, "ExtLine2Point Example"

    ' Change the endpoint of the second extension line
    point1(0) = 12: point1(1) = 5: point1(2) = 0
    dimObj.ExtLine2Point = point1
    dimObj.Update

    ' Return the endpoint of the second extension line
    ' Note that the return value is a Variant
    Dim retPoint As Variant
    retPoint = dimObj.ExtLine2Point

    MsgBox "The new value for ExtLine2Point is " & dimObj.ExtLine2Point(0) & ", " & dimObj.ExtLine2Point(1) & ", " & dimObj.ExtLine2Point(2), vbInformation, "ExtLine2Point Example"
End Sub


ExtLine2StartPoint Example [ActiveX and VBA Reference: AAR]

ExtLine2StartPoint Example

Using Programming Languages other than VBA

Sub Example_ExtLine2StartPoint()
    ' This example creates an angular dimension. It then changes
    ' the location of the ExtLine2StartPoint.

    Dim dimObj As AcadDimAngular
    Dim angVert(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the dimension
    angVert(0) = 0#: angVert(1) = 5#: angVert(2) = 0#
    FirstPoint(0) = 1#: FirstPoint(1) = 7#: FirstPoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    TextPoint(0) = 3#: TextPoint(1) = 5#: TextPoint(2) = 0#

    ' Create the angular dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAngular(angVert, FirstPoint, SecondPoint, TextPoint)
    ZoomAll
    MsgBox "The current value of ExtLine2StartPoint is " & dimObj.ExtLine2StartPoint(0) & ", " & dimObj.ExtLine2StartPoint(1) & ", " & dimObj.ExtLine2StartPoint(2), vbInformation, "ExtLine2StartPoint Example"

    ' Change the start point of the second extension line
    FirstPoint(0) = 1: FirstPoint(1) = 4: FirstPoint(2) = 0
    dimObj.ExtLine2StartPoint = FirstPoint
    dimObj.Update

    ' Return the start point of the second extension line
    ' Note that the return value is a Variant
    Dim retPnt As Variant
    retPnt = dimObj.ExtLine2StartPoint
    MsgBox "The new value of ExtLine2StartPoint is " & dimObj.ExtLine2StartPoint(0) & ", " & dimObj.ExtLine2StartPoint(1) & ", " & dimObj.ExtLine2StartPoint(2), vbInformation, "ExtLine2StartPoint Example"
End Sub


ExtLine2Suppress Example [ActiveX and VBA Reference: AAR]

ExtLine2Suppress Example

Using Programming Languages other than VBA

Sub Example_ExtLine2Suppress()
    ' This example creates a Dim3PointAngular object in model space
    ' and suppresses the extension lines using the ExtLine1Suppress
    ' and ExtLine2Suppress properties

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double
    Dim Line1Suppressed As String, Line2Suppressed As String

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current extension line suppression information
    Line1Suppressed = IIf(DimPointAngularObj.ExtLine1Suppress, "is suppressed", "is not suppressed")
    Line2Suppressed = IIf(DimPointAngularObj.ExtLine2Suppress, "is suppressed", "is not suppressed")

    MsgBox "Line one of the extension " & Line1Suppressed & vbCrLf & _
           "Line two of the extension " & Line2Suppressed

    ' Suppress line one of the extension
    DimPointAngularObj.ExtLine1Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line one of the extension is now suppressed"

    ' Suppress line two of the extension
    DimPointAngularObj.ExtLine2Suppress = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Line two of the extension is now suppressed"

   ' Turn both extension lines back on
    DimPointAngularObj.ExtLine1Suppress = False
    DimPointAngularObj.ExtLine2Suppress = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Both extension lines are now visible again"

End Sub


Fade Example [ActiveX and VBA Reference: AAR]

Fade Example

Using Programming Languages other than VBA

Sub Example_Fade()
    ' This example inserts a raster image and finds the current
    ' Fade value of the image. It then changes the Fade value
    ' of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have the image, or if it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double
    Dim rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "Filer error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current Fade
    ThisDrawing.Regen True
    MsgBox "The Fade is currently set to: " & raster.Fade, vbInformation

    ' Change the Fade to 5
    raster.Fade = 50
    ThisDrawing.Regen True
    MsgBox "The Fade is now set to: " & raster.Fade, vbInformation
End Sub


Feature Example [ActiveX and VBA Reference: AAR]

Feature Example

Using Programming Languages other than VBA

Sub Example_Feature()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


FieldCode Example [ActiveX and VBA Reference: AAR]

FieldCode Example

Using Programming Languages other than VBA

Sub Example_FieldCode()
    ' This example creates a text object in model space.
    ' It then returns the field code string for the object.

    Dim textObj As IAcadText2
    Dim text As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    text = "%<\AcVar Date \f ""M/d/yyyy""%>%"
    insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(text, insertionPoint, height)
    ZoomAll

    ' Return the current text string for the object
    text = textObj.FieldCode
    MsgBox "The FieldCode for the text object equals: " & text, vbInformation, "FieldCode Example"

End Sub


FieldLength Example [ActiveX and VBA Reference: AAR]

FieldLength Example

Using Programming Languages other than VBA

Sub Example_FieldLength()
    ' This example creates an attribute definition in model space.
    ' It then queries the initial value of the FieldLength property,
    ' changes that value, and finally resets the value.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "New Tag"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Return the current field length of the attribute
    Dim currFieldLength As Integer
    currFieldLength = attributeObj.FieldLength
    MsgBox "The FieldLength of the attribute is " & attributeObj.FieldLength, vbInformation, "FieldLength Example"

    ' Change the field length
    attributeObj.FieldLength = currFieldLength + 2
    attributeObj.Update
    MsgBox "The new FieldLength of the attribute is " & attributeObj.FieldLength, vbInformation, "FieldLength Example"

    ' Reset the field length to the original value
    attributeObj.FieldLength = currFieldLength
    attributeObj.Update
    MsgBox "The FieldLength of the attribute is reset to " & attributeObj.FieldLength, vbInformation, "FieldLength Example"

End Sub


FileName Example [ActiveX and VBA Reference: AAR]

FileName Example

Using Programming Languages other than VBA

Sub Example_FileName()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


Files Example [ActiveX and VBA Reference: AAR]

Files Example

Using Programming Languages other than VBA

Sub Example_Files()
    ' This example obtains a reference to the Files Preferences object
    ' from the Application Preferences object, and reads one of the File
    ' preferences

    Dim ACADPref As AcadPreferencesFiles

    ' Obtain a reference to the Files Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    MsgBox "We now have access to the properties and methods of the Files Preferences object!"
    MsgBox "The File preference AutoSavePath is set to: " & ACADPref.AutoSavePath

    ' Release Files Preferences object
    Set ACADPref = Nothing
    MsgBox "We have now released the Files Preferences object!"
End Sub


FileSize Example [ActiveX and VBA Reference: AAR]

FileSize Example

Using Programming Languages other than VBA

Sub Example_FileSize()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


FingerprintGUID Example [ActiveX and VBA Reference: AAR]

FingerprintGUID Example

Using Programming Languages other than VBA

Sub Example_FingerprintGUID()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


Fit Example [ActiveX and VBA Reference: AAR]

Fit Example

Using Programming Languages other than VBA

Sub Example_Fit()
    ' This example creates an aligned dimension in model space
    ' and cycles the text fit of the dimension to a couple of common values

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentFit As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 6: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension line fit information
    Select Case dimObj.Fit
        Case acTextAndArrows:   CurrentFit = "Text and Arrows"
        Case acArrowsOnly:      CurrentFit = "Arrows Only"
        Case acTextOnly:        CurrentFit = "Text Only"
        Case acBestFit:         CurrentFit = "Best Fit"
    End Select

    MsgBox "The current dimension fit is set to: " & CurrentFit

    ' Change the fit to arrows only
    dimObj.Fit = acArrowsOnly
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension fit has been changed to arrows only"

    ' Change the fit to text only
    dimObj.Fit = acTextOnly
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension fit has been changed to text only"

End Sub


FitPoints Example [ActiveX and VBA Reference: AAR]

FitPoints Example

Using Programming Languages other than VBA

Sub Example_FitPoints()
   ' This example creates a Spline object in model space, reads the fit points
   ' of the Spline and then modifies the fit points of the Spline.

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim FPoints(0 To 8) As Double
    Dim UserMessage As String
    Dim fitPoints As Variant
    Dim iCount As Long, iPoint As Integer
    Dim NewFP(0 To 2) As Double

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    FPoints(0) = 0: FPoints(1) = 0: FPoints(2) = 0
    FPoints(3) = 5:   FPoints(4) = 5: FPoints(5) = 0
    FPoints(6) = 10: FPoints(7) = 0: FPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(FPoints, startTan, endTan)
    ThisDrawing.Application.ZoomAll

    ' Display fit points for this Spline
    GoSub DISPLAYPOINTS

    ' Modify an existing fit point for this Spline
    fitPoints(0) = 3
    splineObj.fitPoints = fitPoints

    ' Now add a new fit point
    NewFP(0) = 15: NewFP(1) = 4: NewFP(2) = 0
    splineObj.AddFitPoint splineObj.NumberOfFitPoints + 1, NewFP

    ThisDrawing.Application.ZoomAll

    ' Display new fit points for this Spline
    GoSub DISPLAYPOINTS

    Exit Sub

DISPLAYPOINTS:
    fitPoints = splineObj.fitPoints

    ' Display in groups of three
    UserMessage = ""
    iPoint = 0
    For iCount = 0 To UBound(fitPoints) Step 3
        iPoint = iPoint + 1
        UserMessage = UserMessage & iPoint & ")" & vbTab
        UserMessage = UserMessage & fitPoints(iCount)
        UserMessage = UserMessage & ", " & fitPoints(iCount + 1)
        UserMessage = UserMessage & ", " & fitPoints(iCount + 2)
        UserMessage = UserMessage & vbCrLf
    Next

    MsgBox "The " & splineObj.NumberOfFitPoints & " Spline fit points are: " & vbCrLf & vbCrLf & UserMessage

    Return
End Sub


FitTolerance Example [ActiveX and VBA Reference: AAR]

FitTolerance Example

Using Programming Languages other than VBA

Sub Example_FitTolerance()
    ' This example creates a spline object in model space.
    ' It then changes the FitTolerance property of that spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Find the current FitTolerance value
    Dim currFitTolerance As Double
    currFitTolerance = splineObj.FitTolerance
    MsgBox "The current FitTolerance is " & currFitTolerance, vbInformation, "FitTolerance Example"

    ' Change the fit tolerance value
    splineObj.FitTolerance = 5
    ZoomAll
    MsgBox "The FitTolerance is now " & splineObj.FitTolerance, vbInformation, "FitTolerance Example"

End Sub


Float Example [ActiveX and VBA Reference: AAR]

Float Example

Using Programming Languages other than VBA

Sub Example_Float()
    ' This example creates a new toolbar called "TestToolbar" and inserts three
    ' buttons into it. The toolbar is then displayed as a floating toolbar,
    ' and then as a docked toolbar.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add three buttons to the new toolbar.
    ' All three buttons will have the same macro attached.
    Dim newButton1 As AcadToolbarItem
    Dim newButton2 As AcadToolbarItem
    Dim newButton3 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)
    Set newButton2 = newToolBar.AddToolbarButton("", "NewButton2", "Open a file.", openMacro)
    Set newButton3 = newToolBar.AddToolbarButton("", "NewButton3", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    ' Dock the toolbar to the left of the screen.
    newToolBar.Dock acToolbarDockLeft
    GoSub QUERYSTATUS

    ' Float the toolbar
    newToolBar.Float 200, 200, 1
    GoSub QUERYSTATUS

    Exit Sub

QUERYSTATUS:
    ' Query the toolbar to see if it is docked.
    If newToolBar.DockStatus = acToolbarFloating Then
        MsgBox "The toolbar is floating."
    Else
        MsgBox "The toolbar is docked."
    End If
    Return

End Sub


FloatingRows Example [ActiveX and VBA Reference: AAR]

FloatingRows Example

Using Programming Languages other than VBA

Sub Example_FloatingRows()
    ' This example creates a new toolbar called "TestToolbar" and inserts three
    ' buttons into it. The toolbar is then displayed as a floating
    ' toolbar with 1 and then 3 rows.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add three buttons to the new toolbar.
    ' All three buttons will have the same macro attached.
    Dim newButton1 As AcadToolbarItem
    Dim newButton2 As AcadToolbarItem
    Dim newButton3 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)
    Set newButton2 = newToolBar.AddToolbarButton("", "NewButton2", "Open a file.", openMacro)
    Set newButton3 = newToolBar.AddToolbarButton("", "NewButton3", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True
    newToolBar.Float 200, 200, 1

    MsgBox "The toolbar has " & newToolBar.FloatingRows & " row."

    newToolBar.FloatingRows = 2
    MsgBox "The toolbar has " & newToolBar.FloatingRows & " rows."

    newToolBar.FloatingRows = 3
    MsgBox "The toolbar has " & newToolBar.FloatingRows & " rows."

End Sub


FlowDirection Example [ActiveX and VBA Reference: AAR]

FlowDirection Example

Using Programming Languages other than VBA

Sub Example_FlowDirection()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


Flyout Example [ActiveX and VBA Reference: AAR]

Flyout Example

Using Programming Languages other than VBA

Sub Example_Flyout()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar(TestMenu) with a Toolbar button that will act
    ' as a flyout.  The examples sets the Flyout menu to an existing Toolbar menu.
    ' The Toolbar will automatically be displayed and will display the UCS menu
    ' as a flyout.

    Dim currMenuGroup As acadMenuGroup
    Dim newToolBar As AcadToolbar, newToolBarFlyoutButton As AcadToolbarItem

    On Error GoTo ERRORTRAP

    ' Use MenuGroups property to obtain reference to main AutoCAD menu
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    ' Create a new Toolbar in this group
    Set newToolBar = currMenuGroup.Toolbars.Add("TestMenu")

    ' Add new button to TestMenu that will link to the Flyout menu
    '
    ' * NOTE: Set the macro name to the name of the flyout toolbar because
    ' setting it to an empty string causes an error.  The paremeter
    ' is actually ignored when the style is flyout, but must have any value other than "".
    Set newToolBarFlyoutButton = newToolBar.AddToolbarButton(newToolBar.count + 1, "Flyout", "Flyout", "UCS", True)

    ' Link the existing toolbar "UCS" as the flyout for the new toolbar button
    '
    ' * NOTE: To change the flyout, simply change the MenuGroup and Toolbar name below
    newToolBarFlyoutButton.AttachToolbarToFlyout "ACAD", "UCS"

    MsgBox "The flyout attached to the Test menu is " & newToolBarFlyoutButton.Flyout.name

    Exit Sub

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description
End Sub


FontFile Example [ActiveX and VBA Reference: AAR]

FontFile Example

Using Programming Languages other than VBA

Sub Example_FontFile()
    ' This example returns the current setting of
    ' the FontFile property. It then changes the value, and
    ' finally resets the value back to the original setting.

    Dim textStyle1 As AcadTextStyle
    Dim currFontFile As String
    Dim newFontFile As String

    Set textStyle1 = ThisDrawing.ActiveTextStyle

    ' Retrieve the current FontFile value
    currFontFile = textStyle1.fontFile
    MsgBox "The current value for FontFile is " & currFontFile, vbInformation, "FontFile Example"

    ' Change the value for FontFile
    newFontFile = "C:/AutoCAD/Fonts/italic.shx"
    textStyle1.fontFile = newFontFile
    MsgBox "The new value for FontFile is " & textStyle1.fontFile, vbInformation, "FontFile Example"

    ' Reset font file
    textStyle1.fontFile = currFontFile
    MsgBox "The value for FontFile has been reset to " & textStyle1.fontFile, vbInformation, "FontFile Example"
End Sub


FontFileMap Example [ActiveX and VBA Reference: AAR]

FontFileMap Example

Using Programming Languages other than VBA

Sub Example_FontFileMap()
    ' This example returns the current setting of
    ' FontFileMap. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currFontFileMap As String
    Dim newFontFileMap As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current FontFileMap value
    currFontFileMap = preferences.Files.FontFileMap
    MsgBox "The current value for FontFileMap is " & currFontFileMap, vbInformation, "FontFileMap Example"

    ' Change the value for FontFileMap
    newFontFileMap = "TestFontFileMap.fmp"
    preferences.Files.FontFileMap = newFontFileMap
    MsgBox "The new value for FontFileMap is " & newFontFileMap, vbInformation, "FontFileMap Example"

    ' Reset FontFileMap to its original value
    preferences.Files.FontFileMap = currFontFileMap
    MsgBox "The FontFileMap value is reset to " & currFontFileMap, vbInformation, "FontFileMap Example"
End Sub


ForceLineInside Example [ActiveX and VBA Reference: AAR]

ForceLineInside Example

Using Programming Languages other than VBA

Sub Example_ForceLineInside()
    ' This example creates an aligned dimension in model space
    ' and toggles dimension lines to be drawn between extension lines

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current line suppression information
    CurrentValue = IIf(dimObj.ForceLineInside, "are", "are not")
    MsgBox "Dimension lines " & CurrentValue & " forced between the extension lines"

    ' Force the display of dimension lines between the extension lines
    dimObj.ForceLineInside = True
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension lines are forced between the extension lines"

    ' Do not force the display of dimension lines between the extension lines (default)
    dimObj.ForceLineInside = False
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension lines are not forced between the extension lines"

End Sub


FoundPath Example [ActiveX and VBA Reference: AAR]

FoundPath Example

Using Programming Languages other than VBA

Sub Example_FoundPath()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


FractionFormat Example [ActiveX and VBA Reference: AAR]

FractionFormat Example

Using Programming Languages other than VBA

Sub Example_FractionFormat()
   ' This example creates an aligned dimension in model space and
   ' uses FractionFormat to cycle through some fractional formats
   ' for the dimension.
   ' * Note the appearance of the "1/2" component of the dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Switch to a mode that works with the FractionFormat property
    dimObj.UnitsFormat = acDimLArchitectural

    ' Cycle through some common fractional formats

    dimObj.FractionFormat = acDiagonal      ' Change format to Diagonal
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension format is now set to diagonal"

    dimObj.FractionFormat = acHorizontal    ' Change format to Horizontal
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension format is now set to horizontal"

    dimObj.FractionFormat = acNotStacked    ' Change format to NotStacked
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension format is now unstacked"

End Sub


Freeze Example [ActiveX and VBA Reference: AAR]

Freeze Example

Using Programming Languages other than VBA

Sub Example_Freeze()
    ' This example creates a new layer called "Freeze".
    ' It then displays the status of the Freeze property
    ' for the new layer, toggles the status of the
    ' Freeze property, and again displays its status.
    ' After running this example, you can check the layer
    ' control on the Object Properties tool bar. It will
    ' show the new layer and the latest Freeze status.

    Dim layerObj As AcadLayer

    ' Create the new layer
    Set layerObj = ThisDrawing.Layers.Add("Freeze")

    ' Display the Freeze status of the new layer
    GoSub DISPLAYSTATUS

    ' Toggle the status of the Freeze property for the layer
    layerObj.Freeze = Not (layerObj.Freeze)

    ' Display the Freeze status of the new layer
    GoSub DISPLAYSTATUS
    Exit Sub

DISPLAYSTATUS:
    If layerObj.Freeze Then
        MsgBox "Layer " & layerObj.name & " is frozen.", , "Freeze Example"
    Else
        MsgBox "Layer " & layerObj.name & " is thawed.", , "Freeze Example"
    End If
    Return

End Sub


FullCrcValidation Example [ActiveX and VBA Reference: AAR]

FullCRCValidation Example

Using Programming Languages other than VBA

Sub Example_FullCRCValidation()
    ' This example returns the current setting of
    ' FullCRCValidation. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currFullCRCValidation As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current FullCRCValidation value
    currFullCRCValidation = preferences.OpenSave.FullCRCValidation
    MsgBox "The current value for FullCRCValidation is " & preferences.OpenSave.FullCRCValidation, vbInformation, "FullCRCValidation Example"

    ' Change the value for FullCRCValidation
    preferences.OpenSave.FullCRCValidation = Not (currFullCRCValidation)
    MsgBox "The new value for FullCRCValidation is " & preferences.OpenSave.FullCRCValidation, vbInformation, "FullCRCValidation Example"

    ' Reset FullCRCValidation to its original value
    preferences.OpenSave.FullCRCValidation = currFullCRCValidation
    MsgBox "The FullCRCValidation value is reset to " & preferences.OpenSave.FullCRCValidation, vbInformation, "FullCRCValidation Example"
End Sub


FullFileName Example [ActiveX and VBA Reference: AAR]

FullFileName Example

Using Programming Languages other than VBA

Sub Example_FullFileName()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


FullName Example [ActiveX and VBA Reference: AAR]

FullName Example

Using Programming Languages other than VBA

Sub Example_FullName()
    ' This example uses the FullName property to find
    ' the full name of the current drawing, and of
    ' the application.

    ' Find the full name of current drawing file including path.
    ' (If the drawing has not been saved, this name will be blank.)
    Dim docName As String
    docName = ThisDrawing.FullName
    MsgBox "The full name of the current drawing is " & docName, , "FullName Example"

    ' Find the full name of application
    Dim appName As String
    appName = ThisDrawing.Application.FullName
    MsgBox "The full name of the current application is " & appName, , "FullName Example"

End Sub


FullScreenTrackingVector Example [ActiveX and VBA Reference: AAR]

FullScreenTrackingVector Example

Using Programming Languages other than VBA

Sub Example_FullScreenTrackingVector()
    ' This example reads and modifies the preference value that controls
    ' the display of full-screen tracking vectors.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.FullScreenTrackingVector
    MsgBox "The FullScreenTrackingVector preference is set to: " & originalValue

    ' Modify the FullScreenTrackingVector preference by toggling the value
    ACADPref.FullScreenTrackingVector = Not (originalValue)
    newValue = ACADPref.FullScreenTrackingVector
    MsgBox "The FullScreenTrackingVector preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.FullScreenTrackingVector = originalValue
    MsgBox "The FullScreenTrackingVector preference was reset back to: " & originalValue
End Sub


GenerateUsageData Example [ActiveX and VBA Reference: AAR]

GenerateUsageData Example

Using Programming Languages other than VBA

Sub Example_GenerateUsageData()
    ' This example provides usage information for the layers
    ' in a drawing
    Dim MyLayers As IAcadLayers2
    Set MyLayers = ThisDrawing.Layers
    MyLayers.GenerateUsageData
    Dim MyLayerObj As IAcadLayer2
    For Each MyLayerObj In ThisDrawing.Layers
      MyLayerObj.Description = "Test"
      MsgBox (MyLayerObj.Used)
    Next MyLayerObj
End Sub


GetAcadState Example [ActiveX and VBA Reference: AAR]

GetAcadState Example

Using Programming Languages other than VBA

Sub Example_GetAcadState()
    ' This example gets the acadState object and checks to see if
    ' AutoCAD is in a quiescent state.
    Dim State As AcadState
    Set State = GetAcadState
    If State.IsQuiescent Then
        MsgBox "AutoCAD is quiescent."
    Else
        MsgBox "AutoCAD is not quiescent."
    End If
End Sub


GetAlignment Example [ActiveX and VBA Reference: AAR]

GetAlignment Example

Using Programming Languages other than VBA

Sub Example_GetAlignment()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetAlignment2 Example [ActiveX and VBA Reference: AAR]

GetAlignment2 Example

Using Programming Languages other than VBA

Sub Example_GetAlignment2()
       ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As IAcadTableStyle2
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow + AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col

      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            , AcRowType.acDataRow + AcRowType.acTitleRow, True

      Call customObj.SetAlignment2("NewStyle", acBottomRight)

      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetAllProfileNames Example [ActiveX and VBA Reference: AAR]

GetAllProfileNames Example

Using Programming Languages other than VBA

Sub Example_GetAllProfileNames()
    ' This example gets all the profiles available for the system.

    Dim systemProfiles As Variant
    Call AcadApplication.preferences.Profiles.GetAllProfileNames(systemProfiles)

    ' List all the profiles for the system
    Dim x As Integer
    Dim msg As String
    msg = ""
    For x = LBound(systemProfiles) To UBound(systemProfiles)
        msg = msg & systemProfiles(x) & vbCrLf
    Next
    MsgBox msg, vbInformation, "Available Profiles"
End Sub


GetAngle Example [ActiveX and VBA Reference: AAR]

GetAngle Example

Using Programming Languages other than VBA

Sub Example_GetAngle()
    ' This example demonstrates 4 different ways to retrieve
    ' an angle from the user using the GetAngle method.

    Dim retAngle As Double

    ' Return the angle in radians with a prompt
    retAngle = ThisDrawing.Utility.GetAngle(, "Enter an angle: ")
    MsgBox "The angle entered was " & retAngle, , "GetAngle Example"

    ' Return the angle in radians without any prompt
    retAngle = ThisDrawing.Utility.GetAngle()
    MsgBox "The angle entered was " & retAngle, , "GetAngle Example"

    ' Return the angle in radians with a prompt and an angle base point
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    retAngle = ThisDrawing.Utility.GetAngle(basePnt, "Enter an angle: ")
    MsgBox "The angle entered was " & retAngle, , "GetAngle Example"

    ' Return the angle in radians with an angle base point but no prompt
    retAngle = ThisDrawing.Utility.GetAngle(basePnt)
    MsgBox "The angle entered was " & retAngle, , "GetAngle Example"

End Sub


GetAttributes Example [ActiveX and VBA Reference: AAR]

GetAttributes Example

Using Programming Languages other than VBA

Sub Example_GetAttributes()
    ' This example creates a block. It then adds attributes to that
    ' block. The block is then inserted into the drawing to create
    ' a block reference.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "TESTBLOCK")

    ' Define the attribute definition
    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String
    height = 1#
    mode = acAttributeModeVerify
    prompt = "Attribute Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "Attribute Tag"
    value = "Attribute Value"

    ' Create the attribute definition object in model space
    Set attributeObj = blockObj.AddAttribute(height, mode, prompt, insertionPoint, tag, value)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "TESTBLOCK", 1#, 1#, 1#, 0)
    ZoomAll

    ' Get the attributes for the block reference
    Dim varAttributes As Variant
    varAttributes = blockRefObj.GetAttributes

    ' Move the attribute tags and values into a string to be displayed in a Msgbox
    Dim strAttributes As String
    Dim I As Integer
    For I = LBound(varAttributes) To UBound(varAttributes)
        strAttributes = strAttributes & "  Tag: " & varAttributes(I).TagString & _
                        "   Value: " & varAttributes(I).textString & "    "
    Next
    MsgBox "The attributes for blockReference " & blockRefObj.name & " are: " & strAttributes, , "GetAttributes Example"

    ' Change the value of the attribute
    ' Note: There is no SetAttributes. Once you have the variant array, you have the objects.
    ' Changing them changes the objects in the drawing.
    varAttributes(0).textString = "NEW VALUE!"

    ' Get the attributes
    Dim newvarAttributes As Variant
    newvarAttributes = blockRefObj.GetAttributes

    ' Again, display the tags and values
    strAttributes = ""
    For I = LBound(varAttributes) To UBound(varAttributes)
        strAttributes = strAttributes & "  Tag: " & varAttributes(I).TagString & _
                        "   Value: " & varAttributes(I).textString & "    "
    Next
    MsgBox "The attributes for blockReference " & blockRefObj.name & " are: " & strAttributes, , "GetAttributes Example"

End Sub


GetBackgroundColor Example [ActiveX and VBA Reference: AAR]

GetBackgroundColor Example

Using Programming Languages other than VBA

Sub Example_GetBackgroundColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetBackgroundColorNone Example [ActiveX and VBA Reference: AAR]

GetBackgroundColorNone Example

Using Programming Languages other than VBA

Sub Example_GetBackgroundColorNone()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetBitmaps Example [ActiveX and VBA Reference: AAR]

GetBitmaps Example

Using Programming Languages other than VBA

Sub Example_GetBitmaps()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar (TestMenu) and inserts a ToolBarButton
    ' with a custom icon into it. The menu is automatically shown.
    '
    ' * NOTE: The paths of the icons for the new toolbar should be updated
    ' before running this example.

    Dim currMenuGroup As acadMenuGroup
    Dim newToolBar As AcadToolbar, newToolBarButton As AcadToolbarItem
    Dim openMacro As String
    Dim SmallBitmapName  As String, LargeBitmapName  As String

    On Error GoTo ERRORTRAP

    ' Use MenuGroups property to obtain reference to main AutoCAD menu
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    ' Create the new Toolbar in this group
    Set newToolBar = currMenuGroup.Toolbars.Add("TestMenu")

    ' Add an item to the new Toolbar and assign an Open macro
    ' (VBA equivalent of: "ESC ESC _open ")
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)
    Set newToolBarButton = newToolBar.AddToolbarButton(newToolBar.count + 1, "Open", "Open Macro", openMacro, False)

    ' Read icon paths for this Toolbar button
    GoSub READPATHS

    ' Change the default icon (smile face) for the new toolbar button
    SmallBitmapName = "c:\images\16x16.bmp"     ' Use a 16x16 pixel .BMP image
    LargeBitmapName = "c:\images\32x32.bmp"     ' Use a 32x32 pixel .BMP image
    newToolBarButton.SetBitmaps SmallBitmapName, LargeBitmapName

    ' Read icon paths for this Toolbar button
    GoSub READPATHS

    Exit Sub

READPATHS:
    ' Read icon paths for this Toolbar button
    newToolBarButton.GetBitmaps SmallBitmapName, LargeBitmapName
    MsgBox "The new Toolbar uses the following icon files: " & _
           vbCrLf & vbCrLf & "Small Bitmap: " & SmallBitmapName & vbCrLf & _
           "Large Bitmap: " & LargeBitmapName

    Return

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description
End Sub


GetBoundingBox Example [ActiveX and VBA Reference: AAR]

GetBoundingBox Example

Using Programming Languages other than VBA

Sub Example_GetBoundingBox()
    ' This example creates a line in model space. It then finds the
    ' bounding box for the line and displays the corners of the box.

    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim lineObj As AcadLine

    ' Create the Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    Dim minExt As Variant
    Dim maxExt As Variant

    ' Return the bounding box for the line and return the minimum
    ' and maximum extents of the box in the minExt and maxExt variables.
    lineObj.GetBoundingBox minExt, maxExt

    ' Print the min and max extents
    MsgBox "The extents of the bounding box for the line are:" & vbCrLf _
         & "Min Extent: " & minExt(0) & "," & minExt(1) & "," & minExt(2) _
         & vbCrLf & "Max Extent: " & maxExt(0) & "," & maxExt(1) & "," & maxExt(2), vbInformation, "GetBoundingBox Example"

End Sub


GetBulge Example [ActiveX and VBA Reference: AAR]

GetBulge Example

Using Programming Languages other than VBA

Sub Example_GetBulge()
    ' This example creates a lightweight polyline in model space.
    ' It then finds and changes the bulge for a given segment.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 1

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ZoomAll

    ' Find the bulge of the third segment
    Dim currentBulge As Double
    currentBulge = plineObj.GetBulge(3)
    MsgBox "The bulge for the third segment is " & plineObj.GetBulge(3), , "GetBulge Example"

    ' Change the bulge of the third segment
    plineObj.SetBulge 3, -0.5
    plineObj.Update
    MsgBox "The bulge for the third segment is now " & plineObj.GetBulge(3), , "GetBulge Example"

End Sub


GetCanonicalMediaNames Example [ActiveX and VBA Reference: AAR]

GetCanonicalMediaNames Example

Using Programming Languages other than VBA

Sub Example_GetCanonicalMediaNames()
    ' This example gets the current plot device information
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout

    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo

    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()

    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next

    ' List all the media names, and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()

    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next

    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()

    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next

End Sub


GetColor Example [ActiveX and VBA Reference: AAR]

GetColor Example

Using Programming Languages other than VBA

Sub Example_GetColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetConstantAttributes Example [ActiveX and VBA Reference: AAR]

GetConstantAttributes Example

Using Programming Languages other than VBA

Sub Example_GetConstantAttributes()
    ' This example creates a constant attribute definition on a block.
    ' It then queries the block to return the attribute.

    ' Create the block to hold the attribute
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "New_Block")

    ' Define the attribute definition
    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim tag As String
    Dim value As String
    height = 1#
    mode = acAttributeModeConstant
    prompt = "Constant Prompt"
    insertionPnt(0) = 5#: insertionPnt(1) = 5#: insertionPnt(2) = 0#
    tag = "Constant Tag"
    value = "Constant Value"

    ' Create the attribute definition object on the block
    Set attributeObj = blockObj.AddAttribute(height, mode, prompt, insertionPnt, tag, value)
    ZoomAll

    ' Insert the block into the drawing
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "New_Block", 1#, 1#, 1#, 0)

    ' Get the constant attribute definition from the block
    Dim queryAttribute As Variant
    queryAttribute = blockRefObj.GetConstantAttributes

    Dim count As Integer
    count = UBound(queryAttribute) - LBound(queryAttribute)
    MsgBox "The block reference has " & count & " constant attributes."
End Sub


GetControlPoint Example [ActiveX and VBA Reference: AAR]

GetControlPoint Example

Using Programming Languages other than VBA

Sub Example_GetControlPoint()
    ' This example creates a spline object in model space.
    ' It then finds the coordinates of the first control point
    ' and changes that value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the first control point
    Dim controlPoint As Variant
    controlPoint = splineObj.GetControlPoint(0)
    MsgBox "Control point 1 is at " & controlPoint(0) & ", " & controlPoint(1) & ", " & controlPoint(2), , "GetControlPoint Example"

    ' Change the coordinate of the first fit point
    controlPoint(0) = 0: controlPoint(1) = 3: controlPoint(2) = 0
    splineObj.SetControlPoint 0, controlPoint
    splineObj.Update
    MsgBox "Control point 1 is now at " & controlPoint(0) & ", " & controlPoint(1) & ", " & controlPoint(2), , "GetControlPoint Example"

End Sub


GetCorner Example [ActiveX and VBA Reference: AAR]

GetCorner Example

Using Programming Languages other than VBA

Sub Example_GetCorner()
    ' This example provides a base point and prompts the user to
    ' input the second point to make a rectangle.

    Dim returnPnt As Variant
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#

    ' Prompt the user to pick second point and returns the point
    returnPnt = ThisDrawing.Utility.GetCorner(basePnt, "Enter Other corner: ")

    ' Display the point picked
    MsgBox "The point picked was " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetCorner Example"

End Sub


GetCustomByIndex Example [ActiveX and VBA Reference: AAR]

GetCustomByIndex Example

Using Programming Languages other than VBA

Sub Example_GetCustomByIndex()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


GetCustomByKey Example [ActiveX and VBA Reference: AAR]

GetCustomByKey Example

Using Programming Languages other than VBA

Sub Example_GetCustomByKey()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


GetCustomScale Example [ActiveX and VBA Reference: AAR]

GetCustomScale Example

Using Programming Languages other than VBA

Sub Example_GetCustomScale()
    ' This example will access the Layouts collection for the current drawing
    ' and list basic information about the custom scale for each Layout.
    ' It will then change the custom scale information for model space and re-display
    ' the scale information.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim Numerator As Double, Denominator As Double
    Dim Measurement As String

    ' Display current scale information
    GoSub DISPLAY_SCALE_INFO

    ' Modify scale
    Numerator = 1
    Denominator = 1

    ThisDrawing.Layouts("Model").SetCustomScale Numerator, Denominator
    ThisDrawing.Regen acAllViewports

    ' Display new scale information
    GoSub DISPLAY_SCALE_INFO

    Exit Sub

DISPLAY_SCALE_INFO:
    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the scale information of every layout in this drawing
    For Each Layout In Layouts
        msg = msg & Layout.name & vbCrLf

        ' Get scale information
        Layout.GetCustomScale Numerator, Denominator

        ' Are we using inches or millimeters
        Measurement = IIf(Layout.PaperUnits = acInches, " inch(es)", " millimeter(s)")

        ' Format for display
        msg = msg & vbTab & "Contains " & Numerator & Measurement & vbCrLf
        msg = msg & vbTab & "Contains " & Denominator & " drawing units" & vbCrLf
        msg = msg & "_____________________" & vbCrLf

    Next

    ' Display custom scale information
    MsgBox "Custom scale information for the current drawing is: " & msg

    Return
End Sub


GetDistance Example [ActiveX and VBA Reference: AAR]

GetDistance Example

Using Programming Languages other than VBA

Sub Example_GetDistance()
    ' This example returns the distance entered by the user.

    Dim returnDist As Double
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 0#: basePnt(1) = 0#: basePnt(2) = 0#

    ' Return the value entered by user. A prompt is provided.
    returnDist = ThisDrawing.Utility.GetDistance(, "Enter distance: ")
    MsgBox "The distance entered was " & returnDist & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetDistance Example"

    ' Return the value entered by user. No prompt is provided.
    returnDist = ThisDrawing.Utility.GetDistance()
    MsgBox "The distance entered was " & returnDist, , "GetDistance Example"

    ' Return the value entered by user. A base point and prompt are provided.
    returnDist = ThisDrawing.Utility.GetDistance(basePnt, "Enter a distance: ")
    MsgBox "The distance entered was " & returnDist, , "GetDistance Example"

End Sub


GetEntity Example [ActiveX and VBA Reference: AAR]

GetEntity Example

Using Programming Languages other than VBA

Sub Example_GetEntity()
    ' This example creates several objects in model space. It then
    ' prompts the user to select an object. The example continues to
    ' have the user select objects until the user selects in empty space.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Begin the selection
    Dim returnObj As AcadObject
    Dim basePnt As Variant

    On Error Resume Next

    ' The following example waits for a selection from the user

RETRY:
    ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"

    If Err <> 0 Then
        Err.Clear
        MsgBox "Program ended.", , "GetEntity Example"
        Exit Sub
    Else
        returnObj.Update
        MsgBox "The object type is: " & returnObj.EntityName, , "GetEntity Example"
        returnObj.Update
    End If

    GoTo RETRY
End Sub


GetExtensionDictionary Example [ActiveX and VBA Reference: AAR]

GetExtensionDictionary Example

Using Programming Languages other than VBA

Sub Example_GetExtensionDictionary()
    ' This example creates a Circle object in model space and
    ' adds a new Extension Dictionary to the Circle object

    Dim EDictionary As AcadDictionary
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    MsgBox "Circle object Extension Dictionary state before: " & circleObj.HasExtensionDictionary

    ' Create an Extension Dictionary for the new Circle
    Set EDictionary = circleObj.GetExtensionDictionary

    MsgBox "Circle object Extension Dictionary state after: " & circleObj.HasExtensionDictionary
End Sub


GetFitPoint Example [ActiveX and VBA Reference: AAR]

GetFitPoint Example

Using Programming Languages other than VBA

Sub Example_GetFitPoint()
    ' This example creates a spline object in model space.
    ' It then finds the coordinates of the fit points.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the fit points
    Dim fitPoint As Variant
    Dim index As Integer
    For index = 0 To splineObj.NumberOfFitPoints - 1
        fitPoint = splineObj.GetFitPoint(index)
        MsgBox "Fit point " & index + 1 & " is at " & fitPoint(0) & ", " & fitPoint(1) & ", " & fitPoint(2), , "GetFitPoint Example"
    Next

End Sub


GetFont Example [ActiveX and VBA Reference: AAR]

GetFont Example

Using Programming Languages other than VBA

Sub Example_GetFont()
    ' This example find the font information for the active text style.

    Dim typeFace As String
    Dim Bold As Boolean
    Dim Italic As Boolean
    Dim charSet As Long
    Dim PitchandFamily As Long

    ThisDrawing.ActiveTextStyle.GetFont typeFace, Bold, Italic, charSet, PitchandFamily

    MsgBox "The current text style has the following font properties:" & vbCrLf _
            & "Typeface: " & typeFace & vbCrLf _
            & "Bold: " & Bold & vbCrLf _
            & "Italic: " & Italic & vbCrLf _
            & "Character set: " & charSet & vbCrLf _
            & "Pitch and Family: " & PitchandFamily

End Sub


GetGridColor Example [ActiveX and VBA Reference: AAR]

GetGridColor Example

Using Programming Languages other than VBA

Sub Example_GetGridColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetGridLineWeight Example [ActiveX and VBA Reference: AAR]

GetGridLineWeight Example

Using Programming Languages other than VBA

Sub Example_GetGridLineWeight()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetGridSpacing Example [ActiveX and VBA Reference: AAR]

GetGridSpacing Example

Using Programming Languages other than VBA

Sub Example_GetGridSpacing()
    ' This example turns on the grid for the current viewport.
    ' It then finds the current grid spacing, and changes that spacing.

    ' Find the current active viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Turn on the grid and reset the viewport to see it come on.
    viewportObj.GridOn = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Find the current grid spacing
    Dim XSpacing As Double
    Dim YSpacing As Double

    viewportObj.GetGridSpacing XSpacing, YSpacing
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, , "GetGridSpacing Example"

    ' Change the grid spacing
    XSpacing = XSpacing * 0.5
    YSpacing = YSpacing * 0.5
    viewportObj.SetGridSpacing XSpacing, YSpacing
    ThisDrawing.ActiveViewport = viewportObj
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, , "GetGridSpacing Example"

End Sub


GetGridVisibility Example [ActiveX and VBA Reference: AAR]

GetGridVisibility Example

Using Programming Languages other than VBA

Sub Example_GetGridVisibility()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetInput Example [ActiveX and VBA Reference: AAR]

GetInput Example

Using Programming Languages other than VBA

Sub Example_GetInput()
    ' This example prompts for user input of a point. By using the
    ' InitializeUserInput method to define a keyword list, the example can also
    ' return keywords entered by the user.

    On Error Resume Next

    ' Define the valid keywords
    Dim keywordList As String
    keywordList = "Keyword1 Keyword2"

    ' Call InitializeUserInput to set up the keywords
    ThisDrawing.Utility.InitializeUserInput 128, keywordList

    ' Get the user input
    Dim returnPnt As Variant
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point(Keyword1, Keyword2): ")
    If Err Then
         If StrComp(Err.Description, "User input is a keyword", 1) = 0 Then
         ' One of the keywords was entered
             Dim inputString As String
             Err.Clear
             inputString = ThisDrawing.Utility.GetInput
             MsgBox "You entered the keyword: " & inputString
         Else
             MsgBox "Error selecting the point: " & Err.Description
             Err.Clear
         End If
    Else
        ' Display point coordinates
        MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetInput Example"
    End If

End Sub


GetInteger Example [ActiveX and VBA Reference: AAR]

GetInteger Example

Using Programming Languages other than VBA

Sub Example_GetInteger()
    ' This example returns the integer entered by the user.

    Dim returnInt As Integer

    ' Return the value entered by user. A prompt is provided.
    returnInt = ThisDrawing.Utility.GetInteger("Enter an integer: ")
    MsgBox "The integer entered was " & returnInt & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetInteger Example"

    ' Return the value entered by user. No prompt is provided.
    returnInt = ThisDrawing.Utility.GetInteger()
    MsgBox "The integer entered was " & returnInt, , "GetInteger Example"

End Sub


GetInterfaceObject Example [ActiveX and VBA Reference: AAR]

GetInterfaceObject Example

Using Programming Languages other than VBA

Sub Example_GetInterfaceObject()
    ' This example returns top level object of another application.
    On Error GoTo ERRORHANDLER

    Dim poly As Object
    Set poly = ThisDrawing.Application.GetInterfaceObject("Polycad.Application")

ERRORHANDLER:
    MsgBox Err.Description, , "GetInterfaceObject Example"

End Sub


GetInvisibleEdge Example [ActiveX and VBA Reference: AAR]

GetInvisibleEdge Example

Using Programming Languages other than VBA

Sub Example_GetInvisibleEdge()
    ' This example creates a 3D face in model space.
    ' It then toggles the visibility of the  first edge.

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double

    ' Define the four coordinates of the face
    point1(0) = 1#: point1(1) = 1#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 1#: point2(2) = 1#
    point3(0) = 1#: point3(1) = 10#: point3(2) = 0#
    point4(0) = 5#: point4(1) = 5#: point4(2) = 1#

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ZoomAll

    ' Find the current visibility status of the first edge of the face
    Dim visStatus As Boolean
    visStatus = faceObj.GetInvisibleEdge(0)
    MsgBox "The first face is currently " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"

    ' Toggle the visibility of the first edge of the face
    faceObj.SetInvisibleEdge 0, Not (visStatus)
    ThisDrawing.Regen False
    MsgBox "The first face is now " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"

End Sub


GetKeyword Example [ActiveX and VBA Reference: AAR]

GetKeyword Example

Using Programming Languages other than VBA

Sub Example_GetKeyword()
    ' This example uses Getkeyword to return a keyword entered by the user.
    ' InitializeUserInput establishes the valid keywords.

    ' Define the list of valid keywords
    Dim kwordList As String
    kwordList = "Width Height Depth"
    ThisDrawing.Utility.InitializeUserInput 1, kwordList

    ' Prompt the user to input any of the keywords. Return "Width", "Height" or "Depth" in
    ' the returnString variable depending on whether the user input "W", "H" or "D".
    Dim returnString As String
    returnString = ThisDrawing.Utility.GetKeyword("Enter a keyword (Height)(Width)(Depth): ")
    MsgBox "You entered " & returnString, , "GetKeyword Example"

End Sub


GetLocaleMediaName Example [ActiveX and VBA Reference: AAR]

GetLocaleMediaName Example

Using Programming Languages other than VBA

Sub Example_GetLocaleMediaName()
    ' This example gets the current plot device information
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout

    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo

    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()

    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next

    ' List all the media names, and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()

    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next

    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()

    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next

End Sub


GetLoopAt Example [ActiveX and VBA Reference: AAR]

GetLoopAt Example

Using Programming Languages other than VBA

Sub Example_GetLoopAt()
    ' This example creates an associative hatch in model space.
    ' It then finds the objects that make up the first loop of the hatch.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the objects that make up the first loop
    Dim loopObjs As Variant
    hatchObj.GetLoopAt 0, loopObjs

    ' Find the types of the objects in the loop
    Dim I As Integer
    Dim objName As String
    objName = ""
    For I = LBound(loopObjs) To UBound(loopObjs)
        objName = objName & loopObjs(I).EntityName & ", "
    Next

    MsgBox "The objects in the first loop of the hatch are: " & objName, , "GetLoopAt Example"

End Sub


GetName Example [ActiveX and VBA Reference: AAR]

GetName Example

Using Programming Languages other than VBA

Sub Example_GetName()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary. It then
    ' finds the name of the object in the dictionary.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

    ' Find the keyword name of an object in the dictionary
    keyName = dictObj.GetName(customObj)

End Sub


GetObject Example [ActiveX and VBA Reference: AAR]

GetObject Example

Using Programming Languages other than VBA

Sub Example_GetObject()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary. It then
    ' returns the object using GetObject.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ARX Application.
    On Error GoTo ERRORHANDLER
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

    ' Find the object
    Dim tempObj As Object
    Set tempObj = dictObj.GetObject(keyName)

ERRORHANDLER:
    MsgBox Err.Description, , "GetObject Example"

End Sub


GetOrientation Example [ActiveX and VBA Reference: AAR]

GetOrientation Example

Using Programming Languages other than VBA

Sub Example_GetOrientation()
    ' This example uses the GetOrientation method to demonstrate three different ways to retrieve
    ' an orientation from the user.

    Dim retOrientation As Double

    ' Return the Orientation in radians with a prompt
    retOrientation = ThisDrawing.Utility.GetOrientation(, "Enter an Orientation: ")
    MsgBox "The Orientation entered was " & retOrientation & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetOrientation Example"

    ' Return the Orientation in radians without any prompt
    retOrientation = ThisDrawing.Utility.GetOrientation()
    MsgBox "The Orientation entered was " & retOrientation, , "GetOrientation Example"

    ' Return the Orientation in radians with a prompt and an Orientation base point
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    retOrientation = ThisDrawing.Utility.GetOrientation(basePnt, "Enter an Orientation: ")
    MsgBox "The Orientation entered was " & retOrientation, , "GetOrientation Example"

End Sub


GetPaperMargins Example [ActiveX and VBA Reference: AAR]

GetPaperMargins Example

Using Programming Languages other than VBA

Sub Example_GetPaperMargins()
    ' This example will access the Layouts collection for the current drawing
    ' and list the plot size based on the margins returned from the GetPaperMargins
    ' property for each Layout except model space.
    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim Measurement As String
    Dim MarginLowerLeft As Variant, MarginUpperRight As Variant

    Dim PaperHeight As Double, PaperWidth As Double
    Dim PlotHeight As Double, PlotWidth As Double

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the margin information of every layout in this drawing

    For Each Layout In Layouts
        ' Skip model space
        If Layout.name = "Model" Then GoTo NEXT_LAYOUT
        ThisDrawing.ActiveLayout = Layout

        msg = msg & Layout.name & vbCrLf

        ' Get paper size and margin information
        Layout.GetPaperMargins MarginLowerLeft, MarginUpperRight
        Layout.GetPaperSize PaperWidth, PaperHeight

        ' Do plot area calculations

        PlotWidth = PaperWidth - (MarginUpperRight(0) - MarginLowerLeft(0))
        PlotHeight = PaperHeight - (MarginUpperRight(1) - MarginLowerLeft(1))

        ' Are we using inches or millimeters
        Measurement = " millimeter(s)"

        ' Format for display
        msg = msg & vbTab & "The paper size for this layout is: " & PaperWidth & " X " & PaperHeight & Measurement & vbCrLf & vbCrLf

        msg = msg & vbTab & "The paper margins are: " & vbCrLf & _
                            vbTab & vbTab & "Left" & vbTab & "(" & MarginLowerLeft(0) & ")" & Measurement & vbCrLf & _
                            vbTab & vbTab & "Right" & vbTab & "(" & MarginUpperRight(0) & ")" & Measurement & vbCrLf & _
                            vbTab & vbTab & "Top" & vbTab & "(" & MarginUpperRight(1) & ")" & Measurement & vbCrLf & _
                            vbTab & vbTab & "Bottom" & vbTab & "(" & MarginLowerLeft(1) & ")" & Measurement & vbCrLf & vbCrLf
        msg = msg & vbTab & "The paper plot area for this layout is: " & PlotWidth & " X " & PlotHeight & Measurement & vbCrLf

        msg = msg & "_____________________" & vbCrLf

NEXT_LAYOUT:
    Next

    ' Display paper size and margin information
    MsgBox "Paper plot information for the current drawing is: " & msg
End Sub


GetPaperSize Example [ActiveX and VBA Reference: AAR]

GetPaperSize Example

Using Programming Languages other than VBA

Sub Example_GetPaperSize()
    ' This example gets the width and height of the default
    ' paper size for your system.

    Dim PaperWidth As Double
    Dim PaperHeight As Double

    ThisDrawing.ActiveLayout.GetPaperSize PaperWidth, PaperHeight

    MsgBox "The default paper size is " & vbCrLf & _
            "Width: " & PaperWidth & vbCrLf & _
            "Height: " & PaperHeight

End Sub


GetPlotDeviceNames Example [ActiveX and VBA Reference: AAR]

GetPlotDeviceNames Example

Using Programming Languages other than VBA

Sub Example_GetPlotDeviceNames()
    ' This example gets the current plot device information
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout

    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo

    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()

    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next

    ' List all the media names, and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()

    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next

    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()

    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next

End Sub


GetPlotStyleTableNames Example [ActiveX and VBA Reference: AAR]

GetPlotStyleTableNames Example

Using Programming Languages other than VBA

Sub Example_GetPlotStyleTableNames()
    ' This example gets the current plot device information
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout

    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo

    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()

    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next

    ' List all the media names, and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()

    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next

    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()

    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next

End Sub


GetPoint Example [ActiveX and VBA Reference: AAR]

GetPoint Example

Using Programming Languages other than VBA

Sub Example_GetPoint()
    ' This example returns a point entered by the user.

    Dim returnPnt As Variant

    ' Return a point using a prompt
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2) & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetPoint Example"

    ' Return a point, no prompt
    returnPnt = ThisDrawing.Utility.GetPoint
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetPoint Example"

    ' Return a point using a base point and a prompt
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    returnPnt = ThisDrawing.Utility.GetPoint(basePnt, "Enter a point: ")
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2)

    ' Create a line from the base point and the last point entered
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, returnPnt)
    ZoomAll

End Sub


GetProjectFilePath Example [ActiveX and VBA Reference: AAR]

GetProjectFilePath Example

Using Programming Languages other than VBA

Sub Example_GetProjectFilePath()
    ' This example finds the current project file information.

    Dim preferences As AcadPreferences
    Set preferences = ThisDrawing.Application.preferences

    ' Get the current project file information
    Dim currProjPath As String
    Dim currProjName As Variant
    currProjName = ThisDrawing.GetVariable("PROJECTNAME")
    If currProjName <> "" Then
        currProjPath = preferences.Files.GetProjectFilePath(currProjName)
    End If
    If currProjPath = "" Then
        MsgBox "There is no current project file or path. ", , "GetProjectFilePath Example"
    Else
        MsgBox "The current project file path is: " & currProjPath, , "GetProjectFilePath Example"
    End If

End Sub


GetReal Example [ActiveX and VBA Reference: AAR]

GetReal Example

Using Programming Languages other than VBA

Sub Example_GetReal()
    ' This example returns the Real entered by the user.

    Dim returnReal As Double

    ' Return the value entered by user. A prompt is provided.
    returnReal = ThisDrawing.Utility.GetReal("Enter an Real: ")
    MsgBox "The real entered was " & returnReal & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetReal Example"

    ' Return the value entered by user. No prompt is provided.
    returnReal = ThisDrawing.Utility.GetReal()
    MsgBox "The real entered was " & returnReal, , "GetReal Example"

End Sub


GetRemoteFile Example [ActiveX and VBA Reference: AAR]

GetRemoteFile Example

Using Programming Languages other than VBA

Sub Example_GetRemoteFile()
    ' This example will prompt the user for a URL to download and will verify that
    ' a proper URL was entered.  After downloading, the example will attempt to load
    ' the downloaded URL as a drawing.
    '
    ' * Note: Remember to delete the downloaded file from your disk drive when finished.

    Dim Utility As AcadUtility
    Dim URL As String, DestFile As String, FileURL As String

    Set Utility = ThisDrawing.Utility   ' Connect to Utility object

GETURL:
    ' Prompt user for a URL to download.  This should be a URL to an AutoCAD drawing file.
    URL = InputBox("Enter the complete URL of the file you wish to download. " & _
                    "Enter BROWSER to select the URL from a web browser", _
                    "Enter URL To Download", URL)

    URL = Trim(URL)                     ' Get rid of blank spaces

    If URL = "" Then Exit Sub           ' Did user cancel

    ' Does the user want to select from a browser?
    If StrComp(URL, "BROWSER", vbTextCompare) = 0 Then
        Utility.LaunchBrowserDialog _
        URL, "AutoCAD Browser", "Open", "http://www.autodesk.com", "ACADBROWSER", True

        GoTo GETURL     ' Return to display chosen URL and allow modifications
    End If

    ' Determine if user entered a valid URL; if not, prompt again
    If Not (Utility.IsURL(URL)) Then
        MsgBox "The URL you entered is not valid.  Make sure the syntax is a valid URL."
        GoTo GETURL
    End If

    ' Download URL
    Utility.GetRemoteFile URL, DestFile, True

    ' Display downloaded file information
    MsgBox URL & " was downloaded to: " & DestFile & vbCrLf & vbCrLf & _
           "Press any key to attempt to load the new file as a drawing."

    ' Attempt to load file as drawing; if an error occurs, this was probably not a drawing
    ' file, but rather the text from a web page.
    ' Try loading the downloaded file into a text editor to view the contents.
    On Error Resume Next
    ThisDrawing.Application.Documents.Open DestFile
    If Err.Number <> 0 Then
        MsgBox "Error loading downloaded file as a drawing: " & Err.Description & vbCrLf & vbCrLf & _
               "This is probably not a valid drawing file!"
    End If
    On Error GoTo 0

    ' Use IsRemoteFile to determine if this file was downloaded from a URL.
    ' If it was, display the URL it was downloaded from
    '
    ' * Note: Although the results that IsRemoteFile will return are already known
    ' since the file was just downloaded it is important to know how this
    ' method can be used.
    If Utility.IsRemoteFile(DestFile, FileURL) Then
        MsgBox "The file: " & DestFile & " is a downloaded file and was downloaded from: " & FileURL
    Else
        MsgBox "The file: " & DestFile & " is not a downloaded file."
    End If

End Sub


GetSnapSpacing Example [ActiveX and VBA Reference: AAR]

GetSnapSpacing Example

Using Programming Languages other than VBA

Sub Example_GetSnapSpacing()
    ' This example finds the current Snap spacing, and changes that spacing.

    ' Find the current active viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Turn on Snap spacing and reset the viewport.
    viewportObj.SnapOn = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Find the current Snap spacing
    Dim XSpacing As Double
    Dim YSpacing As Double

    viewportObj.GetSnapSpacing XSpacing, YSpacing
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, Title:="GetSnapSpacing Example"

    ' Change the Snap spacing
    XSpacing = XSpacing * 0.5
    YSpacing = YSpacing * 0.5
    viewportObj.SetSnapSpacing XSpacing, YSpacing
    ThisDrawing.ActiveViewport = viewportObj
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, Title:="GetSnapSpacing Example"

End Sub


GetString Example [ActiveX and VBA Reference: AAR]

GetString Example

Using Programming Languages other than VBA

Sub Example_GetString()
    ' This example demonstrates different ways of returning a string
    ' entered by a user.

    Dim returnString As String

    ' Prompt & Input cannot contain blanks
    returnString = ThisDrawing.Utility.GetString(False, "Enter text (a space or <enter> terminates input): ")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"

    ' Prompt & Input can contain blanks
    returnString = ThisDrawing.Utility.GetString(True, "Enter text (<enter> terminates input):")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"

    ' Prompt & Input can contain blanks, but not an empty string
    Dim NoNull As Integer
    NoNull = 1    ' Disallow null
    ThisDrawing.Utility.InitializeUserInput NoNull
    returnString = ThisDrawing.Utility.GetString(True, "Enter text (<enter> terminates input): ")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"

End Sub


GetSubEntity Example [ActiveX and VBA Reference: AAR]

GetSubEntity Example

Using Programming Languages other than VBA

Sub Example_GetSubEntity()
    ' This example prompts the user to select on object on the screen with a mouse click,
    ' and returns some information about the selected object.

    Dim Object As Object
    Dim PickedPoint As Variant, TransMatrix As Variant, ContextData As Variant
    Dim HasContextData As String

    On Error GoTo NOT_ENTITY

TRYAGAIN:

    MsgBox "Use the mouse to click on an object in the current drawing after dismissing this dialog box."

    ' Get information about selected object
    ThisDrawing.Utility.GetSubEntity Object, PickedPoint, TransMatrix, ContextData

    ' Process and display selected object properties
    HasContextData = IIf(VarType(ContextData) = vbEmpty, " does not ", " does ")

    MsgBox "The object you chose was an: " & TypeName(Object) & vbCrLf & _
            "Your point of selection was: " & PickedPoint(0) & ", " & _
                                              PickedPoint(1) & ", " & _
                                              PickedPoint(2) & vbCrLf & _
            "This object" & HasContextData & "have nested objects."

    Exit Sub

NOT_ENTITY:
    ' If you click on empty space or do not select an entity,
    ' this error will be generated
    If MsgBox("You have not selected an object.  Click OK to try again.", _
               vbOKCancel & vbInformation) = vbOK Then
        Resume TRYAGAIN
    End If
End Sub


GetTextHeight Example [ActiveX and VBA Reference: AAR]

GetTextHeight Example

Using Programming Languages other than VBA

Sub Example_GetTextHeight()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetTextStyle Example [ActiveX and VBA Reference: AAR]

GetTextStyle Example

Using Programming Languages other than VBA

Sub Example_GetTextStyle()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


GetUCSMatrix Example [ActiveX and VBA Reference: AAR]

GetUCSMatrix Example

Using Programming Languages other than VBA

Sub Example_GetUCSMatrix()
    ' This example creates a new UCS and finds the UCS matrix for it.
    ' It then creates a circle using WCS coordinates and
    ' transforms the circle for the UCS.

    ' Define a new UCS and turn on the UCS icon at the origin.
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double

    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0

    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
    ThisDrawing.ActiveUCS = ucsObj
    ThisDrawing.ActiveViewport.UCSIconOn = True
    ThisDrawing.ActiveViewport.UCSIconAtOrigin = True
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport

    ' Create a circle using WCS coordinates
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 1: center(1) = 1: center(2) = 0
    radius = 0.5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll

    ' Get the UCS transformation matrix
    Dim TransMatrix As Variant
    TransMatrix = ucsObj.GetUCSMatrix()

    ' Transform the circle to the UCS coordinates
    MsgBox "Transform the circle.", , "GetUCSMatrix Example"
    circleObj.TransformBy (TransMatrix)
    circleObj.Update

    MsgBox "The circle is transformed.", , "GetUCSMatrix Example"

End Sub


GetVariable Example [ActiveX and VBA Reference: AAR]

GetVariable Example

Using Programming Languages other than VBA

Sub Example_GetVariable()
    ' This example finds the current setting of the
    ' system variable FILLMODE.

    Dim sysVarName As String
    Dim varData As Variant

    sysVarName = "FILLMODE"
    varData = ThisDrawing.GetVariable(sysVarName)
    MsgBox sysVarName & " = " & varData, , "GetVariable Example"

End Sub


GetWeight Example [ActiveX and VBA Reference: AAR]

GetWeight Example

Using Programming Languages other than VBA

Sub Example_GetWeight()
    ' This example creates a spline object in model space.
    ' It then finds the weight of the first control point
    ' and changes that value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the first fit point
    Dim weight As Double
    weight = splineObj.GetWeight(0)
    MsgBox "The weight of control point 1 is " & weight, , "GetWeight Example"

    ' Change the weight of the first control point
    weight = 5
    splineObj.SetWeight 0, weight
    splineObj.Update
    MsgBox "The weight of control point 1 is now " & weight, , "GetWeight Example"

End Sub


GetWidth Example [ActiveX and VBA Reference: AAR]

GetWidth Example

Using Programming Languages other than VBA

Sub Example_GetWidth()
    ' The following code prompts you to select a lightweight
    ' polyline, then displays the width of each segment of the
    ' selected polyline.

    Dim returnObj As AcadObject
    Dim basePnt As Variant
    Dim retCoord As Variant
    Dim StartWidth As Double
    Dim EndWidth As Double
    Dim i, j As Long
    Dim nbr_of_segments As Long
    Dim nbr_of_vertices As Long
    Dim segment As Long
    Dim message_string

    On Error Resume Next

    ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select a polyline"

    ' Make sure the user selected a polyline.
    If Err <> 0 Then
        If returnObj.EntityName <> "AcDbPolyline" Then
            MsgBox "You did not select a polyline"
        End If
        Exit Sub
    End If

    ' Obtain the coordinates of each vertex of the selected polyline.
    ' The coordinates are returned in an array of points.
    retCoord = returnObj.Coordinates

    segment = 0
    i = LBound(retCoord)                 ' Start index of coordinates array
    j = UBound(retCoord)                 ' End index of coordinates array
    nbr_of_vertices = ((j - i) \ 2) + 1  ' Number of vertices in the polyline

    ' Determine the number of segments in the polyline.
    ' A closed polyline has as many segments as it has vertices.
    ' An open polyline has one fewer segment than it has vertices.
    ' Check the Closed property to determine if the polyline is closed.

    If returnObj.Closed Then
        nbr_of_segments = nbr_of_vertices
    Else
        nbr_of_segments = nbr_of_vertices - 1
    End If

    ' Get the width of each segment of the polyline
    Do While nbr_of_segments > 0

        ' Get the width of the current segment
        returnObj.GetWidth segment, StartWidth, EndWidth

        message_string = "The segment that begins at " & retCoord(i) & "," & retCoord(i + 1) _
            & " has a start width of " & StartWidth & " and an end width of " & EndWidth
        MsgBox message_string, , "GetWidth Example"

        ' Prepare to obtain width of next segment, if any
        i = i + 2
        segment = segment + 1
        nbr_of_segments = nbr_of_segments - 1
    Loop

End Sub


GetWindowToPlot Example [ActiveX and VBA Reference: AAR]

GetWindowToPlot Example

Using Programming Languages other than VBA

Sub Example_GetWindowToPlot()
    ' This example allows the user to define an area in the current layout to plot
    ' and displays a plot preview of the defined area.
    '
    ' * Note: You will have to exit the plot preview
    '  before the VBA example will stop and control will be returned

    Dim point1 As Variant, point2 As Variant

    ' Get first point in window
    point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")
    ReDim Preserve point1(0 To 1)   ' Change this to a 2D array by removing the Z position

    ' Get second point in window
    point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")
    ReDim Preserve point2(0 To 1)   ' Change this to a 2D array by removing the Z position

    ' Send information about window to current layout
    ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2

    ' Read back window information
    ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2

    MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _
           "Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _
           "Upper Right: " & point2(0) & ", " & point2(1)

    ' Make sure the instruction is to plot a view, not some other plot style
    ThisDrawing.ActiveLayout.PlotType = acWindow

    ' Send Plot To Window
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub


GetXdata Example [ActiveX and VBA Reference: AAR]

GetXData Example

Using Programming Languages other than VBA

Sub Example_GetXData()
    ' This example creates a line and attaches extended data to that line.

    ' Create the line
    Dim lineObj As AcadLine
    Dim startPt(0 To 2) As Double, endPt(0 To 2) As Double
    startPt(0) = 1#: startPt(1) = 1#: startPt(2) = 0#
    endPt(0) = 5#: endPt(1) = 5#: endPt(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)
    ZoomAll

    ' Initialize all the xdata values. Note that first data in the list should be
    ' application name and first datatype code should be 1001
    Dim DataType(0 To 9) As Integer
    Dim Data(0 To 9) As Variant
    Dim reals3(0 To 2) As Double
    Dim worldPos(0 To 2) As Double

    DataType(0) = 1001: Data(0) = "Test_Application"
    DataType(1) = 1000: Data(1) = "This is a test for xdata"

    DataType(2) = 1003: Data(2) = "0"                   ' layer
    DataType(3) = 1040: Data(3) = 1.23479137438413E+40  ' real
    DataType(4) = 1041: Data(4) = 1237324938            ' distance
    DataType(5) = 1070: Data(5) = 32767                 ' 16 bit Integer
    DataType(6) = 1071: Data(6) = 32767                 ' 32 bit Integer
    DataType(7) = 1042: Data(7) = 10                    ' scaleFactor

    reals3(0) = -2.95: reals3(1) = 100: reals3(2) = -20
    DataType(8) = 1010: Data(8) = reals3                ' real

    worldPos(0) = 4: worldPos(1) = 400.99999999: worldPos(2) = 2.798989
    DataType(9) = 1011: Data(9) = worldPos              ' world space position

    ' Attach the xdata to the line
    lineObj.SetXData DataType, Data

    ' Return the xdata for the line
    Dim xdataOut As Variant
    Dim xtypeOut As Variant
    lineObj.GetXData "", xtypeOut, xdataOut

End Sub


GetXRecordData Example [ActiveX and VBA Reference: AAR]

GetXRecordData Example

Using Programming Languages other than VBA

Sub Example_GetXRecordData()
    ' This example creates a new XRecord if one doesn't exist,
    ' appends data to the XRecord and reads it back.  To see data being added
    ' run the example more than once.

    Dim TrackingDictionary As AcadDictionary, TrackingXRecord As AcadXRecord
    Dim XRecordDataType As Variant, XRecordData As Variant
    Dim ArraySize As Long, iCount As Long
    Dim DataType As Integer, Data As String, msg As String

    ' Unique identifiers to distinguish our XRecordData from other XRecordData
    Const TYPE_STRING = 1
    Const TAG_DICTIONARY_NAME = "ObjectTrackerDictionary"
    Const TAG_XRECORD_NAME = "ObjectTrackerXRecord"

    ' Connect to the dictionary we store the XRecord in
    On Error GoTo CREATE
    Set TrackingDictionary = ThisDrawing.Dictionaries(TAG_DICTIONARY_NAME)
    Set TrackingXRecord = TrackingDictionary.GetObject(TAG_XRECORD_NAME)
    On Error GoTo 0

    ' Get current XRecordData
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData

    ' If we don't have an array already then create one
    If VarType(XRecordDataType) And vbArray = vbArray Then
        ArraySize = UBound(XRecordDataType) + 1       ' Get the size of the data elements returned
        ArraySize = ArraySize + 1                        ' Increase to hold new data

        ReDim Preserve XRecordDataType(0 To ArraySize)
        ReDim Preserve XRecordData(0 To ArraySize)
    Else
        ArraySize = 0
        ReDim XRecordDataType(0 To ArraySize) As Integer
        ReDim XRecordData(0 To ArraySize) As Variant
    End If

    ' Append new XRecord Data
    '
    ' For this sample we only append the current time to the XRecord
    XRecordDataType(ArraySize) = TYPE_STRING: XRecordData(ArraySize) = CStr(Now)
    TrackingXRecord.SetXRecordData XRecordDataType, XRecordData

    ' Read back all XRecordData entries
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData
    ArraySize = UBound(XRecordDataType)

    ' Retrieve and display stored XRecordData
    For iCount = 0 To ArraySize
        ' Get information for this element
        DataType = XRecordDataType(iCount)
        Data = XRecordData(iCount)

        If DataType = TYPE_STRING Then
            msg = msg & Data & vbCrLf
        End If
    Next

    MsgBox "The data in the XRecord is: " & vbCrLf & vbCrLf & msg, vbInformation

    Exit Sub

CREATE:
    ' Create the entities that hold our XRecordData
    If TrackingDictionary Is Nothing Then  ' Make sure we have our tracking object
        Set TrackingDictionary = ThisDrawing.Dictionaries.Add(TAG_DICTIONARY_NAME)
        Set TrackingXRecord = TrackingDictionary.AddXRecord(TAG_XRECORD_NAME)
    End If

    Resume
End Sub


GradientAngle Example [ActiveX and VBA Reference: AAR]

GradientAngle Example

Using Programming Languages other than VBA

Sub Example_GradientAngle()
    ' This example changes the value of the GradientAngle property.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    hatchObj.GradientColor1 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Initial value of GradientAngle is " & hatchObj.GradientAngle
    hatchObj.GradientAngle = 3.1415 / 4
    MsgBox "New value of GradientAngle is " & hatchObj.GradientAngle
End Sub


GradientCentered Example [ActiveX and VBA Reference: AAR]

GradientCentered Example

Using Programming Languages other than VBA

Sub Example_GradientCentered()
    ' This example changes the value of the GradientCentered property.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    hatchObj.GradientColor1 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Initial value of GradientCentered is " & hatchObj.GradientCentered
    hatchObj.GradientCentered = False
    MsgBox "New value of GradientCentered is " & hatchObj.GradientCentered
End Sub


GradientColor1 Example [ActiveX and VBA Reference: AAR]

GradientColor1 Example

Using Programming Languages other than VBA

Sub Example_GradientColor1()
    ' This example changes the value of the GradientColor1 property.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor, newColor As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set newColor = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    Call newColor.SetRGB(0, 100, 0)
    hatchObj.GradientColor1 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Initial value of GradientColor1 is :" & vbCrLf & _
                    "red = " & hatchObj.GradientColor1.Red & vbCrLf & _
                    "green = " & hatchObj.GradientColor1.Green & vbCrLf & _
                    "blue = " & hatchObj.GradientColor1.Blue

    hatchObj.GradientColor1 = newColor
    MsgBox "New value of GradientColor1 is :" & vbCrLf & _
                    "red = " & hatchObj.GradientColor1.Red & vbCrLf & _
                    "green = " & hatchObj.GradientColor1.Green & vbCrLf & _
                    "blue = " & hatchObj.GradientColor1.Blue
End Sub


GradientColor2 Example [ActiveX and VBA Reference: AAR]

GradientColor2 Example

Using Programming Languages other than VBA

Sub Example_GradientColor2()
    ' This example changes the value of the GradientColor2 property.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor, newColor As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set newColor = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    Call newColor.SetRGB(0, 100, 0)
    hatchObj.GradientColor1 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Initial value of GradientColor2 is :" & vbCrLf & _
                    "red = " & hatchObj.GradientColor2.Red & vbCrLf & _
                    "green = " & hatchObj.GradientColor2.Green & vbCrLf & _
                    "blue = " & hatchObj.GradientColor2.Blue

    hatchObj.GradientColor2 = newColor
    MsgBox "New value of GradientColor2 is :" & vbCrLf & _
                    "red = " & hatchObj.GradientColor2.Red & vbCrLf & _
                    "green = " & hatchObj.GradientColor2.Green & vbCrLf & _
                    "blue = " & hatchObj.GradientColor2.Blue
End Sub


GradientName Example [ActiveX and VBA Reference: AAR]

GradientName Example

Using Programming Languages other than VBA

Sub Example_GradientName()
    ' This example changes the value of the GradientName property.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "CYLINDER"
    PatternType = acPreDefinedGradient '0
    bAssociativity = True

    ' Create the associative Hatch object in model space
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity, acGradientObject)
    Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor
    Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call col1.SetRGB(255, 0, 0)
    Call col2.SetRGB(0, 255, 0)
    hatchObj.GradientColor2 = col1
    hatchObj.GradientColor2 = col2

    ' Create the outer boundary for the hatch (a circle)
    Dim outerLoop(0 To 0) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Append the outerboundary to the hatch object, and display the hatch
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Initial value of GradientName is " & hatchObj.GradientName
    hatchObj.GradientName = "SPHERICAL"
    MsgBox "New value of GradientName is " & hatchObj.GradientName
End Sub


GraphicsWinLayoutBackgrndColor Example [ActiveX and VBA Reference: AAR]

GraphicsWinLayoutBackgrndColor Example

Using Programming Languages other than VBA

Sub Example_GraphicsWinLayoutBackgrndColor()
    ' This example returns the current setting of
    ' GraphicsWinLayoutBackgrndColor. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currGraphicsWinLayoutBackgrndColor As OLE_COLOR

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current GraphicsWinLayoutBackgrndColor value
    currGraphicsWinLayoutBackgrndColor = preferences.DISPLAY.GraphicsWinLayoutBackgrndColor
    MsgBox "The current value for GraphicsWinLayoutBackgrndColor is " _
            & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example"

    ' Change the value for GraphicsWinLayoutBackgrndColor
    preferences.DISPLAY.GraphicsWinLayoutBackgrndColor = 16
    MsgBox "The new value for GraphicsWinLayoutBackgrndColor is " _
            & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example"

    ' Reset GraphicsWinLayoutBackgrndColor to its original value
    preferences.DISPLAY.GraphicsWinLayoutBackgrndColor = currGraphicsWinLayoutBackgrndColor
    MsgBox "The GraphicsWinLayoutBackgrndColor value is reset to " _
            & preferences.DISPLAY.GraphicsWinLayoutBackgrndColor, vbInformation, "GraphicsWinLayoutBackgrndColor Example"
End Sub


GraphicsWinModelBackgrndColor Example [ActiveX and VBA Reference: AAR]

GraphicsWinModelBackgrndColor Example

Using Programming Languages other than VBA

Sub Example_GraphicsWinModelBackgrndColor()
    ' This example returns the current setting of
    ' GraphicsWinModelBackgrndColor. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currGraphicsWinModelBackgrndColor As OLE_COLOR

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current GraphicsWinModelBackgrndColor value
    currGraphicsWinModelBackgrndColor = preferences.DISPLAY.GraphicsWinModelBackgrndColor
    MsgBox "The current value for GraphicsWinModelBackgrndColor is " _
            & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"

    ' Change the value for GraphicsWinModelBackgrndColor
    preferences.DISPLAY.GraphicsWinModelBackgrndColor = 16
    MsgBox "The new value for GraphicsWinModelBackgrndColor is " _
            & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"

    ' Reset GraphicsWinModelBackgrndColor to its original value
    preferences.DISPLAY.GraphicsWinModelBackgrndColor = currGraphicsWinModelBackgrndColor
    MsgBox "The GraphicsWinModelBackgrndColor value is reset to " _
            & preferences.DISPLAY.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"
End Sub


Green Example [ActiveX and VBA Reference: AAR]

Green Example

Using Programming Languages other than VBA

Sub Example_Green()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    MsgBox "Red = " & retcolor.Red
    MsgBox "Green = " & retcolor.Green
    MsgBox "Blue = " & retcolor.Blue
End Sub


GridOn Example [ActiveX and VBA Reference: AAR]

GridOn Example

Using Programming Languages other than VBA

Sub Example_GridOn()
    ' This example toggles the setting of GridOn.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

TOGGLEGRID:
    If MsgBox("Toggle the grid?", vbOKCancel, "GridOn Example") = vbOK Then
        viewportObj.GridOn = Not (viewportObj.GridOn)
    Else
        Exit Sub
    End If

    ' Reset the active viewport to see the change
    ThisDrawing.ActiveViewport = viewportObj

    GoTo TOGGLEGRID

End Sub


GripColorSelected Example [ActiveX and VBA Reference: AAR]

GripColorSelected Example

Using Programming Languages other than VBA

Sub Example_GripColorSelected()
    ' This example reads and modifies the preference value that controls
    ' the color of selected grips.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.GripColorSelected
    MsgBox "The GripColorSelected preference is set to: " & originalValue

    ' Modify the GripColorSelected preference by setting it to green
    ACADPref.GripColorSelected = acGreen
    newValue = ACADPref.GripColorSelected
    MsgBox "The GripColorSelected preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.GripColorSelected = originalValue
    MsgBox "The GripColorSelected preference was reset back to: " & originalValue
End Sub


GripColorUnselected Example [ActiveX and VBA Reference: AAR]

GripColorUnselected Example

Using Programming Languages other than VBA

Sub Example_GripColorUnselected()
    ' This example reads and modifies the preference value that controls
    ' the color of unselected grips.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.GripColorUnselected
    MsgBox "The GripColorUnselected preference is set to: " & originalValue

    ' Modify the GripColorUnselected preference by setting it to green
    ACADPref.GripColorUnselected = acGreen
    newValue = ACADPref.GripColorUnselected
    MsgBox "The GripColorUnselected preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.GripColorUnselected = originalValue
    MsgBox "The GripColorUnselected preference was reset back to: " & originalValue
End Sub


GripSize Example [ActiveX and VBA Reference: AAR]

GripSize Example

Using Programming Languages other than VBA

Sub Example_GripSize()
    ' This example reads and modifies the preference value that controls
    ' the size of grips. When finished, this example resets the
    ' preference value back to its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.GripSize
    MsgBox "The GripSize preference is set to: " & originalValue

    ' Modify the GripSize preference by setting it to 5
    ACADPref.GripSize = 5
    newValue = ACADPref.GripSize
    MsgBox "The GripSize preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.GripSize = originalValue
    MsgBox "The GripSize preference was reset back to: " & originalValue
End Sub


Groups Example [ActiveX and VBA Reference: AAR]

Groups Example

Using Programming Languages other than VBA

Sub Example_Groups()
    ' This example finds the current Groups collection and
    ' adds a new group to that collection.

    Dim groupColl As AcadGroups
    Set groupColl = ThisDrawing.Groups

    ' Create a dimension style named "TEST" in current drawing
    Dim testGroup As AcadGroup
    Set testGroup = groupColl.Add("TEST")
    MsgBox "A new group called " & testGroup.name & " has been added to the Groups collection.", vbInformation, "Groups Example"
End Sub


Handle Example [ActiveX and VBA Reference: AAR]

Handle Example

Using Programming Languages other than VBA

Sub Example_Handle()
    ' This example creates several objects in model space.
    ' It then iterates through the objects in model space and displays the
    ' Handle for each object found.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 5: centerPt(1) = 3: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection and display
    ' the handle of each object found.

    Dim entHandle As String
    Dim entry As AcadEntity
    For Each entry In ThisDrawing.ModelSpace
        entHandle = entry.handle
        entry.Highlight (True)
        MsgBox "The handle of this object is " & entHandle, vbInformation, "Handle Example"
        entry.Highlight (False)
    Next
End Sub


HandleToObject Example [ActiveX and VBA Reference: AAR]

HandleToObject Example

Using Programming Languages other than VBA

Sub Example_HandleToObject()
    ' This example creates a spline in model space, and returns the
    ' handle for the spline. Then the spline is returned from the handle and colored.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ZoomAll

    ' Find the handle of the spline
    Dim handle As String
    handle = splineObj.handle
    MsgBox "The handle of the Spline is: " & splineObj.handle, , "HandleToObject Example"

    ' Find an object from a given handle
    Dim tempObj As AcadObject
    Set tempObj = ThisDrawing.HandleToObject(handle)

    ' Now use the newly initialized object variable to color the object
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    tempObj.TrueColor = color

    ThisDrawing.Regen True
    MsgBox "The Spline is now blue.", , "ObjectIDToObject Example"

End Sub


HasAttributes Example [ActiveX and VBA Reference: AAR]

HasAttributes Example

Using Programming Languages other than VBA

Sub Example_HasAttributes()
    ' This example first creates a block without attributes.
    ' It then inserts the block and checks whether it has attributes.
    ' It then adds attributes to the block and inserts it again.
    ' Then it checks the new block reference for attributes.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")

    ' Add a circle to the block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)
    ThisDrawing.Application.ZoomAll
    MsgBox "This block reference " & IIf(blockRefObj.HasAttributes, "has attributes.", "does not have attributes."), , "Has Attributes Example"

    ' Add attributes to the block definition.
    ' Define the attribute definition.
    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String
    height = 1#
    mode = acAttributeModeVerify
    prompt = "Attribute Prompt"
    insertionPoint(0) = 1#: insertionPoint(1) = 1#: insertionPoint(2) = 0
    tag = "Attribute Tag"
    value = "Attribute Value"

    ' Create the attribute definition
    Set attributeObj = blockObj.AddAttribute(height, mode, prompt, insertionPoint, tag, value)

    ' Insert the block again
    Dim blockRefObj2 As AcadBlockReference
    insertionPnt(0) = 3#: insertionPnt(1) = 3#: insertionPnt(2) = 0
    Set blockRefObj2 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)
    ZoomAll
    MsgBox "The first block reference " & IIf(blockRefObj.HasAttributes, "has attributes.", "does not have attributes.") & vbCrLf & _
            "The second block reference " & IIf(blockRefObj2.HasAttributes, "has attributes.", "does not have attributes."), , "Has Attributes Example"

End Sub


HasExtensionDictionary Example [ActiveX and VBA Reference: AAR]

HasExtensionDictionary Example

Using Programming Languages other than VBA

Sub Example_HasExtensionDictionary()
    ' This example will iterate through each object in the current drawing and
    ' determine whether that object has an associated Extension Dictionary

    Dim DrawingObject As AcadObject
    Dim ExtensionDictionaryResults As String

    ' Make sure this drawing contains objects before continuing
    If ThisDrawing.ModelSpace.count = 0 Then
        MsgBox "There are no objects in the current drawing."
        Exit Sub
    End If

    For Each DrawingObject In ThisDrawing.ModelSpace
        ' Determine whether object contains Extension Dictionary
        Select Case DrawingObject.HasExtensionDictionary
            Case True
                ExtensionDictionaryResults = ExtensionDictionaryResults & DrawingObject.ObjectName & " has an associated Extension Dictionary" & vbCrLf
            Case False
                ExtensionDictionaryResults = ExtensionDictionaryResults & DrawingObject.ObjectName & " does not have an associated Extension Dictionary" & vbCrLf
        End Select
    Next

    MsgBox ExtensionDictionaryResults
End Sub


HasVpAssociation Example [ActiveX and VBA Reference: AAR]

HasVpAssociation Example

Using Programming Languages other than VBA

Sub Example_HasVpAssociation()
    ' This example demonstrates the
    ' CategoryName, LayoutId, LayerState,
    ' and HasVpAssociation properties of the View object

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

    ' Create a view named "New_View" in current drawing
    Dim viewObj As IAcadView2

    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.Name & " has been added." & vbCrLf & _
           "Height: " & viewObj.Height & vbCrLf & _
           "Width: " & viewObj.Width, , "Example"

    viewObj.CategoryName = "My View Category"
    viewObj.LayerState = "My Layer State"

    viewObj.LayoutId = ThisDrawing.Layouts(1).ObjectID

    MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
            viewObj.LayoutId & " is the Layout ID." & vbCrLf & _
            viewObj.LayerState & " is the Layer state."

    If viewObj.HasVpAssociation = True Then
        MsgBox "The view is associated with a paper space viewport."
    Else
        MsgBox "The view is not associated with a paper space viewport."

   End If
End Sub


HatchObjectType Example [ActiveX and VBA Reference: AAR]

HatchObjectType Example

Using Programming Languages other than VBA

Sub Example_HatchObjectType()
    ' This example changes the value of the HatchObjectType property.
    ' The example requires that the active drawing contain an existing hatch.

    Dim ent As AcadHatch ' AcadEntity
    Dim util As AcadUtility
    Set util = ThisDrawing.Utility
    Dim pt As Variant
    Call util.GetEntity(ent, pt, "Select hatch :")
    With ent
        MsgBox "Initial value of HatchObjectType = " & .HatchObjectType
        .HatchObjectType = acGradientObject
        .GradientAngle = 3.1415 / 4
        .GradientCentered = False
        .GradientName = "SPHERICAL"
        Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor
        Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
        Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
        Call col1.SetRGB(255, 0, 0)
        Call col2.SetRGB(0, 255, 0)
        .GradientColor1 = col1
        .GradientColor2 = col2
        MsgBox "New value of HatchObjectType = " & .HatchObjectType
    End With
End Sub


HatchStyle Example [ActiveX and VBA Reference: AAR]

HatchStyle Example

Using Programming Languages other than VBA

Sub Example_HatchStyle()
    ' This example creates an associative hatch in model space.
    ' The hatch style is then changed to demonstrate the different
    ' ways that inner loops are processed.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Set the hatch style to normal
    hatchObj.hatchstyle = acHatchStyleNormal
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The HatchStyle is set to " & Choose(hatchObj.hatchstyle + 1, "acHatchStyleNormal", "acHatchStyleOuter", "acHatchStyleIgnore"), , "HatchStyle Example"

    ' Set the hatch style to outer
    hatchObj.hatchstyle = acHatchStyleOuter
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The HatchStyle is set to " & Choose(hatchObj.hatchstyle + 1, "acHatchStyleNormal", "acHatchStyleOuter", "acHatchStyleIgnore"), , "HatchStyle Example"

    ' Set the hatch style to ignore
    hatchObj.hatchstyle = acHatchStyleIgnore
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The HatchStyle is set to " & Choose(hatchObj.hatchstyle + 1, "acHatchStyleNormal", "acHatchStyleOuter", "acHatchStyleIgnore"), , "HatchStyle Example"

End Sub


HeaderSuppressed Example [ActiveX and VBA Reference: AAR]

HeaderSuppressed Example

Using Programming Languages other than VBA

Sub Example_HeaderSuppressed()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


Height Example [ActiveX and VBA Reference: AAR]

Height Example

Using Programming Languages other than VBA

Sub Example_Height()
    ' This example creates a text object in model space.
    ' It then changes the height of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The text height is " & textObj.height, vbInformation, "Height Example"

    ' Change the value of the Height to 1
    textObj.height = 1
    textObj.Update
    MsgBox "The text height is set to " & textObj.height, vbInformation, "Height Example"

End Sub


Helix Example [ActiveX and VBA Reference: AAR]

Helix Example

Using Programming Languages other than VBA

Sub Example_Helix_BaseRadius()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            helix.BaseRadius = helix.BaseRadius * 2
            MsgBox "Baseradius of helix is doubled to " & helix.BaseRadius * 2
            End If
    Next
    ssetObj.Delete
End Sub

Sub Example_Helix_TopRadius()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            helix.TopRadius = helix.TopRadius * 0.5
            MsgBox "Top radius of helix is halved to " & helix.TopRadius * 0.5
            End If
    Next
    ssetObj.Delete
End Sub

Sub Example_Helix_Direction()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            If helix.Twist = acCCW Then
                helix.Twist = acCW
            Else
                helix.Twist = acCCW
            End If
            MsgBox "Direction is reversed"
            End If
    Next
    ssetObj.Delete
End Sub

Sub Example_Helix_Height()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            helix.Constrain = acHeight
            helix.Height = helix.Height * 2
            MsgBox "Height doubled"
            End If
    Next
    ssetObj.Delete
End Sub

Sub Example_Helix_Turns()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            helix.Constrain = acTurns
            helix.Turns = helix.Turns * 2
            MsgBox "Turns doubled"
            End If
    Next
    ssetObj.Delete
End Sub

Sub Example_Helix_TurnHeight()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_HELIX")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim helix As AcadHelix
    Dim helixBaseRadius As Double
    Dim objName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
            If TypeOf obj Is AcadHelix Then
            Set helix = obj
            helix.Constrain = acTurnHeight
            helix.TurnHeight = helix.TurnHeight * 2
            MsgBox "Turns height doubled"
            End If
    Next
    ssetObj.Delete
End Sub


HelpFilePath Example [ActiveX and VBA Reference: AAR]

HelpFilePath Example

Using Programming Languages other than VBA

Sub Example_HelpFilePath()
    ' This example returns the current setting of
    ' HelpFilePath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currHelpFilePath As String
    Dim newHelpFilePath As String
    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current HelpFilePath value
    currHelpFilePath = preferences.Files.HelpFilePath
    MsgBox "The current value for HelpFilePath is " & currHelpFilePath, vbInformation, "HelpFilePath Example"

    ' Change the value for HelpFilePath
    newHelpFilePath = "C:/AutoCAD/Help"
    preferences.Files.HelpFilePath = newHelpFilePath
    MsgBox "The new value for HelpFilePath is " & newHelpFilePath, vbInformation, "HelpFilePath Example"

    ' Reset HelpFilePath to its original value
    preferences.Files.HelpFilePath = currHelpFilePath
    MsgBox "The HelpFilePath value is reset to " & currHelpFilePath, vbInformation, "HelpFilePath Example"
End Sub


HelpString Example [ActiveX and VBA Reference: AAR]

HelpString Example

Using Programming Languages other than VBA

Sub Example_HelpString()
    ' This example creates a new toolbar called "TestToolbar" and inserts a
    ' button into it. The HelpString property of the toolbar is then
    ' read and changed.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add a button to the new toolbar.
    Dim newButton1 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    ' Read the current value of the Help string
    MsgBox "The current HelpString for the toolbar button is: " & newButton1.HelpString

    ' Change the value of the Help string
    newButton1.HelpString = "Use this toolbar button to Open a file."

    ' Read the new value of the Help string
    MsgBox "The new HelpString for the toolbar button is: " & newButton1.HelpString
End Sub


Highlight Example [ActiveX and VBA Reference: AAR]

Highlight Example

Using Programming Languages other than VBA

Sub Example_Highlight()
    ' This example creates several objects in model space.
    ' It then iterates through model space, highlights each
    ' object, and displays its Entity Name.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection and
    ' highlight each object.

    Dim entName As String
    Dim entry As AcadEntity
    For Each entry In ThisDrawing.ModelSpace
        entName = entry.ObjectName
        entry.Highlight (True)
        MsgBox "The name of this object is " & entName, vbInformation, "Highlight Example"
        entry.Highlight (False)
    Next
End Sub


HistoryLines Example [ActiveX and VBA Reference: AAR]

HistoryLines Example

Using Programming Languages other than VBA

Sub Example_HistoryLines()
    ' This example returns the current setting of
    ' HistoryLines. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currHistoryLines As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current HistoryLines value
    currHistoryLines = preferences.DISPLAY.HistoryLines
    MsgBox "The current value for HistoryLines is " & preferences.DISPLAY.HistoryLines, vbInformation, "HistoryLines Example"

    ' Change the value for HistoryLines
    preferences.DISPLAY.HistoryLines = 42
    MsgBox "The new value for HistoryLines is " & preferences.DISPLAY.HistoryLines, vbInformation, "HistoryLines Example"

    ' Reset HistoryLines to its original value
    preferences.DISPLAY.HistoryLines = currHistoryLines
    MsgBox "The HistoryLines value is reset to " & preferences.DISPLAY.HistoryLines, vbInformation, "HistoryLines Example"
End Sub


HorizontalTextPosition Example [ActiveX and VBA Reference: AAR]

HorizontalTextPosition Example

Using Programming Languages other than VBA

Sub Example_HorizontalTextPosition()
    ' This example creates an aligned dimension in model space
    ' and cycles the dimension text through different
    ' horizontal alignments

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 9: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current text position
    Select Case dimObj.HorizontalTextPosition
        Case acHorzCentered:        CurrentValue = "centered"
        Case acFirstExtensionLine:  CurrentValue = "aligned to first extension line"
        Case acSecondExtensionLine: CurrentValue = "aligned to second extension line"
        Case acOverFirstExtension:  CurrentValue = "aligned over first extension line"
        Case acOverSecondExtension: CurrentValue = "aligned over second extension line"
    End Select

    MsgBox "The dimension is " & CurrentValue

    ' Force the alignment of the dimension text to the first extension line
    dimObj.HorizontalTextPosition = acFirstExtensionLine
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension text is now aligned to the first extension line"

    ' Force the alignment of the dimension text to the second extension line
    dimObj.HorizontalTextPosition = acSecondExtensionLine
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension text is now aligned to the second extension line"

End Sub


HorzCellMargin Example [ActiveX and VBA Reference: AAR]

HorzCellMargin Example

Using Programming Languages other than VBA

Sub Example_HorzCellMargin()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


HWND Example [ActiveX and VBA Reference: AAR]

HWND Example

Using Programming Languages other than VBA

Sub Example_HWND()
    ' This example returns the handle (Hwnd) of a document window. The handle can be
    ' used with WindowsAPI calls, or with ActiveX components that require a handle
    ' to a window.

    ' If there are no open documents, then exit
    If Documents.count = 0 Then
        MsgBox "There are no open documents!"
        Exit Sub
    End If

    MsgBox "The HWND of the active document is: " & ActiveDocument.HWND
End Sub


HyperlinkBase Example [ActiveX and VBA Reference: AAR]

HyperlinkBase Example

Using Programming Languages other than VBA

Sub Example_HyperlinkBase()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


HyperlinkDisplayCursor Example [ActiveX and VBA Reference: AAR]

HyperlinkDisplayCursor Example

Using Programming Languages other than VBA

Sub Example_HyperlinkDisplayCursor()
    ' This example reads and modifies the preference value that controls
    ' the display of the hyperlink cursor and shortcut menu.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.HyperlinkDisplayCursor
    MsgBox "The HyperlinkDisplayCursor preference is set to: " & originalValue

    ' Modify the HyperlinkDisplayCursor preference by toggling the value
    ACADPref.HyperlinkDisplayCursor = Not (ACADPref.HyperlinkDisplayCursor)
    newValue = ACADPref.HyperlinkDisplayCursor
    MsgBox "The HyperlinkDisplayCursor preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.HyperlinkDisplayCursor = originalValue
    MsgBox "The HyperlinkDisplayCursor preference was reset back to: " & originalValue
End Sub


HyperlinkDisplayTooltip Example [ActiveX and VBA Reference: AAR]

HyperlinkDisplayTooltip Example

Using Programming Languages other than VBA

Sub Example_HyperLinkDisplayTooltip()
    ' This example reads and modifies the preference value that controls
    ' the display of hyperlink tooltips.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.HyperlinkDisplayTooltip
    MsgBox "The HyperLinkDisplayTooltip preference is set to: " & originalValue

    ' Modify the HyperLinkDisplayTooltip preference by toggling the value
    ACADPref.HyperlinkDisplayTooltip = Not (ACADPref.HyperlinkDisplayTooltip)
    newValue = ACADPref.HyperlinkDisplayTooltip
    MsgBox "The HyperLinkDisplayTooltip preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.HyperlinkDisplayTooltip = originalValue
    MsgBox "The HyperLinkDisplayTooltip preference was reset back to: " & originalValue
End Sub


Hyperlinks Example [ActiveX and VBA Reference: AAR]

Hyperlinks Example

Using Programming Languages other than VBA

Sub Example_HyperLinks()
    ' This example creates a Circle object in model space and
    ' adds a new Hyperlink to its Hyperlink collection

    Dim Hyperlinks As AcadHyperlinks
    Dim Hyperlink As AcadHyperlink
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim HLList As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    ' Get reference to the Circle's Hyperlinks collection
    Set Hyperlinks = circleObj.Hyperlinks

    ' Add a new Hyperlink complete with all properties
    Set Hyperlink = Hyperlinks.Add("AutoDesk")
    Hyperlink.URL = "www.autodesk.com"
    Hyperlink.URLDescription = "Autodesk Main Site"
    Hyperlink.URLNamedLocation = "MY_LOCATION"

    ' Read and display a list of existing Hyperlinks and
    ' their properties for this object
    For Each Hyperlink In Hyperlinks
        HLList = HLList & "____________________________________" & vbCrLf   ' Separator
        HLList = HLList & "URL: " & Hyperlink.URL & vbCrLf
        HLList = HLList & "URL Description: " & Hyperlink.URLDescription & vbCrLf
        HLList = HLList & "URL Named Location: " & Hyperlink.URLNamedLocation & vbCrLf
    Next

    MsgBox "The circle has " & Hyperlinks.count & " Hyperlink: " & vbCrLf & HLList
End Sub


ImageFile Example [ActiveX and VBA Reference: AAR]

ImageFile Example

Using Programming Languages other than VBA

Sub Example_ImageFile()
    ' This example inserts a raster image and then finds the
    ' ImageFile for the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have the image, or if it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double, rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "File error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current ImageFile
    ThisDrawing.Regen True
    MsgBox "The ImageFile is currently set to: " & raster.ImageFile, vbInformation
End Sub


ImageFrameHighlight Example [ActiveX and VBA Reference: AAR]

ImageFrameHighlight Example

Using Programming Languages other than VBA

Sub Example_ImageFrameHighlight()
    ' This example reads and modifies the preference value that controls
    ' the display of raster images during selection. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.ImageFrameHighlight
    MsgBox "The ImageFrameHighlight preference is set to: " & originalValue

    ' Modify the ImageFrameHighlight preference by toggling the value
    ACADPref.ImageFrameHighlight = Not (originalValue)
    newValue = ACADPref.ImageFrameHighlight
    MsgBox "The ImageFrameHighlight preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ImageFrameHighlight = originalValue
    MsgBox "The ImageFrameHighlight preference was reset back to: " & originalValue
End Sub


ImageHeight Example [ActiveX and VBA Reference: AAR]

ImageHeight Example

Using Programming Languages other than VBA

Sub Example_ImageHeight()
    ' This example adds a raster image in model space and then finds
    ' the height and width of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have this image, or if it is located
    ' in a different directory, insert a valid path and file name
    ' for the imageName variable below.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage
    imageName = "C:/AutoCAD/sample/downtown.jpg"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotationAngle = 0

    ' Creates a raster image in model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    ' Find the height and width of the raster image
    Dim height As Variant
    Dim width As Variant

    height = rasterObj.ImageHeight
    width = rasterObj.ImageWidth

    MsgBox "Raster image: " & rasterObj.ImageFile & vbCrLf & _
            "ImageHeight: " & str(height) & vbCrLf & _
            "ImageWidth: " & str(width)

End Sub


ImageVisibility Example [ActiveX and VBA Reference: AAR]

ImageVisibility Example

Using Programming Languages other than VBA

Sub Example_ImageVisibility()
    ' This example inserts a raster image and finds the current status
    ' of ImageVisibility for the image. It then changes the ImageVisibility
    ' status of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have the image, or if it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double, rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "File error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current ImageVisibility
    ThisDrawing.Regen True
    MsgBox "The ImageVisibility is currently set to: " & raster.ImageVisibility, vbInformation

    ' Change the ImageVisibility
    If (raster.ImageVisibility) Then
        raster.ImageVisibility = False
    Else
        raster.ImageVisibility = True
    End If
    ThisDrawing.Regen True
    MsgBox "The ImageVisibility is now set to: " & raster.ImageVisibility, vbInformation
End Sub


ImageWidth Example [ActiveX and VBA Reference: AAR]

ImageWidth Example

Using Programming Languages other than VBA

Sub Example_ImageWidth()
    ' This example adds a raster image in model space and then finds
    ' the height and width of the image.

    ' This example uses the "downtown.jpg" found in the Sample
    ' directory. If you do not have this image, or if it is located
    ' in a different directory, insert a valid path and file name
    ' for the imageName variable below.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage
    imageName = "C:/AutoCAD/sample/downtown.jpg"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotationAngle = 0

    ' Creates a raster image in model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    ' Find the height and width of the raster image
    Dim height As Variant
    Dim width As Variant

    height = rasterObj.ImageHeight
    width = rasterObj.ImageWidth

    MsgBox "Raster image: " & rasterObj.ImageFile & vbCrLf & _
            "ImageHeight: " & str(height) & vbCrLf & _
            "ImageWidth: " & str(width)

End Sub


Import Example [ActiveX and VBA Reference: AAR]

Import Example

Using Programming Languages other than VBA

Sub Example_Import()
    ' This example will create a new drawing. Be sure to save
    ' your work and start a new drawing before running this example.
    ' This example creates a circle. It then exports the drawing
    ' to a file called DXFExprt.DXF. It then opens a new drawing
    ' and imports the file.

    ' Create the circle for visual representation
    Dim circleObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 2: centerPt(1) = 2: centerPt(2) = 0
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)
    ZoomAll

    ' Create an empty selection set
    Dim sset As AcadSelectionSet
    Set sset = ThisDrawing.SelectionSets.Add("TEST")

    ' Export the current drawing to the file specified above.
    Dim exportFile As String
    exportFile = "C:\my documents\DXFExprt"    ' Adjust path for your system
    ThisDrawing.Export exportFile, "DXF", sset

    ' Open a new drawing
    Dim Acad As AcadApplication
    Dim newdoc As AcadDocument
    Set Acad = ThisDrawing.Application
    Set newdoc = Acad.Documents.Add("acad.dwt")

    ' Define the import
    Dim importFile As String
    Dim InsertPoint(0 To 2) As Double
    Dim scalefactor As Double
    importFile = "C:\my documents\DXFExprt.dxf"  ' Adjust path for your system
    InsertPoint(0) = 0#: InsertPoint(1) = 0#: InsertPoint(2) = 0#
    scalefactor = 2#

    ' Import the file
    ThisDrawing.Import importFile, InsertPoint, scalefactor
    ZoomAll

End Sub


ImportProfile Example [ActiveX and VBA Reference: AAR]

ImportProfile Example

Using Programming Languages other than VBA

Sub Example_ImportProfile()
    ' This example imports a profile.
    ' NOTE: A dummy profile name is used so that your existing
    ' profiles are not changed.

    Dim preferences As AcadPreferences
    Dim strProfileToImport As String

    Set preferences = ThisDrawing.Application.preferences

    ' Specify the profile to delete.
    strProfileToImport = "TestProfile"

    ' Delete the profile
    ' The call will fail if "TestProfile" does not exist
    On Error GoTo Error
    preferences.Profiles.ImportProfile strProfileToImport, "TESTPROFILE.ARG", True

    Exit Sub

Error:
        MsgBox "ImportProfile of " & strProfileToImport & " failed. " & Err.Description, , "ImportProfile Example"

End Sub


IncrementalSavePercent Example [ActiveX and VBA Reference: AAR]

IncrementalSavePercent Example

Using Programming Languages other than VBA

Sub Example_IncrementalSavePercent()
    ' This example returns the current setting of
    ' IncrementalSavePercent. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currIncrementalSavePercent As Integer
    Dim newIncrementalSavePercent As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current IncrementalSavePercent value
    currIncrementalSavePercent = preferences.OpenSave.IncrementalSavePercent
    MsgBox "The current value for IncrementalSavePercent is " & currIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"

    ' Change the value for IncrementalSavePercent
    newIncrementalSavePercent = 20
    preferences.OpenSave.IncrementalSavePercent = newIncrementalSavePercent
    MsgBox "The new value for IncrementalSavePercent is " & newIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"

    ' Reset IncrementalSavePercent to its original value
    preferences.OpenSave.IncrementalSavePercent = currIncrementalSavePercent
    MsgBox "The IncrementalSavePercent value is reset to " & currIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"
End Sub


Index Example [ActiveX and VBA Reference: AAR]

Index Example

Using Programming Languages other than VBA

Sub Example_Index()
    ' This example iterates through the first menu in the menu bar
    ' and displays the index for each menu item.

    Dim menuItem As AcadPopupMenuItem
    Dim menuIndex As String
    menuIndex = ""

    For Each menuItem In ThisDrawing.Application.MenuBar.Item(0)
        menuIndex = menuIndex & menuItem.TagString & " has the index: " & menuItem.index & vbCrLf
    Next menuItem
    MsgBox menuIndex

End Sub


IndexFDL Example [ActiveX and VBA Reference: AAR]

Index Example

Using Programming Languages other than VBA

Sub Example_IndexFDL()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


IndexOf Example [ActiveX and VBA Reference: AAR]

IndexOf Example

Using Programming Languages other than VBA

Sub Example_IndexOf()
    'This example adds an entry to the File Dependency List, returns its Index, updates
    'the entry, and then removes the entry.

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim FDLIndex As Long
    FDLIndex = objFDLCol.CreateEntry("acad:xref", "c:\referenced.dwg", True, True)
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim IndexNumber As Long
    IndexNumber = objFDLCol.IndexOf("acad:xref", "c:\referenced.dwg")
    Dim IndexString As String
    IndexString = CStr(IndexNumber)
    MsgBox ("The index of the new entry is " & IndexString & ".")

    objFDLCol.UpdateEntry (FDLIndex)

    objFDLCol.RemoveEntry FDLIndex, True
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")
 End Sub


InitializeUserInput Example [ActiveX and VBA Reference: AAR]

InitializeUserInput Example

Using Programming Languages other than VBA

Sub Example_InitializeUserInput()
    ' This example prompts for user input of a point. By using the
    ' InitializeUserInput method to define a keyword list, it can also
    ' return keywords entered by the user.

    On Error Resume Next

    ' Define the valid keywords
    Dim keywordList As String
    keywordList = "Keyword1 Keyword2"

    ' Call InitializeUserInput to setup the keywords
    ThisDrawing.Utility.InitializeUserInput 128, keywordList

    ' Get the user input
    Dim returnPnt As Variant
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point(Keyword1, Keyword2): ")
    If Err Then
         If StrComp(Err.Description, "User input is a keyword", 1) = 0 Then
         ' One of the keywords was entered
             Dim inputString As String
             Err.Clear
             inputString = ThisDrawing.Utility.GetInput
             MsgBox "You entered the keyword: " & inputString
         Else
             MsgBox "Error selecting the point: " & Err.Description
             Err.Clear
         End If
    Else
        ' Display point coordinates
        MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetInput Example"
    End If

End Sub


InsertBlock Example [ActiveX and VBA Reference: AAR]

InsertBlock Example

Using Programming Languages other than VBA

Sub Example_InsertBlock()
    ' This example creates a block containing a circle.
    ' It then inserts the block.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")

    ' Add a circle to the block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)

    ZoomAll

End Sub


InsertInMenuBar Example [ActiveX and VBA Reference: AAR]

InsertInMenuBar Example

Using Programming Languages other than VBA

Sub Example_InsertInMenuBar()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

End Sub


InsertionPoint Example [ActiveX and VBA Reference: AAR]

InsertionPoint Example

Using Programming Languages other than VBA

Sub Example_InsertionPoint()
    ' This example creates a text object in model space.
    ' It then changes the insertion point of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll

    ' Return the current value of the insertion point
    Dim currInsertionPoint As Variant
    currInsertionPoint = textObj.insertionPoint
    MsgBox "The insertion point of the text is " & currInsertionPoint(0) & ", " & currInsertionPoint(1) & ", " & currInsertionPoint(2), vbInformation, "InsertionPoint Example"

    ' Change the insertion point of the text object and
    ' update the display of the text object.
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    textObj.insertionPoint = insertionPoint
    textObj.Update
    MsgBox "The new insertion point of the text is " & textObj.insertionPoint(0) & ", " & textObj.insertionPoint(1) & ", " & textObj.insertionPoint(2), vbInformation, "InsertionPoint Example"

End Sub


InsertLoopAt Example [ActiveX and VBA Reference: AAR]

InsertLoopAt Example

Using Programming Languages other than VBA

Sub Example_InsertLoopAt()
    ' This example creates an associative hatch in model space.
    ' A Loop is then inserted into the hatch.
    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    MsgBox "Insert another loop.", , "InsertLoopAt Example"

    ' Insert the second circle as the other inner loop
    Dim LoopObj(0) As AcadEntity
    radius = 0.5
    Set LoopObj(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.InsertLoopAt hatchObj.NumberOfLoops, acHatchLoopTypeDefault, LoopObj

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    MsgBox "Loop inserted.", , "InsertLoopAt Example"

End Sub


InsertMenuInMenuBar Example [ActiveX and VBA Reference: AAR]

InsertMenuInMenuBar Example

Using Programming Languages other than VBA

Sub Example_InsertMenuInMenuBar()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    currMenuGroup.Menus.InsertMenuInMenuBar "TestMenu", ""

End Sub


IntersectWith Example [ActiveX and VBA Reference: AAR]

IntersectWith Example

Using Programming Languages other than VBA

Sub Example_IntersectWith()
    ' This example creates a line and circle and finds the points at
    ' which they intersect.

    ' Create the line
    Dim lineObj As AcadLine
    Dim startPt(0 To 2) As Double
    Dim endPt(0 To 2) As Double
    startPt(0) = 1: startPt(1) = 1: startPt(2) = 0
    endPt(0) = 5: endPt(1) = 5: endPt(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 3: centerPt(1) = 3: centerPt(2) = 0
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)
    ZoomAll

    ' Find the intersection points between the line and the circle
    Dim intPoints As Variant
    intPoints = lineObj.IntersectWith(circleObj, acExtendNone)

    ' Print all the intersection points
    Dim I As Integer, j As Integer, k As Integer
    Dim str As String
    If VarType(intPoints) <> vbEmpty Then
        For I = LBound(intPoints) To UBound(intPoints)
            str = "Intersection Point[" & k & "] is: " & intPoints(j) & "," & intPoints(j + 1) & "," & intPoints(j + 2)
            MsgBox str, , "IntersectWith Example"
            str = ""
            I = I + 2
            j = j + 3
            k = k + 1
        Next
    End If
End Sub


Invisible Example [ActiveX and VBA Reference: AAR]

Invisible Example

Using Programming Languages other than VBA

Sub Example_Invisible()
    ' This example creates an attribute definition in model space.
    ' It then queries the visibility of the attribute, changes
    ' the visibility, and queries the visibility again.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "New Tag"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Find the current visibility for the attribute
    GoSub QUERYSTATUS

    ' Change the visibility of the attribute
    attributeObj.Invisible = Not attributeObj.Invisible
    ZoomAll

    GoSub QUERYSTATUS

    Exit Sub

QUERYSTATUS:
    If attributeObj.Invisible Then
        MsgBox "The attribute is invisible."
    Else
        MsgBox "The attribute is visible."
    End If
    Return
End Sub


IsCloned Example [ActiveX and VBA Reference: AAR]

IsCloned Example

Using Programming Languages other than VBA

Sub Example_IsCloned()
    ' This example creates a Circle object and uses the CopyObjects
    ' method to copy the Circle. It then displays some information
    ' about the source objects used in the CopyObjects operation.

    Dim circleObj As AcadCircle, circleObjCopy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius1Copy As Double
    Dim objCollection(0 To 0) As Object
    Dim retObjects As Variant
    Dim IDPairs As Variant
    Dim IsClonedState As String, IsPrimary As String, IsXLated As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius1Copy = 1#

    ' Add two circles to the drawing
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius1)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj

    ' Copy object and get back a collection of the new objects
    retObjects = ThisDrawing.CopyObjects(objCollection, , IDPairs)

    ' Get newly created object and apply new properties to the copies
    Set circleObjCopy = retObjects(0)

    circleObjCopy.radius = radius1Copy

    ThisDrawing.Application.ZoomAll
    ThisDrawing.Regen acAllViewports

    ' Display whether the first source object has a clone
    IsClonedState = IIf(IDPairs(0).IsCloned, "is cloned.", "is not cloned.")
    IsPrimary = IIf(IDPairs(0).IsPrimary, "is a primary member of the objects being copied.", "is owned by a primary member of the objects being copied.")
    IsXLated = IIf(IDPairs(0).IsOwnerXlated, "has been translated.", "has not been translated.")

    MsgBox "The new Circle source object: " & IsClonedState & vbCrLf & _
           "The new Circle source object: " & IsPrimary & vbCrLf & _
           "The source of the new Circle object: " & IsXLated & vbCrLf, vbInformation

End Sub


IsLayout Example [ActiveX and VBA Reference: AAR]

IsLayout Example

Using Programming Languages other than VBA

Sub Example_IsLayout()
    ' This example cycles through each Block object in a drawing
    ' and determines whether style of each Block by accessing the
    ' IsLayout and IsXRef properties.  A Block
    ' object is also added at runtime so the results are mixed and do not only
    ' come from the default Blocks.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newBlock As AcadBlock, insertedBlock As AcadBlockReference
    Dim tempBlock As AcadBlock
    Dim msg As String

    ' Define the Circle object that will be inserted into the block
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle object
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block object
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Add the new block to model space
    Set insertedBlock = ThisDrawing.ModelSpace.InsertBlock(InsertPoint, "CBlock", 1, 1, 1, 0)

    ThisDrawing.Application.ZoomAll

    msg = vbCrLf & vbCrLf

    For Each tempBlock In ThisDrawing.Blocks
        If Not (tempBlock.IsLayout) And Not (tempBlock.IsXRef) Then
            ' Block is simple
            msg = msg & tempBlock.name & ": Simple"
        ElseIf tempBlock.IsXRef Then
            ' Block is an external reference
            msg = msg & tempBlock.name & ": External Reference"
            If tempBlock.IsLayout Then
                ' Block also contains layout geometry
                msg = msg & tempBlock.name & " and Contains Layout Geometry"
            End If
        ElseIf tempBlock.IsLayout Then
            ' Block contains layout geometry
            msg = msg & tempBlock.name & ": Contains Layout Geometry"
        End If

        msg = msg & vbCrLf      ' Move to next line
    Next

    ' Display Block information for this drawing
    MsgBox "Blocks in this drawing have the following styles: " & msg

End Sub


IsModified Example [ActiveX and VBA Reference: AAR]

IsModified Example

Using Programming Languages other than VBA

Sub Example_IsModified()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


ISOPenWidth Example [ActiveX and VBA Reference: AAR]

ISOPenWidth Example

Using Programming Languages other than VBA

Sub Example_ISOPenWidth()
    ' This example creates an associative hatch in model space.
    ' The ISOPenWidth of the hatch pattern is then returned and changed.

    Dim hatchObj As AcadHatch
    Dim patternName As String, PatternType As Long
    Dim bAssociativity As Boolean
    Dim outerLoop(0 To 1) As Object
    Dim center(0 To 2) As Double
    Dim radius As Double, startAngle As Double, endAngle As Double
    Dim innerLoop1(0) As Object, innerLoop2(0) As Object
    Dim PatternScale As Double

    ' Define the hatch
    patternName = "ANSI31": PatternType = 0: bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3:  startAngle = 0:  endAngle = 3.141592

    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1

    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the ISO pen width of the hatch pattern
    MsgBox "The ISO pen width of the hatch pattern is: " & hatchObj.ISOPenWidth, vbInformation

    ' Change the ISO pen width of the hatch pattern
    hatchObj.ISOPenWidth = acPenWidth050
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Display new pen width for this hatch
    If hatchObj.ISOPenWidth = acPenWidthUnk Then
        ' Non-Standard pen widths
        MsgBox "The ISO pen width of the hatch pattern is now: " & hatchObj.PatternScale, vbInformation
    Else
        ' Standard pen widths
        MsgBox "The ISO pen width of the hatch pattern is now: " & hatchObj.ISOPenWidth, vbInformation
    End If

End Sub


IsOwnerXlated Example [ActiveX and VBA Reference: AAR]

IsOwnerXlated Example

Using Programming Languages other than VBA

Sub Example_IsOwnerXlated()
    ' This example creates a Circle object and uses the CopyObjects
    ' method to copy the Circle. It then displays some information
    ' about the source objects used in the CopyObjects operation.

    Dim circleObj As AcadCircle, circleObjCopy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius1Copy As Double
    Dim objCollection(0 To 0) As Object
    Dim retObjects As Variant
    Dim IDPairs As Variant
    Dim IsClonedState As String, IsPrimary As String, IsXLated As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius1Copy = 1#

    ' Add two circles to the drawing
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius1)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj

    ' Copy object and get back a collection of the new objects (copies)
    retObjects = ThisDrawing.CopyObjects(objCollection, , IDPairs)

    ' Get newly created object and apply new properties to the copies
    Set circleObjCopy = retObjects(0)

    circleObjCopy.radius = radius1Copy

    ThisDrawing.Application.ZoomAll
    ThisDrawing.Regen acAllViewports

    ' Display whether the first source object has a clone
    IsClonedState = IIf(IDPairs(0).IsCloned, "is cloned.", "is not cloned.")
    IsPrimary = IIf(IDPairs(0).IsPrimary, "is a primary member of the objects being copied.", "is owned by a primary member of the objects being copied.")
    IsXLated = IIf(IDPairs(0).IsOwnerXlated, "has been translated.", "has not been translated.")

    MsgBox "The new Circle source object: " & IsClonedState & vbCrLf & _
           "The new Circle source object: " & IsPrimary & vbCrLf & _
           "The source of the new Circle object: " & IsXLated & vbCrLf, vbInformation

End Sub


IsPeriodic Example [ActiveX and VBA Reference: AAR]

IsPeriodic Example

Using Programming Languages other than VBA

Sub Example_IsPeriodic()
   ' This example creates a Spline object in model space and
   ' determines if the Spline is periodic

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim UserMessage As String

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0: fitPoints(3) = 5
    fitPoints(4) = 5: fitPoints(5) = 0: fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ThisDrawing.Application.ZoomAll

    ' Display whether or not new Spline is periodic
    UserMessage = IIf(splineObj.IsPeriodic, "is periodic", "is not periodic")

    MsgBox "The new Spline " & UserMessage

End Sub


IsPlanar Example [ActiveX and VBA Reference: AAR]

IsPlanar Example

Using Programming Languages other than VBA

Sub Example_IsPlanar()
   ' This example creates a Spline object in model space and
   ' determines whether the Spline is planar

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim UserMessage As String

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0: fitPoints(3) = 5
    fitPoints(4) = 5: fitPoints(5) = 0: fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ThisDrawing.Application.ZoomAll

    ' Display whether or not new Spline is planar
    UserMessage = IIf(splineObj.IsPlanar, "is planar", "is not planar")

    MsgBox "The new Spline " & UserMessage

End Sub


IsPrimary Example [ActiveX and VBA Reference: AAR]

IsPrimary Example

Using Programming Languages other than VBA

Sub Example_IsPrimary()
    ' This example creates a Circle object and uses the CopyObjects
    ' method to make a copy of the Circle. It then displays some information
    ' about the source objects used in the CopyObjects operation.

    Dim circleObj As AcadCircle, circleObjCopy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius1Copy As Double
    Dim objCollection(0 To 0) As Object
    Dim retObjects As Variant
    Dim IDPairs As Variant
    Dim IsClonedState As String, IsPrimary As String, IsXLated As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius1Copy = 1#

    ' Add two circles to the drawing
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius1)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj

    ' Copy object and get back a collection of the new objects (copies)
    retObjects = ThisDrawing.CopyObjects(objCollection, , IDPairs)

    ' Get newly created object and apply new properties to the copies
    Set circleObjCopy = retObjects(0)

    circleObjCopy.radius = radius1Copy

    ThisDrawing.Application.ZoomAll
    ThisDrawing.Regen acAllViewports

    ' Display whether the first source object has a clone
    IsClonedState = IIf(IDPairs(0).IsCloned, "is cloned.", "is not cloned.")
    IsPrimary = IIf(IDPairs(0).IsPrimary, "is a primary member of the objects being copied.", "is owned by a primary member of the objects being copied.")
    IsXLated = IIf(IDPairs(0).IsOwnerXlated, "has been translated.", "has not been translated.")

    MsgBox "The new Circle source object: " & IsClonedState & vbCrLf & _
           "The new Circle source object: " & IsPrimary & vbCrLf & _
           "The source of the new Circle object: " & IsXLated & vbCrLf, vbInformation

End Sub


IsQuiescent Example [ActiveX and VBA Reference: AAR]

IsQuiescent Example

Using Programming Languages other than VBA

Sub Example_IsQuiescent()
    ' This example gets the acadState object and checks to see whether
    ' AutoCAD is in a quiescent state.
    Dim State As AcadState
    Set State = GetAcadState
    If State.IsQuiescent Then
        MsgBox "AutoCAD is quiescent."
    Else
        MsgBox "AutoCAD is not quiescent."
    End If
End Sub


IsRational Example [ActiveX and VBA Reference: AAR]

IsRational Example

Using Programming Languages other than VBA

Sub Example_IsRational()
    ' This example creates a spline object in model space.
    ' It then determines whether the spline is rational or non-rational
    ' based on the IsRational property.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display a message according to the IsRational value for the spline.
    If splineObj.IsRational Then
        MsgBox "The newly created Spline is a rational Spline", , "IsRational Example"
    Else
        MsgBox "The newly created Spline is a non-rational Spline", , "IsRational Example"
    End If

End Sub


IsRemoteFile Example [ActiveX and VBA Reference: AAR]

IsRemoteFile Example

Using Programming Languages other than VBA

Sub Example_IsRemoteFile()
    ' This example will prompt the user for a URL to download and will verify that
    ' a proper URL was entered.  After downloading, the example will attempt to load
    ' the downloaded URL as a drawing.
    '
    ' * Note: Remember to delete the downloaded file from your disk drive when finished.

    Dim Utility As AcadUtility
    Dim URL As String, DestFile As String, FileURL As String

    Set Utility = ThisDrawing.Utility   ' Connect to Utility object

GETURL:
    ' Prompt user for a URL to download.  This should be a URL to an AutoCAD drawing file.
    URL = InputBox("Enter the complete URL of the file you wish to download. " & _
                    "Enter BROWSER to select the URL from a web browser", _
                    "Enter URL To Download", URL)

    URL = Trim(URL)                     ' Get rid of blank spaces

    If URL = "" Then Exit Sub           ' Did user cancel

    ' Does the user want to select from a browser?
    If StrComp(URL, "BROWSER", vbTextCompare) = 0 Then
        Utility.LaunchBrowserDialog _
        URL, "AutoCAD Browser", "Open", "http://www.autodesk.com", "ACADBROWSER", True

        GoTo GETURL     ' Return to display chosen URL and allow modifications
    End If

    ' Determine if user entered a valid URL; if not, prompt again
    If Not (Utility.IsURL(URL)) Then
        MsgBox "The URL you entered is not valid.  Make sure the syntax is a valid URL."
        GoTo GETURL
    End If

    ' Download URL
    Utility.GetRemoteFile URL, DestFile, True

    ' Display downloaded file information
    MsgBox URL & " was downloaded to: " & DestFile & vbCrLf & vbCrLf & _
           "Press any key to attempt to load the new file as a drawing."

    ' Attempt to load file as drawing; if an error occurs, this was probably not a drawing
    ' file, but rather the text from a web page.
    ' Try loading the downloaded file into a text editor to view the contents.
    On Error Resume Next
    ThisDrawing.Application.Documents.Open DestFile
    If Err.Number <> 0 Then
        MsgBox "Error loading downloaded file as a drawing: " & Err.Description & vbCrLf & vbCrLf & _
               "This is probably not a valid drawing file!"
    End If
    On Error GoTo 0

    ' Use IsRemoteFile to determine if this file was downloaded from a URL.
    ' If it was, display the URL it was downloaded from.
    '
    ' * Note: Although the results IsRemoteFile will return are already known because
    ' the file was just downloaded, it is important to know how this
    ' method can be used.
    If Utility.IsRemoteFile(DestFile, FileURL) Then
        MsgBox "The file: " & DestFile & " is a downloaded file and was downloaded from: " & FileURL
    Else
        MsgBox "The file: " & DestFile & " is not a downloaded file."
    End If

End Sub


Issuer Example [ActiveX and VBA Reference: AAR]

Issuer Example

Using Programming Languages other than VBA

Sub Example_Issuer()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True

    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP

    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


IsURL Example [ActiveX and VBA Reference: AAR]

IsURL Example

Using Programming Languages other than VBA

Sub Example_IsURL()
    ' This example will prompt the user for a URL to download and will verify that
    ' a proper URL was entered.  After downloading, the example will attempt to load
    ' the downloaded URL as a drawing.
    '
    ' * Note: Remember to delete the downloaded file from your disk drive when finished.

    Dim Utility As AcadUtility
    Dim URL As String, DestFile As String, FileURL As String

    Set Utility = ThisDrawing.Utility   ' Connect to Utility object

GETURL:
    ' Prompt user for a URL to download.  This should be a URL to an AutoCAD drawing file.
    URL = InputBox("Enter the complete URL of the file you wish to download. " & _
                    "Enter BROWSER to select the URL from a web browser", _
                    "Enter URL To Download", URL)

    URL = Trim(URL)                     ' Get rid of blank spaces

    If URL = "" Then Exit Sub           ' Did user cancel

    ' Does the user want to select from a browser?
    If StrComp(URL, "BROWSER", vbTextCompare) = 0 Then
        Utility.LaunchBrowserDialog _
        URL, "AutoCAD Browser", "Open", "http://www.autodesk.com", "ACADBROWSER", True

        GoTo GETURL     ' Return to display chosen URL and allow modifications
    End If

    ' Determine if user entered a valid URL; if not, prompt again
    If Not (Utility.IsURL(URL)) Then
        MsgBox "The URL you entered is not valid.  Make sure the syntax is a valid URL."
        GoTo GETURL
    End If

    ' Download URL
    Utility.GetRemoteFile URL, DestFile, True

    ' Display downloaded file information
    MsgBox URL & " was downloaded to: " & DestFile & vbCrLf & vbCrLf & _
           "Press any key to attempt to load the new file as a drawing."

    ' Attempt to load file as drawing; if an error occurs, this was probably not a drawing
    ' file, but rather the text from a web page.
    ' Try loading the downloaded file into a text editor to view the contents.
    On Error Resume Next
    ThisDrawing.Application.Documents.Open DestFile
    If Err.Number <> 0 Then
        MsgBox "Error loading downloaded file as a drawing: " & Err.Description & vbCrLf & vbCrLf & _
               "This is probably not a valid drawing file!"
    End If
    On Error GoTo 0

    ' Use IsRemoteFile to determine if this file was downloaded from a URL.
    ' If it was, display the URL it was downloaded from
    '
    ' * Note: Although the results IsRemoteFile will return are already known because
    ' the file was just downloaded, it is important to know how this
    ' method can be used.
    If Utility.IsRemoteFile(DestFile, FileURL) Then
        MsgBox "The file: " & DestFile & " is a downloaded file and was downloaded from: " & FileURL
    Else
        MsgBox "The file: " & DestFile & " is not a downloaded file."
    End If

End Sub


IsXRef Example [ActiveX and VBA Reference: AAR]

IsXRef Example

Using Programming Languages other than VBA

Sub Example_IsXRef()
    ' This example cycles through each Block object in a drawing
    ' and determines the style of each Block by accessing the
    ' IsLayout and IsXRef properties.  A Block
    ' object is also added at runtime so the results are mixed and do not only
    ' come from the default Blocks.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newBlock As AcadBlock, insertedBlock As AcadBlockReference
    Dim tempBlock As AcadBlock
    Dim msg As String

    ' Define the Circle object that will be inserted into the block
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle object
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block object
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Add the new block to model space
    Set insertedBlock = ThisDrawing.ModelSpace.InsertBlock(InsertPoint, "CBlock", 1, 1, 1, 0)

    ThisDrawing.Application.ZoomAll

    msg = vbCrLf & vbCrLf

    For Each tempBlock In ThisDrawing.Blocks
        If Not (tempBlock.IsLayout) And Not (tempBlock.IsXRef) Then
            ' Block is simple
            msg = msg & tempBlock.name & ": Simple"
        ElseIf tempBlock.IsXRef Then
            ' Block is an external reference
            msg = msg & tempBlock.name & ": External Reference"
            If tempBlock.IsLayout Then
                ' Block also contains layout geometry
                msg = msg & tempBlock.name & " and Contains Layout Geometry"
            End If
        ElseIf tempBlock.IsLayout Then
            ' Block contains layout geometry
            msg = msg & tempBlock.name & ": Contains Layout Geometry"
        End If

        msg = msg & vbCrLf      ' Move to next line
    Next

    ' Display Block information for this drawing
    MsgBox "Blocks in this drawing have the following styles: " & msg

End Sub


Item Example [ActiveX and VBA Reference: AAR]

Item Example

Using Programming Languages other than VBA

Sub Example_Item()
    ' This example shows two uses of the Item method.
    ' The first uses Item with an index counter to return an item in a collection.
    ' The second uses Item with a string to return an item in a collection.

    ' Iterate thru the model space collection,
    ' get all the items in the collection
    ' and store them in an array called newObjs
    Dim count As Integer
    count = ThisDrawing.ModelSpace.count

    ReDim newObjs(count) As AcadEntity
    Dim index As Integer
    For index = 0 To count - 1
        Set newObjs(index) = ThisDrawing.ModelSpace.Item(index)
    Next

    ' Get a particular item, in this case a layer, based on name "0"
    Dim layerObj As AcadLayer
    Set layerObj = ThisDrawing.Layers.Item("0")

End Sub


Key Example [ActiveX and VBA Reference: AAR]

Key Example

Using Programming Languages other than VBA

Sub Example_Key()
    ' This example creates two Circle objects and uses the CopyObjects
    ' method to copy them. It then returns the
    ' object IDs of the source objects using the Key property and uses these
    ' values to remove the original (source) objects

    Dim circleObj1 As AcadCircle, circleObj2 As AcadCircle
    Dim circleObj1Copy As AcadCircle, circleObj2Copy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius2 As Double
    Dim radius1Copy As Double, radius2Copy As Double
    Dim objCollection(0 To 1) As Object
    Dim retObjects As Variant
    Dim IDPairs As Variant
    Dim SourceObject As AcadObject

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius2 = 7#
    radius1Copy = 1#: radius2Copy = 2#

    ' Add two circles to the drawing
    Set circleObj1 = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius1)
    Set circleObj2 = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius2)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj1
    Set objCollection(1) = circleObj2

    ' Copy object and get back a collection of the new objects (copies)
    retObjects = ThisDrawing.CopyObjects(objCollection, , IDPairs)

    ' Get newly created object and apply new properties to the copies
    Set circleObj1Copy = retObjects(0)
    Set circleObj2Copy = retObjects(1)

    circleObj1Copy.radius = radius1Copy
    circleObj2Copy.radius = radius2Copy

    ThisDrawing.Application.ZoomAll
    ThisDrawing.Regen acAllViewports

    ' Display the object IDs of the source objects used for the copy
    MsgBox "The first source object ID is: " & IDPairs(0).Key & vbCrLf & _
           "The second source object ID is: " & IDPairs(1).Key

    ' This key can be used with objectIDtoObject to reference the source objects,
    ' which is handy if the user manually selected the source objects.
    '
    ' Delete the source objects from the ID obtained
    Set SourceObject = ThisDrawing.ObjectIdToObject(IDPairs(0).Key)
    SourceObject.Delete
    Set SourceObject = ThisDrawing.ObjectIdToObject(IDPairs(1).Key)
    SourceObject.Delete

    ThisDrawing.Regen acAllViewports

    MsgBox "The source objects have just been deleted!", vbInformation
End Sub


KeyboardAccelerator Example [ActiveX and VBA Reference: AAR]

KeyboardAccelerator Example

Using Programming Languages other than VBA

Sub Example_KeyboardAccelerator()
    ' This example returns the current setting of
    ' KeyboardAccelerator. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currKeyboardAccelerator As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current KeyboardAccelerator value
    currKeyboardAccelerator = preferences.User.KeyboardAccelerator
    MsgBox "The current value for KeyboardAccelerator is " & currKeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"

    ' Change the value for KeyboardAccelerator
    If currKeyboardAccelerator = acPreferenceClassic Then
        preferences.User.KeyboardAccelerator = acPreferenceCustom
    Else
        preferences.User.KeyboardAccelerator = acPreferenceClassic
    End If
    MsgBox "The new value for KeyboardAccelerator is " & preferences.User.KeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"

    ' Reset KeyboardAccelerator to its original value
    preferences.User.KeyboardAccelerator = currKeyboardAccelerator
    MsgBox "The KeyboardAccelerator value is reset to " & preferences.User.KeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"
End Sub


KeyboardPriority Example [ActiveX and VBA Reference: AAR]

KeyboardPriority Example

Using Programming Languages other than VBA

Sub Example_KeyboardPriority()
    ' This example returns the current setting of
    ' KeyboardPriority. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currKeyboardPriority As Integer
    Dim constant As String
    Dim newConstant As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current KeyboardPriority value
    currKeyboardPriority = preferences.User.KeyboardPriority
    constant = Choose(currKeyboardPriority + 1, "acKeyboardRunningObjSnap", "acKeyboardEntry", "acKeyboardEntryExceptScripts")
    MsgBox "The current value for KeyboardPriority is " & constant, vbInformation, "KeyboardPriority Example"

    ' Change the value for KeyboardPriority
    newConstant = "acKeyboardEntry"
    preferences.User.KeyboardPriority = acKeyboardEntry
    MsgBox "The new value for KeyboardPriority is " & newConstant, vbInformation, "KeyboardPriority Example"

    ' Reset KeyboardPriority to its original value
    preferences.User.KeyboardPriority = currKeyboardPriority
    MsgBox "The KeyboardPriority value is reset to " & constant, vbInformation, "KeyboardPriority Example"
End Sub


KeyLength Example [ActiveX and VBA Reference: AAR]

KeyLength Example

Using Programming Languages other than VBA

Sub Example_KeyLength()
    ' This example encrypts and saves a file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


Keywords Example [ActiveX and VBA Reference: AAR]

Keywords Example

Using Programming Languages other than VBA

Sub Example_Keywords()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


Knots Example [ActiveX and VBA Reference: AAR]

Knots Example

Using Programming Languages other than VBA

Sub Example_Knots()
   ' This example creates a Spline object in model space and
   ' returns the knot vector for the new Spline

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim knotVector As Variant

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0: fitPoints(3) = 5
    fitPoints(4) = 5: fitPoints(5) = 0: fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ThisDrawing.Application.ZoomAll

    ' Display the knot vector of the new Spline
    knotVector = splineObj.Knots
    MsgBox "The knot vector of the new Spline is: " & vbCrLf & _
                                            knotVector(0) & vbCrLf & _
                                            knotVector(1) & vbCrLf & _
                                            knotVector(2)
End Sub


Label Example [ActiveX and VBA Reference: AAR]

Label Example

Using Programming Languages other than VBA

Sub Example_Label()
    ' This example iterates through the first menu in the menu bar
    ' and displays the label for each menu item.

    Dim menuItem As AcadPopupMenuItem
    Dim menuLabel As String
    menuLabel = ""

    For Each menuItem In ThisDrawing.Application.MenuBar.Item(0)
        menuLabel = menuLabel & menuItem.Label & vbCrLf
    Next menuItem
    MsgBox menuLabel

End Sub


LandingGap Example [ActiveX and VBA Reference: AAR]

LandingGap Example

Using Programming Languages other than VBA

Sub Example_LandingGap()
    ' This example creates an MLeader object and gets and sets values for
    ' the landing gap.

    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.LandingGap = 3.2

    ZoomAll

End Sub


LargeButtons Example [ActiveX and VBA Reference: AAR]

LargeButtons Example

Using Programming Languages other than VBA

Sub Example_LargeButtons()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar (TestMenu) and inserts a ToolBarButton
    ' into it.  It then sets the LargeButtons property to change the visible style
    ' of all the system Toolbars

    Dim CurrSize As Boolean, ButtonSize As String
    Dim Toolbars As AcadToolbars

    ' Make the system Toolbar buttons bigger
    Set Toolbars = ThisDrawing.Application.MenuGroups("ACAD").Toolbars

    ' Get current size
    CurrSize = Toolbars.LargeButtons

    ' Display current Toolbar size
    GoSub DISPLAY

    ' Toggle Toolbar size
    Toolbars.LargeButtons = Not (Toolbars.LargeButtons)

    ' Display current Toolbar size
    GoSub DISPLAY

    ' Reset to original value
    Toolbars.LargeButtons = CurrSize

    ' Display current Toolbar size
    GoSub DISPLAY

    Exit Sub

DISPLAY:
    ' Display button style
    ButtonSize = IIf(Toolbars.LargeButtons, "Large", "Normal size")
    MsgBox "We are displaying " & ButtonSize & " buttons.", vbInformation

    Return
End Sub


LastHeight Example [ActiveX and VBA Reference: AAR]

LastHeight Example

Using Programming Languages other than VBA

Sub Example_LastHeight()
    ' This example finds the current value for LastHeight.
    ' It then changes that value, and resets it again.

    Dim txtStyleObj As AcadTextStyle
    Set txtStyleObj = ThisDrawing.ActiveTextStyle

    ' Set and retrieve the LastHeight property
    Dim currHeight As Double
    Dim newHeight As Double

    ' Retrieve current LastHeight property
    currHeight = txtStyleObj.lastHeight
    MsgBox "The current value for LastHeight is " & txtStyleObj.lastHeight, , "LastHeight Example"

    ' Set LastHeight to a new value
    txtStyleObj.lastHeight = 4#

    ' Retrieve the current LastHeight value
    newHeight = txtStyleObj.lastHeight
    MsgBox "The new value for LastHeight is " & txtStyleObj.lastHeight, , "LastHeight Example"

    ' Finally reset LastHeight to its default value
    txtStyleObj.lastHeight = currHeight
    MsgBox "The value for LastHeight has been reset to " & txtStyleObj.lastHeight, , "LastHeight Example"

End Sub


LastSavedBy Example [ActiveX and VBA Reference: AAR]

LastSavedBy Example

Using Programming Languages other than VBA

Sub Example_LastSavedBy()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


LaunchBrowserDialog Example [ActiveX and VBA Reference: AAR]

LaunchBrowserDialog Example

Using Programming Languages other than VBA

Sub Example_LaunchBrowserDialog()
    ' This example will prompt the user for a URL to download and will verify that
    ' a proper URL was entered.  After downloading, the example will attempt to load
    ' the downloaded URL as a drawing.
    '
    ' * Note: Remember to delete the downloaded file from your disk drive when finished.

    Dim Utility As AcadUtility
    Dim URL As String, DestFile As String, FileURL As String

    Set Utility = ThisDrawing.Utility   ' Connect to Utility object

GETURL:
    ' Prompt user for a URL to download.  This should be a URL to an AutoCAD drawing file.
    URL = InputBox("Enter the complete URL of the file you wish to download. " & _
                    "Enter BROWSER to select the URL from a web browser", _
                    "Enter URL To Download", URL)

    URL = Trim(URL)                     ' Get rid of blank spaces

    If URL = "" Then Exit Sub           ' Did user cancel

    ' Does the user want to select from a browser?
    If StrComp(URL, "BROWSER", vbTextCompare) = 0 Then
        Utility.LaunchBrowserDialog _
        URL, "AutoCAD Browser", "Open", "http://www.autodesk.com", "ACADBROWSER", True

        GoTo GETURL     ' Return to display chosen URL and allow modifications
    End If

    ' Determine if user entered a valid URL; if not, prompt again
    If Not (Utility.IsURL(URL)) Then
        MsgBox "The URL you entered is not valid.  Make sure the syntax is a valid URL."
        GoTo GETURL
    End If

    ' Download URL
    Utility.GetRemoteFile URL, DestFile, True

    ' Display downloaded file information
    MsgBox URL & " was downloaded to: " & DestFile & vbCrLf & vbCrLf & _
           "Press any key to attempt to load the new file as a drawing."

    ' Attempt to load file as drawing; if an error occurs, this was probably not a drawing
    ' file, but rather the text from a web page.
    ' Try loading the downloaded file into a text editor to view the contents.
    On Error Resume Next
    ThisDrawing.Application.Documents.Open DestFile
    If Err.Number <> 0 Then
        MsgBox "Error loading downloaded file as a drawing: " & Err.Description & vbCrLf & vbCrLf & _
               "This is probably not a valid drawing file!"
    End If
    On Error GoTo 0

    ' Use IsRemoteFile to determine if this file was downloaded from a URL.
    ' If it was, display the URL it was downloaded from
    '
    ' * Note: Although the results IsRemoteFile will return are already known because
    ' the file was just downloaded, it is important to know how this
    ' method can be used.
    If Utility.IsRemoteFile(DestFile, FileURL) Then
        MsgBox "The file: " & DestFile & " is a downloaded file and was downloaded from: " & FileURL
    Else
        MsgBox "The file: " & DestFile & " is not a downloaded file."
    End If

End Sub


Layer Example [ActiveX and VBA Reference: AAR]

Layer Example

Using Programming Languages other than VBA

Sub Example_Layer()
    ' This example creates a new layer named "ABC" (colored blue).
    ' It then creates a circle and assigns it to layer "ABC"

    ' Create new layer
    Dim layerObj As AcadLayer
    Set layerObj = ThisDrawing.Layers.Add("ABC")
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)
    layerObj.TrueColor = color

    ' Create Circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 3: center(1) = 3: center(2) = 0
    radius = 1.5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll
    MsgBox "The circle has been created on layer " & circleObj.Layer, , "Layer Example"

    ' Set the layer of new circle to "ABC"
    circleObj.Layer = "ABC"

    ' Refresh view
    ThisDrawing.Regen (True)
    MsgBox "The circle is now on layer " & circleObj.Layer, , "Layer Example"

End Sub


LayerOn Example [ActiveX and VBA Reference: AAR]

LayerOn Example

Using Programming Languages other than VBA

Sub Example_LayerOn()
    ' This example creates a new layer called "LayerOn".
    ' It then displays the status of the LayerOn property
    ' for the new layer, toggles the status of the
    ' LayerOn property, and again displays its status.
    ' After running this example, you can check the layer
    ' control on the Object Properties tool bar. It will
    ' show the new layer and the latest LayerOn status.

    Dim layerObj As AcadLayer

    ' Create the new layer
    Set layerObj = ThisDrawing.Layers.Add("LayerOn")

    ' Display the LayerOn status of the new layer
    GoSub DISPLAYSTATUS

    ' Toggle the status of the LayerOn property for the layer
    layerObj.LayerOn = Not (layerObj.LayerOn)

    ' Display the LayerOn status of the new layer
    GoSub DISPLAYSTATUS
    Exit Sub

DISPLAYSTATUS:
    If layerObj.LayerOn Then
        MsgBox "Layer " & layerObj.name & " is turned on.", , "LayerOn Example"
    Else
        MsgBox "Layer " & layerObj.name & " is turned off.", , "LayerOn Example"
    End If
    Return

End Sub


Layers Example [ActiveX and VBA Reference: AAR]

Layers Example

Using Programming Languages other than VBA

Sub Example_Layers()
    ' This example finds the current Layers collection and
    ' adds a new layer to that collection.

    Dim layerColl As AcadLayers
    Set layerColl = ThisDrawing.Layers

    ' Create a dimension style named "TEST" in current drawing
    Dim testlayer As AcadLayer
    Set testlayer = layerColl.Add("TEST")
    MsgBox "A new layer called " & testlayer.name & " has been added to the Layers collection.", vbInformation, "Layers Example"
End Sub


LayerState Example [ActiveX and VBA Reference: AAR]

LayerState Example

Using Programming Languages other than VBA

Sub Example_LayerState()
    ' This example demonstrates the
    ' CategoryName, LayoutId, LayerState,
    ' and HasVpAssociation properties of the View object

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

    ' Create a view named "New_View" in current drawing
    Dim viewObj As IAcadView2

    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.Name & " has been added." & vbCrLf & _
           "Height: " & viewObj.Height & vbCrLf & _
           "Width: " & viewObj.Width, , "Example"

    viewObj.CategoryName = "My View Category"
    viewObj.LayerState = "My Layer State"

    viewObj.LayoutId = ThisDrawing.Layouts(1).ObjectID

    MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
            viewObj.LayoutId & " is the Layout ID." & vbCrLf & _
            viewObj.LayerState & " is the Layer state."

    If viewObj.HasVpAssociation = True Then
        MsgBox "The view is associated with a paper space viewport."
    Else
        MsgBox "The view is not associated with a paper space viewport."

   End If
End Sub


Layout Example [ActiveX and VBA Reference: AAR]

Layout Example

Using Programming Languages other than VBA

Sub Example_Layout()
    ' This example references the Layout object obtained from model space.
    ' We then display information from the Layout object.

    Dim Layout As ACADLayout

    ' Attach to Layout object
    Set Layout = ThisDrawing.ModelSpace.Layout
    MsgBox "We now have access to the properties and methods of the model space Layout object!"

    ' Retrieve the name of the model space Layout
    MsgBox "The name of the model space Layout is: " & Layout.name

    ' Release object
    Set Layout = Nothing
    MsgBox "The Layout object has been released!"
End Sub


LayoutCreateViewport Example [ActiveX and VBA Reference: AAR]

LayoutCreateViewport Example

Using Programming Languages other than VBA

Sub Example_LayoutCreateViewport()
    ' This example reads and modifies the preference value that controls
    ' the automatic creation of a viewport for new layouts. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.LayoutCreateViewport
    MsgBox "The LayoutCreateViewport preference is set to: " & originalValue

    ' Modify the LayoutCreateViewport preference by toggling the value
    ACADPref.LayoutCreateViewport = Not (originalValue)
    newValue = ACADPref.LayoutCreateViewport
    MsgBox "The LayoutCreateViewport preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutCreateViewport = originalValue
    MsgBox "The LayoutCreateViewport preference was reset back to: " & originalValue
End Sub


LayoutCrosshairColor Example [ActiveX and VBA Reference: AAR]

LayoutCrosshairColor Example

Using Programming Languages other than VBA

Sub Example_LayoutCrosshairColor()
    ' This example reads and modifies the preference value that controls
    ' the color of the crosshairs and text for paper space layouts.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Switch to paper space to view this change
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Read and display the original value
    originalValue = ACADPref.LayoutCrosshairColor
    MsgBox "The LayoutCrosshairColor preference is: " & originalValue

    ' Modify the LayoutCrosshairColor preference by making it red
    ACADPref.LayoutCrosshairColor = vbRed
    newValue = ACADPref.LayoutCrosshairColor
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutCrosshairColor preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutCrosshairColor = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutCrosshairColor preference was reset back to: " & originalValue
End Sub


LayoutDisplayMargins Example [ActiveX and VBA Reference: AAR]

LayoutDisplayMargins Example

Using Programming Languages other than VBA

Sub Example_LayoutDisplayMargins()
    ' This example reads and modifies the preference value that controls
    ' the display of margins in layouts. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Switch to paper space to view this change
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Read and display the original value
    originalValue = ACADPref.LayoutDisplayMargins
    MsgBox "The LayoutDisplayMargins preference is set to: " & originalValue

    ' Modify the LayoutDisplayMargins preference by toggling the value
    ACADPref.LayoutDisplayMargins = Not (originalValue)
    newValue = ACADPref.LayoutDisplayMargins
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayMargins preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutDisplayMargins = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayMargins preference was reset back to: " & originalValue
End Sub


LayoutDisplayPaper Example [ActiveX and VBA Reference: AAR]

LayoutDisplayPaper Example

Using Programming Languages other than VBA

Sub Example_LayoutDisplayPaper()
    ' This example reads and modifies the preference value that controls
    ' the display of the paper background in layouts. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Switch to paper space to view this change
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Read and display the original value
    originalValue = ACADPref.LayoutDisplayPaper
    MsgBox "The LayoutDisplayPaper preference is set to: " & originalValue

    ' Modify the LayoutDisplayPaper preference by toggling the value
    ACADPref.LayoutDisplayPaper = Not (originalValue)
    newValue = ACADPref.LayoutDisplayPaper
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayPaper preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutDisplayPaper = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayPaper preference was reset back to: " & originalValue
End Sub


LayoutDisplayPaperShadow Example [ActiveX and VBA Reference: AAR]

LayoutDisplayPaperShadow Example

Using Programming Languages other than VBA

Sub Example_LayoutDisplayPaperShadow()
    ' This example reads and modifies the preference value that controls
    ' the display of the paper background shadow in layouts. When finished, this example
    ' resets the preference value back to its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Switch to paper space to view this change
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Read and display the original value
    originalValue = ACADPref.LayoutDisplayPaperShadow
    MsgBox "The LayoutDisplayPaperShadow preference is set to: " & originalValue

    ' Modify the LayoutDisplayPaperShadow preference by toggling the value
    ACADPref.LayoutDisplayPaperShadow = Not (originalValue)
    newValue = ACADPref.LayoutDisplayPaperShadow
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayPaperShadow preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutDisplayPaperShadow = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The LayoutDisplayPaperShadow preference was reset back to: " & originalValue
End Sub


LayoutID Example [ActiveX and VBA Reference: AAR]

LayoutID Example

Using Programming Languages other than VBA

Sub Example_LayoutID()
    ' This example demonstrates the
    ' CategoryName, LayoutID, LayerState,
    ' and HasVpAssociation properties of the View object

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

    ' Create a view named "New_View" in current drawing
    Dim viewObj As IAcadView2

    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.Name & " has been added." & vbCrLf & _
           "Height: " & viewObj.Height & vbCrLf & _
           "Width: " & viewObj.Width, , "Example"

    viewObj.CategoryName = "My View Category"
    viewObj.LayerState = "My Layer State"

    viewObj.LayoutId = ThisDrawing.Layouts(1).ObjectID

    MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
            viewObj.LayoutId & " is the Layout ID." & vbCrLf & _
            viewObj.LayerState & " is the Layer state."

    If viewObj.HasVpAssociation = True Then
        MsgBox "The view is associated with a paper space viewport."
    Else
        MsgBox "The view is not associated with a paper space viewport."

   End If
End Sub


Layouts Example [ActiveX and VBA Reference: AAR]

Layouts Example

Using Programming Languages other than VBA

Sub Example_Layouts()
    ' This example will access the Layouts collection for the current drawing
    ' and list basic information about the Layouts in the drawing.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the names of every layout in this drawing
    For Each Layout In Layouts
        msg = msg & Layout.name & vbCrLf
    Next

    ' Display a list of available layouts
    MsgBox "There are " & Layouts.count & " layouts in " & _
            ThisDrawing.WindowTitle & ":" & msg
End Sub


LayoutShowPlotSetup Example [ActiveX and VBA Reference: AAR]

LayoutShowPlotSetup Example

Using Programming Languages other than VBA

Sub Example_LayoutShowPlotSetup()
    ' This example reads and modifies the preference value that controls
    ' the display of the Plot Setup dialog when a new layout is created.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.LayoutShowPlotSetup
    MsgBox "The LayoutShowPlotSetup preference is set to: " & originalValue

    ' Modify the LayoutShowPlotSetup preference by toggling the value
    ACADPref.LayoutShowPlotSetup = Not (originalValue)
    newValue = ACADPref.LayoutShowPlotSetup
    MsgBox "The LayoutShowPlotSetup preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LayoutShowPlotSetup = originalValue
    MsgBox "The LayoutShowPlotSetup preference was reset back to: " & originalValue
End Sub


LayoutSwitched Example [: AAR]

LayoutSwitched Example

Using Programming Languages other than VBA

Private Sub AcadDocument_LayoutSwitched(ByVal LayoutName As String)
    ' This example intercepts a drawing LayoutSwitched event.
    '
    ' This event is triggered when the user switches to a different
    ' drawing layout view.
    '
    ' To trigger this example event: Open a drawing and change its layout view
    '
    ' For example: Switch the drawing from Model view to Layout1 view

    ' Use the "LayoutName" variable to determine the which layout view we changed to
    MsgBox "The drawing layout was just changed to: " & LayoutName
End Sub


LeaderLength Example [ActiveX and VBA Reference: AAR]

LeaderLength Example

Using Programming Languages other than VBA

Sub Example_LeaderLength()
    ' This example creates a diametric dimension
    ' and returns the LeaderLength for that dimension.

    Dim dimObj As AcadDimDiametric
    Dim chordPoint(0 To 2) As Double
    Dim farChordPoint(0 To 2) As Double
    Dim leaderLength As Double

    ' Define the dimension
    chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
    farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
    leaderLength = 1#

    ' Create the diametric dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
    ZoomAll
End Sub


LeaderLineInfo Example [ActiveX and VBA Reference: AAR]

LeaderLineInfo Example

Using Programming Languages other than VBA

Sub Example_LeaderLineInfo()
    ' This example creates an MLeader object and gets and sets values for
    ' the leader line.

    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    Dim col As New AcadAcCmColor
    col.SetRGB 200, 23, 45
    oML.LeaderLineColor = col
    oML.LeaderLineWeight = acLnWt013

End Sub


Left Example [ActiveX and VBA Reference: AAR]

Left Example

Using Programming Languages other than VBA

Sub Example_Left()
    ' This example creates a new toolbar called "TestToolbar" and inserts a
    ' button into it. The toolbar is then displayed and the Left
    ' position is returned.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add a button to the new toolbar.
    Dim newButton1 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    'Find the Left position
    Dim currLeft As Integer
    currLeft = newToolBar.Left
    MsgBox "The current value of Left is " & newToolBar.Left, , "Left Example"

    ' Change the value of Left
    newToolBar.Left = currLeft + 100
    MsgBox "The new value of Left is " & newToolBar.Left, , "Left Example"

    ' Reset the value of Left
    newToolBar.Left = currLeft
    MsgBox "The value of Left has been reset to " & newToolBar.Left, , "Left Example"

End Sub


Length Example [ActiveX and VBA Reference: AAR]

Length Example

Using Programming Languages other than VBA

Sub Example_Length()
   ' This example adds a line in model space and returns the length of the new line

    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double, endPoint(0 To 2)  As Double

    ' Define the start and end points for the line
    startPoint(0) = 1: startPoint(1) = 1: startPoint(2) = 0
    endPoint(0) = 5: endPoint(1) = 5: endPoint(2) = 0

    ' Create the line in model space
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ThisDrawing.Application.ZoomAll

    MsgBox "The length of the new Line is: " & lineObj.length
End Sub


LensLength Example [ActiveX and VBA Reference: AAR]

LensLength Example

Using Programming Languages other than VBA

Sub Example_LensLength()
    ' This example creates a new paper space viewport.
    ' It then displays the lens length of the viewport.

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the paper space viewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.DISPLAY True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports

    ' Find the Lens Length for the viewport
    Dim lenslgnth As Double
    lenslgnth = pviewportObj.LensLength
    MsgBox "The lens length of the paperspace viewport is " & pviewportObj.LensLength, , "LensLength Example"

End Sub


Limits Example [ActiveX and VBA Reference: AAR]

Limits Example

Using Programming Languages other than VBA

Sub Example_Limits()
    ' This example finds the current limits for the drawing.
    ' It then changes the limits for the drawing. The grid
    ' is turned on to show the limits.

    ' Turn on the grid for the active viewport
    ThisDrawing.ActiveViewport.GridOn = True
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport

    ' Find the current limits
    Dim currLimits As Variant
    currLimits = ThisDrawing.Limits
    MsgBox "The current drawing limits are " & vbCrLf _
           & "Lower-left corner " & ThisDrawing.Limits(0) & ", " & ThisDrawing.Limits(1) & vbCrLf _
           & "Upper-right corner " & ThisDrawing.Limits(2) & ", " & ThisDrawing.Limits(3), , "Limits Example"

    ' Change the limits
    Dim newLimits(0 To 3) As Double
    newLimits(0) = 2#: newLimits(1) = 2#: newLimits(2) = 4#: newLimits(3) = 4#
    ThisDrawing.Limits = newLimits
    ThisDrawing.Regen acActiveViewport
    MsgBox "The new drawing limits are " & vbCrLf _
           & "Lower-left corner " & ThisDrawing.Limits(0) & ", " & ThisDrawing.Limits(1) & vbCrLf _
           & "Upper-right corner " & ThisDrawing.Limits(2) & ", " & ThisDrawing.Limits(3), , "Limits Example"

    ' Reset the drawing limits
    ThisDrawing.Limits = currLimits
    ThisDrawing.Regen acActiveViewport
    MsgBox "The drawing limits have been reset to " & vbCrLf _
           & "Lower-left corner " & ThisDrawing.Limits(0) & ", " & ThisDrawing.Limits(1) & vbCrLf _
           & "Upper-right corner " & ThisDrawing.Limits(2) & ", " & ThisDrawing.Limits(3), , "Limits Example"
End Sub


LinearScaleFactor Example [ActiveX and VBA Reference: AAR]

LinearScaleFactor Example

Using Programming Languages other than VBA

Sub Example_LinearScaleFactor()
   ' This example creates an aligned dimension in model space and
   ' turns on the tolerance display for the new dimension.  The LinearScaleFactor
   ' of the tolerance is then read and modified.
   '
   ' * Note the change in the text of the dimension after the modification.

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentScale As Integer

    ' Define the dimension
    point1(0) = 1: point1(1) = 10: point1(2) = 0
    point2(0) = 10: point2(1) = 10: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Turn on the tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical
    ThisDrawing.Application.ZoomAll

    ' Display current scale factor
    MsgBox dimObj.LinearScaleFactor

    ' Change current scale factor
    dimObj.LinearScaleFactor = 10#      ' Multiply by ten
    ThisDrawing.Regen acAllViewports

    ' Display new scale factor
    MsgBox dimObj.LinearScaleFactor
End Sub


LineSpacingDistance Example [ActiveX and VBA Reference: AAR]

LineSpacingDistance Example

Using Programming Languages other than VBA

Sub Example_LineSpacingDistance()
    ' This example creates an MText object, displays the value of the LineSpacingDistance property,
    ' changes the value of the property, and then resets the value to the original value.

    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    Dim CurrentDistance As Double
    Dim corner(0 To 2) As Double
    corner(0) = 0
    corner(1) = 10
    corner(2) = 0
    width = 10
    text = "This is the text for the MText object"
    ' Creates the MText Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

    ' Find the current LineSpacingDistance
    CurrentDistance = MTextObj.LineSpacingDistance
    MsgBox "The LineSpacingDistance for the MText object is: " & CurrentDistance

    ' Change the LineSpacingDistance
    MTextObj.LineSpacingDistance = 0.7
    MsgBox "The LineSpacingDistance for the MText object is: " & MTextObj.LineSpacingDistance

    ' Reset the LineSpacingDistance
    MTextObj.LineSpacingDistance = CurrentDistance
    MsgBox "The LineSpacingDistance for the MText object is: " & MTextObj.LineSpacingDistance
End Sub


LineSpacingFactor Example [ActiveX and VBA Reference: AAR]

LineSpacingFactor Example

Using Programming Languages other than VBA

Sub Example_LineSpacingFactor()
    ' This example creates an MText object in model space
    ' and then finds the LineSpacingFactor for the object.

    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text String for the mtext Object"

    ' Creates the MText Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

    ' Find the current LineSpacingFactor
    Dim currFactor As Double
    currFactor = MTextObj.LineSpacingFactor
    MsgBox "The LineSpacingFactor for the MText object is: " & currFactor

    ' Change the LineSpacingFactor
    MTextObj.LineSpacingFactor = 4
    MsgBox "The LineSpacingFactor for the MText object is: " & MTextObj.LineSpacingFactor

    ' Reset the LineSpacingFactor
    MTextObj.LineSpacingFactor = currFactor
    MsgBox "The LineSpacingFactor for the MText object is: " & MTextObj.LineSpacingFactor

End Sub


LineSpacingStyle Example [ActiveX and VBA Reference: AAR]

LineSpacingStyle Example

Using Programming Languages other than VBA

Sub Example_LineSpacingStyle()
    ' This example creates an MText object in model space
    ' and then finds the LineSpacingStyle for the object.

    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text String for the mtext Object"

    ' Creates the mtext Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

    ' Find the current LineSpacingStyle
    Dim currStyle As Integer
    currStyle = MTextObj.LineSpacingStyle
    MsgBox "The LineSpacingStyle for the MText object is: " & currStyle

    ' Change the LineSpacingStyle
    MTextObj.LineSpacingStyle = acLineSpacingStyleExactly
    MsgBox "The LineSpacingStyle for the MText object is: " & MTextObj.LineSpacingStyle

    ' Reset the LineSpacingStyle
    MTextObj.LineSpacingStyle = currStyle
    MsgBox "The LineSpacingStyle for the MText object is: " & MTextObj.LineSpacingStyle

End Sub


Linetype Example [ActiveX and VBA Reference: AAR]

Linetype Example

Using Programming Languages other than VBA

Sub Example_Linetype()
    ' This example searches for the linetype DashDot. If it is
    ' not found, it is added from the acad.lin file. Then a
    ' line is created and changed to the DashDot linetype.

    ' Search the linetypes collection for the DashDot linetype.
    Dim entry As AcadLineType
    Dim found As Boolean
    found = False
    For Each entry In ThisDrawing.Linetypes
        If StrComp(entry.name, "DASHDOT", 1) = 0 Then
            found = True
            Exit For
        End If
    Next
    If Not (found) Then ThisDrawing.Linetypes.Load "DASHDOT", "acad.lin"

    ' Create the line
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Change the linetype of the line
    lineObj.Linetype = "DASHDOT"
    ZoomAll

End Sub


LinetypeGeneration Example [ActiveX and VBA Reference: AAR]

LinetypeGeneration Example

Using Programming Languages other than VBA

Sub Example_LinetypeGeneration()
    ' This example creates a polyline in model space and
    ' queries and changes the linetype generation for
    ' the polyline.

    ' To see the effect of changing the linetype generation, set
    ' the linetype of the polyline to something other than continuous,
    ' ByBlock, or ByLayer.

    Dim plineObj As AcadPolyline
    Dim points(0 To 14) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    ZoomAll

    ' Find the current linetype generation for the polyline
    MsgBox "The linetype generation for the polyline is: " & plineObj.LinetypeGeneration

    ' Change the linetype generation
    plineObj.LinetypeGeneration = Not plineObj.LinetypeGeneration
    plineObj.Update
    MsgBox "The linetype generation for the polyline is now: " & plineObj.LinetypeGeneration

End Sub


Linetypes Example [ActiveX and VBA Reference: AAR]

Linetypes Example

Using Programming Languages other than VBA

Sub Example_Linetypes()
    ' This example finds the linetypes collection and
    ' lists all the available linetypes in the collection.

    Dim linetypeColl As AcadLineTypes
    Dim entry As AcadLineType
    Dim msg As String

    ' Return the linetype collection object of the active document
    Set linetypeColl = ThisDrawing.Linetypes
    ' List all available linetypes
    For Each entry In linetypeColl
        msg = msg & entry.name & vbCrLf
    Next
    MsgBox "The linetypes available in this drawing are:" & vbCrLf & msg, vbInformation, "Linetypes Example"
End Sub


LinetypeScale Example [ActiveX and VBA Reference: AAR]

LinetypeScale Example

Using Programming Languages other than VBA

Sub Example_LinetypeScale()
    ' This example creates a line and finds the linetype scale
    ' for the line. It then changes the linetype scale, and finally
    ' resets the linetype scale back to the original value.
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim lineObj As AcadLine
    Dim currLTScale As Double

    ' Create a Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Update
    currLTScale = lineObj.LinetypeScale
    MsgBox "The linetype scale for the line is:" & lineObj.LinetypeScale, vbInformation, "Linetypes Example"

    ' Set the linetype scale of a Line to .5
    lineObj.LinetypeScale = 0.5
    lineObj.Update
    MsgBox "The new linetype scale for the line is:" & lineObj.LinetypeScale, vbInformation, "Linetypes Example"

    ' Reset the linetype scale of a Line to what is was before
    lineObj.LinetypeScale = currLTScale
    lineObj.Update
    MsgBox "The linetype scale for the line is reset to:" & lineObj.LinetypeScale, vbInformation, "Linetypes Example"
End Sub


LineWeight Example [ActiveX and VBA Reference: AAR]

LineWeight Example

Using Programming Languages other than VBA

Sub Example_LineWeight()
    ' This example creates a circle in model space and then
    ' finds the current lineweight for the circle. The lineweight
    ' is then changed to a new value.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll

    ' Find the lineweight for the circle
    MsgBox "The current lineweight for the circle is " & circleObj.Lineweight

    ' Change the lineweight for the circle
    circleObj.Lineweight = acLnWt211
    circleObj.Update
    MsgBox "The current lineweight for the circle is " & circleObj.Lineweight
End Sub


LineweightDisplay Example [ActiveX and VBA Reference: AAR]

LineweightDisplay Example

Using Programming Languages other than VBA

Sub Example_LineweightDisplay()
    ' This example reads and modifies the preference value that controls
    ' whether symbol names may include extended character sets, or more
    ' than 31 characters.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.LineWeightDisplay
    MsgBox "The LineweightDisplay preference is set to: " & originalValue

    ' Modify the LineweightDisplay preference by toggling the value
    ACADPref.LineWeightDisplay = Not (ACADPref.LineWeightDisplay)
    newValue = ACADPref.LineWeightDisplay
    MsgBox "The LineweightDisplay preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.LineWeightDisplay = originalValue
    MsgBox "The LineweightDisplay preference was reset back to: " & originalValue
End Sub


LispCancelled Example [: AAR]

LispCancelled Example

Using Programming Languages other than VBA

Private Sub AcadDocument_LispCancelled()
    ' This example intercepts a drawing LispCancelled event.
    '
    ' This event is triggered when the evaluation of a LISP expression is cancelled.
    '
    ' To trigger this example event: Run a LISP expression and
    ' cancel the LISP evaluation before it finishes

    MsgBox "A LISP evaluation was just cancelled."
End Sub


ListARX Example [ActiveX and VBA Reference: AAR]

ListARX Example

Using Programming Languages other than VBA

Sub Example_ListARX()
    ' This example gets all the loaded ObjectARX applications

    ' Get the list of applications
    Dim appList As Variant
    appList = ThisDrawing.Application.ListArx

    ' Iterate through the list, and display the names, if any.
    If VarType(appList) <> vbEmpty Then
        Dim I As Integer
        For I = LBound(appList) To UBound(appList)
            MsgBox "ObjectARX application name: " & appList(I)
        Next
    Else
        MsgBox "No ObjectARX applications present."
    End If

End Sub


Load Example [ActiveX and VBA Reference: AAR]

Load Example

Using Programming Languages other than VBA

Sub Example_Load()
    ' This example attempts to load the linetype "CENTER" from
    ' the acad.lin file. If the linetype already exists, then
    ' a message is displayed.

    Dim linetypeName As String
    linetypeName = "CENTER"

    ' Load "CENTER" line type from acad.lin file
    On Error Resume Next    ' trap any load errors
    ThisDrawing.Linetypes.Load linetypeName, "acad.lin"

    ' If the name already exists, then notify user
    If Err.Description = "Duplicate record name" Then
        MsgBox "A line type named '" & linetypeName & "' already exists.", , "Load Example"
    End If

End Sub


LoadAcadLspInAllDocuments Example [ActiveX and VBA Reference: AAR]

LoadAcadLspInAllDocuments Example

Using Programming Languages other than VBA

Sub Example_LoadAcadLspInAllDocuments()
    ' This example returns the current setting of
    ' LoadAcadLspInAllDocuments. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currLoadAcadLspInAllDocuments As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current LoadAcadLspInAllDocuments value
    currLoadAcadLspInAllDocuments = preferences.System.LoadAcadLspInAllDocuments
    MsgBox "The current value for LoadAcadLspInAllDocuments is " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"

    ' Change the value for LoadAcadLspInAllDocuments
    preferences.System.LoadAcadLspInAllDocuments = Not (currLoadAcadLspInAllDocuments)
    MsgBox "The new value for LoadAcadLspInAllDocuments is " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"

    ' Reset LoadAcadLspInAllDocuments to its original value
    preferences.System.LoadAcadLspInAllDocuments = currLoadAcadLspInAllDocuments
    MsgBox "The LoadAcadLspInAllDocuments value is reset to " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"
End Sub


LoadARX Example [ActiveX and VBA Reference: AAR]

LoadARX Example

Using Programming Languages other than VBA

Sub Example_LoadARX()
    ' This example loads an ObjectARX application.

    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX application.
    ThisDrawing.Application.LoadArx ("MyARXApp.arx")

End Sub


LoadDVB Example [ActiveX and VBA Reference: AAR]

LoadDVB Example

Using Programming Languages other than VBA

Sub Example_LoadDVB()
    ' This example loads a DVB file and runs a macro
    ' contained in the file using the RunMacro method.
    '
    ' This example uses a DVB file named drawline.dvb.
    ' You should change the example to use a file on your computer.
    '
    ' * Note: If you open a DVB file and then run the example to load it, there will be an error
    ' when the DVB file is unloaded.

    Dim FileName As String

    FileName = "c:\drawline.dvb"

    ' Load a sample VBA project DVB file
    LoadDVB FileName

    ' Run the drawline sample macro
    RunMacro "Module1.Drawline"

    ' Unload the drawline VBA project DVB file now.
    UnloadDVB FileName

    MsgBox "The DVB file has been run!"
End Sub


LoadShapeFile Example [ActiveX and VBA Reference: AAR]

LoadShapeFile Example

Using Programming Languages other than VBA

Sub Example_LoadShapeFile()
    ' This example loads a shape file

    Dim shapeFileToLoad As String
    shapeFileToLoad = "C:/AutoCAD/Support/ltypeshp.shx"

    ' Load the shape file
    On Error GoTo ERRORHANDLE
    ThisDrawing.LoadShapeFile shapeFileToLoad
    Exit Sub

ERRORHANDLE:
    MsgBox Err.Description, Title:="LoadShapeFile"

End Sub


LocaleID Example [ActiveX and VBA Reference: AAR]

LocaleID Example

Using Programming Languages other than VBA

Sub Example_LocaleID()
    ' This code retrieves the Locale ID and displays it in a message box
    MsgBox "The locale ID is " & ThisDrawing.Application.LocaleId, , "LocaleID Example"

End Sub


Lock Example [ActiveX and VBA Reference: AAR]

Lock Example

Using Programming Languages other than VBA

Sub Example_Lock()
    ' This example creates a new layer called "Lock".
    ' It then displays the status of the Lock property
    ' for the new layer, toggles the status of the
    ' Lock property, and again displays its status.
    ' After running this example, you can check the layer
    ' control on the Object Properties tool bar. It will
    ' show the new layer and the latest Lock status.

    Dim layerObj As AcadLayer

    ' Create the new layer
    Set layerObj = ThisDrawing.Layers.Add("Lock")

    ' Display the Lock status of the new layer
    GoSub DISPLAYSTATUS

    ' Toggle the status of the Lock property for the layer
    layerObj.Lock = Not (layerObj.Lock)

    ' Display the Lock status of the new layer
    GoSub DISPLAYSTATUS
    Exit Sub

DISPLAYSTATUS:
    If layerObj.Lock Then
        MsgBox "Layer " & layerObj.name & " is locked.", , "Lock Example"
    Else
        MsgBox "Layer " & layerObj.name & " is unlocked.", , "Lock Example"
    End If
    Return

End Sub


LogFileOn Example [ActiveX and VBA Reference: AAR]

LogFileOn Example

Using Programming Languages other than VBA

Sub Example_LogFileOn()
    ' This example returns the current setting of
    ' LogFileOn. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currLogFileOn As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current LogFileOn value
    currLogFileOn = preferences.OpenSave.LogFileOn
    MsgBox "The current value for LogFileOn is " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"

    ' Change the value for LogFileOn
    preferences.OpenSave.LogFileOn = Not (currLogFileOn)
    MsgBox "The new value for LogFileOn is " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"

    ' Reset LogFileOn to its original value
    preferences.OpenSave.LogFileOn = currLogFileOn
    MsgBox "The LogFileOn value is reset to " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"
End Sub


LogFilePath Example [ActiveX and VBA Reference: AAR]

LogFilePath Example

Using Programming Languages other than VBA

Sub Example_LogFilePath()
    ' This example returns the current setting of
    ' LogFilePath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currLogFilePath As String
    Dim newLogFilePath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current LogFilePath value
    currLogFilePath = preferences.Files.LogFilePath
    MsgBox "The current value for LogFilePath is " & currLogFilePath, vbInformation, "LogFilePath Example"

    ' Change the value for LogFilePath
    newLogFilePath = "C:/AutoCAD/"
    preferences.Files.LogFilePath = newLogFilePath
    MsgBox "The new value for LogFilePath is " & newLogFilePath, vbInformation, "LogFilePath Example"

    ' Reset LogFilePath to its original value
    preferences.Files.LogFilePath = currLogFilePath
    MsgBox "The LogFilePath value is reset to " & currLogFilePath, vbInformation, "LogFilePath Example"
End Sub


LowerLeftCorner Example [ActiveX and VBA Reference: AAR]

LowerLeftCorner Example

Using Programming Languages other than VBA

Sub Example_LowerLeftCorner()
    ' This example creates a new viewport and makes it active.
    ' Then it splits the viewport into four windows.
    ' It then finds the lower-left corner of each of the
    ' windows.
    Dim newViewport As AcadViewport

    ' Create a new viewport and make it active
    Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT")
    ThisDrawing.ActiveViewport = newViewport

    ' Split the viewport in four windows
    newViewport.Split acViewport4

    ' Make the newly split viewport active
    ThisDrawing.ActiveViewport = newViewport

    ' Iterate through the viewports. For each viewport,
    ' make that viewport active and display the coordinates
    ' of the lower left corner.
    Dim entry As AcadViewport
    Dim lowerLeft As Variant
    For Each entry In ThisDrawing.Viewports
        entry.GridOn = True
        ThisDrawing.ActiveViewport = entry
        lowerLeft = entry.LowerLeftCorner
        MsgBox "The lower left corner of this viewport is " & lowerLeft(0) & ", " & lowerLeft(1), , "LowerLeftCorner Example"
        entry.GridOn = False
    Next
End Sub


Macro Example [ActiveX and VBA Reference: AAR]

Macro Example

Using Programming Languages other than VBA

Sub Example_Macro()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar.
    ' To remove the menu after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

    MsgBox "The macro for the Open menu item is: " & newMenuItem.Macro

End Sub


MainDictionary Example [ActiveX and VBA Reference: AAR]

MainDictionary Example

Using Programming Languages other than VBA

Sub Example_MainDictionary()
    ' This example returns the current setting of
    ' MainDictionary. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currMainDictionary As String
    Dim newMainDictionary As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current MainDictionary value
    currMainDictionary = preferences.Files.MainDictionary
    MsgBox "The current value for MainDictionary is " & currMainDictionary, vbInformation, "MainDictionary Example"

    ' Change the value for MainDictionary
    newMainDictionary = "TestMainDictionary"
    preferences.Files.MainDictionary = newMainDictionary
    MsgBox "The new value for MainDictionary is " & newMainDictionary, vbInformation, "MainDictionary Example"

    ' Reset MainDictionary to its original value
    preferences.Files.MainDictionary = currMainDictionary
    MsgBox "The MainDictionary value is reset to " & currMainDictionary, vbInformation, "MainDictionary Example"
End Sub


MajorAxis Example [ActiveX and VBA Reference: AAR]

MajorAxis Example

Using Programming Languages other than VBA

Sub Example_MajorAxis()
    ' This example creates an ellipse and finds the major axis
    ' for that ellipse. It then changes the major axis for the ellipse.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
    ellObj.Update
    MsgBox "The ellipse has a major axis of " & majAxis(0) & ", " & majAxis(1) & ", " & majAxis(2), vbInformation, "MajorAxis Example"

    ' Change the major axis of the ellipse
    majAxis(0) = 5: majAxis(1) = 5: majAxis(2) = 0
    ellObj.MajorAxis = majAxis
    ellObj.Update

    ' Query the major axis of an Ellipse
    Dim retMajAxis As Variant
    retMajAxis = ellObj.MajorAxis
    MsgBox "The ellipse has been udpated with the major axis " & retMajAxis(0) & ", " & retMajAxis(1) & ", " & retMajAxis(2), vbInformation, "MajorAxis Example"
End Sub


MajorRadius Example [ActiveX and VBA Reference: AAR]

MajorRadius Example

Using Programming Languages other than VBA

Sub Example_MajorRadius()
  ' This example creates an Ellipse in model space and displays
  ' both the Major radius and the Minor radius of the new Ellipse

    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double, center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5: center(1) = 5: center(2) = 0
    majAxis(0) = 10: majAxis(1) = 20: majAxis(2) = 0
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ThisDrawing.Application.ZoomAll

    ' Display radius information
    MsgBox "The major radius of the new Ellipse is: " & ellObj.majorRadius & vbCrLf & _
           "The minor radius of the new Ellipse is: " & ellObj.minorRadius
End Sub


Mask Example [ActiveX and VBA Reference: AAR]

Mask Example

Using Programming Languages other than VBA

Sub Example_SetMask()
    ' The following code updates the Mask property of layer
    ' settings saved under the name "ColorLineType, so that
    ' Color, LineType, and LineWeight layer properties will
    ' be restored by a Restore operation.

    Dim oLSM As AcadLayerStateManager
    Dim settings As AcLayerStateMask

    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")
    oLSM.SetDatabase ThisDrawing.Database

    ' Retrieve the current mask setting from ColorLinetype
    settings = oLSM.Mask("ColorLinetype")

    ' Set mask so that Color, LineType, and LineWeight
    ' properties will be restored by a Restore operation
     settings = acLsColor + acLsLineType + acLsLineWeight

    ' Commit the new settings mask to ColorLinetype
     oLSM.Mask("ColorLinetype") = settings

End Sub


Material Example [ActiveX and VBA Reference: AAR]

Material Example

Using Programming Languages other than VBA

Sub Example_AddMaterial()
    Dim oMaterial As AcadMaterial
    Dim oMaterials As AcadMaterials
    Set oMaterial = ThisDrawing.Materials.Add("TestMaterial")
    oMaterial.Description = "This material demonstrates how to add a material to a database."
    ThisDrawing.ActiveMaterial = oMaterial
        ' Display the status of the new layer
    MsgBox oMaterial.Name & " has been added." & vbCrLf & _
            "Name: " & oMaterial.Name & vbCrLf & vbCrLf & _
            "Description: " & vbCrLf & vbCrLf & _
            oMaterial.Description

End Sub


MaxActiveViewports Example [ActiveX and VBA Reference: AAR]

MaxActiveViewports Example

Using Programming Languages other than VBA

Sub Example_MaxActiveViewports()
    ' This example returns the current setting of
    ' MaxActiveViewports. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currMaxActiveViewports As Integer
    Dim newMaxActiveViewports As Integer

    ' Retrieve the current MaxActiveViewports value
    currMaxActiveViewports = ThisDrawing.preferences.MaxActiveViewports
    MsgBox "The current value for MaxActiveViewports is " & currMaxActiveViewports, vbInformation, "MaxActiveViewports Example"

    ' Change the value for MaxActiveViewports
    newMaxActiveViewports = 20
    ThisDrawing.preferences.MaxActiveViewports = newMaxActiveViewports
    MsgBox "The new value for MaxActiveViewports is " & newMaxActiveViewports, vbInformation, "MaxActiveViewports Example"

    ' Reset MaxActiveViewports to its original value
    ThisDrawing.preferences.MaxActiveViewports = currMaxActiveViewports
    MsgBox "The MaxActiveViewports value is reset to " & currMaxActiveViewports, vbInformation, "MaxActiveViewports Example"
End Sub


MaxAutoCADWindow Example [ActiveX and VBA Reference: AAR]

MaxAutoCADWindow Example

Using Programming Languages other than VBA

Sub Example_MaxAutoCADWindow()
    ' This example returns the current setting of
    ' MaxAutoCADWindow. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currMaxAutoCADWindow As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current MaxAutoCADWindow value
    currMaxAutoCADWindow = preferences.DISPLAY.MaxAutoCADWindow
    MsgBox "The current value for MaxAutoCADWindow is " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"

    ' Change the value for MaxAutoCADWindow
    preferences.DISPLAY.MaxAutoCADWindow = Not (currMaxAutoCADWindow)
    MsgBox "The new value for MaxAutoCADWindow is " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"

    ' Reset MaxAutoCADWindow to its original value
    preferences.DISPLAY.MaxAutoCADWindow = currMaxAutoCADWindow
    MsgBox "The MaxAutoCADWindow value is reset to " & preferences.DISPLAY.MaxAutoCADWindow, vbInformation, "MaxAutoCADWindow Example"
End Sub


Mclose Example [ActiveX and VBA Reference: AAR]

MClose Example

Using Programming Languages other than VBA

Sub Example_MClose()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then closes the polymesh in the 'M' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 2: points(1) = 2: points(2) = 1
    points(3) = 2.5: points(4) = 2: points(5) = 0
    points(6) = 5: points(7) = 2: points(8) = 0
    points(9) = 5.5: points(10) = 2: points(11) = 1
    points(12) = 2: points(13) = 4: points(14) = 0.5
    points(15) = 2.5: points(16) = 4: points(17) = 0
    points(18) = 5: points(19) = 4: points(20) = 0
    points(21) = 5.5: points(22) = 4: points(23) = 0.5
    points(24) = 2: points(25) = 6: points(26) = 0.5
    points(27) = 2.5: points(28) = 6: points(29) = 0
    points(30) = 5: points(31) = 6: points(32) = 0
    points(33) = 5.5: points(34) = 6: points(35) = 0.5
    points(36) = 2: points(37) = 8: points(38) = 1
    points(39) = 2.5: points(40) = 8: points(41) = 0
    points(42) = 5: points(43) = 8: points(44) = 0
    points(45) = 5.5: points(46) = 8: points(47) = 1

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the cylinder
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Close the polymesh in the 'M' direction
    MsgBox "The polymesh is " & IIf(meshObj.MClose, "closed", "open") & " in the 'M' direction.", , "MClose Example"
    meshObj.MClose = True
    ThisDrawing.Regen acActiveViewport
    MsgBox "The polymesh is " & IIf(meshObj.MClose, "closed", "open") & " in the 'M' direction.", , "MClose Example"

End Sub


Mdensity Example [ActiveX and VBA Reference: AAR]

MDensity Example

Using Programming Languages other than VBA

Sub Example_MDensity()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then changes the type of polymesh, and finds the
    ' number of points in the 'M' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 2: points(4) = 0: points(5) = 1
    points(6) = 4: points(7) = 0: points(8) = 0
    points(9) = 6: points(10) = 0: points(11) = 1
    points(12) = 0: points(13) = 2: points(14) = 0
    points(15) = 2: points(16) = 2: points(17) = 1
    points(18) = 4: points(19) = 2: points(20) = 0
    points(21) = 6: points(22) = 2: points(23) = 1
    points(24) = 0: points(25) = 4: points(26) = 0
    points(27) = 2: points(28) = 4: points(29) = 1
    points(30) = 4: points(31) = 4: points(32) = 0
    points(33) = 6: points(34) = 4: points(35) = 0
    points(36) = 0: points(37) = 6: points(38) = 0
    points(39) = 2: points(40) = 6: points(41) = 1
    points(42) = 4: points(43) = 6: points(44) = 0
    points(45) = 6: points(46) = 6: points(47) = 0

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the polymesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Change the type of mesh. (MDensity is not valid for acSimpleMesh type.)
    meshObj.Type = acQuadSurfaceMesh
    meshObj.Update
    ThisDrawing.Regen acActiveViewport

    ' Find the MDensity for the mesh
    Dim currDensity As Integer
    currDensity = meshObj.MDensity
    MsgBox "The MDensity for the mesh is " & meshObj.MDensity, , "MDensity Example"

End Sub


Measurement Example [ActiveX and VBA Reference: AAR]

Measurement Example

Using Programming Languages other than VBA

Sub Example_Measurement()
    ' This example creates an aligned dimension in model space
    ' and returns the measurement of the dimension; in the case
    ' of a linear dimension, this measurement will be its length

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 9: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current measurement
    MsgBox "The current measurement of the new dimension is: " & dimObj.Measurement
End Sub


MenuBar Example [ActiveX and VBA Reference: AAR]

MenuBar Example

Using Programming Languages other than VBA

Sub Example_MenuBar()
    ' This example uses MenuBar to obtain a reference to the AutoCAD File menu.
    ' It then creates a new menu item and inserts it at the bottom of the File menu.
    '
    ' The menu item will be automatically removed when AutoCAD is restarted

    Dim menu As AcadPopupMenu, newMenuItem As AcadPopupMenuItem
    Dim openMacro As String

    On Error GoTo ERRORTRAP

    ' Use MenuBar property to obtain reference to the AutoCAD File menu
    Set menu = ThisDrawing.Application.MenuBar.Item("&File")

    ' Add a menu item to the new menu and
    ' assign an Open macro (VBA equivalent of: "ESC ESC _open ")
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    ' Add a menu separator
    menu.AddSeparator (menu.count + 1)

    ' Add new menu item to File menu
    Set newMenuItem = menu.AddMenuItem(menu.count + 1, "NEW MENU ITEM", openMacro)

    MsgBox "A new menu item has been added to the File menu!"

    Exit Sub

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description

End Sub


MenuFile Example [ActiveX and VBA Reference: AAR]

MenuFile Example

Using Programming Languages other than VBA

Sub Example_MenuFile()
    ' This example returns the current setting of
    ' MenuFile.

    Dim preferences As AcadPreferences
    Dim currMenuFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current MenuFile value
    currMenuFile = preferences.Files.MenuFile
    MsgBox "The current value for MenuFile is " & currMenuFile, vbInformation, "MenuFile Example"

End Sub


MenuFileName Example [ActiveX and VBA Reference: AAR]

MenuFileName Example

Using Programming Languages other than VBA

Sub Example_MenuFileName()
    ' This example finds the file name for all loaded menu groups.

    Dim fileNames As String
    Dim menuGroup As acadMenuGroup

    fileNames = ""
    For Each menuGroup In ThisDrawing.Application.MenuGroups
        fileNames = fileNames & menuGroup.name & "  " & menuGroup.MenuFileName & vbCrLf
    Next menuGroup
    MsgBox fileNames
End Sub


MenuGroups Example [ActiveX and VBA Reference: AAR]

MenuGroups Example

Using Programming Languages other than VBA

Sub Example_MenuGroups()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar.
    '
    ' The menu item will be automatically removed when AutoCAD is restarted

    Dim currMenuGroup As acadMenuGroup
    Dim newMenu As AcadPopupMenu, newMenuItem As AcadPopupMenuItem
    Dim openMacro As String

    On Error GoTo ERRORTRAP

    ' Use MenuGroups property to obtain reference to main AutoCAD menu
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    ' Create the new menu in this group
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu and
    ' assign an Open macro (VBA equivalent of: "ESC ESC _open ")
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)

    MsgBox "A new menu has been added to the ACAD menu system!"

    Exit Sub

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description
End Sub


Menus Example [ActiveX and VBA Reference: AAR]

Menus Example

Using Programming Languages other than VBA

Sub Example_Menus()
    ' This example finds the names of all menus in the first menu group.

    Dim menuNames As String
    Dim menuCollection As AcadPopupMenus
    Dim menu As AcadPopupMenu

    Set menuCollection = ThisDrawing.Application.MenuGroups.Item(0).Menus
    menuNames = ""
    For Each menu In menuCollection
        menuNames = menuNames & menu.name & vbCrLf
    Next menu
    MsgBox menuNames
End Sub


MergeCell Example [ActiveX and VBA Reference: AAR]

MergeCell Example

Using Programming Languages other than VBA

Sub Example_CellMerge()

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)
    Call MyTable.MergeCells(2, 3, 2, 3)

    MsgBox "The cells have been merged appropriately."

    ZoomExtents

End Sub


MinorAxis Example [ActiveX and VBA Reference: AAR]

MinorAxis Example

Using Programming Languages other than VBA

Sub Example_MinorAxis()
    ' This example creates an ellipse and returns the minor
    ' axis for that ellipse.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
    ZoomAll

    ' Find the minor axis for the ellipse
    Dim minorAxis As Variant
    minorAxis = ellObj.minorAxis
    MsgBox "The ellipse has a minor axis of " & minorAxis(0) & ", " & minorAxis(1) & ", " & minorAxis(2), vbInformation, "MinorAxis Example"
End Sub


MinorRadius Example [ActiveX and VBA Reference: AAR]

MinorRadius Example

Using Programming Languages other than VBA

Sub Example_MinorRadius()
  ' This example creates an Ellipse in model space and displays
  ' both the Major radius and the Minor radius of the new Ellipse

    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double, center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5: center(1) = 5: center(2) = 0
    majAxis(0) = 10: majAxis(1) = 20: majAxis(2) = 0
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ThisDrawing.Application.ZoomAll

    ' Display radius information
    MsgBox "The major radius of the new Ellipse is: " & ellObj.majorRadius & vbCrLf & _
           "The minor radius of the new Ellipse is: " & ellObj.minorRadius
End Sub


Mirror Example [ActiveX and VBA Reference: AAR]

Mirror Example

Using Programming Languages other than VBA

Sub Example_Mirror()
    ' This example creates a lightweight polyline
    ' and then mirrors that polyline.

    ' Create the polyline
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 1
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True
    ZoomAll

    ' Define the mirror axis
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 0: point1(1) = 4.25: point1(2) = 0
    point2(0) = 4: point2(1) = 4.25: point2(2) = 0

    MsgBox "Mirror the polyline.", , "Mirror Example"

    ' Mirror the polyline
    Dim mirrorObj As AcadLWPolyline
    Set mirrorObj = plineObj.Mirror(point1, point2)

    ZoomAll
    MsgBox "Mirror completed.", , "Mirror Example"

End Sub


Mirror3D Example [ActiveX and VBA Reference: AAR]

Mirror3D Example

Using Programming Languages other than VBA

Sub Example_Mirror3D()
    ' This example creates a box in model space, and mirrors the box about a plane.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Define the mirroring plane with three points
    Dim mirrorPt1(0 To 2) As Double
    Dim mirrorPt2(0 To 2) As Double
    Dim mirrorPt3(0 To 2) As Double

    mirrorPt1(0) = 1.25: mirrorPt1(1) = 0: mirrorPt1(2) = 0
    mirrorPt2(0) = 1.25: mirrorPt2(1) = 2: mirrorPt2(2) = 0
    mirrorPt3(0) = 1.25: mirrorPt3(1) = 2: mirrorPt3(2) = 2

    ' Mirror the box
    Dim mirrorBoxObj As Acad3DSolid
    Set mirrorBoxObj = boxObj.Mirror3D(mirrorPt1, mirrorPt2, mirrorPt3)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


MLeaderLines Example [ActiveX and VBA Reference: AAR]

MLeaderLines Example

Using Programming Languages other than VBA

Sub Example_MLeaderLines()
    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45

    oML.LeaderLineWeight = acLnWt013
    oML.LeaderType = acSplineLeader
    oML.LeaderLineColor = col

    oML.LandingGap = 5.2
    oML.ContentBlockType = acBlockHexagon
    oML.BlockConnectionType = acConnectBase
    oML.ContentType = acMTextContent

End Sub


MLeaderStyle Example [ActiveX and VBA Reference: AAR]

MLeaderStyle Example

Using Programming Languages other than VBA

Sub MLS()

    Dim oDict As AcadDictionary
    Set oDict = ThisDrawing.Dictionaries.Item("ACAD_MLEADERSTYLE")

    Dim i As Long
    For i = 0 To oDict.Count - 1
      Dim oObj As AcadObject
      Set oObj = oDict.Item(i)
      If oObj.ObjectName = "AcDbMLeaderStyle" Then
          Dim oMLS As AcadMLeaderStyle
          Set oMLS = oObj
          MsgBox "Name = " & oMLS.Name & vbCrLf & _
          "Annotative = " & oMLS.Annotative & vbCrLf & _
          "ContentType = " & oMLS.ContentType & vbCrLf & _
          "LeaderLineType = " & oMLS.LeaderLineType, vbInformation, "MLeader Styles"
      End If
    Next i
    Dim oNewMLS As AcadMLeaderStyle
    Set oNewMLS = oDict.AddObject("TEST", "AcDbMLeaderStyle")

    oNewMLS.LeaderLineType = acSplineLeader
    Dim oCol As New AcadAcCmColor
    oCol.ColorIndex = acBlue
    oNewMLS.LeaderLineColor = oCol

    Call ThisDrawing.SetVariable("CMLEADERSTYLE", "TEST")
    Dim points(0 To 5) As Double
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 2: points(4) = 2: points(5) = 0
    Dim oML As AcadMLeader
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)
    oML.TextString = "mleader created with " & vbCrLf & "style ""TEST"""

End Sub


Mode Example [ActiveX and VBA Reference: AAR]

Mode Example

Using Programming Languages other than VBA

Sub Example_Mode()
    ' This example creates an attribute definition in model space.
    ' It then queries the initial value of the Mode property,
    ' changes that value, and finally resets the value.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "New Tag"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Return the current field length of the attribute
    Dim currMode As Integer
    Dim constant As String
    currMode = attributeObj.mode
    GoSub GETCONSTANT
    MsgBox "The Mode of the attribute is " & constant, vbInformation, "Mode Example"

    ' Change the field length
    attributeObj.mode = acAttributeModeInvisible
    GoSub GETCONSTANT
    attributeObj.Update
    MsgBox "The new Mode of the attribute is " & constant, vbInformation, "Mode Example"

    ' Reset the field length to the original value
    attributeObj.mode = currMode
    GoSub GETCONSTANT
    attributeObj.Update
    MsgBox "The Mode of the attribute is reset to " & constant, vbInformation, "Mode Example"
    Exit Sub

GETCONSTANT:
    ' Get the constant that corresponds to the current mode
    constant = Choose(attributeObj.mode, "acAttributeModeInvisible", "acAttributeModeConstant", "", "acAttributeModeVerify", "", "", "", "acAttributeModePreset")
    Return
End Sub


ModelCrosshaircolor Example [ActiveX and VBA Reference: AAR]

ModelCrosshaircolor Example

Using Programming Languages other than VBA

Sub Example_ModelCrossHairColor()
    ' This example returns the current setting of
    ' Model space CrossHairColor. It then changes the value, and
    ' finally resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currCrossHairColor As OLE_COLOR

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current CrossHairColor value
    currCrossHairColor = preferences.DISPLAY.ModelCrosshairColor
    MsgBox "The current value for the model space CrossHairColor is " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"

    ' Change the value for CrossHairColor
    preferences.DISPLAY.ModelCrosshairColor = vbGreen
    MsgBox "The new value for CrossHairColor is " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"

    ' Reset CrossHairColor to its original value
    preferences.DISPLAY.ModelCrosshairColor = currCrossHairColor
    MsgBox "The CrossHairColor value is reset to " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"

End Sub


ModelSpace Example [ActiveX and VBA Reference: AAR]

ModelSpace Example

Using Programming Languages other than VBA

Sub Example_ModelSpace()
    ' This example adds a line and a circle to model space.
    ' The line is added using a user-defined variable representing
    ' the model space. The circle is added without using the
    ' user-defined variable. Either use of the ModelSpace
    ' property is valid.

    ' Define the line
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 4: endPoint(1) = 4: endPoint(2) = 0

    ' Add the line to model space using the mspace variable
    Dim mspace As AcadModelSpace
    Set mspace = ThisDrawing.ModelSpace
    Set lineObj = mspace.AddLine(startPoint, endPoint)

    ' Define a circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 4: center(1) = 4: center(2) = 0
    radius = 1

    ' Add the circle to model space without using the mspace variable
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ZoomAll

End Sub


ModelType Example [ActiveX and VBA Reference: AAR]

ModelType Example

Using Programming Languages other than VBA

Sub Example_ModelType()
    ' This example creates a plot configuration object
    ' and then finds the ModelType for the object.

    Dim PlotConfigObj As AcadPlotConfiguration

    ' Creates the MText Object
    Set PlotConfigObj = ThisDrawing.PlotConfigurations.Add("NewPlotConfiguration")

    ' Find the current ModelType
    Dim currModelType As Boolean
    currModelType = PlotConfigObj.ModelType
    MsgBox "The ModelType for the object is: " & currModelType

End Sub


Modified Example [ActiveX and VBA Reference: AAR]

Modified Example

Using Programming Languages other than VBA

Public WithEvents PLine As AcadLWPolyline    ' Use with Modified Event Example

Sub Example_Modified()
     ' This example creates a lightweight polyline in model space and
     ' references the PolyLine using the public variable (PLine) which
     ' is set up to intercept Modified events.
     '
     ' This example then modifies the new object, triggering the code
     ' in the Modified event.

    Dim points(0 To 9) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4

    ' Create a lightweight Polyline object in model space
    '
    ' * Note: We are returning the new PolyLine object into a Module
    ' level variable.  This allows us to intercept events associated
    ' with that particular object.
    Set PLine = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)

    ThisDrawing.Application.ZoomAll

    ' Modify object to trigger event.
    '
    ' * Note: The event code for the PolyLine modification will be triggered
    ' before we move forward and refresh the view, so the line will not
    ' appear blue when the event message box is displayed.
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)
    PLine.TrueColor = color

    ThisDrawing.Regen acAllViewports

End Sub

Private Sub PLine_Modified(ByVal pObject As AutoCAD.IAcadObject)
    ' This example intercepts an object's Modified event.
    '
    ' This event is triggered when an object supporting this event is modified.
    '
    ' To trigger this code: Modify an object connected to this event
    ' * Note: By connected, we mean the object set up to intercept events using
    ' the VBA WithEvents statement

    ' Use the "pObject" variable to determine which object was modified
    MsgBox "You just modified an object with an ID of: " & pObject.ObjectID

End Sub


Modified Example [ActiveX and VBA Reference: AAR]

Surfaces Example

Using Programming Languages other than VBA

Sub SurfaceProperties()
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SURFACES2")
    Dim mode As Integer

    ssetObj.SelectOnScreen

    Dim obj As AcadEntity
    Dim extrude As AcadExtrudedSurface
    Dim objName As String
    Dim LayerName As String
    For Each obj In ssetObj
        objName = obj.ObjectName
        If TypeOf obj Is AcadExtrudedSurface Then
            ExtrudedSurfaceProperties obj
        ElseIf TypeOf obj Is AcadRevolvedSurface Then
            RevolvedSurfaceProperties obj
        ElseIf TypeOf obj Is AcadLoftedSurface Then
            LoftedSurfaceProperties obj
        ElseIf TypeOf obj Is AcadSweptSurface Then
            SweptSurfaceProperties obj
        ElseIf TypeOf obj Is AcadPlaneSurface Then
            PlaneSurfaceProperties obj
        End If
    Next
    ssetObj.Delete
End Sub
Private Sub ExtrudedSurfaceProperties(extrude As AcadExtrudedSurface)
    GetSurfaceBoundingBox extrude
    MsgBox "SurfaceType: " & extrude.SurfaceType & vbCr & _
            "Height: " & extrude.Height & vbCr & _
            "TaperAngle: " & extrude.TaperAngle & vbCr & _
            "Direction: " & extrude.Direction & vbCr & _
            "Material: " & extrude.Material & vbCr & _
            "UIsolineDensity: " & extrude.UIsolineDensity & vbCr & _
            "VIsolineDensity: " & extrude.VIsolineDensity
    'Now change the configurable properties
    extrude.Height = extrude.Height * 1.5
    extrude.TaperAngle = extrude.TaperAngle * (3.14 / 2)
    extrude.UIsolineDensity = extrude.UIsolineDensity * 2#
    extrude.VIsolineDensity = extrude.VIsolineDensity * 0.5
    ThisDrawing.Regen acActiveViewport
    Utility.GetString 0, "Press return to continue..."
    'Now change the properties back to their original values
    extrude.Height = extrude.Height / 1.5
    extrude.TaperAngle = extrude.TaperAngle / (3.14 / 2)
    extrude.UIsolineDensity = extrude.UIsolineDensity / 2#
    extrude.VIsolineDensity = extrude.VIsolineDensity / 0.5
End Sub
Private Sub RevolvedSurfaceProperties(revolve As AcadRevolvedSurface)
    GetSurfaceBoundingBox revolve
    MsgBox "SurfaceType: " & revolve.SurfaceType & vbCr & _
            "RevolutionAngle: " & revolve.RevolutionAngle & vbCr & _
            "AxisPosition: " & revolve.AxisPosition & vbCr & _
            "AxisDirection: " & revolve.AxisDirection & vbCr & _
            "Material: " & revolve.Material & vbCr & _
            "UIsolineDensity: " & revolve.UIsolineDensity & vbCr & _
            "VIsolineDensity: " & revolve.VIsolineDensity
    'Now change the configurable properties
    revolve.RevolutionAngle = revolve.RevolutionAngle * (3.14 / 2)

    revolve.UIsolineDensity = revolve.UIsolineDensity * 2#
    revolve.VIsolineDensity = revolve.VIsolineDensity * 0.5

    ThisDrawing.Regen acActiveViewport
    Utility.GetString 0, "Press return to continue..."

    'Now change the properties back to their original values
    revolve.RevolutionAngle = revolve.RevolutionAngle / (3.14 / 2)
    revolve.UIsolineDensity = revolve.UIsolineDensity / 2#
    revolve.VIsolineDensity = revolve.VIsolineDensity / 0.5
End Sub
Private Sub LoftedSurfaceProperties(lofted As AcadLoftedSurface)
    GetSurfaceBoundingBox lofted
    MsgBox "SurfaceType: " & lofted.SurfaceType & vbCr & _
            "NumCrossSections: " & lofted.NumCrossSections & vbCr & _
            "NumGuidePaths: " & lofted.NumGuidePaths & vbCr & _
            "SurfaceNormals: " & lofted.SurfaceNormals & vbCr & _
            "StartDraftAngle: " & lofted.StartDraftAngle & vbCr & _
            "StartDraftMagnitude: " & lofted.StartDraftMagnitude & vbCr & _
            "EndDraftAngle: " & lofted.EndDraftAngle & vbCr & _
            "EndDraftMagnitude: " & lofted.EndDraftMagnitude & vbCr & _
            "Closed: " & lofted.Closed & vbCr & _
            "Material: " & lofted.Material & vbCr & _
            "UIsolineDensity: " & lofted.UIsolineDensity & vbCr & _
            "VIsolineDensity: " & lofted.VIsolineDensity
    'Now change the configurable properties
    lofted.StartDraftAngle = lofted.StartDraftAngle * (3.14 / 2)
    lofted.EndDraftAngle = lofted.EndDraftAngle * (3.14 / 4)
    lofted.UIsolineDensity = lofted.UIsolineDensity * 2#
    lofted.VIsolineDensity = lofted.VIsolineDensity * 0.5

    ThisDrawing.Regen acActiveViewport
    Utility.GetString 0, "Press return to continue..."

    'Now change the properties back to their original values
    lofted.StartDraftAngle = lofted.StartDraftAngle / (3.14 / 2)
    lofted.EndDraftAngle = lofted.EndDraftAngle / (3.14 / 4)
    lofted.UIsolineDensity = lofted.UIsolineDensity / 2#
    lofted.VIsolineDensity = lofted.VIsolineDensity / 0.5
End Sub
Private Sub SweptSurfaceProperties(swept As AcadSweptSurface)
    GetSurfaceBoundingBox swept
    MsgBox "SurfaceType: " & swept.SurfaceType & vbCr & _
            "ProfileRotation: " & swept.ProfileRotation & vbCr & _
            "Bank: " & swept.Bank & vbCr & _
            "Twist: " & swept.Twist & vbCr & _
            "scale: " & swept.scale & vbCr & _
            "Length: " & swept.Length & vbCr & _
            "Material: " & swept.Material & vbCr & _
            "UIsolineDensity: " & swept.UIsolineDensity & vbCr & _
            "VIsolineDensity: " & swept.VIsolineDensity

    swept.ProfileRotation = swept.ProfileRotation * 3.14 * 0.25
    swept.Bank = Not swept.Bank
    swept.Twist = swept.Twist * 3.14 * -0.5
    swept.UIsolineDensity = swept.UIsolineDensity * 2#
    swept.VIsolineDensity = swept.VIsolineDensity * 0.5

    ThisDrawing.Regen acActiveViewport
    Utility.GetString 0, "Press return to continue..."

    'Now change the properties back to their original values
    swept.ProfileRotation = swept.ProfileRotation / (3.14 * 0.25)
    swept.Bank = Not swept.Bank
    swept.Twist = swept.Twist / (3.14 * -0.5)
    swept.UIsolineDensity = swept.UIsolineDensity / 2#
    swept.VIsolineDensity = swept.VIsolineDensity / 0.5
End Sub
Private Sub PlaneSurfaceProperties(planar As AcadPlaneSurface)
    GetSurfaceBoundingBox planar
    MsgBox "SurfaceType: " & planar.SurfaceType & vbCr & _
            "UIsolineDensity: " & planar.UIsolineDensity & vbCr & _
            "VIsolineDensity: " & planar.VIsolineDensity

    planar.UIsolineDensity = planar.UIsolineDensity * 2#
    planar.VIsolineDensity = planar.VIsolineDensity * 0.5

    ThisDrawing.Regen acActiveViewport
    Utility.GetString 0, "Press return to continue..."

    'Now change the properties back to their original values
    planar.UIsolineDensity = planar.UIsolineDensity / 2#
    planar.VIsolineDensity = planar.VIsolineDensity / 0.5
End Sub
Private Sub GetSurfaceBoundingBox(surf As AcadSurface)
    Dim MinPoint As Variant
    Dim MaxPoint As Variant

    surf.GetBoundingBox MinPoint, MaxPoint

    ' Print the min and max extents
    MsgBox "The extents of the bounding box for the surface are:" & vbCrLf _
    & "Min Point: " & MinPoint(0) & "," & MinPoint(1) & "," & MinPoint(2) _
    & vbCrLf & "Max Point: " & MaxPoint(0) & "," & MaxPoint(1) & "," & MaxPoint(2), vbInformation, "GetBoundingBox of Surface"
End Sub


MomentOfInertia Example [ActiveX and VBA Reference: AAR]

MomentOfInertia Example

Using Programming Languages other than VBA

Sub Example_MomentOfInertia()
    ' This example creates a box in model space.
    ' It then returns the MomentOfInertia for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the MomentOfInertia for the box
    Dim momentOfInertia As Variant
    momentOfInertia = boxObj.momentOfInertia
    MsgBox "The MomentOfInertia for the box is " & momentOfInertia(0) & ", " & momentOfInertia(1) & ", " & momentOfInertia(2), , "MomentOfInertia Example"

End Sub


Move Example [ActiveX and VBA Reference: AAR]

Move Example

Using Programming Languages other than VBA

Sub Example_Move()
    ' This example creates a circle and then performs
    ' a move on that circle.

    ' Create the circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 2#: center(1) = 2#: center(2) = 0#
    radius = 0.5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll

    ' Define the points that make up the move vector
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 2: point2(1) = 0: point2(2) = 0

    MsgBox "Move the circle 2 units in the X direction.", , "Move Example"

    ' Move the circle
    circleObj.Move point1, point2

    ZoomAll
    MsgBox "Move completed.", , "Move Example"

End Sub


MRUNumber Example [ActiveX and VBA Reference: AAR]

MRUNumber Example

Using Programming Languages other than VBA

Sub Example_MRUNumber()
    ' This example reads the preference value containing
    ' the number of most recently used files that are shown in the File menu.

    Dim ACADPref As AcadPreferencesOpenSave
    Dim originalValue As Variant

    ' Get the OpenSave preferences object
    Set ACADPref = ThisDrawing.Application.preferences.OpenSave

    ' Read and display the preference value
    originalValue = ACADPref.MRUNumber
    MsgBox "The number of most recently used files that are shown is: " & originalValue

End Sub


MSpace Example [ActiveX and VBA Reference: AAR]

MSpace Example

Using Programming Languages other than VBA

Sub Example_MSpace()
    ' This example creates a new paper space viewport.
    ' It then toggles the ability to edit in model space using
    ' the MSpace property.

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paperspace
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the paper space viewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.DISPLAY True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports

    ' Find the current MSpace value
    MsgBox "The ability to edit model space from this PViewport is " & IIf(ThisDrawing.mspace, "on.", "off."), , "MSpace Example"

    ' Toggle the setting of MSpace
    ThisDrawing.mspace = False
    MsgBox "The ability to edit model space from this PViewport is now " & IIf(ThisDrawing.mspace, "on.", "off."), , "MSpace Example"

End Sub


MTextAttribute Example [ActiveX and VBA Reference: AAR]

MTextAttribute Example

Using Programming Languages other than VBA

Sub Example_MTextAttribute()
     ' This example creates an attribute definition in model space.
    ' It then manipulates its MText properties

    Dim attributeObj As IAcadAttribute2
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1.4
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5.2: insertionPoint(1) = 5.7: insertionPoint(2) = 0
    tag = "NEW_TAG"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)

    attributeObj.MTextAttributeContent = "test content"
    attributeObj.MTextBoundaryWidth = 4.2
    attributeObj.UpdateMTextAttribute
    ZoomAll

End Sub


MVertexCount Example [ActiveX and VBA Reference: AAR]

MVertexCount Example

Using Programming Languages other than VBA

Sub Example_MVertexCount()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then finds the number of points in the 'M' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 2: points(4) = 0: points(5) = 1
    points(6) = 4: points(7) = 0: points(8) = 0
    points(9) = 6: points(10) = 0: points(11) = 1
    points(12) = 0: points(13) = 2: points(14) = 0
    points(15) = 2: points(16) = 2: points(17) = 1
    points(18) = 4: points(19) = 2: points(20) = 0
    points(21) = 6: points(22) = 2: points(23) = 1
    points(24) = 0: points(25) = 4: points(26) = 0
    points(27) = 2: points(28) = 4: points(29) = 1
    points(30) = 4: points(31) = 4: points(32) = 0
    points(33) = 6: points(34) = 4: points(35) = 0
    points(36) = 0: points(37) = 6: points(38) = 0
    points(39) = 2: points(40) = 6: points(41) = 1
    points(42) = 4: points(43) = 6: points(44) = 0
    points(45) = 6: points(46) = 6: points(47) = 0

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the polymesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Find the MVertexCount for the mesh
    Dim currVertexCount As Integer
    currVertexCount = meshObj.MVertexCount
    MsgBox "The MVertexCount for the mesh is " & meshObj.MVertexCount, , "MVertexCount Example"

End Sub


Name Example [ActiveX and VBA Reference: AAR]

Name Example

Using Programming Languages other than VBA

Sub Example_Name()
    ' This example creates a new layer. It then
    ' changes the name of that layer.

    ' Add the new layer
    Dim layerObj As AcadLayer
    Set layerObj = ThisDrawing.Layers.Add("NewLayer")

    ' Find the name of the new layer
    Dim layerName As String
    layerName = layerObj.name
    MsgBox "A new layer was created with the name: " & layerObj.name, , "Name Example"

    ' Change the name of the layer to "TEST". Note that behavior of the
    ' following code will be different for different objects. In some cases such as
    ' Block reference, changing the name means referencing to a new Block and therefore
    ' a Block with named "TEST" should already exist: otherwise an error will be
    ' returned.
    layerObj.name = "TEST"
    layerName = layerObj.name
    MsgBox "The new name of the layer is: " & layerObj.name, , "Name Example"

End Sub


NameNoMnemonic Example [ActiveX and VBA Reference: AAR]

NameNoMnemonic Example

Using Programming Languages other than VBA

Sub Example_NameNoMnemonic()
    ' This example iterates through the menus collection and
    ' displays the Name and NameNoMnemonic property for each menu.

    ' Note that depending on how many menus are currently loaded, the
    ' menuStatus string may not be displayed in full.

    Dim currMenu As AcadPopupMenu
    Dim menuStatus As String

    menuStatus = ""
    For Each currMenu In ThisDrawing.Application.MenuGroups.Item(0).Menus
        menuStatus = menuStatus & currMenu.name & " -- " & currMenu.NameNoMnemonic & vbCrLf
    Next currMenu
    MsgBox menuStatus

End Sub


Nclose Example [ActiveX and VBA Reference: AAR]

NClose Example

Using Programming Languages other than VBA

Sub Example_NClose()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then closes the polymesh in the 'N' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 2: points(1) = 2: points(2) = 1
    points(3) = 2.5: points(4) = 2: points(5) = 0
    points(6) = 5: points(7) = 2: points(8) = 0
    points(9) = 5.5: points(10) = 2: points(11) = 1
    points(12) = 2: points(13) = 4: points(14) = 0.5
    points(15) = 2.5: points(16) = 4: points(17) = 0
    points(18) = 5: points(19) = 4: points(20) = 0
    points(21) = 5.5: points(22) = 4: points(23) = 0.5
    points(24) = 2: points(25) = 6: points(26) = 0.5
    points(27) = 2.5: points(28) = 6: points(29) = 0
    points(30) = 5: points(31) = 6: points(32) = 0
    points(33) = 5.5: points(34) = 6: points(35) = 0.5
    points(36) = 2: points(37) = 8: points(38) = 1
    points(39) = 2.5: points(40) = 8: points(41) = 0
    points(42) = 5: points(43) = 8: points(44) = 0
    points(45) = 5.5: points(46) = 8: points(47) = 1

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the cylinder
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Close the polymesh in the 'M' direction
    MsgBox "The polymesh is " & IIf(meshObj.NClose, "closed", "open") & " in the 'N' direction.", , "NClose Example"
    meshObj.NClose = True
    ThisDrawing.Regen acActiveViewport
    MsgBox "The polymesh is " & IIf(meshObj.NClose, "closed", "open") & " in the 'N' direction.", , "NClose Example"

End Sub


NDensity Example [ActiveX and VBA Reference: AAR]

NDensity Example

Using Programming Languages other than VBA

Sub Example_NDensity()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then changes the type of polymesh, and finds the
    ' number of points in the 'N' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 2: points(4) = 0: points(5) = 1
    points(6) = 4: points(7) = 0: points(8) = 0
    points(9) = 6: points(10) = 0: points(11) = 1
    points(12) = 0: points(13) = 2: points(14) = 0
    points(15) = 2: points(16) = 2: points(17) = 1
    points(18) = 4: points(19) = 2: points(20) = 0
    points(21) = 6: points(22) = 2: points(23) = 1
    points(24) = 0: points(25) = 4: points(26) = 0
    points(27) = 2: points(28) = 4: points(29) = 1
    points(30) = 4: points(31) = 4: points(32) = 0
    points(33) = 6: points(34) = 4: points(35) = 0
    points(36) = 0: points(37) = 6: points(38) = 0
    points(39) = 2: points(40) = 6: points(41) = 1
    points(42) = 4: points(43) = 6: points(44) = 0
    points(45) = 6: points(46) = 6: points(47) = 0

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the polymesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Change the type of mesh. (NDensity is not valid for acSimpleMesh type.)
    meshObj.Type = acQuadSurfaceMesh
    meshObj.Update
    ThisDrawing.Regen acActiveViewport

    ' Find the NDensity for the mesh
    Dim currDensity As Integer
    currDensity = meshObj.NDensity
    MsgBox "The NDensity for the mesh is " & meshObj.NDensity, , "NDensity Example"

End Sub


New Example [ActiveX and VBA Reference: AAR]

New Example

Using Programming Languages other than VBA

Sub Example_New()
    ' This example creates a new drawing based on the template ansi-a.dwt.
    ' Note: The path to the template file is included with its name. Adjust
    ' this path for your installation location before running this example.

    Dim templateFileName As String
    templateFileName = "c:\AutoCAD\template\ansi-a.dwt"

    ThisDrawing.New templateFileName

End Sub


NewDrawing Example [: AAR]

NewDrawing Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_NewDrawing()
    ' This example intercepts an Application NewDrawing event.
    '
    ' This event is triggered when a new drawing request is sent to AutoCAD.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Use AutoCAD to create a new drawing using File/New

    MsgBox "A request to start a new drawing was just intercepted!"
End Sub


Normal Example [ActiveX and VBA Reference: AAR]

Normal Example

Using Programming Languages other than VBA

Sub Example_Normal()
    ' This example creates a circle in model space.
    ' It then finds the current normal to that circle
    ' and changes the normal.

    ' Define a circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 4: center(1) = 4: center(2) = 0
    radius = 1

    ' Add the circle to model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
    ZoomAll

    ' Find the normal for the circle
    Dim currNormal As Variant
    currNormal = circleObj.Normal
    MsgBox "The current normal for the circle is " & circleObj.Normal(0) & ", " & circleObj.Normal(1) & ", " & circleObj.Normal(2), , "Normal Example"

    ' Change the normal for the circle
    Dim newNormal(0 To 2) As Double
    newNormal(0) = 1: newNormal(1) = 1: newNormal(2) = -1
    circleObj.Normal = newNormal
    circleObj.Update
    MsgBox "The current normal for the circle is " & circleObj.Normal(0) & ", " & circleObj.Normal(1) & ", " & circleObj.Normal(2), , "Normal Example"

End Sub


NumberOfControlPoints Example [ActiveX and VBA Reference: AAR]

NumberOfControlPoints Example

Using Programming Languages other than VBA

Sub Example_NumberOfControlPoints()
    ' This example creates a spline object in model space.
    ' It then finds the number of control points for that spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    MsgBox "The Spline has " & splineObj.NumberOfControlPoints & " control points.", , "NumberOfControlPoints Example"

End Sub


NumberOfCopies Example [ActiveX and VBA Reference: AAR]

NumberOfCopies Example

Using Programming Languages other than VBA

Sub Example_NumberOfCopies()
    ' This example plots the layouts of a drawing.

    Dim oPlot As AcadPlot
    Dim AddedLayouts() As String
    Dim LayoutList As Variant
    Dim oLayout As AcadLayout
    Dim ArraySize As Integer, BatchCount As Integer

    For Each oLayout In ThisDrawing.Layouts
        ArraySize = ArraySize + 1
        ReDim Preserve AddedLayouts(1 To ArraySize)
        AddedLayouts(ArraySize) = oLayout.Name
    Next

    LayoutList = AddedLayouts
    Set oPlot = ThisDrawing.Plot
    oPlot.SetLayoutsToPlot LayoutList
    oPlot.PlotToDevice  "dwf6 eplot.pc3"
End Sub


NumberOfFaces Example [ActiveX and VBA Reference: AAR]

NumberOfFaces Example

Using Programming Languages other than VBA

Sub Example_NumberOfFaces()
    ' This example creates a PolyFaceMesh and displays the number of faces it contains

    Dim vertexList(0 To 17) As Double
    Dim FaceList(0 To 7) As Integer
    Dim NewPolyFaceMeshObj As AcadPolyfaceMesh
    Dim direction(0 To 2) As Double

    'Data for new PolyFaceMesh object
    vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
    vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
    vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
    vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
    vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
    vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 6

    FaceList(0) = 1:    FaceList(1) = 2:    FaceList(2) = 5
    FaceList(3) = 4:    FaceList(4) = 2:    FaceList(5) = 3
    FaceList(6) = 6:    FaceList(7) = 5

    ' Create new PolyFaceMesh object
    Set NewPolyFaceMeshObj = ModelSpace.AddPolyfaceMesh(vertexList, FaceList)
    NewPolyFaceMeshObj.Update

    ' Change the viewing direction of the viewport to
    ' better see the polyface mesh
    direction(0) = -1: direction(1) = -1: direction(2) = 1
    ThisDrawing.ActiveViewport.direction = direction
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ThisDrawing.Application.ZoomAll

    ' Display number of faces in this PolyFaceMesh
    MsgBox "The new PolyFaceMesh contains " & NewPolyFaceMeshObj.NumberOfFaces & " faces."
End Sub


NumberOfFitPoints Example [ActiveX and VBA Reference: AAR]

NumberOfFitPoints Example

Using Programming Languages other than VBA

Sub Example_NumberOfFitPoints()
    ' This example creates a spline object in model space.
    ' It then finds the number of control points for that spline.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    MsgBox "The Spline has " & splineObj.NumberOfFitPoints & " fit points.", , "NumberOfFitPoints Example"

End Sub


NumberOfLoops Example [ActiveX and VBA Reference: AAR]

NumberOfLoops Example

Using Programming Languages other than VBA

Sub Example_NumberOfLoops()
    ' This example creates an associative hatch in model space.
    ' The number of loops in the hatch is then returned.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the number of loops in the hatch
    Dim numOfLoops As Integer
    numOfLoops = hatchObj.NumberOfLoops
    MsgBox "The number of loops in the hatch is " & hatchObj.NumberOfLoops, , "NumberOfLoops Example"

End Sub


NumberOfVertices Example [ActiveX and VBA Reference: AAR]

NumberOfVertices Example

Using Programming Languages other than VBA

Sub Example_NumberOfVertices()
    ' This example creates a PolyFaceMesh and displays the number of vertices it contains

    Dim vertexList(0 To 17) As Double
    Dim FaceList(0 To 7) As Integer
    Dim NewPolyFaceMeshObj As AcadPolyfaceMesh
    Dim direction(0 To 2) As Double

    'Data for new PolyFaceMesh object
    vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
    vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
    vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
    vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
    vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
    vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 6

    FaceList(0) = 1:    FaceList(1) = 2:    FaceList(2) = 5
    FaceList(3) = 4:    FaceList(4) = 2:    FaceList(5) = 3
    FaceList(6) = 6:    FaceList(7) = 5

    ' Create new PolyFaceMesh object
    Set NewPolyFaceMeshObj = ModelSpace.AddPolyfaceMesh(vertexList, FaceList)
    NewPolyFaceMeshObj.Update

    ' Change the viewing direction of the viewport to
    ' better see the polyface mesh
    direction(0) = -1: direction(1) = -1: direction(2) = 1
    ThisDrawing.ActiveViewport.direction = direction
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ThisDrawing.Application.ZoomAll

    ' Display number of vertices in this PolyFaceMesh
    MsgBox "The new PolyFaceMesh contains " & NewPolyFaceMeshObj.NumberOfVertices & " vertices."
End Sub


NumCustomInfo Example [ActiveX and VBA Reference: AAR]

NumCustomInfo Example

Using Programming Languages other than VBA

Sub Example_NumCustomInfo()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


NVertexCount Example [ActiveX and VBA Reference: AAR]

NVertexCount Example

Using Programming Languages other than VBA

Sub Example_NVertexCount()
    ' This example creates a 4 X 4 polygonmesh in model space.
    ' It then finds the number of points in the 'N' direction.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double

    ' Create the matrix of points
    points(0) = 0: points(1) = 0: points(2) = 0
    points(3) = 2: points(4) = 0: points(5) = 1
    points(6) = 4: points(7) = 0: points(8) = 0
    points(9) = 6: points(10) = 0: points(11) = 1
    points(12) = 0: points(13) = 2: points(14) = 0
    points(15) = 2: points(16) = 2: points(17) = 1
    points(18) = 4: points(19) = 2: points(20) = 0
    points(21) = 6: points(22) = 2: points(23) = 1
    points(24) = 0: points(25) = 4: points(26) = 0
    points(27) = 2: points(28) = 4: points(29) = 1
    points(30) = 4: points(31) = 4: points(32) = 0
    points(33) = 6: points(34) = 4: points(35) = 0
    points(36) = 0: points(37) = 6: points(38) = 0
    points(39) = 2: points(40) = 6: points(41) = 1
    points(42) = 4: points(43) = 6: points(44) = 0
    points(45) = 6: points(46) = 6: points(47) = 0

    mSize = 4: nSize = 4

    ' Create a 3Dmesh in model space
    Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)

    ' Change the viewing direction of the viewport to better see the polymesh
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Find the NVertexCount for the mesh
    Dim currVertexCount As Integer
    currVertexCount = meshObj.NVertexCount
    MsgBox "The NVertexCount for the mesh is " & meshObj.NVertexCount, , "NVertexCount Example"

End Sub


ObjectAdded Example [: AAR]

ObjectAdded Example

Using Programming Languages other than VBA

Private Sub AcadDocument_ObjectAdded(ByVal Object As Object)
    ' This example intercepts a drawing ObjectAdded event.
    '
    ' This event is triggered when an object is added to a drawing.
    '
    ' To trigger this example event: Add an object to an open drawing

    ' Use the "Object" variable to determine the type of object added
    MsgBox "A " & TypeName(Object) & " was just added to the drawing!"
End Sub


ObjectErased Example [: AAR]

ObjectErased Example

Using Programming Languages other than VBA

Private Sub AcadDocument_ObjectErased(ByVal ObjectID As Long)
    ' This example intercepts a drawing ObjectErased event.
    '
    ' This event is triggered when an object is removed from a drawing.
    '
    ' To trigger this example event: Delete (Cut) an existing object from an open drawing

    ' Use the "Object" variable to determine the type of object removed
    MsgBox "The ID of the object deleted is: " & ObjectID

End Sub


ObjectID Example [ActiveX and VBA Reference: AAR]

ObjectID Example

Using Programming Languages other than VBA

Sub Example_ObjectID()
    ' This example creates several objects in model space.
    ' It then iterates through model space and displays the
    ' ObjectID for each object found.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a Polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a Line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a Circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 5: centerPt(1) = 3: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an Ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection and display
    ' the ObjectID of each object found.

    Dim entObjectID As Long
    Dim entry As AcadEntity
    For Each entry In ThisDrawing.ModelSpace
        entObjectID = entry.objectID
        entry.Highlight (True)
        MsgBox "The ObjectID of this object is " & entObjectID, vbInformation, "ObjectID Example"
        entry.Highlight (False)
    Next
End Sub


ObjectIDToObject Example [ActiveX and VBA Reference: AAR]

ObjectIDToObject Example

Using Programming Languages other than VBA

Sub Example_ObjectIDToObject()
    ' This example creates a spline in model space, and returns the
    ' handle for the spline. Then the spline is returned from the handle and colored.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ZoomAll

    ' Find the objectID of the spline
    Dim objectID As Long
    objectID = splineObj.objectID
    MsgBox "The objectID of the Spline is: " & splineObj.objectID, , "ObjectIDToObject Example"

    ' Find an object from a given objectID
    Dim tempObj As AcadObject
    Set tempObj = ThisDrawing.ObjectIdToObject(objectID)

    ' Now use the newly initialized object variable to color the object
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    tempObj.TrueColor = color

    ThisDrawing.Regen True
    MsgBox "The Spline is now blue.", , "ObjectIDToObject Example"

End Sub


ObjectModified Example [: AAR]

ObjectModified Example

Using Programming Languages other than VBA

Private Sub AcadDocument_ObjectModified(ByVal Object As Object)
    ' This example intercepts a drawing ObjectModified event.
    '
    ' This event is triggered when an object in a drawing is modified.
    '
    ' To trigger this example event: Modify an object in any open drawing

    ' Use the "Object" variable to determine the type of object modified
    MsgBox "A " & TypeName(Object) & " was just modified!"
End Sub


ObjectName Example [ActiveX and VBA Reference: AAR]

ObjectName Example

Using Programming Languages other than VBA

Sub Example_ObjectName()
    ' This example creates several objects in model space.
    ' It then iterates through model space and displays the
    ' Object Name for each object found.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a Polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a Line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a Circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an Ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection and display
    ' the object name of each object found.

    Dim objName As String
    Dim entry As AcadEntity
    For Each entry In ThisDrawing.ModelSpace
        objName = entry.ObjectName
        entry.Highlight (True)
        MsgBox "The name of this object is " & objName, vbInformation, "ObjectName Example"
        entry.Highlight (False)
    Next
End Sub


ObjectSnapMode Example [ActiveX and VBA Reference: AAR]

ObjectSnapMode Example

Using Programming Languages other than VBA

Sub Example_ObjectSnapMode()
    ' This example toggles the setting of the Object Snap Mode.

    Dim currObjSnapMode As Boolean

    ' Get the current ObjectSnapMode value
    currObjSnapMode = ThisDrawing.ObjectSnapMode
    MsgBox "The object snap mode is currently " & IIf(ThisDrawing.ObjectSnapMode, "on.", "off."), , "ObjectSnapMode Example"

    ' Change the default ObjectSnapMode value
    ThisDrawing.ObjectSnapMode = Not (currObjSnapMode)
    MsgBox "The object snap mode is now " & IIf(ThisDrawing.ObjectSnapMode, "on.", "off."), , "ObjectSnapMode Example"

End Sub


ObjectSortByPlotting Example [ActiveX and VBA Reference: AAR]

ObjectSortByPlotting Example

Using Programming Languages other than VBA

Sub Example_ObjectSortByPlotting()
    ' This example reads and modifies the preference value that controls
    ' the sorting of drawing objects by plotting order.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortByPlotting
    MsgBox "The ObjectSortByPlotting preference is set to: " & originalValue

    ' Modify the ObjectSortByPlotting preference by toggling the value
    ACADPref.ObjectSortByPlotting = Not (ACADPref.ObjectSortByPlotting)
    newValue = ACADPref.ObjectSortByPlotting
    MsgBox "The ObjectSortByPlotting preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortByPlotting = originalValue
    MsgBox "The ObjectSortByPlotting preference was reset back to: " & originalValue
End Sub


ObjectSortByPSOutput Example [ActiveX and VBA Reference: AAR]

ObjectSortByPSOutput Example

Using Programming Languages other than VBA

Sub Example_ObjectSortByPSOutput()
    ' This example reads and modifies the preference value which controls
    ' the sorting of drawing objects by PostScript output order.
    ' When finished, this example resets the preference value back to
    ' it's original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortByPSOutput
    MsgBox "The ObjectSortByPSOutput preference is set to: " & originalValue

    ' Modify the ObjectSortByPSOutput preference by toggling the value
    ACADPref.ObjectSortByPSOutput = Not (ACADPref.ObjectSortByPSOutput)
    newValue = ACADPref.ObjectSortByPSOutput
    MsgBox "The ObjectSortByPSOutput preference has been set to: " & newValue

    ' Reset the preference back to it's original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortByPSOutput = originalValue
    MsgBox "The ObjectSortByPSOutput preference was reset back to: " & originalValue
End Sub


ObjectSortByRedraws Example [ActiveX and VBA Reference: AAR]

ObjectSortByRedraws Example

Using Programming Languages other than VBA

Sub Example_ObjectSortByRedraws()
    ' This example reads and modifies the preference value that controls
    ' the sorting of drawing objects by redraw order.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortByRedraws
    MsgBox "The ObjectSortByRedraws preference is set to: " & originalValue

    ' Modify the ObjectSortByRedraws preference by toggling the value
    ACADPref.ObjectSortByRedraws = Not (ACADPref.ObjectSortByRedraws)
    newValue = ACADPref.ObjectSortByRedraws
    MsgBox "The ObjectSortByRedraws preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortByRedraws = originalValue
    MsgBox "The ObjectSortByRedraws preference was reset back to: " & originalValue
End Sub


ObjectSortByRegens Example [ActiveX and VBA Reference: AAR]

ObjectSortByRegens Example

Using Programming Languages other than VBA

Sub Example_ObjectSortByRegens()
    ' This example reads and modifies the preference value that controls
    ' the sorting of drawing objects by regeneration order.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortByRegens
    MsgBox "The ObjectSortByRegens preference is set to: " & originalValue

    ' Modify the ObjectSortByRegens preference by toggling the value
    ACADPref.ObjectSortByRegens = Not (ACADPref.ObjectSortByRegens)
    newValue = ACADPref.ObjectSortByRegens
    MsgBox "The ObjectSortByRegens preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortByRegens = originalValue
    MsgBox "The ObjectSortByRegens preference was reset back to: " & originalValue
End Sub


ObjectSortBySelection Example [ActiveX and VBA Reference: AAR]

ObjectSortBySelection Example

Using Programming Languages other than VBA

Sub Example_ObjectSortBySelection()
    ' This example reads and modifies the preference value that controls
    ' the sorting of drawing objects by object selection.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortBySelection
    MsgBox "The ObjectSortBySelection preference is set to: " & originalValue

    ' Modify the ObjectSortBySelection preference by toggling the value
    ACADPref.ObjectSortBySelection = Not (ACADPref.ObjectSortBySelection)
    newValue = ACADPref.ObjectSortBySelection
    MsgBox "The ObjectSortBySelection preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortBySelection = originalValue
    MsgBox "The ObjectSortBySelection preference was reset back to: " & originalValue
End Sub


ObjectSortBySnap Example [ActiveX and VBA Reference: AAR]

ObjectSortBySnap Example

Using Programming Languages other than VBA

Sub Example_ObjectSortBySnap()
    ' This example reads and modifies the preference value that controls
    ' the sorting of drawing objects by object snap.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.ObjectSortBySnap
    MsgBox "The ObjectSortBySnap preference is set to: " & originalValue

    ' Modify the ObjectSortBySnap preference by toggling the value
    ACADPref.ObjectSortBySnap = Not (ACADPref.ObjectSortBySnap)
    newValue = ACADPref.ObjectSortBySnap
    MsgBox "The ObjectSortBySnap preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ObjectSortBySnap = originalValue
    MsgBox "The ObjectSortBySnap preference was reset back to: " & originalValue
End Sub


ObliqueAngle Example [ActiveX and VBA Reference: AAR]

ObliqueAngle Example

Using Programming Languages other than VBA

Sub Example_ObliqueAngle()
    ' This example creates a text object in model space.
    ' It then changes the ObliqueAngle of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The ObliqueAngle is " & textObj.ObliqueAngle, vbInformation, "ObliqueAngle Example"

    ' Change the value of the ObliqueAngle to 45 degrees (.707 radians)
    textObj.ObliqueAngle = 0.707
    ZoomAll
    MsgBox "The ObliqueAngle is set to " & textObj.ObliqueAngle, vbInformation, "ObliqueAngle Example"

End Sub


Offset Example [ActiveX and VBA Reference: AAR]

Offset Example

Using Programming Languages other than VBA

Sub Example_Offset()
    ' This example creates a lightweight polyline
    ' and then offsets the polyline.

    ' Create the polyline
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 1
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True
    ZoomAll

    MsgBox "Offset the polyline by 0.25.", , "Offset Example"

    ' Offset the polyline
    Dim offsetObj As Variant
    offsetObj = plineObj.offset(0.25)

    ZoomAll
    MsgBox "Offset completed.", , "Offset Example"

End Sub


OLELaunch Example [ActiveX and VBA Reference: AAR]

OLELaunch Example

Using Programming Languages other than VBA

Sub Example_OLELaunch()
    ' This example reads and modifies the preference value that controls
    ' whether to launch the parent application when plotting OLE objects.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.OLELaunch
    MsgBox "The OLELaunch preference is set to: " & originalValue

    ' Modify the OLELaunch preference by toggling the value
    ACADPref.OLELaunch = Not (ACADPref.OLELaunch)
    newValue = ACADPref.OLELaunch
    MsgBox "The OLELaunch preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.OLELaunch = originalValue
    MsgBox "The OLELaunch preference was reset back to: " & originalValue
End Sub


OLEQuality Example [ActiveX and VBA Reference: AAR]

OLEQuality Example

Using Programming Languages other than VBA

Sub Example_OLEQuality()
    ' This example reads and modifies the preference value that controls
    ' the plot quality of OLE objects. When finished, this example resets
    ' the preference value back to its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Variant, DisplayValue As String

    ' Get the output preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Store original value
    originalValue = ACADPref.OLEQuality

    ' Read and display the original value
    GoSub GETVALUE
    MsgBox "The OLEQuality preference is currently set to: " & DisplayValue

    ' Modify the OLEQuality preference by changing it to High Quality Photographic
    ACADPref.OLEQuality = acOQHighPhoto
    GoSub GETVALUE
    MsgBox "The OLEQuality preference has been set to: " & DisplayValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.OLEQuality = originalValue
    GoSub GETVALUE
    MsgBox "The OLEQuality preference was reset back to: " & DisplayValue

    Exit Sub

GETVALUE:
    ' Convert the value of this setting to a meaningful text string
    DisplayValue = ACADPref.OLEQuality
    Select Case DisplayValue
        Case acOQLineArt: DisplayValue = "Line Art"
        Case acOQText: DisplayValue = "Text"
        Case acOQGraphics: DisplayValue = "Graphics"
        Case acOQPhoto: DisplayValue = "Photo"
        Case acOQHighPhoto: DisplayValue = "High Photo"
    End Select

    Return

End Sub


OnMenuBar Example [ActiveX and VBA Reference: AAR]

OnMenuBar Example

Using Programming Languages other than VBA

Sub Example_OnMenuBar()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar, and then
    ' removed from the menu bar.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)
    GoSub QUERYMENU

    ' Remove the menu from the menu bar
    currMenuGroup.Menus.RemoveMenuFromMenuBar ("TestMenu")
    GoSub QUERYMENU
    Exit Sub

QUERYMENU:
    If newMenu.OnMenuBar Then
        MsgBox "The menu called " & newMenu.name & " is on the menu bar."
    Else
        MsgBox "The menu called " & newMenu.name & " is not on the menu bar."
    End If
    Return

End Sub


Open Example [ActiveX and VBA Reference: AAR]

Open Example

Using Programming Languages other than VBA

Sub Example_Open()
    ' The following example opens "C:\AutoCAD\Sample\city map.dwg" file.
    ' This drawing may not exist on your system. Change the drawing
    ' path and name to reflect a valid AutoCAD drawing on your system.

    ThisDrawing.Application.Documents.Open ("C:\AutoCAD\Sample\city map.dwg")

End Sub


OpenSave Example [ActiveX and VBA Reference: AAR]

OpenSave Example

Using Programming Languages other than VBA

Sub Example_OpenSave()
    ' This example obtains a reference to the OpenSave Preferences object
    ' from the Application Preferences object, and reads one of the OpenSave
    ' preferences

    Dim ACADPref As AcadPreferencesOpenSave

    ' Obtain a reference to the OpenSave Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.OpenSave

    MsgBox "You now have access to the properties and methods of the OpenSave Preferences object!"
    MsgBox "The OpenSave preference TempFileExtension is set to: " & ACADPref.TempFileExtension

    ' Release OpenSave Preferences object
    Set ACADPref = Nothing
    MsgBox "The OpenSave Preferences object has been released!"
End Sub


Origin Example [ActiveX and VBA Reference: AAR]

Origin Example

Using Programming Languages other than VBA

Sub Example_Origin()
    ' This example creates a UCS and returns its origin.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Create a new UCS with origin 2, 2, 0
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double

    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0

    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
    ThisDrawing.ActiveUCS = ucsObj
    viewportObj.UCSIconOn = True
    viewportObj.UCSIconAtOrigin = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Display the current origin for the new UCS
    MsgBox "The origin of the UCS is: " & ucsObj.origin(0) & ", " & ucsObj.origin(1) & ", " & ucsObj.origin(2), , "Origin Example"

    ' Change the origin of the UCS
    origin(0) = 4: origin(1) = 4: origin(2) = 0
    ucsObj.origin = origin

    ' Reset the active UCS and viewport to see the change
    ThisDrawing.ActiveUCS = ucsObj
    ThisDrawing.ActiveViewport = viewportObj

    MsgBox "The origin of the UCS is now: " & ucsObj.origin(0) & ", " & ucsObj.origin(1) & ", " & ucsObj.origin(2), , "Origin Example"

End Sub


OrthoOn Example [ActiveX and VBA Reference: AAR]

OrthoOn Example

Using Programming Languages other than VBA

Sub Example_OrthoOn()
    ' This example toggles the setting of OrthoOn.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Display the current setting of OrthoOn
    MsgBox "Isometric snap mode is: " & IIf(viewportObj.OrthoOn, "On", "Off"), , "OrthoOn Example"

    ' Toggle the setting of OrthoOn
    viewportObj.OrthoOn = Not (viewportObj.OrthoOn)

    ' Reset the active viewport to see the change on the AutoCAD status bar
    ThisDrawing.ActiveViewport = viewportObj

    MsgBox "Isometric snap mode is now: " & IIf(viewportObj.OrthoOn, "On", "Off"), , "OrthoOn Example"

End Sub


Output Example [ActiveX and VBA Reference: AAR]

Output Example

Using Programming Languages other than VBA

Sub Example_Output()
    ' This example obtains a reference to the Output Preferences object
    ' from the Application Preferences object, and reads one of the Output
    ' preferences

    Dim ACADPref As AcadPreferencesOutput

    ' Obtain a reference to the Output Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output

    MsgBox "You now have access to the properties and methods of the Output Preferences object!"
    MsgBox "The Output preference DefaultOutputDevice is set to: " & ACADPref.DefaultOutputDevice

    ' Release Output Preferences object
    Set ACADPref = Nothing
    MsgBox "The Output Preferences object has been released!"
End Sub


OwnerID Example [ActiveX and VBA Reference: AAR]

OwnerID Example

Using Programming Languages other than VBA

Sub Example_OwnerID()
    ' This example creates an MText object in model space
    ' and then finds the OwnerID for the object.

    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text string for the MText object"

    ' Creates the MText object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

    MsgBox "The OwnerID for the MText object is: " & MTextObj.OwnerID

End Sub


PageSetupOverridesTemplateFile Example [ActiveX and VBA Reference: AAR]

PageSetupOverridesTemplateFile Example

Using Programming Languages other than VBA

Sub Example_PageSetupOverridesTemplateFile()

' Note: Change the file path and name to a valid file on your system.

    Dim MyFiles As IAcadPreferencesFiles2
    Set MyFiles = AcadApplication.Preferences.Files
    MyFiles.PageSetupOverridesTemplateFile = "C:\MyTemplate.dwt"

End Sub


PaperSpace Example [ActiveX and VBA Reference: AAR]

PaperSpace Example

Using Programming Languages other than VBA

Sub Example_PaperSpace()
    ' This example sets the variable pspace to the paper space object collection.

    Dim pspace As AcadPaperSpace
    Set pspace = ThisDrawing.PaperSpace

End Sub


PaperUnits Example [ActiveX and VBA Reference: AAR]

PaperUnits Example

Using Programming Languages other than VBA

Sub Example_PaperUnits()
    ' This example will access the Layouts collection for the current drawing
    ' and list basic information about the paper units used for each Layout.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim Measurement As String

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the paper units information of every layout in this drawing
    For Each Layout In Layouts
        ' Using inches or millimeters?
        Measurement = IIf(Layout.PaperUnits = acInches, " inches", " millimeters")

        ' Format for display
        msg = msg & Layout.name & " is using" & Measurement & vbCrLf
    Next

    ' Display paper units information
    MsgBox "The paper units used in the current drawing are: " & msg
End Sub


Parent Example [ActiveX and VBA Reference: AAR]

Parent Example

Using Programming Languages other than VBA

Sub Example_Parent()
    ' This example creates a new toolbar and then finds the parent toolbar.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("MyTools")

    ' Add a button to the new toolbar.
    ' All three buttons will have the same macro attached.
    Dim newButton1 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "OpenFile", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    ' Find the parent toolbar for the toolbar button
    MsgBox "The " & newButton1.name & " button is on the " & newButton1.Parent.name & " toolbar."
End Sub


Password Example [ActiveX and VBA Reference: AAR]

Password Example

Using Programming Languages other than VBA

Sub Example_Password()
    ' This example opens a password-protected file, closes it, and then opens another
    ' password-protected file.

    ThisDrawing.Application.Documents.Open "C:\MyDrawing.dwg", , "MYPASSWORD"
    'AutoCAD converts all passwords to uppercase before applying them

    ThisDrawing.Close

    ThisDrawing.Application.Documents.Open "C:\MyDrawing2.dwg", , "MYSECONDPASSWORD"

End Sub


Path Example [ActiveX and VBA Reference: AAR]

Path Example

Using Programming Languages other than VBA

Sub Example_Path()
    ' This example returns the path of the drawing and application.

    ' If the drawing has not been saved, the path of the
    ' document will be blank.
    Dim docPath As String
    docPath = ThisDrawing.Path
    MsgBox "The Path of the current drawing is " & docPath, , "Path Example"

    Dim appPath As String
    appPath = ThisDrawing.Application.Path
    MsgBox "The Path of the current appication is " & appPath, , "Path Example"

End Sub


PatternAngle Example [ActiveX and VBA Reference: AAR]

PatternAngle Example

Using Programming Languages other than VBA

Sub Example_PatternAngle()
    ' This example creates an associative hatch in model space.
    ' The angle of the hatch pattern is returned, and updated.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch
    ' An arc and a line are used to create a closed loop

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the angle of the hatch pattern
    Dim patternAngle As Double
    patternAngle = hatchObj.patternAngle
    MsgBox "The angle of the hatch pattern is " & hatchObj.patternAngle, , "PatternAngle Example"

    ' Change the angle of the hatch pattern
    hatchObj.patternAngle = 5.25
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The angle of the hatch pattern is now " & hatchObj.patternAngle, , "PatternAngle Example"

End Sub


PatternDouble Example [ActiveX and VBA Reference: AAR]

PatternDouble Example

Using Programming Languages other than VBA

Sub Example_PatternDouble()
    ' This example creates an associative hatch in model space.
    ' It then returns whether or not the pattern is doubled, and
    ' then changes that value.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ansi31"
    PatternType = acHatchPatternTypePreDefined
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Determine if the pattern is doubled
    Dim patternDouble As Boolean
    patternDouble = hatchObj.patternDouble
    MsgBox "Pattern doubling: " & hatchObj.patternDouble, , "PatternDouble Example"

    ' Change the angle of the hatch pattern
    hatchObj.patternDouble = Not (hatchObj.patternDouble)
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "Pattern doubling: " & hatchObj.patternDouble, , "PatternDouble Example"

End Sub


PatternName [ActiveX and VBA Reference: AAR]

PatternName Example

Using Programming Languages other than VBA

Sub Example_PatternName()
    ' This example creates an associative hatch in model space.
    ' The name of the hatch pattern is then returned.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the name of the hatch pattern
    patternName = hatchObj.patternName
    MsgBox "The name of the hatch pattern is " & hatchObj.patternName, , "patternName Example"

End Sub


PatternScale Example [ActiveX and VBA Reference: AAR]

PatternScale Example

Using Programming Languages other than VBA

Sub Example_PatternScale()
    ' This example creates an associative hatch in model space.
    ' The scale of the hatch pattern is then returned and changed.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the scale of the hatch pattern
    Dim PatternScale As Double
    PatternScale = hatchObj.PatternScale
    MsgBox "The scale of the hatch pattern is " & hatchObj.PatternScale, , "PatternScale Example"

    ' Change the scale of the hatch pattern
    hatchObj.PatternScale = PatternScale + 2
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The scale of the hatch pattern is now " & hatchObj.PatternScale, , "PatternScale Example"

End Sub


PatternSpace Example [ActiveX and VBA Reference: AAR]

PatternSpace Example

Using Programming Languages other than VBA

Sub Example_PatternSpace()
    ' This example creates an associative hatch in model space.
    ' The spacing of the hatch pattern is then returned and changed.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the space of the hatch pattern
    Dim patternSpace As Double
    patternSpace = hatchObj.patternSpace
    MsgBox "The spacing of the hatch pattern is " & hatchObj.patternSpace, , "PatternSpace Example"

    ' Change the spacing of the hatch pattern
    hatchObj.patternSpace = patternSpace + 2
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The spacing of the hatch pattern is now " & hatchObj.patternSpace, , "PatternSpace Example"

End Sub


PatternType Example [ActiveX and VBA Reference: AAR]

PatternType Example

Using Programming Languages other than VBA

Sub Example_PatternType()
    ' This example creates an associative hatch in model space.
    ' The type of the hatch pattern is then returned.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = acHatchPatternTypePreDefined
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.
    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ThisDrawing.Regen True

    ' Find the type of hatch
    PatternType = hatchObj.PatternType
    MsgBox "The type of hatch pattern is " & Choose(hatchObj.PatternType + 1, "acHatchPatternTypeUserDefined", "acHatchPatternTypePreDefined", "acHatchPatternTypeCustomDefined"), , "PatternType Example"

End Sub


Perimeter Example [ActiveX and VBA Reference: AAR]

Perimeter Example

Using Programming Languages other than VBA

Sub Example_Perimeter()
    ' This example creates a region from an arc and a line.
    ' It then returns the length of the perimeter of the region.
    Dim curves(0 To 1) As AcadEntity
    Dim arcObj As AcadArc
    Dim lineObj As AcadLine

    ' Create the arc and line
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
    radius = 2#
    startAngle = 0
    endAngle = 3.141592
    Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)
    Set lineObj = ThisDrawing.ModelSpace.AddLine(arcObj.startPoint, arcObj.endPoint)
    Set curves(0) = arcObj
    Set curves(1) = lineObj

    ' Create the region
    Dim regionObj As Variant
    regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
    ZoomAll

    ' Find the perimeter of the region.
    Dim perimeter As Double
    perimeter = regionObj(0).perimeter
    MsgBox "The perimeter of the region is " & regionObj(0).perimeter, , "Perimeter Example"

End Sub


PickAdd Example [ActiveX and VBA Reference: AAR]

PickAdd Example

Using Programming Languages other than VBA

Sub Example_PickAdd()
    ' This example reads and modifies the preference value that controls
    ' whether objects are added to the selection set using the SHIFT key.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickAdd
    MsgBox "The PickAdd preference is set to: " & originalValue

    ' Modify the PickAdd preference by toggling the value
    ACADPref.PickAdd = Not (ACADPref.PickAdd)
    newValue = ACADPref.PickAdd
    MsgBox "The PickAdd preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickAdd = originalValue
    MsgBox "The PickAdd preference was reset back to: " & originalValue
End Sub


PickAuto Example [ActiveX and VBA Reference: AAR]

PickAuto Example

Using Programming Languages other than VBA

Sub Example_PickAuto()
    ' This example reads and modifies the preference value that controls
    ' automatic windowing at the Select Objects prompt.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickAuto
    MsgBox "The PickAuto preference is set to: " & originalValue

    ' Modify the PickAuto preference by toggling the value
    ACADPref.PickAuto = Not (ACADPref.PickAuto)
    newValue = ACADPref.PickAuto
    MsgBox "The PickAuto preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickAuto = originalValue
    MsgBox "The PickAuto preference was reset back to: " & originalValue
End Sub


PickBoxSize Example [ActiveX and VBA Reference: AAR]

PickBoxSize Example

Using Programming Languages other than VBA

Sub Example_PickBoxSize()
    ' This example reads and modifies the preference value that controls
    ' the size of the object selection target.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickBoxSize
    MsgBox "The PickBoxSize preference is set to: " & originalValue

    ' Modify the PickBoxSize preference by setting it to 5
    ACADPref.PickBoxSize = 5
    newValue = ACADPref.PickBoxSize
    MsgBox "The PickBoxSize preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickBoxSize = originalValue
    MsgBox "The PickBoxSize preference was reset back to: " & originalValue
End Sub


PickDrag Example [ActiveX and VBA Reference: AAR]

PickDrag Example

Using Programming Languages other than VBA

Sub Example_PickDrag()
    ' This example reads and modifies the preference value that controls
    ' the method of drawing a selection window.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickDrag
    MsgBox "The PickDrag preference is set to: " & originalValue

    ' Modify the PickDrag preference by toggling the value
    ACADPref.PickDrag = Not (ACADPref.PickDrag)
    newValue = ACADPref.PickDrag
    MsgBox "The PickDrag preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickDrag = originalValue
    MsgBox "The PickDrag preference was reset back to: " & originalValue
End Sub


PickFirst Example [ActiveX and VBA Reference: AAR]

PickFirst Example

Using Programming Languages other than VBA

Sub Example_PickFirst()
    ' This example reads and modifies the preference value that controls
    ' whether you select objects before (noun-verb selection) or after
    ' you issue a command.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the selection preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickFirst
    MsgBox "The PickFirst preference is set to: " & originalValue

    ' Modify the PickFirst preference by toggling the value
    ACADPref.PickFirst = Not (ACADPref.PickFirst)
    newValue = ACADPref.PickFirst
    MsgBox "The PickFirst preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickFirst = originalValue
    MsgBox "The PickFirst preference was reset back to: " & originalValue
End Sub


PickfirstSelectionSet Example [ActiveX and VBA Reference: AAR]

PickfirstSelectionSet Example

Using Programming Languages other than VBA

Sub Example_PickfirstSelectionSet()
    ' This example lists all the objects in the pickfirst selection set.
    ' Before running this example, create some objects in the active
    ' drawing and select those objects. The objects currently selected
    ' in the active drawing will be returned in the pickfirst selection set.

    Dim pfSS As AcadSelectionSet
    Dim ssobject As AcadEntity
    Dim msg As String
    msg = vbCrLf

    Set pfSS = ThisDrawing.PickfirstSelectionSet
    For Each ssobject In pfSS
        msg = msg & vbCrLf & ssobject.ObjectName
    Next ssobject
    MsgBox "The Pickfirst selection set contains: " & msg

End Sub


PickGroup Example [ActiveX and VBA Reference: AAR]

PickGroup Example

Using Programming Languages other than VBA

Sub Example_PickGroup()
    ' This example reads and modifies the preference value that
    ' determines if picking a single object in a group selects the entire group.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSelection
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    ' Read and display the original value
    originalValue = ACADPref.PickGroup
    MsgBox "The PickGroup preference is set to: " & originalValue

    ' Modify the PickGroup preference by toggling the value
    ACADPref.PickGroup = Not (ACADPref.PickGroup)
    newValue = ACADPref.PickGroup
    MsgBox "The PickGroup preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PickGroup = originalValue
    MsgBox "The PickGroup preference was reset back to: " & originalValue
End Sub


Plot Example [ActiveX and VBA Reference: AAR]

Plot Example

Using Programming Languages other than VBA

Sub Example_Plot()
    ' This example sends a plot of the current drawing
    ' to a file.

    ' Define the plot variable
    Dim currentPlot As ACADPlot
    Set currentPlot = ThisDrawing.Plot

    ' Define the output file name.
    ' Use "" to use the drawing name as the file name.
    ' Note: if the file name exists an error will be generated.
    Dim plotFileName As String
    plotFileName = "MyPlot"

    currentPlot.PlotToFile (plotFileName)

End Sub


PlotConfigurations Example [ActiveX and VBA Reference: AAR]

PlotConfigurations Example

Using Programming Languages other than VBA

Sub Example_PlotConfigurations()
    ' This example will access the PlotConfigurations collection for the current drawing,
    ' add a plot configuration, and list basic information about the
    ' plot configurations in the drawing.

    Dim PlotConfigurations As AcadPlotConfigurations
    Dim PlotConfiguration As AcadPlotConfiguration
    Dim msg As String

    ' Get PlotConfigurations collection from document object
    Set PlotConfigurations = ThisDrawing.PlotConfigurations

    ' If there aren't any plot configurations, then add one
    If PlotConfigurations.count = 0 Then
        '*** Customize the new configuration to your satisfaction ***
        PlotConfigurations.Add "NEW_CONFIGURATION"
    End If

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the names of the plot configurations in this drawing
    For Each PlotConfiguration In PlotConfigurations
        msg = msg & PlotConfiguration.name & vbCrLf
    Next

    ' Display a list of available plot configurations
    MsgBox "There are " & PlotConfigurations.count & " plot configuration(s) in " & _
            ThisDrawing.WindowTitle & ":" & msg
End Sub


PlotHidden Example [ActiveX and VBA Reference: AAR]

PlotHidden Example

Using Programming Languages other than VBA

Sub Example_PlotHidden()
    ' This example will access the Layouts collection for the current drawing
    ' and display whether the objects for each layout are to be hidden during a plot.
    ' It will then toggle the state of PlotHidden for "Layout1" and re-display the
    ' PlotHidden state for each Layout.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim IsHidden As String

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    ' Display current hidden information
    GoSub DISPLAY

    ' Toggle object hidden state for Layout1
    Layouts("Layout1").PlotHidden = Not (Layouts("Layout1").PlotHidden)

    ' Display new hidden information
    GoSub DISPLAY

    Exit Sub

DISPLAY:
    msg = ""    ' Clear message

    ' Determine whether the objects for each layout are hidden during a plot
    For Each Layout In Layouts
        ' Are these objects hidden?
        IsHidden = IIf(Layout.PlotHidden, " are hidden ", " are not hidden ")

        ' Format for display
        msg = msg & "Objects for " & Layout.name & IsHidden & "during a plot." & vbCrLf
    Next

    ' Display layout information
    MsgBox msg

    Return
End Sub


PlotLegacy Example [ActiveX and VBA Reference: AAR]

PlotLegacy Example

Using Programming Languages other than VBA

Sub Example_PlotLegacy()
    ' This example reads and modifies the PlotLegacy
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Boolean

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.PlotLegacy
    MsgBox "The PlotLegacy preference is set to: " & originalValue

    ' Modify the PlotLegacy preference by toggling the value
    ACADPref.PlotLegacy = Not ACADPref.PlotLegacy

    MsgBox "The PlotLegacy preference has been set to: " & ACADPref.PlotLegacy

    ' Reset the preference back to its original value
    ACADPref.PlotLegacy = originalValue
    MsgBox "The PlotLegacy preference was reset back to: " & originalValue
End Sub


PlotLogFilePath Example [ActiveX and VBA Reference: AAR]

PlotLogFilePath Example

Using Programming Languages other than VBA

Sub Example_PlotLogFilePath()
' Note: Change the path to a valid folder on your system.

    Dim MyPreference As IAcadPreferencesFiles2
    Set MyPreference = AcadApplication.Preferences.Files
    MyPreference.PlotLogFilePath = "C:\Plots"

End Sub


PlotOrigin Example [ActiveX and VBA Reference: AAR]

PlotOrigin Example

Using Programming Languages other than VBA

Sub Example_PlotOrigin()
    ' This example reads and modifies the PlotOrigin
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Variant
    Dim newValue(0 To 1) As Double

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotOrigin
    MsgBox "The PlotOrigin value is set to: " & originalValue(0) & " ," & originalValue(1)

    ' Modify the PlotOrigin preference by toggling the value
    newValue(0) = originalValue(0) + 20
    newValue(1) = originalValue(1) - 20
    ACADLayout.PlotOrigin = newValue
    MsgBox "The PlotOrigin value is set to: " & newValue(0) & " ," & newValue(1)

    ' Reset the preference back to its original value
    ACADLayout.PlotOrigin = originalValue
    MsgBox "The PlotOrigin value is set to: " & originalValue(0) & " ," & originalValue(1)
End Sub


PlotPolicy Example [ActiveX and VBA Reference: AAR]

PlotPolicy Example

Using Programming Languages other than VBA

Sub Example_PlotPolicy()
    ' This example reads and modifies the PlotPolicy
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.PlotPolicy
    MsgBox "The PlotPolicy preference is set to: " & originalValue

    ' Modify the PlotPolicy preference by toggling the value
    ACADPref.PlotPolicy = acPolicyNamed
    MsgBox "The PlotPolicy preference has been set to: " & ACADPref.PlotPolicy

    ' Reset the preference back to its original value
    ACADPref.PlotPolicy = originalValue
    MsgBox "The PlotPolicy preference was reset back to: " & originalValue
End Sub


PlotRotation Example [ActiveX and VBA Reference: AAR]

PlotRotation Example

Using Programming Languages other than VBA

Sub Example_PlotRotation()
    ' This example reads and modifies the PlotRotation
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Integer

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotRotation
    MsgBox "The PlotRotation value is set to: " & originalValue

    ' Modify the PlotRotation preference by toggling the value
    ACADLayout.PlotRotation = ac180degrees
    MsgBox "The PlotRotation preference has been set to: " & ACADLayout.PlotRotation

    ' Reset the preference back to its original value
    ACADLayout.PlotRotation = originalValue
    MsgBox "The PlotRotation preference was reset back to: " & originalValue
End Sub


PlotStyleName Example [ActiveX and VBA Reference: AAR]

PlotStyleName Example

Using Programming Languages other than VBA

Sub Example_PlotStyleName()
    ' This example creates a circle in model space and then
    ' finds the current PlotStyleName for the circle.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll

    ' Find the PlotStyleName for the circle
    MsgBox "The current PlotStyleName for the circle is " & circleObj.PlotStyleName

End Sub


Plottable Example [ActiveX and VBA Reference: AAR]

Plottable Example

Using Programming Languages other than VBA

Sub Example_Plottable()
    ' This example creates a new layer called "New_Layer".  It then uses
    ' the Plottable property of each Layer to display whether or not that layer
    ' is plottable.  The user has the ability to toggle the plottable state
    ' for each layer, and the final plottable status for all layers is displayed.

    Dim layerObj As AcadLayer, tempLayer As AcadLayer
    Dim msg As String

    ' Add the layer to the layers collection
    Set layerObj = ThisDrawing.Layers.Add("New_Layer")

    ' Make the new layer the active layer for the drawing
    ThisDrawing.ActiveLayer = layerObj

    ' Cycle through the layers and allow user to make them plottable or not

    For Each tempLayer In ThisDrawing.Layers
        If tempLayer.Plottable Then     ' Determine if this layer is plottable
            If MsgBox("The layer '" & tempLayer.name & "' will plot.  Would you like to turn off plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.Plottable = False     ' Change plottable state
            End If
        Else
            If MsgBox("The layer '" & tempLayer.name & "' will not plot.  Would you like to turn on plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.Plottable = True      ' Change plottable state
            End If
        End If
    Next

    ' Display the new plottable status of the layers in this drawing

    For Each tempLayer In ThisDrawing.Layers
        ' Determine if this layer is plottable
        If tempLayer.Plottable Then
            msg = msg & "The layer '" & tempLayer.name & "' will plot." & vbCrLf
        Else
            msg = msg & "The layer '" & tempLayer.name & "' will not plot." & vbCrLf
        End If
    Next

    MsgBox msg
End Sub


PlotToDevice Example [ActiveX and VBA Reference: AAR]

PlotToDevice Example

Using Programming Languages other than VBA

Sub Example_PlotToDevice()
    ' This example sends a plot of the current drawing
    ' to the default device for your system.

    ThisDrawing.Plot.PlotToDevice

End Sub


PlotToFile Example [ActiveX and VBA Reference: AAR]

PlotToFile Example

Using Programming Languages other than VBA

Sub Example_PlotToFile()
    ' This example sends a plot of the current drawing
    ' to a file.

    ' Define the output file name.
    ' Use "" to use the drawing name as the file name.
    Dim plotFileName As String
    plotFileName = "MyPlot"

    Dim result As Boolean

    result = ThisDrawing.Plot.PlotToFile(plotFileName)

End Sub


PlotType Example [ActiveX and VBA Reference: AAR]

PlotType Example

Using Programming Languages other than VBA

Sub Example_PlotType()
    ' This example reads and modifies the PlotType
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Integer

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotType
    MsgBox "The PlotType value is set to: " & originalValue

    ' Modify the PlotType preference by toggling the value
    ACADLayout.PlotType = acExtents
    MsgBox "The PlotType preference has been set to: " & ACADLayout.PlotType

    ' Reset the preference back to its original value
    ACADLayout.PlotType = originalValue
    MsgBox "The PlotType preference was reset back to: " & originalValue
End Sub


PlotViewportBorders Example [ActiveX and VBA Reference: AAR]

PlotViewportBorders Example

Using Programming Languages other than VBA

Sub Example_PlotViewportBorders()
    ' This example reads and modifies the PlotViewportBorders
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotViewportBorders
    MsgBox "The PlotViewportBorders value is set to: " & originalValue

    ' Modify the PlotViewportBorders preference by toggling the value
    ACADLayout.PlotViewportBorders = Not ACADLayout.PlotViewportBorders
    MsgBox "The PlotViewportBorders preference has been set to: " & ACADLayout.PlotViewportBorders

    ' Reset the preference back to its original value
    ACADLayout.PlotViewportBorders = originalValue
    MsgBox "The PlotViewportBorders preference was reset back to: " & originalValue
End Sub


PlotViewportsFirst Example [ActiveX and VBA Reference: AAR]

PlotViewportsFirst Example

Using Programming Languages other than VBA

Sub Example_PlotViewportsFirst()
    ' This example reads and modifies the PlotViewportsFirst
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotViewportsFirst
    MsgBox "The PlotViewportsFirst value is set to: " & originalValue

    ' Modify the PlotViewportsFirst preference by toggling the value
    ACADLayout.PlotViewportsFirst = Not ACADLayout.PlotViewportsFirst
    MsgBox "The PlotViewportsFirst preference has been set to: " & ACADLayout.PlotViewportsFirst

    ' Reset the preference back to its original value
    ACADLayout.PlotViewportsFirst = originalValue
    MsgBox "The PlotViewportsFirst preference was reset back to: " & originalValue
End Sub


PlotWithLineweights Example [ActiveX and VBA Reference: AAR]

PlotWithLineweights Example

Using Programming Languages other than VBA

Sub Example_PlotWithLineweights()
    ' This example reads and modifies the PlotWithLineweights
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotWithLineweights
    MsgBox "The PlotWithLineweights value is set to: " & originalValue

    ' Modify the PlotWithLineweights preference by toggling the value
    ACADLayout.PlotWithLineweights = Not ACADLayout.PlotWithLineweights
    MsgBox "The PlotWithLineweights preference has been set to: " & ACADLayout.PlotWithLineweights

    ' Reset the preference back to its original value
    ACADLayout.PlotWithLineweights = originalValue
    MsgBox "The PlotWithLineweights preference was reset back to: " & originalValue
End Sub


PlotWithPlotStyles Example [ActiveX and VBA Reference: AAR]

PlotWithPlotStyles Example

Using Programming Languages other than VBA

Sub Example_ShowPlotStyles()
    ' This example reads and changes the PlotWithPlotStyles
    ' value, and shows a plot preview so the user can see the change.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.PlotWithPlotStyles
    MsgBox "The PlotWithPlotStyles value is set to: " & originalValue

    ' Modify the PlotWithPlotStyles preference by changing the value
    ACADLayout.PlotWithPlotStyles = Not ACADLayout.PlotWithPlotStyles
    MsgBox "The PlotWithPlotStyles preference has been set to: " & ACADLayout.PlotWithPlotStyles

    'Show plot preview
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview

End Sub


PolarPoint Example [ActiveX and VBA Reference: AAR]

PolarPoint Example

Using Programming Languages other than VBA

Sub Example_PolarPoint()
    ' This example finds the coordinate of a point that is a given
    ' distance and angle from a base point.

    Dim polarPnt As Variant
    Dim basePnt(0 To 2) As Double
    Dim angle As Double
    Dim distance As Double

    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    angle = 0.1744444   ' 45 degrees
    distance = 5
    polarPnt = ThisDrawing.Utility.PolarPoint(basePnt, angle, distance)

    ' Create a line from the base point to the polar point
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, polarPnt)
    ZoomAll

End Sub


PolarTrackingVector Example [ActiveX and VBA Reference: AAR]

PolarTrackingVector Example

Using Programming Languages other than VBA

Sub Example_PolarTrackingVector()
    ' This example reads and modifies the preference value that controls
    ' the display of polar tracking vectors.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesDrafting
    Dim originalValue As Variant, newValue As Variant

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Drafting

    ' Read and display the original value
    originalValue = ACADPref.PolarTrackingVector
    MsgBox "The PolarTrackingVector preference is set to: " & originalValue

    ' Modify the PolarTrackingVector preference by toggling the value
    ACADPref.PolarTrackingVector = Not (originalValue)
    newValue = ACADPref.PolarTrackingVector
    MsgBox "The PolarTrackingVector preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PolarTrackingVector = originalValue
    MsgBox "The PolarTrackingVector preference was reset back to: " & originalValue
End Sub


PostScriptPrologFile Example [ActiveX and VBA Reference: AAR]

PostScriptPrologFile Example

Using Programming Languages other than VBA

Sub Example_PostScriptPrologFile()
    ' This example returns the current setting of
    ' PostScriptPrologFile. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currPostScriptPrologFile As String
    Dim newPostScriptPrologFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current PostScriptPrologFile value
    currPostScriptPrologFile = preferences.Files.PostScriptPrologFile
    If currPostScriptPrologFile = "" Then
        MsgBox "PostScriptPrologFile is not currently set.", vbInformation, "PostScriptPrologFile Example"
    Else
        MsgBox "The current value for PostScriptPrologFile is " & currPostScriptPrologFile, vbInformation, "PostScriptPrologFile Example"
    End If

    ' Change the value for PostScriptPrologFile
    newPostScriptPrologFile = "TestPostScriptPrologFile"
    preferences.Files.PostScriptPrologFile = newPostScriptPrologFile
    MsgBox "The new value for PostScriptPrologFile is " & newPostScriptPrologFile, vbInformation, "PostScriptPrologFile Example"

    ' Reset PostScriptPrologFile to its original value
    preferences.Files.PostScriptPrologFile = currPostScriptPrologFile
    If currPostScriptPrologFile = "" Then
        MsgBox "PostScriptPrologFile is reset to NULL.", vbInformation, "PostScriptPrologFile Example"
    Else
        MsgBox "The PostScriptPrologFile value is reset to " & currPostScriptPrologFile, vbInformation, "PostScriptPrologFile Example"
    End If
End Sub


Preferences Example [ActiveX and VBA Reference: AAR]

Preferences Example

Using Programming Languages other than VBA

Sub Example_Preferences()
    ' This example returns the current setting of
    ' LogFilePath from the preferences object.

    Dim preferences As AcadPreferences
    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current LogFilePath value
    MsgBox "The current value for LogFilePath is " & preferences.Files.LogFilePath, , "Preferences Example"

End Sub


Preset Example [ActiveX and VBA Reference: AAR]

Preset Example

Using Programming Languages other than VBA

Sub Example_Preset()
    ' This example creates a block containing an attribute definition.
    ' Initially, the attribute has the preset flag turned on and will display a preset
    ' value for the attribute when the parent block is inserted as a reference.
    '
    ' Every time the example is run, attempt to find the attribute and
    ' toggle the Preset value.
    '
    ' * Note: After running this example for the first time, select the menu "Insert/Block..."
    ' and create a block reference from "Block-PRESET".  You will see
    ' the preset value display for the attribute when the blockref is displayed.
    '
    ' Then run the example again and repeat the block insert.  Notice this time that the
    ' preset has been turned off, and you are now prompted for the attribute value.

    Dim attributeObj As AcadAttribute
    Dim height As Double, mode As Long, prompt As String, tag As String, value As String
    Dim AttrInsertionPoint(0 To 2) As Double
    Dim BlockInsertionPoint(0 To 2) As Double
    Dim newBlock As AcadBlock
    Dim IsPreset As String

    ' Determine if this block has already been created.  If so, get the block and
    ' the attribute inside; otherwise, create a new block containing an
    ' attribute.
    On Error Resume Next

    Set newBlock = ThisDrawing.Blocks("Block-PRESET")

    If Err = 0 Then         ' The example block has been created
        Set attributeObj = newBlock.Item(0)                 ' Get only object in example block

        attributeObj.Preset = Not (attributeObj.Preset)     ' Toggle the attribute preset value

    ElseIf Err <> 0 Then    ' The example block has not been created

        ' Create a new block to hold the Attribute object
        BlockInsertionPoint(0) = 0: BlockInsertionPoint(1) = 0: BlockInsertionPoint(2) = 0
        Set newBlock = ThisDrawing.Blocks.Add(BlockInsertionPoint, "Block-PRESET")

        ' Define the attribute definition
        AttrInsertionPoint(0) = 0: AttrInsertionPoint(1) = 0: AttrInsertionPoint(2) = 0
        height = 1#:
        mode = acAttributeModePreset
        prompt = "New Prompt"
        tag = "New Tag": value = "Preset"

        ' Add attribute definition object to new block
        Set attributeObj = newBlock.AddAttribute(height, mode, prompt, AttrInsertionPoint, tag, value)

    End If

    On Error GoTo 0

    ' Read the attribute back and display information
    IsPreset = IIf(attributeObj.Preset, "has a preset value of: " & attributeObj.textString, _
                   "does not have a preset value")

    MsgBox "The block attribute " & IsPreset, vbInformation
End Sub


PrimaryUnitsPrecision Example [ActiveX and VBA Reference: AAR]

PrimaryUnitsPrecision Example

Using Programming Languages other than VBA

Sub Example_PrimaryUnitsPrecision()
   ' This example creates an aligned dimension in model space and
   ' uses PrimaryUnitsPrecision to allow the user to change
   ' the number of decimal places displayed for the primary units and tolerance
   ' units of the dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim oldPrecision As String, newPrecision As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical
    dimObj.ToleranceLowerLimit = -0.0001
    dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Application.ZoomAll

    ' Store old precision value as default for input box
    oldPrecision = dimObj.PrimaryUnitsPrecision

    ' Allow the user to change the precision for the dimension and dimension tolerance
    newPrecision = InputBox("Enter a new precision for the dimension and tolerances.  The value must range from 0 to 8.", "Change Precision", oldPrecision)

    Select Case newPrecision
        Case 0: newPrecision = acDimPrecisionZero
        Case 1: newPrecision = acDimPrecisionOne
        Case 2: newPrecision = acDimPrecisionTwo
        Case 3: newPrecision = acDimPrecisionThree
        Case 4: newPrecision = acDimPrecisionFour
        Case 5: newPrecision = acDimPrecisionFive
        Case 6: newPrecision = acDimPrecisionSix
        Case 7: newPrecision = acDimPrecisionSeven
        Case 8: newPrecision = acDimPrecisionEight
        Case Else
            MsgBox "The precision has not been changed."
            Exit Sub
    End Select

    ' Change the dimension and tolerance precision
    dimObj.TolerancePrecision = newPrecision
    dimObj.PrimaryUnitsPrecision = newPrecision

    ThisDrawing.Regen acAllViewports

    ' Read back and display the dimension and dimension tolerance precision
    newPrecision = dimObj.PrimaryUnitsPrecision
    MsgBox "The precision has been set to " & newPrecision & " decimal places"
End Sub


PrincipalDirections Example [ActiveX and VBA Reference: AAR]

PrincipalDirections Example

Using Programming Languages other than VBA

Sub Example_PrincipalDirections()
    ' This example creates a box in model space.
    ' It then returns the PrincipalDirections for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the PrincipalDirections for the box
    Dim PrincipalDirections As Variant
    PrincipalDirections = boxObj.PrincipalDirections
    MsgBox "The PrincipalDirections for the box are " & PrincipalDirections(0) & ", " & PrincipalDirections(1) & ", " & PrincipalDirections(2), , "PrincipalDirections Example"

End Sub


PrincipalMoments Example [ActiveX and VBA Reference: AAR]

PrincipalMoments Example

Using Programming Languages other than VBA

Sub Example_PrincipalMoments()
    ' This example creates a box in model space.
    ' It then returns the PrincipalMoments for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the PrincipalMoments for the box
    Dim PrincipalMoments As Variant
    PrincipalMoments = boxObj.PrincipalMoments
    MsgBox "The PrincipalMoments for the box are " & PrincipalMoments(0) & ", " & PrincipalMoments(1) & ", " & PrincipalMoments(2), , "PrincipalMoments Example"

End Sub


PrinterConfigPath Example [ActiveX and VBA Reference: AAR]

PrinterConfigPath Example

Using Programming Languages other than VBA

Sub Example_PrinterConfigPath()
    ' This example reads and modifies the preference value that controls
    ' the location for printer configuration files.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesFiles
    Dim originalValue As Variant, newValue As Variant

    ' Get the files preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    ' Read and display the original value
    originalValue = ACADPref.PrinterConfigPath
    MsgBox "The PrinterConfigPath preference is set to: " & originalValue

    ' Modify the PrinterConfigPath preference by changing the path to "C:\"
    ACADPref.PrinterConfigPath = "C:\"
    newValue = ACADPref.PrinterConfigPath
    MsgBox "The PrinterConfigPath preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PrinterConfigPath = originalValue
    MsgBox "The PrinterConfigPath preference was reset back to: " & originalValue
End Sub


PrinterDescPath Example [ActiveX and VBA Reference: AAR]

PrinterDescPath Example

Using Programming Languages other than VBA

Sub Example_PrinterDescPath()
    ' This example reads and modifies the preference value that controls
    ' the location for printer description files.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesFiles
    Dim originalValue As Variant, newValue As Variant

    ' Get the files preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    ' Read and display the original value
    originalValue = ACADPref.PrinterDescPath
    MsgBox "The PrinterDescPath preference is set to: " & originalValue

    ' Modify the PrinterDescPath preference by changing the path to "C:\"
    ACADPref.PrinterDescPath = "C:\"
    newValue = ACADPref.PrinterDescPath
    MsgBox "The PrinterDescPath preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PrinterDescPath = originalValue
    MsgBox "The PrinterDescPath preference was reset back to: " & originalValue
End Sub


PrinterPaperSizeAlert Example [ActiveX and VBA Reference: AAR]

PrinterPaperSizeAlert Example

Using Programming Languages other than VBA

Sub Example_PrinterPaperSizeAlert()
    ' This example reads and modifies the PrinterPaperSizeAlert
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Boolean

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.PrinterPaperSizeAlert
    MsgBox "The PrinterPaperSizeAlert preference is set to: " & originalValue

    ' Modify the PrinterPaperSizeAlert preference by toggling the value
    ACADPref.PrinterPaperSizeAlert = Not ACADPref.PrinterPaperSizeAlert

    MsgBox "The PrinterPaperSizeAlert preference has been set to: " & ACADPref.PrinterPaperSizeAlert

    ' Reset the preference back to its original value
    ACADPref.PrinterPaperSizeAlert = originalValue
    MsgBox "The PrinterPaperSizeAlert preference was reset back to: " & originalValue
End Sub


PrinterSpoolAlert Example [ActiveX and VBA Reference: AAR]

PrinterSpoolAlert Example

Using Programming Languages other than VBA

Sub Example_PrinterSpoolAlert()
    ' This example reads and modifies the PrinterSpoolAlert
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.PrinterSpoolAlert
    MsgBox "The PrinterSpoolAlert preference is set to: " & originalValue

    ' Modify the PrinterSpoolAlert preference by toggling the value
    ACADPref.PrinterSpoolAlert = acPrinterNeverAlert
    MsgBox "The PrinterSpoolAlert preference has been set to: " & ACADPref.PrinterSpoolAlert

    ' Reset the preference back to its original value
    ACADPref.PrinterSpoolAlert = originalValue
    MsgBox "The PrinterSpoolAlert preference was reset back to: " & originalValue
End Sub


PrinterStyleSheetPath Example [ActiveX and VBA Reference: AAR]

PrinterStyleSheetPath Example

Using Programming Languages other than VBA

Sub Example_PrinterStyleSheetPath()
    ' This example reads and modifies the preference value that controls
    ' the location for printer style sheet files.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesFiles
    Dim originalValue As Variant, newValue As Variant

    ' Get the files preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    ' Read and display the original value
    originalValue = ACADPref.PrinterStyleSheetPath
    MsgBox "The PrinterStyleSheetPath preference is set to: " & originalValue

    ' Modify the PrinterStyleSheetPath preference by changing the path to "C:\"
    ACADPref.PrinterStyleSheetPath = "C:\"
    newValue = ACADPref.PrinterStyleSheetPath
    MsgBox "The PrinterStyleSheetPath preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.PrinterStyleSheetPath = originalValue
    MsgBox "The PrinterStyleSheetPath preference was reset back to: " & originalValue
End Sub


PrintFile Example [ActiveX and VBA Reference: AAR]

PrintFile Example

Using Programming Languages other than VBA

Sub Example_PrintFile()
    ' This example returns the current setting of
    ' PrintFile. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currPrintFile As String
    Dim newPrintFile As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current PrintFile value
    currPrintFile = preferences.Files.PrintFile
    MsgBox "The current value for PrintFile is " & currPrintFile, vbInformation, "PrintFile Example"

    ' Change the value for PrintFile
    newPrintFile = "TestPrintFile.plt"
    preferences.Files.PrintFile = newPrintFile
    MsgBox "The new value for PrintFile is " & newPrintFile, vbInformation, "PrintFile Example"

    ' Reset PrintFile to its original value
    preferences.Files.PrintFile = currPrintFile
    MsgBox "The PrintFile value is reset to " & currPrintFile, vbInformation, "PrintFile Example"
End Sub


PrintSpoolerPath Example [ActiveX and VBA Reference: AAR]

PrintSpoolerPath Example

Using Programming Languages other than VBA

Sub Example_PrintSpoolerPath()
    ' This example returns the current setting of
    ' PrintSpoolerPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currPrintSpoolerPath As String
    Dim newPrintSpoolerPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current PrintSpoolerPath value
    currPrintSpoolerPath = preferences.Files.PrintSpoolerPath
    MsgBox "The current value for PrintSpoolerPath is " & currPrintSpoolerPath, vbInformation, "PrintSpoolerPath Example"

    ' Change the value for PrintSpoolerPath
    newPrintSpoolerPath = "TestPrintSpoolerPath"
    preferences.Files.PrintSpoolerPath = newPrintSpoolerPath
    MsgBox "The new value for PrintSpoolerPath is " & newPrintSpoolerPath, vbInformation, "PrintSpoolerPath Example"

    ' Reset PrintSpoolerPath to its original value
    preferences.Files.PrintSpoolerPath = currPrintSpoolerPath
    MsgBox "The PrintSpoolerPath value is reset to " & currPrintSpoolerPath, vbInformation, "PrintSpoolerPath Example"
End Sub


PrintSpoolExecutable Example [ActiveX and VBA Reference: AAR]

PrintSpoolExecutable Example

Using Programming Languages other than VBA

Sub Example_PrintSpoolExecutable()
    ' This example returns the current setting of
    ' PrintSpoolExecutable. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currPrintSpoolExecutable As String
    Dim newPrintSpoolExecutable As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current PrintSpoolExecutable value
    currPrintSpoolExecutable = preferences.Files.PrintSpoolExecutable
    MsgBox "The current value for PrintSpoolExecutable is " & currPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"

    ' Change the value for PrintSpoolExecutable
    newPrintSpoolExecutable = "TestPrintSpoolExecutable"
    preferences.Files.PrintSpoolExecutable = newPrintSpoolExecutable
    MsgBox "The new value for PrintSpoolExecutable is " & newPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"

    ' Reset PrintSpoolExecutable to its original value
    preferences.Files.PrintSpoolExecutable = currPrintSpoolExecutable
    MsgBox "The PrintSpoolExecutable value is reset to " & currPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"
End Sub


ProductOfInertia Example [ActiveX and VBA Reference: AAR]

ProductOfInertia Example

Using Programming Languages other than VBA

Sub Example_ProductOfInertia()
    ' This example creates a box in model space.
    ' It then returns the ProductOfInertia for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the ProductOfInertia for the box
    Dim ProductOfInertia As Variant
    ProductOfInertia = boxObj.ProductOfInertia
    MsgBox "The ProductOfInertia for the box is " & ProductOfInertia(0) & ", " & ProductOfInertia(1) & ", " & ProductOfInertia(2), , "ProductOfInertia Example"

End Sub


Profiles Example [ActiveX and VBA Reference: AAR]

Profiles Example

Using Programming Languages other than VBA

Sub Example_Profiles()
    ' This example obtains a reference to the Profiles Preferences object
    ' from the Application Preferences object, and reads one of the Profiles
    ' preferences

    Dim ACADPref As AcadPreferencesProfiles

    ' Obtain a reference to the Profiles Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Profiles

    MsgBox "You now have access to the properties and methods of the Profiles Preferences object!"
    MsgBox "The Profiles preference ActiveProfile is set to: " & ACADPref.ActiveProfile

    ' Release Profiles Preferences object
    Set ACADPref = Nothing
    MsgBox "The Profiles Preferences object has been released!"
End Sub


Prompt Example [ActiveX and VBA Reference: AAR]

Prompt Example

Using Programming Languages other than VBA

Sub Example_Prompt()
    ' This example will use the Utility object to display a prompt to the
    ' AutoCAD command line.  To see the results after running the example,
    ' switch to AutoCAD and look at the command line.

    ThisDrawing.Utility.prompt "Press any key..."
End Sub


PromptString Example [ActiveX and VBA Reference: AAR]

PromptString Example

Using Programming Languages other than VBA

Sub Example_PromptString()
    ' This example creates an attribute definition in a block.
    ' It then inserts the block. Then it changes the prompt string
    ' of the attribute definition, and inserts the block again.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "TEST")

    ' Add a circle to block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Define the attribute definition
    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Integer
    Dim prompt As String
    Dim tag As String
    Dim value As String

    height = 1#
    mode = acAttributeModeVerify
    prompt = "Enter value:"
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0
    tag = "Tag1"
    value = "Circle1"

    ' Create the attribute definition on the block
    Set attributeObj = blockObj.AddAttribute(height, mode, prompt, insertionPnt, tag, value)

    ' Insert the block
    Dim blockRefObj1 As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj1 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "TEST", 1#, 1#, 1#, 0)

    ' Change the prompt string and tag of the attribute definition
    attributeObj.PromptString = "Verify value:"

    ' Insert the block again
    Dim blockRefObj2 As AcadBlockReference
    insertionPnt(0) = 4#: insertionPnt(1) = 4#: insertionPnt(2) = 0
    Set blockRefObj2 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "TEST", 1#, 1#, 1#, 0)

    ZoomAll

End Sub


ProviderName Example [ActiveX and VBA Reference: AAR]

ProviderName Example

Using Programming Languages other than VBA

Sub Example_ProviderName()
    ' This example encrypts and saves a file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp

End Sub


ProviderType Example [ActiveX and VBA Reference: AAR]

ProviderType Example

Using Programming Languages other than VBA

Sub Example_ProviderType()
    ' This example encrypts and saves a file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp

End Sub


ProxyImage Example [ActiveX and VBA Reference: AAR]

ProxyImage Example

Using Programming Languages other than VBA

Sub Example_ProxyImage()
    ' This example returns the current setting of
    ' ProxyImage. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currProxyImage As Integer
    Dim constant As String
    Dim newConstant As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ProxyImage value
    currProxyImage = preferences.OpenSave.ProxyImage
    constant = Choose(currProxyImage + 1, "acProxyNotShow", "acProxyShow", "acProxyBoundingBox")
    MsgBox "The current value for ProxyImage is " & constant, vbInformation, "ProxyImage Example"

    ' Change the value for ProxyImage
    newConstant = "acProxyBoundingBox"
    preferences.OpenSave.ProxyImage = acProxyBoundingBox
    MsgBox "The new value for ProxyImage is " & newConstant, vbInformation, "ProxyImage Example"

    ' Reset ProxyImage to its original value
    preferences.OpenSave.ProxyImage = currProxyImage
    MsgBox "The ProxyImage value is reset to " & constant, vbInformation, "ProxyImage Example"
End Sub


PurgeAll Example [ActiveX and VBA Reference: AAR]

PurgeAll Example

Using Programming Languages other than VBA

Sub Example_PurgeAll()
    ' This example removes all unused named references from the database

    ThisDrawing.PurgeAll

End Sub


PurgeFitData Example [ActiveX and VBA Reference: AAR]

PurgeFitData Example

Using Programming Languages other than VBA

Sub Example_PurgeFitData()
    ' This example creates a spline object in model space.
    ' It then returns the current number of fit points,
    ' and then purges the fit data.

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    MsgBox "Before the purge there are " & splineObj.NumberOfFitPoints & " fit points.", , "PurgeFitData Example"

    ' Purge the fit data
    splineObj.PurgeFitData

    ThisDrawing.Regen True
    MsgBox "After the purge there are " & splineObj.NumberOfFitPoints & " fit points.", , "PurgeFitData Example"

End Sub


PutRemoteFile Example [ActiveX and VBA Reference: AAR]

PutRemoteFile Example

Using Programming Languages other than VBA

Sub Example_PutRemoteFile()
    ' This example transfers a local file to a remote URL.  Since this example
    ' relies on both a remote server name and a local file, you will have to
    ' modify both the DestURL and LocalFile variables below to run this example.

    Dim DestURL As String, LocalFile As String

    ' Define source and destination
    DestURL = "ftp://www.myserver.com/autocadfiles/"
    LocalFile = "c:\program files\autocad\sample\city map.dwg"

    ' Transfer local file to remote location
    ThisDrawing.Utility.PutRemoteFile DestURL, LocalFile

    MsgBox LocalFile & " was just transfered to: " & DestURL
End Sub


QNewTemplateFile Example [ActiveX and VBA Reference: AAR]

QNewTemplateFile Example

Using Programming Languages other than VBA

Sub Example_QNewTemplateFile()
    ' This example uses a template file named MyTemplate.dwt to
    ' set a default template for the QNEW command.
    ' You should change the example to use
    ' a template file on your computer.

    Dim MyTemplate As IAcadPreferencesFiles2
    Set MyTemplate = AcadApplication.Preferences.Files
    MyTemplate.QNewTemplateFile = "C:\MainTemplate.dwt"

End Sub


QuietErrorMode Example [ActiveX and VBA Reference: AAR]

QuietErrorMode Example

Using Programming Languages other than VBA

Sub Example_QuietErrorMode()
' This example plots the layouts of a drawing.

    Dim oPlot As AcadPlot
    Dim AddedLayouts() As String
    Dim LayoutList As Variant
    Dim oLayout As AcadLayout
    Dim ArraySize As Integer, BatchCount As Integer

    For Each oLayout In ThisDrawing.Layouts
        ArraySize = ArraySize + 1
        ReDim Preserve AddedLayouts(1 To ArraySize)
        AddedLayouts(ArraySize) = oLayout.Name
    Next

    LayoutList = AddedLayouts
    Set oPlot = ThisDrawing.Plot
    oPlot.SetLayoutsToPlot LayoutList
    oPlot.PlotToDevice  "dwf6 eplot.pc3"
End Sub


Quit Example [ActiveX and VBA Reference: AAR]

Quit Example

Using Programming Languages other than VBA

Sub Example_Quit()
    ' Warning: This example will quit AutoCAD and VBA.

    ThisDrawing.Application.Quit

End Sub


RadiiOfGyration Example [ActiveX and VBA Reference: AAR]

RadiiOfGyration Example

Using Programming Languages other than VBA

Sub Example_RadiiOfGyration()
    ' This example creates a box in model space.
    ' It then returns the RadiiOfGyration for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport for a better view of the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the RadiiOfGyration for the box
    Dim RadiiOfGyration As Variant
    RadiiOfGyration = boxObj.RadiiOfGyration
    MsgBox "The RadiiOfGyration for the box is " & RadiiOfGyration(0) & ", " & RadiiOfGyration(1) & ", " & RadiiOfGyration(2), , "RadiiOfGyration Example"

End Sub


Radius Example [ActiveX and VBA Reference: AAR]

Radius Example

Using Programming Languages other than VBA

Sub Example_Radius()
    ' This example creates an arc in model space.
    ' It then returns the radius of the arc.
    Dim arcObj As AcadArc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngleInDegree As Double
    Dim endAngleInDegree As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#
    startAngleInDegree = 10#
    endAngleInDegree = 230#

    ' Convert the angles in degrees to angles in radians
    Dim startAngleInRadian As Double
    Dim endAngleInRadian As Double
    startAngleInRadian = startAngleInDegree * 3.141592 / 180#
    endAngleInRadian = endAngleInDegree * 3.141592 / 180#

    ' Create the arc object in model space
    Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
    ZoomAll

    ' Find the radius of the arc
    radius = arcObj.radius
    MsgBox "The radius of the arc is " & arcObj.radius, , "Radius Example"

End Sub


RadiusRatio Example [ActiveX and VBA Reference: AAR]

RadiusRatio Example

Using Programming Languages other than VBA

Sub Example_RadiusRatio()
    ' This example creates an ellipse and finds the radius ratio
    ' for that ellipse. It then changes the radius ratio to 0.75.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
    ZoomAll
    MsgBox "This ellipse has a radius ratio of " & ellObj.RadiusRatio, vbInformation, "RadiusRatio Example"

    ' Change the radius ratio of the ellipse
    radRatio = 0.75
    ellObj.RadiusRatio = radRatio
    ellObj.Update
    MsgBox "The ellipse has been udpated with the radius ratio of " & ellObj.RadiusRatio, vbInformation, "RadiusRatio Example"
End Sub


ReadOnly Example [ActiveX and VBA Reference: AAR]

ReadOnly Example

Using Programming Languages other than VBA

Sub Example_ReadOnly()
    ' This example shows if current drawing file is read only or not

    If ThisDrawing.ReadOnly Then
        MsgBox "The current drawing file is read only.", , "ReadOnly Example"
    Else
        MsgBox "The current drawing file is read-write.", , "ReadOnly Example"
    End If

End Sub


RealToString Example [ActiveX and VBA Reference: AAR]

RealToString Example

Using Programming Languages other than VBA

Sub Example_RealToString()
    ' This example converts values in a given format to their string equivalents.

    Dim unit As Long
    Dim valueAsStr As String
    Dim precision As Integer
    Dim valueAsReal As Double
    precision = 6

    ' Convert a real value 17.5 using Scientific mode to a String
    unit = acScientific
    valueAsStr = ThisDrawing.Utility.RealToString(17.5, unit, precision)
    MsgBox "17.5 in scientific format is " & valueAsStr, , "RealToString Example"

    ' Convert a real value 17.5 using Decimal mode to a String
    unit = acDecimal
    valueAsStr = ThisDrawing.Utility.RealToString(17.5, unit, precision)
    MsgBox "17.5 in decimal format is " & valueAsStr, , "RealToString Example"

    ' Convert a real value 17.5 using Engineering mode to a String
    unit = acEngineering
    valueAsStr = ThisDrawing.Utility.RealToString(17.5, unit, precision)
    MsgBox "17.5 in engineering format is " & valueAsStr, , "RealToString Example"

    ' Convert a real value 17.5 using Architectural mode to a String
    unit = acArchitectural
    valueAsStr = ThisDrawing.Utility.RealToString(17.5, unit, precision)
    MsgBox "17.5 in architectural format is " & valueAsStr, , "RealToString Example"

    ' Converts a real value 17.5 using fractional mode to a String
    unit = acFractional
    valueAsStr = ThisDrawing.Utility.RealToString(17.5, unit, precision)
    MsgBox "17.5 in fractional format is " & valueAsStr, , "RealToString Example"

End Sub


Red Example [ActiveX and VBA Reference: AAR]

Red Example

Using Programming Languages other than VBA

Sub Example_Red()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    MsgBox "Red = " & retcolor.Red
    MsgBox "Green = " & retcolor.Green
    MsgBox "Blue = " & retcolor.Blue
End Sub


ReferenceCount Example [ActiveX and VBA Reference: AAR]

ReferenceCount Example

Using Programming Languages other than VBA

Sub Example_ReferenceCount()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


RefreshPlotDeviceInfo Example [ActiveX and VBA Reference: AAR]

RefreshPlotDeviceInfo Example

Using Programming Languages other than VBA

Sub Example_RefreshPlotDeviceInfo()
    ' This example gets the current plot device information,
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout

    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo

    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()

    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next

    ' List all the media names and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()

    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next

    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()

    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next

End Sub


Regen Example [ActiveX and VBA Reference: AAR]

Regen Example

Using Programming Languages other than VBA

Sub Example_Regen()
    ' The following example regenerates the complete drawing
    ThisDrawing.Regen acAllViewports

    ' The following example regenerates the active viewport in the current drawing
    ThisDrawing.Regen acActiveViewport

End Sub


RegenerateTableSuppressed Example [ActiveX and VBA Reference: AAR]

RegenerateTableSuppressed Example

Using Programming Languages other than VBA

Sub Example_RegenerateTableSuppressed()
    Dim MyModelSpace As AcadModelSpace
    Dim MyTable As IAcadTable2
    Dim pt(2) As Double
    Set MyModelSpace = ThisDrawing.ModelSpace
    Set MyTable = MyModelSpace.AddTable(pt, 100, 5, 5, 10)

    'Temporarily disable the recomputing of table block
    MyTable.RegenerateTableSuppressed = True

    Dim i As Integer, j As Integer
    For i = 0 To 99
        For j = 0 To 4
            Call MyTable.SetText(i, j, "my string " & i & ", " & j)
        Next j
    Next i

    'Now force the recomputing of table block
    'so that we can see the update table results
    MyTable.RegenerateTableSuppressed = False

    'You can also call RecomputeTableBlock(true) instead
    'to force the regeneration of table
    'MyTable.RecomputeTableBlock(True)

End Sub


RegisteredApplications Example [ActiveX and VBA Reference: AAR]

RegisteredApplications Example

Using Programming Languages other than VBA

Sub Example_RegisteredApplications()
    ' This example finds the current RegisteredApplications collection and
    ' adds a new RegisteredApplication to that collection.

    Dim RegAppColl As AcadRegisteredApplications
    Set RegAppColl = ThisDrawing.RegisteredApplications

    ' Create a RegisteredApp named "TEST" in the current drawing
    Dim RegAppObj As AcadRegisteredApplication
    Set RegAppObj = RegAppColl.Add("TEST")
    MsgBox "A new registered application called " & RegAppObj.name & " has been added to the Registered Applications collection.", vbInformation, "RegisteredApplications Example"
End Sub


Reload Example [ActiveX and VBA Reference: AAR]

Reload Example

Using Programming Languages other than VBA

Sub Example_Reload()
    On Error GoTo ERRORHANDLER

    ' Define external reference to be inserted
    Dim xrefHome As AcadBlock
    Dim xrefInserted As AcadExternalReference
    Dim insertionPnt(0 To 2) As Double
    Dim PathName As String
    insertionPnt(0) = 1
    insertionPnt(1) = 1
    insertionPnt(2) = 0
    PathName = "c:/AutoCAD/sample/City map.dwg"

    ' Add the external reference to the block
    Set xrefInserted = ThisDrawing.ModelSpace. _
            AttachExternalReference(PathName, "XREF_IMAGE", _
            insertionPnt, 1, 1, 1, 0, False)
    ZoomAll
    MsgBox "The external reference is attached."

    ' Reload the external reference definition
    ThisDrawing.Blocks.Item(xrefInserted.name).Reload
    MsgBox "The external reference is reloaded."
    Exit Sub

ERRORHANDLER:
    MsgBox Err.Description
End Sub


Remove Example [ActiveX and VBA Reference: AAR]

Remove Example

Using Programming Languages other than VBA

Sub Example_Remove()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary. It then
    ' removes the object from the dictionary.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX Application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

    ' Remove the object from the dictionary using the keyName
    dictObj.Remove (keyName)

End Sub


RemoveCustomByIndex Example [ActiveX and VBA Reference: AAR]

RemoveCustomByIndex Example

Using Programming Languages other than VBA

Sub Example_RemoveCustomByIndex()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


RemoveCustomByKey Example [ActiveX and VBA Reference: AAR]

RemoveCustomByKey Example

Using Programming Languages other than VBA

Sub Example_RemoveCustomByKey()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


RemoveEntry Example [ActiveX and VBA Reference: AAR]

RemoveEntry Example

Using Programming Languages other than VBA

Sub Example_RemoveEntry()
    'This example adds an entry to the File Dependency List, returns its Index, updates
    'the entry, and then removes the entry.

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim FDLIndex As Long
    FDLIndex = objFDLCol.CreateEntry("acad:xref", "c:\referenced.dwg", True, True)
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim IndexNumber As Long
    IndexNumber = objFDLCol.IndexOf("acad:xref", "c:\referenced.dwg")
    Dim IndexString As String
    IndexString = CStr(IndexNumber)
    MsgBox ("The index of the new entry is " & IndexString & ".")

    objFDLCol.UpdateEntry (FDLIndex)

    objFDLCol.RemoveEntry FDLIndex, True
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

End Sub


RemoveFromMenuBar Example [ActiveX and VBA Reference: AAR]

RemoveFromMenuBar Example

Using Programming Languages other than VBA

Sub Example_RemoveFromMenuBar()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is then displayed on the menu bar, and then
    ' removed from the menu bar.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)
    GoSub QUERYMENU

    ' Remove the menu from the menu bar
    newMenu.RemoveFromMenuBar
    GoSub QUERYMENU
    Exit Sub

QUERYMENU:
    If newMenu.OnMenuBar Then
        MsgBox "The menu called " & newMenu.name & " is on the menu bar."
    Else
        MsgBox "The menu called " & newMenu.name & " is not on the menu bar."
    End If
    Return

End Sub


RemoveHiddenLines Example [ActiveX and VBA Reference: AAR]

RemoveHiddenLines Example

Using Programming Languages other than VBA

Sub Example_RemoveHiddenLines()
    ' This example creates a new paper space viewport.
    ' It then displays the value of RemoveHiddenLines for the viewport.

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the paper space viewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.DISPLAY True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports

    ' Find the value for RemoveHiddenLines for the viewport
    Dim removeHidden As Boolean
    removeHidden = pviewportObj.RemoveHiddenLines
    MsgBox "The value of the RemoveHiddenLines property for the paperspace viewport is " & pviewportObj.RemoveHiddenLines, , "RemoveHiddenLines Example"

End Sub


RemoveItems Example [ActiveX and VBA Reference: AAR]

RemoveItems Example

Using Programming Languages other than VBA

Sub Example_RemoveItems()
    ' This example creates a selection set and several objects.
    ' It adds the objects to the selection set, and then
    ' removes two of the objects from the selection set.

    ' Create the new selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SELECTIONSET")

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Iterate through the model space collection.
    ' Collect the objects found into an array of objects
    ' to be added to the selection set.
    ReDim ssobjs(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set ssobjs(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects to the selection set
    ssetObj.AddItems ssobjs
    GoSub LISTOBJS

    ' Remove two of the objects from the selection set
    Dim removeObjects(0 To 1) As AcadEntity
    Set removeObjects(0) = ellObj
    Set removeObjects(1) = circObj
    ssetObj.RemoveItems removeObjects
    MsgBox "The ellipse and circle have been removed from the selection set."
    GoSub LISTOBJS

Exit Sub

LISTOBJS:

        ' List all the objects in the selection set
        If ssetObj.count = 0 Then
            MsgBox "The selection set is empty"
        Else
            For I = 0 To ssetObj.count - 1
                MsgBox "The selection set contains: " & ssetObj.Item(I).ObjectName
            Next
        End If
        Return

End Sub


RemoveMenuFromMenuBar Example [ActiveX and VBA Reference: AAR]

RemoveMenuFromMenuBar Example

Using Programming Languages other than VBA

Sub Example_RemoveMenuFromMenuBar()
    ' This example creates a new menu called TestMenu and inserts a menu item
    ' into it. The menu is displayed on the menu bar, and then
    ' removed from the menu bar.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new menu
    Dim newMenu As AcadPopupMenu
    Set newMenu = currMenuGroup.Menus.Add("TestMenu")

    ' Add a menu item to the new menu
    Dim newMenuItem As AcadPopupMenuItem
    Dim openMacro As String
    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newMenuItem = newMenu.AddMenuItem(newMenu.count + 1, "Open", openMacro)

    ' Display the menu on the menu bar
    newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.count + 1)
    GoSub QUERYMENU

    ' Remove the menu from the menu bar
    currMenuGroup.Menus.RemoveMenuFromMenuBar ("TestMenu")
    GoSub QUERYMENU
    Exit Sub

QUERYMENU:
    If newMenu.OnMenuBar Then
        MsgBox "The menu called " & newMenu.name & " is on the menu bar."
    Else
        MsgBox "The menu called " & newMenu.name & " is not on the menu bar."
    End If
    Return

End Sub


Rename Example [ActiveX and VBA Reference: AAR]

Rename Example

Using Programming Languages other than VBA

Sub Example_Rename()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary. It then
    ' renames the object in the dictionary.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

    ' Rename the object
    dictObj.Rename keyName, "NewKeyName"

End Sub

Public Sub Example_RenameLayerSettings()
    ' This example renames a set of saved layer settings from
    ' "ColorLinetype" to "OldColorLinetype."

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object.
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with the
    ' LayerStateManager object.
    oLSM.SetDatabase ThisDrawing.Database

    ' Rename the saved layer settings.
    oLSM.Rename "ColorLinetype", "OldColorLinetype"
End Sub


RenameProfile Example [ActiveX and VBA Reference: AAR]

RenameProfile Example

Using Programming Languages other than VBA

Sub Example_RenameProfile()
    ' This example renames an existing profile.
    ' You can see the renamed profile under Options/Profiles
    '
    ' *Note: This example relies on the default profile "<<Unnamed Profile>>".
    ' If this profile has already been renamed or removed, be sure to change the
    ' name of the SourceProfile to one that currently exists.

    Dim ACADPref As AcadPreferencesProfiles
    Dim SourceProfile As String, DestinationProfile As String

    ' Get the profiles preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Profiles

    ' Rename the default profile
    On Error GoTo ERRORTRAP

    SourceProfile = "<<Unnamed Profile>>"
    DestinationProfile = "NEW_PROFILE_NAME"

    ACADPref.RenameProfile SourceProfile, DestinationProfile

    MsgBox "We have just renamed the profile " & SourceProfile & " to " & DestinationProfile

    Exit Sub

ERRORTRAP:
    If Err.Description <> "" Then
        MsgBox "The default profile '" & SourceProfile & "' cannot be found, please use a different source profile."
    End If

End Sub


RenderSmoothness Example [ActiveX and VBA Reference: AAR]

RenderSmoothness Example

Using Programming Languages other than VBA

Sub Example_RenderSmoothness()
    ' This example returns the current setting of
    ' RenderSmoothness. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currRenderSmoothness As Double
    Dim newRenderSmoothness As Double

    ' Retrieve the current RenderSmoothness value
    currRenderSmoothness = ThisDrawing.preferences.RenderSmoothness
    MsgBox "The current value for RenderSmoothness is " & currRenderSmoothness, vbInformation, "RenderSmoothness Example"

    ' Change the value for RenderSmoothness
    newRenderSmoothness = 2.5
    ThisDrawing.preferences.RenderSmoothness = newRenderSmoothness
    MsgBox "The new value for RenderSmoothness is " & newRenderSmoothness, vbInformation, "RenderSmoothness Example"

    ' Reset RenderSmoothness to its original value
    ThisDrawing.preferences.RenderSmoothness = currRenderSmoothness
    MsgBox "The RenderSmoothness value is reset to " & currRenderSmoothness, vbInformation, "RenderSmoothness Example"
End Sub


Replace Example [ActiveX and VBA Reference: AAR]

Replace Example

Using Programming Languages other than VBA

Sub Example_Replace()
    ' This example creates a dictionary and adds
    ' a custom object to that dictionary. It then
    ' replaces the object in the dictionary.

    Dim dictObj As AcadDictionary
    Set dictObj = ThisDrawing.Dictionaries.Add("TEST_DICTIONARY")

    ' Load the ObjectARX application that defines the custom object.
    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the path and name of your ObjectARX application.
    ThisDrawing.Application.LoadArx ("MyARXApp.dll")

    ' Create the custom object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As AcadObject

    keyName = "OBJ1"
    className = "CAsdkDictObject"

    Set customObj = dictObj.AddObject(keyName, className)

    ' Replace the object from the dictionary with a different object
    Dim newCustomObject As AcadObject
    dictObj.Replace keyName, newCustomObject

End Sub


ResetProfile Example [ActiveX and VBA Reference: AAR]

ResetProfile Example

Using Programming Languages other than VBA

Sub Example_ResetProfile()
    ' This example resets a profile to the default values.
    ' NOTE: A dummy profile name is used so that your existing
    ' profiles are not changed.

    Dim preferences As AcadPreferences
    Dim strProfileToReset As String

    Set preferences = ThisDrawing.Application.preferences

    ' Specify the profile to delete.
    strProfileToReset = "TestProfile"

    ' Delete the profile
    ' The call will fail if "TestProfile" does not exist
    On Error GoTo Error
    preferences.Profiles.ResetProfile strProfileToReset
    Exit Sub

Error:
        MsgBox "ResetProfile of " & strProfileToReset & " failed. " & Err.Description, , "ResetProfile Example"

End Sub


Restore Example [ActiveX and VBA Reference: AAR]

Restore Example

Using Programming Languages other than VBA

Sub Example_RestoreLayerSettings()
    ' The following code restores color and linetype settings
    ' that were saved as "ColorLineType."

    Dim oLSM As AcadLayerStateManager

    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")
    oLSM.SetDatabase ThisDrawing.Database
    oLSM.Restore "ColorLinetype"

End Sub


Reverse Example [ActiveX and VBA Reference: AAR]

Reverse Example

Using Programming Languages other than VBA

Sub Example_Reverse()
    ' This example creates a spline in model space.
    ' It then reverses the spline and therefore the
    ' control point data.

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim msg As String

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ZoomAll
    GoSub GETPOINTS
    MsgBox "Before the reverse the first control point is " & msg

    ' Reverse the Spline and therefore control point data
    splineObj.Reverse

    ThisDrawing.Regen True
    GoSub GETPOINTS
    MsgBox "After the reverse the first control point is " & msg

    Exit Sub

GETPOINTS:
    msg = ""
    ' Get the coordinates from the first control point again
    Dim count As Integer
    For count = 0 To 2
        msg = msg & splineObj.GetControlPoint(0)(count) & ", "
    Next
    msg = VBA.Left(msg, Len(msg) - 2)
    Return

End Sub


RevisionNumber Example [ActiveX and VBA Reference: AAR]

RevisionNumber Example

Using Programming Languages other than VBA

Sub Example_RevisionNumber()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


Rotate Example [ActiveX and VBA Reference: AAR]

Rotate Example

Using Programming Languages other than VBA

Sub Example_Rotate()
    ' This example creates a lightweight polyline
    ' and then rotates that polyline.

    ' Create the polyline
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
    points(0) = 1: points(1) = 2
    points(2) = 1: points(3) = 3
    points(4) = 2: points(5) = 3
    points(6) = 3: points(7) = 3
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 2
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True
    ZoomAll

    MsgBox "Rotate the polyline by 45 degrees.", , "Rotate Example"

    ' Define the rotation
    Dim basePoint(0 To 2) As Double
    Dim rotationAngle As Double
    basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0
    rotationAngle = 0.7853981   ' 45 degrees

    ' Rotate the polyline
    plineObj.Rotate basePoint, rotationAngle

    ZoomAll
    MsgBox "Rotation completed.", , "Rotate Example"

End Sub


Rotate3D Example [ActiveX and VBA Reference: AAR]

Rotate3D Example

Using Programming Languages other than VBA

Sub Example_Rotate3D()
    ' This example creates a box in model space.
    ' It then rotates the box about an axis.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ThisDrawing.Regen True

    ' Define the rotation axis with two points
    Dim rotatePt1(0 To 2) As Double
    Dim rotatePt2(0 To 2) As Double
    Dim rotateAngle As Double

    rotatePt1(0) = -3: rotatePt1(1) = 4: rotatePt1(2) = 0
    rotatePt2(0) = -3: rotatePt2(1) = -4: rotatePt2(2) = 0
    rotateAngle = 30
    rotateAngle = rotateAngle * 3.141592 / 180#

    ' Draw a line between the two axis points so that it is visible.
    ' This is optional. It is not required for the rotation.
    Dim axisLine As AcadLine
    Set axisLine = ThisDrawing.ModelSpace.AddLine(rotatePt1, rotatePt2)
    axisLine.Update
    MsgBox "Rotate the box 30 degrees about the axis shown.", , "Rotate3D Example"

    ' Rotate the box
    boxObj.Rotate3D rotatePt1, rotatePt2, rotateAngle
    ThisDrawing.Regen True
    MsgBox "The box is rotated 30 degrees.", , "Rotate3D Example"

End Sub


Rotation Example [ActiveX and VBA Reference: AAR]

Rotation Example

Using Programming Languages other than VBA

Sub Example_Rotation()
    ' This example creates a text object in model space.
    ' It then changes the Rotation of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The Rotation is " & textObj.rotation, vbInformation, "Rotation Example"

    ' Change the value of the Rotation to 45 degrees (.707 radians)
    textObj.rotation = 0.707
    ZoomAll
    MsgBox "The Rotation is set to " & textObj.rotation, vbInformation, "Rotation Example"

End Sub


RoundDistance Example [ActiveX and VBA Reference: AAR]

RoundDistance Example

Using Programming Languages other than VBA

Sub Example_RoundDistance()
   ' This example creates an aligned dimension in model space and
   ' uses RoundDistance to set the unit display
   ' of the dimension to rounded values

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 10.123: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll

    MsgBox "Press any key to round the dimension unit display to .5"

    ' Round the distance of the dimension to 0.50 of a unit
    dimObj.RoundDistance = 0.5
    ThisDrawing.Regen acAllViewports

    MsgBox "Dimension units have been rounded to: " & dimObj.RoundDistance

End Sub


Rows Example [ActiveX and VBA Reference: AAR]

Rows Example

Using Programming Languages other than VBA

Sub Example_Rows()
    ' This example creates a new MInsertBlock in the current drawing and
    ' displays the column and row information for the new MInsertBlock

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)

    ThisDrawing.Application.ZoomAll

    ' Display information about the Columns and Rows defined by the MInsertBlock
    MsgBox "The new rectangular array is comprised of: " & vbCrLf & _
            newMBlock.Columns & " columns with a spacing of " & newMBlock.ColumnSpacing & " and" & vbCrLf & _
            newMBlock.Rows & " rows with a spacing of " & newMBlock.RowSpacing

End Sub


RowSpacing Example [ActiveX and VBA Reference: AAR]

RowSpacing Example

Using Programming Languages other than VBA

Sub Example_RowSpacing()
    ' This example creates a new MInsertBlock in the current drawing and
    ' displays the column and row information for the new MInsertBlock

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double, InsertPoint(0 To 2) As Double
    Dim radius As Double
    Dim newMBlock As AcadMInsertBlock
    Dim newBlock As AcadBlock

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    radius = 0.5

    ' Create a new block to hold the Circle
    Set newBlock = ThisDrawing.Blocks.Add(centerPoint, "CBlock")

    ' Add the Circle object to the new block
    Set circleObj = ThisDrawing.Blocks("CBlock").AddCircle(centerPoint, radius)

    ' Create a rectangular array of Circles using the new block containing the Circle
    ' and the AddMInsertBlock method
    Set newMBlock = ThisDrawing.ModelSpace.AddMInsertBlock(InsertPoint, "CBlock", 1, 1, 1, 1, 2, 2, 1, 1)

    ThisDrawing.Application.ZoomAll

    ' Display information about the Columns and Rows defined by the MInsertBlock
    MsgBox "The new rectangular array is comprised of: " & vbCrLf & _
            newMBlock.Columns & " columns with a spacing of " & newMBlock.ColumnSpacing & " and" & vbCrLf & _
            newMBlock.Rows & " rows with a spacing of " & newMBlock.RowSpacing

End Sub


RunMacro Example [ActiveX and VBA Reference: AAR]

RunMacro Example

Using Programming Languages other than VBA

Sub Example_RunMacro()
    ' This example loads a DVB file and runs a macro
    ' contained in the file using the RunMacro method.
    '
    ' This example uses a DVB file named drawline.dvb.
    ' You should change the example to use a file on your computer.
    '
    ' * Note: If you open a DVB file and then run the example to load it, there will be an error
    ' when the DVB file is unloaded.

    Dim FileName As String

    FileName = "c:\drawline.dvb"

    ' Load a sample VBA project DVB file
    LoadDVB FileName

    ' Run the drawline sample macro
    RunMacro "Module1.Drawline"

    ' Unload the drawline VBA project DVB file now that we are done
    UnloadDVB FileName

    MsgBox "The DVB file has been run!"

End Sub


Save Example [ActiveX and VBA Reference: AAR]

Save Example

Using Programming Languages other than VBA

Sub Example_Save()
    ' The following example saves current drawing

    ThisDrawing.Save

End Sub

Sub Example_Save_LayerSettings()
    ' The following code saves the color and linetype settings
    ' of the current layer.

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database
    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

End Sub


SaveAs Example [ActiveX and VBA Reference: AAR]

SaveAs Example

Using Programming Languages other than VBA

Sub Example_SaveAs()
    ' The following example saves current drawing as "test.dwg"

    ThisDrawing.SaveAs ("test.dwg")

End Sub


SaveAsType Example [ActiveX and VBA Reference: AAR]

SaveAsType Example

Using Programming Languages other than VBA

Sub Example_SaveAsType()
    ' This example reads and modifies the preference value that controls
    ' the drawing type to save the drawing as.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesOpenSave
    Dim originalValue As Variant, DisplayValue As String

    ' Get the OpenSave preferences object
    Set ACADPref = ThisDrawing.Application.Preferences.OpenSave

    ' Store current setting
    originalValue = ACADPref.SaveAsType

    ' Read and display the original value
    GoSub GETVALUE
    MsgBox "The SaveAsType preference is: " & DisplayValue

    ' Modify the SaveAsType preference by changing it to AutoCAD 2000 DWG
    ACADPref.SaveAsType = ac2000_dwg
    GoSub GETVALUE
    MsgBox "The SaveAsType preference has been set to: " & DisplayValue

    ' Reset the preference back to its original value
    '
    ' Comment out this last section to leave the change to
    '         the preference in effect
    ACADPref.SaveAsType = originalValue

    GoSub GETVALUE
    MsgBox "The SaveAsType preference was reset back to: " & DisplayValue

    Exit Sub

GETVALUE:
    ' Convert the value of this setting to a meaningful text string
    DisplayValue = ACADPref.SaveAsType
    Select Case DisplayValue
        Case ac2000_dwg:  DisplayValue = "AutoCAD 2000 DWG (*.dwg)"
        Case ac2000_dxf:  DisplayValue = "AutoCAD 2000 DXF (*.dxf)"
        Case ac2000_Template: DisplayValue = "AutoCAD 2000 Drawing Template File (*.dwt)"
        Case ac2004_dwg:  DisplayValue = "AutoCAD 2004 DWG (*.dwg)"
        Case ac2004_dxf:  DisplayValue = "AutoCAD 2004 DXF (*.dxf)"
        Case ac2004_Template: DisplayValue = "AutoCAD 2004 Drawing Template File (*.dwt)"
        Case acNative:   DisplayValue = "Latest drawing release"
        Case acUnknown:  DisplayValue = "The drawing type is unknown"
    End Select

    Return
End Sub


Saved Example [ActiveX and VBA Reference: AAR]

Saved Example

Using Programming Languages other than VBA

Sub Example_Saved()
    ' This example checks to see if the current drawing has been modified.

    If Not ThisDrawing.Saved Then
        MsgBox "Drawing has been modified! Use the Save or SaveAs method to save the drawing.", , "Saved Example"
    Else
        MsgBox "Drawing has not been modified since the last save.", , "Saved Example"
    End If

End Sub


SavePreviewThumbnail Example [ActiveX and VBA Reference: AAR]

SavePreviewThumbnail Example

Using Programming Languages other than VBA

Sub Example_SavePreviewThumbnail()
    ' This example returns the current setting of
    ' SavePreviewThumbnail. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currSavePreviewThumbnail As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current SavePreviewThumbnail value
    currSavePreviewThumbnail = preferences.OpenSave.SavePreviewThumbnail
    MsgBox "The current value for SavePreviewThumbnail is " & preferences.OpenSave.SavePreviewThumbnail, vbInformation, "SavePreviewThumbnail Example"

    ' Change the value for SavePreviewThumbnail
    preferences.OpenSave.SavePreviewThumbnail = Not (currSavePreviewThumbnail)
    MsgBox "The new value for SavePreviewThumbnail is " & preferences.OpenSave.SavePreviewThumbnail, vbInformation, "SavePreviewThumbnail Example"

    ' Reset SavePreviewThumbnail to its original value
    preferences.OpenSave.SavePreviewThumbnail = currSavePreviewThumbnail
    MsgBox "The SavePreviewThumbnail value is reset to " & currSavePreviewThumbnail, vbInformation, "SavePreviewThumbnail Example"
End Sub


ScaleEntity Example [ActiveX and VBA Reference: AAR]

ScaleEntity Example

Using Programming Languages other than VBA

Sub Example_ScaleEntity()
    ' This example creates a lightweight polyline
    ' and then scales that polyline.

    ' Create the polyline
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
    points(0) = 1: points(1) = 2
    points(2) = 1: points(3) = 3
    points(4) = 2: points(5) = 3
    points(6) = 3: points(7) = 3
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 2
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True
    ZoomAll

    MsgBox "Scale the polyline by 0.5", , "ScaleEntity Example"

    ' Define the scale
    Dim basePoint(0 To 2) As Double
    Dim scalefactor As Double
    basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0
    scalefactor = 0.5

    ' Scale the polyline
    plineObj.ScaleEntity basePoint, scalefactor

    ZoomAll
    MsgBox "Scale completed.", , "ScaleEntity Example"

End Sub


ScaleFactor Example [ActiveX and VBA Reference: AAR]

ScaleFactor Example

Using Programming Languages other than VBA

Sub Example_ScaleFactor()
    ' This example creates a text object in model space.
    ' It then finds the current scale factor and changes it.
    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll

    ' Find the current scale factor for the text object
    Dim currScaleFactor As Double
    currScaleFactor = textObj.scalefactor
    MsgBox "The scale factor of the text is " & textObj.scalefactor, , "ScaleFactor Example"

    ' Change the scale factor for the text object
    textObj.scalefactor = currScaleFactor + 1
    ThisDrawing.Regen True
    MsgBox "The scale factor of the text is now " & textObj.scalefactor, , "ScaleFactor Example"

End Sub


ScaleLineweights Example [ActiveX and VBA Reference: AAR]

ScaleLineweights Example

Using Programming Languages other than VBA

Sub Example_ScaleLineweights()
    ' This example reads and modifies the ScaleLineweights
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.ScaleLineweights
    MsgBox "The ScaleLineweights value is set to: " & originalValue

    ' Modify the ScaleLineweights preference by toggling the value
    ACADLayout.ScaleLineweights = Not ACADLayout.ScaleLineweights
    MsgBox "The ScaleLineweights preference has been set to: " & ACADLayout.ScaleLineweights

    ' Reset the preference back to its original value
    ACADLayout.ScaleLineweights = originalValue
    MsgBox "The ScaleLineweights preference was reset back to: " & originalValue
End Sub


SCMCommandMode Example [ActiveX and VBA Reference: AAR]

SCMCommandMode Example

Using Programming Languages other than VBA

Sub Example_SCMCommandMode()
    ' This example reads and modifies the SCMCommandMode
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.SCMCommandMode
    MsgBox "The SCMCommandMode preference is set to: " & originalValue

    ' Modify the SCMCommandMode preference by toggling the value
    ACADPref.SCMCommandMode = acEnter

    MsgBox "The SCMCommandMode preference has been set to: " & ACADPref.SCMCommandMode

    ' Reset the preference back to its original value
    ACADPref.SCMCommandMode = originalValue
    MsgBox "The SCMCommandMode preference was reset back to: " & originalValue
End Sub


SCMDefaultMode Example [ActiveX and VBA Reference: AAR]

SCMDefaultMode Example

Using Programming Languages other than VBA

Sub Example_SCMDefaultMode()
    ' This example reads and modifies the SCMDefaultMode
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.SCMDefaultMode
    MsgBox "The SCMDefaultMode preference is set to: " & originalValue

    ' Modify the SCMDefaultMode preference by toggling the value
    ACADPref.SCMDefaultMode = acRepeatLastCommand

    MsgBox "The SCMDefaultMode preference has been set to: " & ACADPref.SCMDefaultMode

    ' Reset the preference back to its original value
    ACADPref.SCMDefaultMode = originalValue
    MsgBox "The SCMDefaultMode preference was reset back to: " & originalValue
End Sub


SCMEditMode Example [ActiveX and VBA Reference: AAR]

SCMEditMode Example

Using Programming Languages other than VBA

Sub Example_SCMEditMode()
    ' This example reads and modifies the SCMEditMode
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.SCMEditMode
    MsgBox "The SCMEditMode preference is set to: " & originalValue

    ' Modify the SCMEditMode preference by toggling the value
    ACADPref.SCMEditMode = acEdRepeatLastCommand

    MsgBox "The SCMEditMode preference has been set to: " & ACADPref.SCMEditMode

    ' Reset the preference back to its original value
    ACADPref.SCMEditMode = originalValue
    MsgBox "The SCMEditMode preference was reset back to: " & originalValue
End Sub


SCMTimeMode Example [ActiveX and VBA Reference: AAR]

SCMTimeMode Example

Using Programming Languages other than VBA

Sub Example_SCMTimeMode()
    ' This example reads and modifies the SCMTimeMode property.
    ' Then the property is reset to its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Boolean, newValue As Boolean

    ' Get the UserPreferences object
    Set ACADPref = ThisDrawing.Application.Preferences.User

    originalValue = ACADPref.SCMTimeMode
    MsgBox "The SCMTimeMode property is currently: " & originalValue

    newValue = IIf(originalValue, False, True)
    ACADPref.SCMTimeMode = newValue

    MsgBox "The SCMTimeMode property has been set to: " & ACADPref.SCMTimeMode

    ' Reset the preference back to its original value
    ACADPref.SCMTimeMode = originalValue
    MsgBox "The SCMTimeMode property was reset back to: " & originalValue
End Sub


SCMTimeValue Example [ActiveX and VBA Reference: AAR]

SCMTimeValue Example

Using Programming Languages other than VBA

Sub Example_SCMTimeValue()
    ' This example reads and modifies the SCMTimeValue property.
    ' Then the property is reset to its original value.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer

    ' Get the UserPreferences object and set the SCMTimeMode property to True
    Set ACADPref = ThisDrawing.Application.Preferences.User
    ACADPref.SCMTimeMode = True

    originalValue = ACADPref.SCMTimeValue
    MsgBox "The SCMTimeValue property is currently: " & originalValue

    newValue = 1000
    ACADPref.SCMTimeValue = newValue

    MsgBox "The SCMTimeValue property has been set to: " & ACADPref.SCMTimeValue

    ' Reset the preference back to its original value
    ACADPref.SCMTimeValue = originalValue
    MsgBox "The SCMTimeValue property was reset back to: " & originalValue
End Sub


SecondPoint Example [ActiveX and VBA Reference: AAR]

SecondPoint Example

Using Programming Languages other than VBA

Sub Example_SecondPoint()
    ' This example creates a ray object. It then finds the
    ' second point of the ray, changes the second point, and
    ' queries the new second point.

    Dim basePoint(0 To 2) As Double
    Dim directionVec(0 To 2) As Double
    Dim rayObj As AcadRay
    Dim currSecondPoint As Variant
    Dim msg As String
    Dim newSecondPoint(0 To 2) As Double

    ' Establish the base point and directional vector for the ray
    basePoint(0) = 3: basePoint(1) = 3: basePoint(2) = 0
    directionVec(0) = 1:    directionVec(1) = 1: directionVec(2) = 0

    ' Create a Ray object in model space
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, directionVec)

    ThisDrawing.Regen True
    MsgBox "A new Ray has been added.", vbInformation

    ' Define a new second point
    newSecondPoint(0) = 4: newSecondPoint(1) = 2: newSecondPoint(2) = 0

    ' Update the ray using the new second point
    rayObj.SecondPoint = newSecondPoint

    ' Query the new second point for the Ray
    currSecondPoint = rayObj.SecondPoint
    msg = currSecondPoint(0) & vbCrLf & _
          currSecondPoint(1) & vbCrLf & _
          currSecondPoint(2)

    ThisDrawing.Regen True
    MsgBox "We've just changed the second point of the new Ray to: " & vbCrLf & msg, vbInformation

End Sub


SectionSolid Example [ActiveX and VBA Reference: AAR]

SectionSolid Example

Using Programming Languages other than VBA

Sub Example_SectionSolid()
    ' This example creates a box in model space.
    ' It then sections the box based on a plane
    ' defined by three points. The section is returned
    ' as a region.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Define the section plane with three points
    Dim sectionPt1(0 To 2) As Double
    Dim sectionPt2(0 To 2) As Double
    Dim sectionPt3(0 To 2) As Double

    sectionPt1(0) = 1.5: sectionPt1(1) = 7.5: sectionPt1(2) = 0
    sectionPt2(0) = 1.5: sectionPt2(1) = 7.5: sectionPt2(2) = 10
    sectionPt3(0) = 8.5: sectionPt3(1) = 2.5: sectionPt3(2) = 10

    ' Section the box
    Dim sectionObj As AcadRegion
    Set sectionObj = boxObj.SectionSolid(sectionPt1, sectionPt2, sectionPt3)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


SegmentPerPolyline Example [ActiveX and VBA Reference: AAR]

SegmentPerPolyline Example

Using Programming Languages other than VBA

Sub Example_SegmentPerPolyline()
    ' This example returns the current setting of
    ' SegmentPerPolyline. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currSegmentPerPolyline As Integer
    Dim newSegmentPerPolyline As Integer

    ' Retrieve the current SegmentPerPolyline value
    currSegmentPerPolyline = ThisDrawing.preferences.SegmentPerPolyline
    MsgBox "The current value for SegmentPerPolyline is " & currSegmentPerPolyline, vbInformation, "SegmentPerPolyline Example"

    ' Change the value for SegmentPerPolyline
    newSegmentPerPolyline = 2001
    ThisDrawing.preferences.SegmentPerPolyline = newSegmentPerPolyline
    MsgBox "The new value for SegmentPerPolyline is " & newSegmentPerPolyline, vbInformation, "SegmentPerPolyline Example"

    ' Reset SegmentPerPolyline to its original value
    ThisDrawing.preferences.SegmentPerPolyline = currSegmentPerPolyline
    MsgBox "The SegmentPerPolyline value is reset to " & currSegmentPerPolyline, vbInformation, "SegmentPerPolyline Example"
End Sub


Select Example [ActiveX and VBA Reference: AAR]

Select Example

Using Programming Languages other than VBA

Sub Example_Select()
    ' This example adds members to a selection set, first by crossing and
    ' then by filtering for circles.

    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")

    ' Add all object to the selection set that lie within a crossing of (28,17,0) and
    ' (-3.3, -3.6,0)
    Dim mode As Integer
    Dim corner1(0 To 2) As Double
    Dim corner2(0 To 2) As Double

    mode = acSelectionSetCrossing
    corner1(0) = 28: corner1(1) = 17: corner1(2) = 0
    corner2(0) = -3.3: corner2(1) = -3.6: corner2(2) = 0
    ssetObj.Select mode, corner1, corner2

    ' Add all the Circles to the selection set that lie within the crossing of (28,17,0) and
    ' (-3.3, -3.6,0) by filtering from the current drawing
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    gpCode(0) = 0
    dataValue(0) = "Circle"

    Dim groupCode As Variant, dataCode As Variant
    groupCode = gpCode
    dataCode = dataValue

    ssetObj.Select mode, corner1, corner2, groupCode, dataCode

End Sub


SelectAtPoint Example [ActiveX and VBA Reference: AAR]

SelectAtPoint Example

Using Programming Languages other than VBA

Sub Example_SelectAtPoint()
    ' This example adds objects to a selection set by identifying a point.
    ' At first all objects at the point are added to the selection set. Then
    ' only circle objects at the point are added to the selection set.

    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET1")

    ' Add to the selection set all the objects that lie at point(6.8,9.4,0)
    Dim point(0 To 2) As Double
    point(0) = 6.8: point(1) = 9.4: point(2) = 0
    ssetObj.SelectAtPoint point

    ' Add to the selection set all the Circles that lie at point (6.8,9.4,0)
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    gpCode(0) = 0
    dataValue(0) = "Circle"

    Dim groupCode As Variant, dataCode As Variant
    groupCode = gpCode
    dataCode = dataValue

    ssetObj.SelectAtPoint point, groupCode, dataCode

End Sub


SelectByPolygon Example [ActiveX and VBA Reference: AAR]

SelectByPolygon Example

Using Programming Languages other than VBA

Sub Example_SelectByPolygon()
    ' This example adds objects to a selection set by defining a polygon.

    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET2")

    ' Add to the selection set all the objects that lie within a fence
    Dim mode As Integer
    Dim pointsArray(0 To 11) As Double
    mode = acSelectionSetFence
    pointsArray(0) = 28.2: pointsArray(1) = 17.2: pointsArray(2) = 0
    pointsArray(3) = -5: pointsArray(4) = 13: pointsArray(5) = 0
    pointsArray(6) = -3.3: pointsArray(7) = -3.6: pointsArray(8) = 0
    pointsArray(9) = 28: pointsArray(10) = -3: pointsArray(11) = 0

    ssetObj.SelectByPolygon mode, pointsArray

    ' Add to the selection set all the Circles that lie within fence
    ReDim gpCode(0 To 1) As Integer
    gpCode(0) = 0
    gpCode(1) = 10

    Dim pnt(0 To 2) As Double
    pnt(0) = 3: pnt(1) = 6: pnt(2) = 0

    ReDim dataValue(0 To 1) As Variant
    dataValue(0) = "Circle"
    dataValue(1) = pnt

    Dim groupCode As Variant, dataCode As Variant
    groupCode = gpCode
    dataCode = dataValue

    ssetObj.SelectByPolygon mode, pointsArray, groupCode, dataCode

End Sub


Selection Example [ActiveX and VBA Reference: AAR]

Selection Example

Using Programming Languages other than VBA

Sub Example_Selection()
    ' This example obtains a reference to the Selection Preferences object
    ' from the Application Preferences object, and reads one of the Selection
    ' preferences

    Dim ACADPref As AcadPreferencesSelection

    ' Obtain a reference to the Selection Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Selection

    MsgBox "We now have access to the properties and methods of the Selection Preferences object!"
    MsgBox "The Selection preference GripSize is set to: " & ACADPref.GripSize

    ' Release Selection Preferences object
    Set ACADPref = Nothing
    MsgBox "We have now released the Selection Preferences object!"
End Sub


SelectionChanged Example [: AAR]

SelectionChanged Example

Using Programming Languages other than VBA

Private Sub AcadDocument_SelectionChanged()
    ' This example intercepts a drawing SelectionChanged event.
    '
    ' This event is triggered when the current selection set in a drawing is modified.
    '
    ' To trigger this example event: Select or deselect objects in any open drawing

    MsgBox "The selection set in a drawing was just changed!"
End Sub


SelectionSets Example [ActiveX and VBA Reference: AAR]

SelectionSets Example

Using Programming Languages other than VBA

Sub Example_SelectionSets()
    ' This example finds the current SelectionSets collection and
    ' adds a new SelectionSet to that collection.

    Dim SSetColl As AcadSelectionSets
    Set SSetColl = ThisDrawing.SelectionSets

    ' Create a SelectionSet named "TEST" in the current drawing
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = SSetColl.Add("TEST")
    MsgBox "A new SelectionSet called " & ssetObj.name & " has been added to the SelectionSets collection.", vbInformation, "SelectionSets Example"
End Sub


SelectOnScreen Example [ActiveX and VBA Reference: AAR]

SelectOnScreen Example

Using Programming Languages other than VBA

Sub Example_SelectOnScreen()
    ' This example adds objects to a selection set by prompting the user
    ' to select ones to add.

    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET")

    ' Add objects to a selection set by prompting user to select on the screen
    ssetObj.SelectOnScreen

End Sub


SendCommand Example [ActiveX and VBA Reference: AAR]

SendCommand Example

Using Programming Languages other than VBA

Sub Example_SendCommand()
   ' This example sends a command for evaluation to the AutoCAD command line
   ' of a particular drawing

   ' Create a Circle in the active drawing and
   ' zoom to display the entire circle
   ThisDrawing.SendCommand "_Circle" & vbCr & "2,2,0" & vbCr & "4" & vbCr
   ThisDrawing.SendCommand "_zoom" & vbCr & "a" & vbCr

   ' Refresh view
   ThisDrawing.Regen acAllViewports

   MsgBox "A circle command has been sent to the command line of the current drawing."
End Sub


SerialNumber Example [ActiveX and VBA Reference: AAR]

SerialNumber Example

Using Programming Languages other than VBA

Sub Example_SerialNumber()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True

    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP

    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


SetAlignment Example [ActiveX and VBA Reference: AAR]

SetAlignment Example

Using Programming Languages other than VBA

Sub Example_SetAlignment()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetAlignment2 Example [ActiveX and VBA Reference: AAR]

SetAlignment2 Example

Using Programming Languages other than VBA

Sub Example_SetAlignment2()
     ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As IAcadTableStyle2
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow + AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col

      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            , AcRowType.acDataRow + AcRowType.acTitleRow, True

      Call customObj.SetAlignment2("NewStyle", acBottomRight)

      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetBackgroundColor Example [ActiveX and VBA Reference: AAR]

SetBackgroundColor Example

Using Programming Languages other than VBA

Sub Example_SetBackgroundColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetBackgroundColorNone Example [ActiveX and VBA Reference: AAR]

SetBackgroundColorNone Example

Using Programming Languages other than VBA

Sub Example_SetBackgroundColorNone()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetBitmaps Example [ActiveX and VBA Reference: AAR]

SetBitmaps Example

Using Programming Languages other than VBA

Sub Example_SetBitmaps()
    ' This example uses MenuGroups to obtain a reference to the AutoCAD main menu.
    ' It then creates a new Toolbar (TestMenu) and inserts a ToolBarButton
    ' with a custom icon. The menu is automatically shown.
    '
    ' * NOTE: The paths of the icons for the new toolbar should be updated
    ' before running this example.

    Dim currMenuGroup As acadMenuGroup
    Dim newToolBar As AcadToolbar, newToolBarButton As AcadToolbarItem
    Dim openMacro As String
    Dim SmallBitmapName  As String, LargeBitmapName  As String

    On Error GoTo ERRORTRAP

    ' Use MenuGroups property to obtain reference to main AutoCAD menu
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    ' Create the new Toolbar in this group
    Set newToolBar = currMenuGroup.Toolbars.Add("TestMenu")

    ' Add an item to the new Toolbar and assign an Open macro
    ' (VBA equivalent of: "ESC ESC _open ")
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)
    Set newToolBarButton = newToolBar.AddToolbarButton(newToolBar.count + 1, "Open", "Open Macro", openMacro, False)

    ' Read icon paths for this Toolbar button
    GoSub READPATHS

    ' Change the default icon (smile face) for the new toolbar button
    SmallBitmapName = "c:\images\16x16.bmp"     ' Use a 16x16 pixel .BMP image
    LargeBitmapName = "c:\images\32x32.bmp"     ' Use a 32x32 pixel .BMP image
    newToolBarButton.SetBitmaps SmallBitmapName, LargeBitmapName

    ' Read icon paths for this Toolbar button
    GoSub READPATHS

    Exit Sub

READPATHS:
    ' Read icon paths for this Toolbar button
    newToolBarButton.GetBitmaps SmallBitmapName, LargeBitmapName
    MsgBox "The new Toolbar uses the following icon files: " & _
           vbCrLf & vbCrLf & "Small Bitmap: " & SmallBitmapName & vbCrLf & _
           "Large Bitmap: " & LargeBitmapName
    Return

ERRORTRAP:
    MsgBox "The following error has occurred: " & Err.Description
End Sub


SetBulge Example [ActiveX and VBA Reference: AAR]

SetBulge Example

Using Programming Languages other than VBA

Sub Example_SetBulge()
    ' This example creates a lightweight polyline in model space.
    ' It then finds and changes the bulge for a given segment.

    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double

    ' Define the 2D polyline points
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 1

    ' Create a lightweight Polyline object in model space
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    ZoomAll

    ' Find the bulge of the third segment
    Dim currentBulge As Double
    currentBulge = plineObj.GetBulge(3)
    MsgBox "The bulge for the third segment is " & plineObj.GetBulge(3), , "SetBulge Example"

    ' Change the bulge of the third segment
    plineObj.SetBulge 3, -0.5
    plineObj.Update
    MsgBox "The bulge for the third segment is now " & plineObj.GetBulge(3), , "SetBulge Example"

End Sub


SetColor Example [ActiveX and VBA Reference: AAR]

SetColor Example

Using Programming Languages other than VBA

Sub Example_SetColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetColorBookColor Example [ActiveX and VBA Reference: AAR]

SetColorBookColor Example

Using Programming Languages other than VBA

Sub Example_SetColorBookColor()
    ' This example draws a line and specifies a color name
    ' from an existing color book.

    Dim FirstColor As AcadAcCmColor
    Set FirstColor = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    Call FirstColor.SetColorBookColor("PANTONE Yellow", "Pantone solid colors-uncoated.acb")
    line.TrueColor = FirstColor
 End Sub


SetControlPoint Example [ActiveX and VBA Reference: AAR]

SetControlPoint Example

Using Programming Languages other than VBA

Sub Example_SetControlPoint()
    ' This example creates a spline object in model space.
    ' It then finds the coordinates of the first control point
    ' and changes that value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the first control point
    Dim controlPoint As Variant
    controlPoint = splineObj.GetControlPoint(0)
    MsgBox "Control point 1 is at " & controlPoint(0) & ", " & controlPoint(1) & ", " & controlPoint(2), , "SetControlPoint Example"

    ' Change the coordinates of the first fit point
    controlPoint(0) = 0: controlPoint(1) = 3: controlPoint(2) = 0
    splineObj.SetControlPoint 0, controlPoint
    splineObj.Update
    MsgBox "Control point 1 is now at " & controlPoint(0) & ", " & controlPoint(1) & ", " & controlPoint(2), , "SetControlPoint Example"

End Sub


SetCustomByIndex Example [ActiveX and VBA Reference: AAR]

SetCustomByIndex Example

Using Programming Languages other than VBA

Sub Example_SetCustomByIndex()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


SetCustomByKey Example [ActiveX and VBA Reference: AAR]

SetCustomByKey Example

Using Programming Languages other than VBA

Sub Example_SetCustomByKey()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


SetCustomScale Example [ActiveX and VBA Reference: AAR]

SetCustomScale Example

Using Programming Languages other than VBA

Sub Example_SetCustomScale()
    ' This example will access the Layouts collection for the current drawing
    ' and list basic information about the custom scale for each Layout.
    ' It will then change the custom scale information for model space and re-display
    ' the scale information.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim Numerator As Double, Denominator As Double
    Dim Measurement As String

    ' Display current scale information
    GoSub DISPLAY_SCALE_INFO

    ' Modify scale
    Numerator = 1
    Denominator = 1

    ThisDrawing.Layouts("Model").SetCustomScale Numerator, Denominator
    ThisDrawing.Regen acAllViewports

    ' Display new scale information
    GoSub DISPLAY_SCALE_INFO

    Exit Sub

DISPLAY_SCALE_INFO:
    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Get the scale information of every layout in this drawing
    For Each Layout In Layouts
        msg = msg & Layout.name & vbCrLf

        ' Get scale information
        Layout.GetCustomScale Numerator, Denominator

        ' Identify whether inches or millimeters are being used.
        Measurement = IIf(Layout.PaperUnits = acInches, " inch(es)", " millimeter(s)")

        ' Format for display
        msg = msg & vbTab & "Contains " & Numerator & Measurement & vbCrLf
        msg = msg & vbTab & "Contains " & Denominator & " drawing units" & vbCrLf
        msg = msg & "_____________________" & vbCrLf

    Next

    ' Display custom scale information
    MsgBox "Custom scale information for the current drawing is: " & msg

    Return
End Sub


SetDatabase Example [ActiveX and VBA Reference: AAR]

SetDatabase Example

Using Programming Languages other than VBA

Sub Example_SetDatabase()
    ' The following code saves the color and linetype settings
    ' of the current layer. It uses the SetDatabase method to
    ' associate the current drawing database with the
    ' LayerStateManager object.

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

End Sub


SetFitPoint Example [ActiveX and VBA Reference: AAR]

SetFitPoint Example

Using Programming Languages other than VBA

Sub Example_SetFitPoint()
    ' This example creates a spline object in model space.
    ' It then finds the coordinates of the first fit point
    ' and changes that value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the first fit point
    Dim fitPoint As Variant
    fitPoint = splineObj.GetFitPoint(0)
    MsgBox "Fit point 1 is at " & fitPoint(0) & ", " & fitPoint(1) & ", " & fitPoint(2), , "SetFitPoint Example"

    ' Change the coordinates of the first fit point
    fitPoint(0) = 0: fitPoint(1) = 3: fitPoint(2) = 0
    splineObj.SetFitPoint 0, fitPoint
    splineObj.Update
    MsgBox "Fit point 1 is now at " & fitPoint(0) & ", " & fitPoint(1) & ", " & fitPoint(2), , "SetFitPoint Example"

End Sub


SetFont Example [ActiveX and VBA Reference: AAR]

SetFont Example

Using Programming Languages other than VBA

Sub Example_SetFont()
    ' This example finds the font information for the active text style.
    ' It then changes the font to bold.

    Dim typeFace As String
    Dim Bold As Boolean
    Dim Italic As Boolean
    Dim charSet As Long
    Dim PitchandFamily As Long

    ThisDrawing.ActiveTextStyle.GetFont typeFace, Bold, Italic, charSet, PitchandFamily

    MsgBox "The current text style has the following font properties:" & vbCrLf _
            & "Typeface: " & typeFace & vbCrLf _
            & "Bold: " & Bold & vbCrLf _
            & "Italic: " & Italic & vbCrLf _
            & "Character set: " & charSet & vbCrLf _
            & "Pitch and Family: " & PitchandFamily

    ' Change the bold property
    Bold = Not Bold

    ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet, PitchandFamily
    MsgBox "The current text style has the following font properties:" & vbCrLf _
            & "Typeface: " & typeFace & vbCrLf _
            & "Bold: " & Bold & vbCrLf _
            & "Italic: " & Italic & vbCrLf _
            & "Character set: " & charSet & vbCrLf _
            & "Pitch and Family: " & PitchandFamily

    ' Reset the font
    Bold = Not Bold
    ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet, PitchandFamily

End Sub


SetGridColor Example [ActiveX and VBA Reference: AAR]

SetGridColor Example

Using Programming Languages other than VBA

Sub Example_SetGridColor()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetGridLineWeight Example [ActiveX and VBA Reference: AAR]

SetGridLineWeight Example

Using Programming Languages other than VBA

Sub Example_SetGridLineWeight()
    'Turn on display of lineweights
    Call ThisDrawing.SetVariable("LWDISPLAY", 1)
    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

    'Set the lineweight for all grid lines of the table to 1.0
    Call MyTable.SetGridLineWeight(AcGridLineType.acHorzTop + AcGridLineType.acHorzBottom + AcGridLineType.acHorzInside + _
                            AcGridLineType.acVertLeft + AcGridLineType.acVertInside + AcGridLineType.acVertRight, _
                            AcRowType.acDataRow + AcRowType.acHeaderRow + AcRowType.acTitleRow, _
                            AcLineWeight.acLnWt050)

    'Assign a lineweight of 2.0 to the top grid line of the Title row
    Call MyTable.SetGridLineWeight(AcGridLineType.acHorzTop, AcRowType.acTitleRow, AcLineWeight.acLnWt200)

    'Assign a lineweight of 2.0 to the bottom grid line of the data row
    Call MyTable.SetGridLineWeight(AcGridLineType.acHorzBottom, AcRowType.acDataRow, AcLineWeight.acLnWt200)
    ZoomExtents

End Sub


SetGridSpacing Example [ActiveX and VBA Reference: AAR]

SetGridSpacing Example

Using Programming Languages other than VBA

Sub Example_SetGridSpacing()
    ' This example turns on the grid for the current viewport.
    ' It then finds the current grid spacing, and changes that spacing.

    ' Find the current active viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Turn on the grid and reset the viewport to see it come on.
    viewportObj.GridOn = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Find the current grid spacing
    Dim XSpacing As Double
    Dim YSpacing As Double

    viewportObj.GetGridSpacing XSpacing, YSpacing
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, , "SetGridSpacing Example"

    ' Change the grid spacing
    XSpacing = XSpacing * 0.5
    YSpacing = YSpacing * 0.5
    viewportObj.SetGridSpacing XSpacing, YSpacing
    ThisDrawing.ActiveViewport = viewportObj
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, , "SetGridSpacing Example"

End Sub


SetGridVisibility Example [ActiveX and VBA Reference: AAR]

SetGridVisibility Example

Using Programming Languages other than VBA

Sub Example_SetGridVisibility()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetInvisibleEdge Example [ActiveX and VBA Reference: AAR]

SetInvisibleEdge Example

Using Programming Languages other than VBA

Sub Example_SetInvisibleEdge()
    ' This example creates a 3D face in model space.
    ' It then toggles the visibility of the  first edge.

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double

    ' Define the four coordinates of the face
    point1(0) = 1#: point1(1) = 1#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 1#: point2(2) = 1#
    point3(0) = 1#: point3(1) = 10#: point3(2) = 0#
    point4(0) = 5#: point4(1) = 5#: point4(2) = 1#

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ZoomAll

    ' Find the current visibility status of the first edge of the face
    Dim visStatus As Boolean
    visStatus = faceObj.GetInvisibleEdge(0)
    MsgBox "The first face is currently " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"

    ' Toggle the visibility of the first edge of the face
    faceObj.SetInvisibleEdge 0, Not (visStatus)
    ThisDrawing.Regen False
    MsgBox "The first face is now " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"

End Sub


SetLayoutsToPlot Example [ActiveX and VBA Reference: AAR]

SetLayoutsToPlot Example

Using Programming Languages other than VBA

Sub Example_SetLayoutsToPlot()
    ' This example plots the layouts of a drawing.

    Dim oPlot As AcadPlot
    Dim AddedLayouts() As String
    Dim LayoutList As Variant
    Dim oLayout As AcadLayout
    Dim ArraySize As Integer, BatchCount As Integer

    For Each oLayout In ThisDrawing.Layouts
        ArraySize = ArraySize + 1
        ReDim Preserve AddedLayouts(1 To ArraySize)
        AddedLayouts(ArraySize) = oLayout.Name
    Next

    LayoutList = AddedLayouts
    Set oPlot = ThisDrawing.Plot
    oPlot.SetLayoutsToPlot LayoutList
    oPlot.PlotToDevice  "dwf6 eplot.pc3"
End Sub


SetNames Example [ActiveX and VBA Reference: AAR]

SetNames Example

Using Programming Languages other than VBA

Sub Example_SetNames()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName
    MsgBox "ColorName=" & col.ColorName
End Sub


SetPattern Example [ActiveX and VBA Reference: AAR]

SetPattern Example

Using Programming Languages other than VBA

Sub Example_SetPattern()
    ' This example creates an associative hatch in model space.
    ' The hatch pattern is then changed.

    Dim hatchObj As AcadHatch
    Dim patternName As String
    Dim PatternType As Long
    Dim bAssociativity As Boolean

    ' Define the hatch
    patternName = "ANSI31"
    PatternType = 0
    bAssociativity = True

    ' Create the associative Hatch object
    Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, bAssociativity)

    ' Create the outer loop for the hatch.
    ' An arc and a line are used to create a closed loop.

    Dim outerLoop(0 To 1) As AcadEntity
    Dim center(0 To 2) As Double
    Dim radius As Double
    Dim startAngle As Double
    Dim endAngle As Double
    center(0) = 5: center(1) = 3: center(2) = 0
    radius = 3
    startAngle = 0
    endAngle = 3.141592
    Set outerLoop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startAngle, endAngle)
    Set outerLoop(1) = ThisDrawing.ModelSpace.AddLine(outerLoop(0).startPoint, outerLoop(0).endPoint)

    ' Append the outer loop to the hatch object
    hatchObj.AppendOuterLoop (outerLoop)

    ' Append the first circle as one inner loop
    Dim innerLoop1(0) As AcadEntity
    center(0) = 5: center(1) = 4.5: center(2) = 0
    radius = 1
    Set innerLoop1(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop1)

    ' Append the second circle as the other inner loop
    Dim innerLoop2(0) As AcadEntity
    radius = 0.5
    Set innerLoop2(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
    hatchObj.AppendInnerLoop (innerLoop2)

    ' Evaluate and display the hatch
    hatchObj.Evaluate
    ZoomAll

    ' Find the name of the hatch pattern
    patternName = hatchObj.patternName
    MsgBox "The hatch pattern is " & hatchObj.patternName, , "SetPattern Example"

    ' Change the hatch pattern
    hatchObj.SetPattern acHatchPatternTypePreDefined, "BRICK"
    hatchObj.Evaluate
    ThisDrawing.Regen True
    MsgBox "The hatch pattern is now " & hatchObj.patternName, , "SetPattern Example"

End Sub


SetProjectFilePath Example [ActiveX and VBA Reference: AAR]

SetProjectFilePath Example

Using Programming Languages other than VBA

Sub Example_SetProjectFilePath()
    ' This example finds the current project file information, changes
    ' that information, and finally resets the information back to the
    ' original values.

    Dim preferences As AcadPreferences
    Set preferences = ThisDrawing.Application.preferences

    ' Get the current project file information
    Dim currProjPath As String
    Dim currProjName As Variant
    currProjName = ThisDrawing.GetVariable("PROJECTNAME")
    If currProjName <> "" Then
        currProjPath = preferences.GetProjectFilePath(currProjName)
    End If
    If currProjPath = "" Then
        MsgBox "There is no current project file or path. ", , "SetProjectFilePath Example"
    Else
        MsgBox "The current project file path is: " & currProjPath, , "SetProjectFilePath Example"
        ' Set new project file information.
        ' Change drive/path as necessary to match your system
        Dim newProjPath As String
        newProjPath = "C:/AutoCAD/"

        preferences.SetProjectFilePath currProjName, newProjPath
        MsgBox "The new project file path is: " & newProjPath, , "GetProjectFilePath Example"

        ' Reset the project file information
        preferences.SetProjectFilePath currProjName, currProjPath
        MsgBox "The project file path has been reset to: " & currProjPath, , "GetProjectFilePath Example"
    End If

End Sub


SetRGB Example [ActiveX and VBA Reference: AAR]

SetRGB Example

Using Programming Languages other than VBA

Sub Example_SetRGB()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    MsgBox "Red = " & retcolor.Red
    MsgBox "Green = " & retcolor.Green
    MsgBox "Blue = " & retcolor.Blue
End Sub


SetSnapSpacing Example [ActiveX and VBA Reference: AAR]

SetSnapSpacing Example

Using Programming Languages other than VBA

Sub Example_SetSnapSpacing()
    ' This example finds the current Snap spacing and changes it.

    ' Find the current active viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Turn on Snap mode and reset the viewport.
    viewportObj.SnapOn = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Find the current Snap spacing
    Dim XSpacing As Double
    Dim YSpacing As Double

    viewportObj.GetSnapSpacing XSpacing, YSpacing
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, Title:="SetSnapSpacing Example"

    ' Change the Snap spacing
    XSpacing = XSpacing * 0.5
    YSpacing = YSpacing * 0.5
    viewportObj.SetSnapSpacing XSpacing, YSpacing
    ThisDrawing.ActiveViewport = viewportObj
    MsgBox "X =" & XSpacing & ", Y =" & YSpacing, Title:="SetSnapSpacing Example"

End Sub


SetTextHeight Example [ActiveX and VBA Reference: AAR]

SetTextHeight Example

Using Programming Languages other than VBA

Sub Example_SetTextHeight()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetTextStyle Example [ActiveX and VBA Reference: AAR]

SetTextStyle Example

Using Programming Languages other than VBA

Sub Example_SetTextStyle()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


SetVariable Example [ActiveX and VBA Reference: AAR]

SetVariable Example

Using Programming Languages other than VBA

Sub Example_SetVariable()
    ' This example sets various system variables, each of
    ' a different data type.

    Dim sysVarName As String
    Dim sysVarData As Variant
    Dim DataType As Integer

    ' Set FILEDIA system variable (data type Integer) to 1. NOTE that
    ' you need to declare a variable as the data type of system variable,
    ' assign data to that variable and then make it variant type
    Dim intData As Integer
    sysVarName = "FILEDIA"
    intData = 1
    sysVarData = intData    ' Integer data
    ThisDrawing.SetVariable sysVarName, sysVarData

    ' Check the variable using GetVariable
    sysVarData = ThisDrawing.GetVariable(sysVarName)
    MsgBox sysVarName & " = " & sysVarData, , "SetVariable Example"

    ' Set DCTCUST system variable (data type String) to "My Custom Dictionary"
    Dim strData As String
    sysVarName = "DCTCUST"
    strData = "My Custom Dictionary"
    sysVarData = strData        ' String data
    ThisDrawing.SetVariable sysVarName, sysVarData

    ' Check the variable using GetVariable
    sysVarData = ThisDrawing.GetVariable(sysVarName)
    MsgBox sysVarName & " = " & sysVarData, , "SetVariable Example"

    ' Set CHAMFERA system variable (data type Double) to 1.5
    Dim dataDouble As Double
    sysVarName = "CHAMFERA"
    dataDouble = 1.5
    sysVarData = dataDouble ' Double data
    ThisDrawing.SetVariable sysVarName, sysVarData
    ' Check the variable using GetVariable
    sysVarData = ThisDrawing.GetVariable(sysVarName)
    MsgBox sysVarName & " = " & sysVarData, , "SetVariable Example"

    ' Set INSBASE system variable (data type array) to (1.0,1.0,0)
    Dim arrayData3D(0 To 2) As Double
    sysVarName = "INSBASE"
    arrayData3D(0) = 1#: arrayData3D(1) = 1#: arrayData3D(2) = 0
    sysVarData = arrayData3D    ' 3D array data
    ThisDrawing.SetVariable sysVarName, sysVarData
    ' Check the variable using GetVariable
    sysVarData = ThisDrawing.GetVariable(sysVarName)
    MsgBox sysVarName & " = " & sysVarData(0) & ", " & sysVarData(1) & ", " & sysVarData(2), , "SetVariable Example"

End Sub


SetView Example [ActiveX and VBA Reference: AAR]

SetView Example

Using Programming Languages other than VBA

Sub Example_SetView()
    ' This example creates a new view.
    ' It then changes the active viewport to
    ' the newly created view.

    ' First, open a sample drawing.
    ThisDrawing.Application.Documents.Open "C:\AutoCAD\Sample\campus.dwg"

    ' Create a new view
    Dim viewObj As AcadView
    Set viewObj = ThisDrawing.Views.Add("TESTVIEW")

    ' Set the view characteristics
    viewObj.center(0) = 374: viewObj.center(1) = 313
    viewObj.width = 450
    viewObj.height = 354

    ' Get the current active viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport
    MsgBox "Change to the saved view.", , "SetView Example"

    ' Set the view in the viewport
    viewportObj.SetView viewObj
    ThisDrawing.ActiveViewport = viewportObj

    ThisDrawing.Regen True

End Sub


SetWeight Example [ActiveX and VBA Reference: AAR]

SetWeight Example

Using Programming Languages other than VBA

Sub Example_SetWeight()
    ' This example creates a spline object in model space.
    ' It then finds the weight of the first control point
    ' and changes that value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
    ZoomAll

    ' Display the coordinates of the first fit point
    Dim weight As Double
    weight = splineObj.GetWeight(0)
    MsgBox "The weight of control point 1 is " & weight, , "SetWeight Example"

    ' Change the weight of the first control point
    weight = 5
    splineObj.SetWeight 0, weight
    splineObj.Update
    MsgBox "The weight of control point 1 is now " & weight, , "SetWeight Example"

End Sub


SetWidth Example [ActiveX and VBA Reference: AAR]

SetWidth Example

Using Programming Languages other than VBA

Sub Example_SetWidth()
    ' The following code prompts you to select a lightweight
    ' polyline, and then prompts you for the width to set each
    ' segment of the polyline.
    ' Pressing ENTER without specifying a width is equivalent to
    ' entering 0.

    Dim returnObj As AcadObject
    Dim basePnt As Variant
    Dim retCoord As Variant
    Dim StartWidth As Double
    Dim EndWidth As Double
    Dim i, j As Long
    Dim nbr_of_segments As Long
    Dim nbr_of_vertices As Long
    Dim segment As Long
    Dim promptStart As String
    Dim promptEnd As String

    On Error Resume Next

    ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select a polyline"

    ' Make sure the user selected a polyline.
    If Err <> 0 Then
        If returnObj.EntityName <> "AcDbPolyline" Then
            MsgBox "You did not select a polyline"
        End If
        Exit Sub
    End If

    ' Obtain the coordinates of each vertex of the selected polyline.
    ' The coordinates are returned in an array of points.
    retCoord = returnObj.Coordinates

    segment = 0
    i = LBound(retCoord)                 ' Start index of coordinates array
    j = UBound(retCoord)                 ' End index of coordinates array
    nbr_of_vertices = ((j - i) \ 2) + 1  ' Number of vertices in the polyline

    ' Determine the number of segments in the polyline.
    ' A closed polyline has as many segments as it has vertices.
    ' An open polyline has one fewer segment than it has vertices.
    ' Check the Closed property to determine if the polyline is closed.

    If returnObj.Closed Then
        nbr_of_segments = nbr_of_vertices
    Else
        nbr_of_segments = nbr_of_vertices - 1
    End If

    ' Have user set the width for each segment of the polygon
    Do While nbr_of_segments > 0

        ' Get width values from the user
        promptStart = vbCrLf & "Specify the width at the beginning of the segment at " & retCoord(i) & "," & retCoord(i + 1) & " ==> "
        promptEnd = vbCrLf & "Now specify the width at the end of that segment ==> "

        StartWidth = ThisDrawing.Utility.GetReal(promptStart)
        EndWidth = ThisDrawing.Utility.GetReal(promptEnd)

        ' Set the width of the current segment
        returnObj.SetWidth segment, StartWidth, EndWidth

        ' Prepare to obtain width of next segment, if any
        i = i + 2
        segment = segment + 1
        nbr_of_segments = nbr_of_segments - 1
    Loop

    MsgBox "Segment widths have been set", , "SetWidth Example"

End Sub


SetWindowToPlot Example [ActiveX and VBA Reference: AAR]

SetWindowToPlot Example

Using Programming Languages other than VBA

Sub Example_SetWindowToPlot()
    ' This example allows the user to define an area in the current layout
    ' and displays a plot preview of the defined area.
    '
    ' * Note: You have to exit the
    ' plot preview before the VBA example will stop and control will be returned

    Dim point1 As Variant, point2 As Variant

    ' Get first point in window
    point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")
    ReDim Preserve point1(0 To 1)   ' Change this to a 2D array by removing the Z position

    ' Get second point in window
    point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")
    ReDim Preserve point2(0 To 1)   ' Change this to a 2D array by removing the Z position

    ' Send information about window to current layout
    ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2

    ' Read back window information
    ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2

    MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _
           "Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _
           "Upper Right: " & point2(0) & ", " & point2(1)

    ' Be sure to plot a view, not some other plot style
    ThisDrawing.ActiveLayout.PlotType = acWindow

    ' Send Plot To Window
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub


SetXdata Example [ActiveX and VBA Reference: AAR]

SetXData Example

Using Programming Languages other than VBA

Sub Example_SetXdata()
    ' This example creates a line and attaches extended data to that line.

    ' Create the line
    Dim lineObj As AcadLine
    Dim startPt(0 To 2) As Double, endPt(0 To 2) As Double
    startPt(0) = 1#: startPt(1) = 1#: startPt(2) = 0#
    endPt(0) = 5#: endPt(1) = 5#: endPt(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)
    ZoomAll

    ' Initialize all the xdata values. Note that first data in the list should be
    ' application name and first datatype code should be 1001
    Dim DataType(0 To 9) As Integer
    Dim Data(0 To 9) As Variant
    Dim reals3(0 To 2) As Double
    Dim worldPos(0 To 2) As Double

    DataType(0) = 1001: Data(0) = "Test_Application"
    DataType(1) = 1000: Data(1) = "This is a test for xdata"

    DataType(2) = 1003: Data(2) = "0"                   ' layer
    DataType(3) = 1040: Data(3) = 1.23479137438413E+40  ' real
    DataType(4) = 1041: Data(4) = 1237324938            ' distance
    DataType(5) = 1070: Data(5) = 32767                 ' 16 bit Integer
    DataType(6) = 1071: Data(6) = 32767                 ' 32 bit Integer
    DataType(7) = 1042: Data(7) = 10                    ' scaleFactor

    reals3(0) = -2.95: reals3(1) = 100: reals3(2) = -20
    DataType(8) = 1010: Data(8) = reals3                ' real

    worldPos(0) = 4: worldPos(1) = 400.99999999: worldPos(2) = 2.798989
    DataType(9) = 1011: Data(9) = worldPos              ' world space position

    ' Attach the xdata to the line
    lineObj.SetXData DataType, Data

    ' Return the xdata for the line
    Dim xdataOut As Variant
    Dim xtypeOut As Variant
    lineObj.GetXData "", xtypeOut, xdataOut

End Sub


SetXRecordData Example [ActiveX and VBA Reference: AAR]

SetXRecordData Example

Using Programming Languages other than VBA

Sub Example_SetXRecordData()
    ' This example creates a new XRecord if one doesn't exist,
    ' appends data to the XRecord, and reads it back.  To see data being added,
    ' run the example more than once.

    Dim TrackingDictionary As AcadDictionary, TrackingXRecord As AcadXRecord
    Dim XRecordDataType As Variant, XRecordData As Variant
    Dim ArraySize As Long, iCount As Long
    Dim DataType As Integer, Data As String, msg As String

    ' Unique identifiers to distinguish our XRecordData from other XRecordData
    Const TYPE_STRING = 1
    Const TAG_DICTIONARY_NAME = "ObjectTrackerDictionary"
    Const TAG_XRECORD_NAME = "ObjectTrackerXRecord"

    ' Connect to the dictionary in which the XRecord is stored
    On Error GoTo CREATE
    Set TrackingDictionary = ThisDrawing.Dictionaries(TAG_DICTIONARY_NAME)
    Set TrackingXRecord = TrackingDictionary.GetObject(TAG_XRECORD_NAME)
    On Error GoTo 0

    ' Get current XRecordData
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData

    ' If there is no array already, create one
    If VarType(XRecordDataType) And vbArray = vbArray Then
        ArraySize = UBound(XRecordDataType) + 1       ' Get the size of the data elements returned
        ArraySize = ArraySize + 1                        ' Increase to hold new data

        ReDim Preserve XRecordDataType(0 To ArraySize)
        ReDim Preserve XRecordData(0 To ArraySize)
    Else
        ArraySize = 0
        ReDim XRecordDataType(0 To ArraySize) As Integer
        ReDim XRecordData(0 To ArraySize) As Variant
    End If

    ' Append new XRecord Data
    '
    ' For this sample, we only append the current time to the XRecord
    XRecordDataType(ArraySize) = TYPE_STRING: XRecordData(ArraySize) = CStr(Now)
    TrackingXRecord.SetXRecordData XRecordDataType, XRecordData

    ' Read back all XRecordData entries
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData
    ArraySize = UBound(XRecordDataType)

    ' Retrieve and display stored XRecordData
    For iCount = 0 To ArraySize
        ' Get information for this element
        DataType = XRecordDataType(iCount)
        Data = XRecordData(iCount)

        If DataType = TYPE_STRING Then
            msg = msg & Data & vbCrLf
        End If
    Next

    MsgBox "The data in the XRecord is: " & vbCrLf & vbCrLf & msg, vbInformation

    Exit Sub

CREATE:
    ' Create the objects that hold the XRecordData
    If TrackingDictionary Is Nothing Then  ' Make sure the tracking object is there
        Set TrackingDictionary = ThisDrawing.Dictionaries.Add(TAG_DICTIONARY_NAME)
        Set TrackingXRecord = TrackingDictionary.AddXRecord(TAG_XRECORD_NAME)
    End If

    Resume
End Sub


ShadePlot Example [ActiveX and VBA Reference: AAR]

ShadePlot Example

Using Programming Languages other than VBA

Sub Example_ShadePlot()
    ' This example creates a paper space viewport,
    ' makes it active, and then sets it to plot as displayed.

    Dim newPViewport As AcadPViewport
    Dim centerPoint(0 To 2) As Double
    Dim height As Double
    Dim width As Double
    height = 30#
    width = 40#
    centerPoint(0) = 30#: centerPoint(1) = 30#: centerPoint(2) = 0#

    ' Create a paper space Viewport object
    ThisDrawing.ActiveSpace = acPaperSpace
    Set newPViewport = ThisDrawing.PaperSpace.AddPViewport(centerPoint, width, height)
    ZoomAll
    newPViewport.Display True
    ThisDrawing.MSpace = True

    ' Set the viewport to plot as displayed
    ThisDrawing.ActivePViewport = newPViewport
    newPViewport.ShadePlot = acShadePlotAsDisplayed
End Sub


ShadowDisplay Example [ActiveX and VBA Reference: AAR]

ShadowDisplay Example

Using Programming Languages other than VBA

Sub Example_ShadowDisplay()

    ' This example creates a cone in model space and changes its shadow display setting.

    Dim coneObj As Acad3DSolid
    Dim centerPoint(0 To 2) As Double
    Set coneObj = ThisDrawing.ModelSpace.AddCone(centerPoint, 5, 20)

    Dim shadowObj As IAcadShadowDisplay
    Dim EnableShadowDisplayStatus As Long
    Dim ShadowDisplay As AcShadowDisplayType
    Dim displaySettingDesc As String
    Set shadowObj = coneObj

    EnableShadowDisplayStatus = shadowObj.EnableShadowDisplay
    ShadowDisplay = shadowObj.ShadowDisplay

    displaySettingDesc = DescribeShadowDisplay(ShadowDisplay)
    If EnableShadowDisplayStatus = 1 Then
        MsgBox "Shadow display is currently enabled for this object." & vbCr & _
            "Current shadow display setting is: " & displaySettingDesc
    Else
        MsgBox "Shadow display is disabled for this object."
    End If

    shadowObj.ShadowDisplay = acCastsShadows
    displaySettingDesc = DescribeShadowDisplay(shadowObj.ShadowDisplay)
    MsgBox "New shadow display setting is: " & displaySettingDesc
End Sub

Private Function DescribeShadowDisplay(acShadow As AcShadowDisplayType) As String
    Select Case acShadow
        Case acCastsAndReceivesShadows:
            DescribeShadowDisplay = "cast and receive shadows."
        Case acCastsShadows:
            DescribeShadowDisplay = "cast shadows only."
        Case acReceivesShadows:
            DescribeShadowDisplay = "receive shadows only."
        Case acIgnoreShadows:
            DescribeShadowDisplay = "ignore shadows."
    End Select
End Function


ShortcutMenu Example [ActiveX and VBA Reference: AAR]

ShortcutMenu Example

Using Programming Languages other than VBA

Sub Example_ShortcutMenu()
    ' This example iterates through the menus collection and
    ' determines if each menu is the shortcut menu.

    ' Note that depending on how many menus are currently loaded, the
    ' menuStatus string may not be displayed in full.

    Dim currMenu As AcadPopupMenu
    Dim menuStatus As String

    menuStatus = ""
    For Each currMenu In ThisDrawing.Application.MenuGroups.Item(0).Menus
    If currMenu.shortcutMenu Then
        menuStatus = menuStatus & currMenu.name & " is the shortcut menu." & vbCrLf
    Else
        menuStatus = menuStatus & currMenu.name & " is not the shortcut menu." & vbCrLf
    End If
    Next currMenu
    MsgBox menuStatus

End Sub


ShortCutMenuDisplay Example [ActiveX and VBA Reference: AAR]

ShortCutMenuDisplay Example

Using Programming Languages other than VBA

Sub Example_ShortCutMenuDisplay()
    ' This example reads and toggles the preference value which controls
    ' whether right-clicking in the drawing area displays a shortcut menu
    ' or issues ENTER.

    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Variant, newValue As Variant
    Dim newAction As String

    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.User

    ' Read and display the original value
    originalValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(originalValue, "displays the shortcut menu", "sends an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse CURRENTLY " & newAction, vbInformation

    ' Modify the AutoSnapMarker preference by toggling the value
    ACADPref.ShortCutMenuDisplay = Not (originalValue)
    newValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(newValue, "display the shortcut menu", "send an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse over the drawing WILL NOW " & newAction, vbInformation
End Sub


ShowPlotStyles Example [ActiveX and VBA Reference: AAR]

ShowPlotStyles Example

Using Programming Languages other than VBA

Sub Example_ShowPlotStyles()
    ' This example reads and modifies the ShowPlotStyles
    ' value, and then regenerates all viewports.

    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean

    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout

    ' Read and display the original value
    originalValue = ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value is set to: " & originalValue

    ' Modify the ShowPlotStyles preference by changing the value
    ACADLayout.ShowPlotStyles = Not ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value has been set to: " & ACADLayout.ShowPlotStyles

    'Regenerate viewports
    ThisDrawing.Regen acAllViewports

End Sub


ShowProxyDialogBox Example [ActiveX and VBA Reference: AAR]

ShowProxyDialogBox Example

Using Programming Languages other than VBA

Sub Example_ShowProxyDialogBox()
    ' This example returns the current setting of
    ' ShowProxyDialogBox. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currShowProxyDialogBox As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ShowProxyDialogBox value
    currShowProxyDialogBox = preferences.OpenSave.ShowProxyDialogBox
    MsgBox "The current value for ShowProxyDialogBox is " & preferences.OpenSave.ShowProxyDialogBox, vbInformation, "ShowProxyDialogBox Example"

    ' Change the value for ShowProxyDialogBox
    preferences.OpenSave.ShowProxyDialogBox = Not (currShowProxyDialogBox)
    MsgBox "The new value for ShowProxyDialogBox is " & preferences.OpenSave.ShowProxyDialogBox, vbInformation, "ShowProxyDialogBox Example"

    ' Reset ShowProxyDialogBox to its original value
    preferences.OpenSave.ShowProxyDialogBox = currShowProxyDialogBox
    MsgBox "The ShowProxyDialogBox value is reset to " & preferences.OpenSave.ShowProxyDialogBox, vbInformation, "ShowProxyDialogBox Example"
End Sub


ShowRasterImage Example [ActiveX and VBA Reference: AAR]

ShowRasterImage Example

Using Programming Languages other than VBA

Sub Example_ShowRasterImage()
    ' This example returns the current setting of
    ' ShowRasterImage. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currShowRasterImage As Boolean

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current ShowRasterImage value
    currShowRasterImage = preferences.DISPLAY.ShowRasterImage
    MsgBox "The current value for ShowRasterImage is " & preferences.DISPLAY.ShowRasterImage, vbInformation, "ShowRasterImage Example"

    ' Change the value for ShowRasterImage
    preferences.DISPLAY.ShowRasterImage = Not (currShowRasterImage)
    MsgBox "The new value for ShowRasterImage is " & preferences.DISPLAY.ShowRasterImage, vbInformation, "ShowRasterImage Example"

    ' Reset ShowRasterImage to its original value
    preferences.DISPLAY.ShowRasterImage = currShowRasterImage
    MsgBox "The ShowRasterImage value is reset to " & preferences.DISPLAY.ShowRasterImage, vbInformation, "ShowRasterImage Example"
End Sub


ShowRotation Example [ActiveX and VBA Reference: AAR]

ShowRotation Example

Using Programming Languages other than VBA

Sub Example_ShowRotation()
    ' This example adds a raster image in model space and rotates the image.
    ' One rotation is done without angle limits, one is done with ShowRotation,
    ' which limits rotations to 90 degrees

    ' This example uses the "downtown.jpg" found in the sample
    ' directory. If you do not have this image, or it is located
    ' in a different directory, insert a valid path and file name
    ' for the imageName variable below.

    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double, rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage

    imageName = "c:\Autocad\sample\downtown.jpg"

    ' Define Raster object
    insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
    scalefactor = 1#: rotationAngle = 0

    On Error GoTo ERRORTRAP

    ' Loads a raster image into model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

    ' Limit the raster image rotations to 90 degrees
    rasterObj.ShowRotation = True

    ' Rotate the raster image 180 degrees
    rasterObj.Rotate insertionPoint, 180
    ThisDrawing.Application.ZoomAll

    Exit Sub

    ' If you get an error (most likely a problem with the file path),
    ' then display an error message

ERRORTRAP:
    If Err.Description <> "" Then
        MsgBox Err.Description
    End If
End Sub


ShowWarningMessages Example [ActiveX and VBA Reference: AAR]

ShowWarningMessages Example

Using Programming Languages other than VBA

Sub Example_ShowWarningMessages()
    ' This example reads and modifies the preference value that
    ' resets all dialog boxes that have the
    ' "Don't Display This Warning Again" check box so they display again.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSystem
    Dim originalValue As Variant, newValue As Variant

    ' Get the system preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    ' Read and display the original value
    originalValue = ACADPref.ShowWarningMessages
    MsgBox "The ShowWarningMessages preference is set to: " & originalValue

    ' Modify the ShowWarningMessages preference by toggling the value
    ACADPref.ShowWarningMessages = Not (ACADPref.ShowWarningMessages)
    newValue = ACADPref.ShowWarningMessages
    MsgBox "The ShowWarningMessages preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.ShowWarningMessages = originalValue
    MsgBox "The ShowWarningMessages preference was reset back to: " & originalValue
End Sub


SingleDocumentMode Example [ActiveX and VBA Reference: AAR]

SingleDocumentMode Example

Using Programming Languages other than VBA

Sub Example_SingleDocumentMode()
    ' This example reads and modifies the preference value that controls
    ' whether AutoCAD runs in single- or multiple-document mode.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSystem
    Dim originalValue As Variant, newValue As Variant

    ' Get the system preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    ' Read and display the original value
    originalValue = ACADPref.SingleDocumentMode
    MsgBox "The SingleDocumentMode preference is set to: " & originalValue

    ' Modify the SingleDocumentMode preference by toggling the value
    ACADPref.SingleDocumentMode = Not (ACADPref.SingleDocumentMode)
    newValue = ACADPref.SingleDocumentMode
    MsgBox "The SingleDocumentMode preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.SingleDocumentMode = originalValue
    MsgBox "The SingleDocumentMode preference was reset back to: " & originalValue
End Sub


SliceSolid Example [ActiveX and VBA Reference: AAR]

SliceSolid Example

Using Programming Languages other than VBA

Sub Example_SliceSolid()
    ' This example creates a box in model space.
    ' It then slices the box based on a plane
    ' defined by three points. The slice is returned
    ' as a 3Dsolid.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Define the section plane with three points
    Dim slicePt1(0 To 2) As Double
    Dim slicePt2(0 To 2) As Double
    Dim slicePt3(0 To 2) As Double

    slicePt1(0) = 1.5: slicePt1(1) = 7.5: slicePt1(2) = 0
    slicePt2(0) = 1.5: slicePt2(1) = 7.5: slicePt2(2) = 10
    slicePt3(0) = 8.5: slicePt3(1) = 2.5: slicePt3(2) = 10

    ' slice the box
    Dim sliceObj As Acad3DSolid
    Set sliceObj = boxObj.SliceSolid(slicePt1, slicePt2, slicePt3, True)

    ' Change the viewing direction of the viewport
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

End Sub


SnapBasePoint Example [ActiveX and VBA Reference: AAR]

SnapBasePoint Example

Using Programming Languages other than VBA

Sub Example_SnapBasePoint()
    ' This example changes the snap base point for a
    ' model space and paper space viewport.

    ' Create a new model space viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.Viewports.Add("NewViewport")

    ' Find the current snap base point
    Dim currSnapPnt As Variant
    currSnapPnt = viewportObj.SnapBasePoint
    MsgBox "The current model space snap base point is " & viewportObj.SnapBasePoint(0) & ", " & viewportObj.SnapBasePoint(1), , "SnapBasePoint Example"

    ' Change the snap base point
    Dim newSnapPnt(0 To 1) As Double
    newSnapPnt(0) = 5#: newSnapPnt(1) = 5#
    viewportObj.SnapBasePoint = newSnapPnt
    MsgBox "The new model space snap base point is " & viewportObj.SnapBasePoint(0) & ", " & viewportObj.SnapBasePoint(1), , "SnapBasePoint Example"

    ' Create a new paper space viewport
    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40
    ThisDrawing.ActiveSpace = acPaperSpace
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)

    ' Find the current snap base point
    currSnapPnt = pviewportObj.SnapBasePoint
    MsgBox "The current paper space snap base point is " & pviewportObj.SnapBasePoint(0) & ", " & pviewportObj.SnapBasePoint(1), , "SnapBasePoint Example"

    ' Change the snap base point
    newSnapPnt(0) = 2#: newSnapPnt(1) = 2#
    pviewportObj.SnapBasePoint = newSnapPnt
    MsgBox "The new paper space snap base point is " & pviewportObj.SnapBasePoint(0) & ", " & pviewportObj.SnapBasePoint(1), , "SnapBasePoint Example"

End Sub


SnapOn Example [ActiveX and VBA Reference: AAR]

SnapOn Example

Using Programming Languages other than VBA

Sub Example_SnapOn()
    ' This example toggles the setting of SnapOn.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Display the current setting of SnapOn
    MsgBox "Snap mode is: " & IIf(viewportObj.SnapOn, "On", "Off"), , "SnapOn Example"

    ' Toggle the setting of SnapOn
    viewportObj.SnapOn = Not (viewportObj.SnapOn)

    ' Reset the active viewport to see the change on the AutoCAD status bar
    ThisDrawing.ActiveViewport = viewportObj

    MsgBox "Snap mode is now: " & IIf(viewportObj.SnapOn, "On", "Off"), , "SnapOn Example"

End Sub


SnapRotAngle Example [ActiveX and VBA Reference: AAR]

SnapRotationAngle Example

Using Programming Languages other than VBA

Sub Example_SnapRotationAngle()
    ' This example changes the snap rotation angle for a
    ' model space and paper space viewport.

    ' Create a new model space viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.Viewports.Add("NewViewport")

    ' Find the current snap rotation angle
    Dim currSnapAngle As Double
    currSnapAngle = viewportObj.SnapRotationAngle
    MsgBox "The current model space snap rotation angle is " & viewportObj.SnapRotationAngle, , "SnapRotationAngle Example"

    ' Change the snap rotation angle
    viewportObj.SnapRotationAngle = 1.5
    MsgBox "The new model space snap rotation angle is " & viewportObj.SnapRotationAngle, , "SnapRotationAngle Example"

    ' Create a new paper space viewport
    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40
    ThisDrawing.ActiveSpace = acPaperSpace
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)

    ' Find the current snap rotation angle
    currSnapAngle = pviewportObj.SnapRotationAngle
    MsgBox "The current paper space snap rotation angle is " & pviewportObj.SnapRotationAngle, , "SnapRotationAngle Example"

    ' Change the snap rotation angle
    pviewportObj.SnapRotationAngle = 1.5
    MsgBox "The new paper space snap base point is " & pviewportObj.SnapRotationAngle, , "SnapRotationAngle Example"

End Sub


SolidFill Example [ActiveX and VBA Reference: AAR]

SolidFill Example

Using Programming Languages other than VBA

Sub Example_SolidFill()
    ' This example reads and modifies the preference value that controls
    ' whether multilines, traces, solids, all hatches (including solid-fill)
    ' and wide polylines are filled in.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.SolidFill
    MsgBox "The SolidFill preference is set to: " & originalValue

    ' Modify the SolidFill preference by toggling the value
    ACADPref.SolidFill = Not (ACADPref.SolidFill)
    newValue = ACADPref.SolidFill
    MsgBox "The SolidFill preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.SolidFill = originalValue
    MsgBox "The SolidFill preference was reset back to: " & originalValue
End Sub


SortentsTable Example [ActiveX and VBA Reference: AAR]

SortentsTable Example

Using Programming Languages other than VBA

Sub Example_SortentsTable()
    ' This example creates a SortentsTable object and
    ' changes the draw order.

    ' Set drawing to display lineweights and create a True Color object
    Dim ACADPref As AcadDatabasePreferences
    Set ACADPref = ThisDrawing.Preferences
    ACADPref.LineWeightDisplay = True
    Dim MyColorObjOne As AcadAcCmColor
    Set MyColorObjOne = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call MyColorObjOne.SetRGB(80, 100, 244)

    ' Draw a polyline
    Dim plineObj As AcadPolyline
    Dim points(0 To 8) As Double
    points(0) = 4: points(1) = 4: points(2) = 0
    points(3) = 3: points(4) = 5: points(5) = 0
    points(6) = 6: points(7) = 20: points(8) = 0
    Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
    plineObj.Lineweight = acLnWt211
    Call MyColorObjOne.SetRGB(90, 110, 150)
    plineObj.TrueColor = MyColorObjOne

    ' Draw a line
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 5: startPoint(1) = 13: startPoint(2) = 0
    endPoint(0) = 5: endPoint(1) = 27: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Lineweight = acLnWt211
    Call MyColorObjOne.SetRGB(50, 80, 230)
    lineObj.TrueColor = MyColorObjOne

    ' Draw a circle
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    centerPoint(0) = 10: centerPoint(1) = 15: centerPoint(2) = 0#
    radius = 5#
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    circleObj.Lineweight = acLnWt211
    Call MyColorObjOne.SetRGB(60, 200, 220)
    circleObj.TrueColor = MyColorObjOne
    ZoomAll
    AcadApplication.Update

    'Gxet an extension dictionary and, if necessary, add a SortentsTable object
    Dim eDictionary As Object
    Set eDictionary = ThisDrawing.ModelSpace.GetExtensionDictionary
    ' Prevent failed GetObject calls from throwing an exception
    On Error Resume Next
    Dim sentityObj As Object
    Set sentityObj = eDictionary.GetObject("ACAD_SORTENTS")
    On Error GoTo 0
    If sentityObj Is Nothing Then
         ' No SortentsTable object, so add one
         Set sentityObj = eDictionary.AddObject("ACAD_SORTENTS", "AcDbSortentsTable")
    End If

    Dim ObjIds(2) As Long
    ObjIds(0) = plineObj.ObjectID
    ObjIds(1) = lineObj.ObjectID
    ObjIds(2) = circleObj.ObjectID

    Dim varObject As AcadObject
    Set varObject = ThisDrawing.ObjectIdToObject(ObjIds(2))
    Dim arr(0) As AcadObject
    Set arr(0) = varObject

    'Move the circle object to the bottom
    sentityObj.MoveToBottom arr
    AcadApplication.Update

End Sub


Split Example [ActiveX and VBA Reference: AAR]

Split Example

Using Programming Languages other than VBA

Sub Example_Split()
    ' This example creates a new viewport and makes it active.
    ' Then it splits the viewport into four windows.
    ' It then takes one of the four windows, and splits that
    ' window horizontally in half.
    Dim newViewport As AcadViewport

    ' Create a new viewport and make it active
    Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT")
    ThisDrawing.ActiveViewport = newViewport

    ' Split the viewport in four windows
    newViewport.Split acViewport4

    ' Make the newly split viewport active
    ThisDrawing.ActiveViewport = newViewport

    ' Note that current drawing layout will show four windows.
    ' However, only one of the windows will be active.
    ' The following code sets the lower-left corner window
    ' to be the active window and then splits that
    ' window into two horizontal windows.
    Dim entry
    For Each entry In ThisDrawing.Viewports
        If entry.name = "TESTVIEWPORT" Then
            Dim lowerLeft
            lowerLeft = entry.LowerLeftCorner
            If lowerLeft(0) = 0 And lowerLeft(1) = 0 Then
                Set newViewport = entry
                Exit For
            End If
        End If
    Next
    newViewport.Split acViewport2Horizontal
    ThisDrawing.ActiveViewport = newViewport
End Sub


StandardScale Example [ActiveX and VBA Reference: AAR]

StandardScale Example

Using Programming Languages other than VBA

Sub Example_StandardScale()
    ' This example will access the active layout for the current drawing
    ' and list the standard scale for that Layout.
    ' It then changes the standard scale for the layout, and finally
    ' resets the scale back to its original value.

    Dim Layout As ACADLayout
    Dim currScale As Integer

    ' Get the activeLayout
    Set Layout = ThisDrawing.ActiveLayout

    ' Find the current standard scale
    currScale = Layout.StandardScale
    MsgBox "The current standard scale is : " & Layout.StandardScale

    ' Change the standard scale to 100:1
    Layout.StandardScale = ac100_1
    MsgBox "The new standard scale is : " & Layout.StandardScale

    ' Reset the original standard scale
    Layout.StandardScale = currScale
    MsgBox "The new standard scale is : " & Layout.StandardScale

End Sub


StartAngle Example [ActiveX and VBA Reference: AAR]

StartAngle Example

Using Programming Languages other than VBA

Sub Example_StartAngle()
    ' This example creates an ellipse and enters the start and
    ' end angles to create an elliptical arc.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    'Enter a start angle of 45 degrees, and an end angle of 270 degrees
    ellObj.startAngle = 45 * (3.14 / 180)
    ellObj.endAngle = 270 * (3.14 / 180)
    ZoomAll
    MsgBox "The ellipse has a start angle of " & ellObj.startAngle * (180 / 3.14) & " and the end angle of " & ellObj.endAngle * (180 / 3.14) & " degrees.", vbInformation, "StartAngle Example"
End Sub


StartBatchMode Example [ActiveX and VBA Reference: AAR]

StartBatchMode Example

Using Programming Languages other than VBA

Sub Example_StartBatchMode()
    'This method may become obsolete and may be removed
    'in a future (post-AutoCAD 2005) version.


StartParameter Example [ActiveX and VBA Reference: AAR]

StartParameter Example

Using Programming Languages other than VBA

Sub Example_StartParameter()
    ' This example creates an ellipse and enters the start and
    ' end parameters to create an elliptical arc.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ' Enter a start parameter of 1.57, and an end parameter of 6.28
    ellObj.StartParameter = 1.57
    ellObj.EndParameter = 6.28
    ZoomAll

    ' Find the start and end parameters for the ellipse
    MsgBox "The ellipse has a start parameter of " & ellObj.StartParameter & " and an end parameter of " & ellObj.EndParameter, vbInformation, "StartParameter Example"
End Sub


StartPoint Example [ActiveX and VBA Reference: AAR]

StartPoint Example

Using Programming Languages other than VBA

Sub Example_StartPoint()
    ' This example creates an elliptical arc and then
    ' finds the coordinates of its start point and endpoint.
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    Dim startPoint As Variant
    Dim endPoint As Variant

    ' Create an ellipse in model space
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ' Enter a start angle of 45 degrees, and an end angle of 270 degrees
    ellObj.startAngle = 45 * (3.14 / 180)
    ellObj.endAngle = 270 * (3.14 / 180)
    ZoomAll

    ' Find the start and endpoints for the ellipse
    startPoint = ellObj.startPoint
    endPoint = ellObj.endPoint
    MsgBox "This ellipse has a start point of " & startPoint(0) & ", " & startPoint(1) & ", " & startPoint(2) & " and an endpoint of " & endPoint(0) & ", " & endPoint(1) & ", " & endPoint(2), vbInformation, "StartPoint Example"
End Sub


StartTangent Example [ActiveX and VBA Reference: AAR]

StartTangent Example

Using Programming Languages other than VBA

Sub Example_StartTangent()
    ' This example creates a spline. It then queries the current setting for
    ' the StartTangent, and then changes the StartTangent to a new value.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double
    Dim endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim msg As String

    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
    fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ThisDrawing.Regen True
    GoSub GETPOINTS
    MsgBox "The StartTangent for the spline is  " & msg, vbInformation, "StartTangent Example"

    Dim newTan(0 To 2) As Double
    newTan(0) = 1.5: newTan(1) = 0.707: newTan(2) = 2

    ' Change the start tangent of Spline to (1.5, 0.707, 2)
    splineObj.EndTangent = newTan

    ThisDrawing.Regen True
    GoSub GETPOINTS
    MsgBox "The StartTangent has been changed to " & msg, vbInformation, "StartTangent Example"

    Exit Sub

GETPOINTS:
    Dim count As Integer
    msg = ""
    ' Get the coordinates from the start tangent
    For count = 0 To 2
        msg = msg & Format(splineObj.StartTangent(count), "0.###") & ", "
    Next
    msg = VBA.Left(msg, Len(msg) - 2)
    Return
End Sub


StartUndoMark Example [ActiveX and VBA Reference: AAR]

StartUndoMark Example

Using Programming Languages other than VBA

Sub Example_StartUndoMark()
    ' This example creates a series of lines, each with an undo marker
    ' defined for it. After lines are created, you can switch to AutoCAD and type
    ' the Undo command, and only one line at a time will be undone. If StartUndoMark
    ' call is not made, an undo in AutoCAD will undo all the lines at once.

    Dim line As AcadLine
    Dim stPnt(0 To 2) As Double
    Dim endPnt(0 To 2) As Double
    stPnt(0) = 1: stPnt(1) = 2: stPnt(2) = 0
    endPnt(0) = 2: stPnt(1) = 1: stPnt(2) = 0

    ' Create the lines
    Dim j As Integer
    For j = 0 To 3
        ThisDrawing.StartUndoMark
        Set line = ThisDrawing.ModelSpace.AddLine(stPnt, endPnt)
        stPnt(0) = stPnt(0) + 3
        endPnt(0) = endPnt(0) + 3
        ThisDrawing.EndUndoMark
    Next
    ZoomAll

End Sub


StatusID Example [ActiveX and VBA Reference: AAR]

StatusID Example

Using Programming Languages other than VBA

Sub Example_StatusID()
    ' This example displays the setting of StatusID.

    Dim currStatusID As Boolean

    ' Display the current setting of statusID
    currStatusID = ThisDrawing.Application.statusID(ThisDrawing.ActiveViewport)
    MsgBox "The statusID of the active viewort is: " & currStatusID, , "StatusID Example"

End Sub


StoreSQLIndex Example [ActiveX and VBA Reference: AAR]

StoreSQLIndex Example

Using Programming Languages other than VBA

Sub Example_StoreSQLIndex()
    ' This example reads and modifies the preference value that controls
    ' whether the SQL index is stored in the drawing.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSystem
    Dim originalValue As Variant, newValue As Variant

    ' Get the system preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    ' Read and display the original value
    originalValue = ACADPref.StoreSQLIndex
    MsgBox "The StoreSQLIndex preference is set to: " & originalValue

    ' Modify the StoreSQLIndex preference by toggling the value
    ACADPref.StoreSQLIndex = Not (ACADPref.StoreSQLIndex)
    newValue = ACADPref.StoreSQLIndex
    MsgBox "The StoreSQLIndex preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.StoreSQLIndex = originalValue
    MsgBox "The StoreSQLIndex preference was reset back to: " & originalValue
End Sub


StyleName Example [ActiveX and VBA Reference: AAR]

StyleName Example

Using Programming Languages other than VBA

Sub Example_StyleName()
    ' This example creates an aligned dimension and then changes the
    ' StyleName property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim currStyleName As String

    ' Define the dimension
    point1(0) = 5#: point1(1) = 3#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 3#: point2(2) = 0#
    location(0) = 7.5: location(1) = 5#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    currStyleName = dimObj.styleName
    MsgBox "The initial StyleName for the dimension is " & dimObj.styleName, vbInformation, "TextString Example"

    ' Create a new dimension style
    ThisDrawing.DimStyles.Add ("NewDimensionStyle")

    ' Change the text string for the dimension
    dimObj.styleName = "NewDimensionStyle"
    dimObj.Update
    MsgBox "The new StyleName for the dimension is " & dimObj.styleName, vbInformation, "TextString Example"

    ' Reset the text string for the dimension
    dimObj.styleName = currStyleName
    dimObj.Update
    MsgBox "The StyleName for the dimension has been reset to " & dimObj.styleName, vbInformation, "TextString Example"
End Sub


StyleSheet Example [ActiveX and VBA Reference: AAR]

StyleSheet Example

Using Programming Languages other than VBA

Sub Example_StyleSheet()
    ' This example finds the name of the style sheet for the active layout

    Dim styleSheetName As String
    styleSheetName = ThisDrawing.ActiveLayout.StyleSheet

    If styleSheetName = "" Then
        MsgBox "There is no style sheet set for the active layout."
    Else
        MsgBox "The style sheet for the active layout is: " & styleSheetName
    End If
End Sub


Subject Example [ActiveX and VBA Reference: AAR]

Subject Example

Using Programming Languages other than VBA

Sub Example_Subject()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True

    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP

    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


Subject Example [ActiveX and VBA Reference: AAR]

Subject Example

Using Programming Languages other than VBA

Sub Example_Subject()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


SubMenu Example [ActiveX and VBA Reference: AAR]

SubMenu Example

Using Programming Languages other than VBA

Sub Example_SubMenu()
    ' This example finds the menu used as the sub menu for the
    ' "Autodesk on the Web" menu item in the Help menu.

    Dim acadMenuGroup As acadMenuGroup
    Set acadMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")

    Dim helpMenu As AcadPopupMenu
    Set helpMenu = acadMenuGroup.Menus.Item("&Help")

    Dim WebMenuItem As AcadPopupMenuItem
    Set WebMenuItem = helpMenu.Item(5)

    Dim subWebMenu As AcadPopupMenu
    Set subWebMenu = WebMenuItem.subMenu

    MsgBox "The name of the submenu is " & subWebMenu.TagString
End Sub


SummaryInfo Example [ActiveX and VBA Reference: AAR]

SummaryInfo Example

Using Programming Languages other than VBA

Sub Example_SummaryInfo()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


SupportPath Example [ActiveX and VBA Reference: AAR]

SupportPath Example

Using Programming Languages other than VBA

Sub Example_SupportPath()
    ' This example returns the current setting of
    ' SupportPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currSupportPath As String
    Dim newSupportPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current SupportPath value
    currSupportPath = preferences.Files.SupportPath
    MsgBox "The current value for SupportPath is " & currSupportPath, vbInformation, "SupportPath Example"

    ' Change the value for SupportPath
    newSupportPath = "TestSupportPath"
    preferences.Files.SupportPath = newSupportPath
    MsgBox "The new value for SupportPath is " & newSupportPath, vbInformation, "SupportPath Example"

    ' Reset SupportPath to its original value
    preferences.Files.SupportPath = currSupportPath
    MsgBox "The SupportPath value is reset to " & currSupportPath, vbInformation, "SupportPath Example"
End Sub


SuppressLeadingZeros Example [ActiveX and VBA Reference: AAR]

SuppressLeadingZeros Example

Using Programming Languages other than VBA

Sub Example_SuppressLeadingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses the SuppressLeadingZeros property to toggle the display of leading zeros
   ' in the dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of leading zeros in the dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of leading zeros for the dimension value
            dimObj.SuppressLeadingZeros = Not (dimObj.SuppressLeadingZeros)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


SuppressTrailingZeros Example [ActiveX and VBA Reference: AAR]

SuppressTrailingZeros Example

Using Programming Languages other than VBA

Sub Example_SuppressTrailingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses the SuppressTrailingZeros property to toggle the display of trailing zeros
   ' in the dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 7: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of trailing zeros in the dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of trailing zeros for the dimension value
            dimObj.SuppressTrailingZeros = Not (dimObj.SuppressTrailingZeros)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


SuppressZeroFeet Example [ActiveX and VBA Reference: AAR]

SuppressZeroFeet Example

Using Programming Languages other than VBA

Sub Example_SuppressZeroFeet()
   ' This example creates an aligned dimension in model space and
   ' uses SuppressZeroFeet to suppress or view the display of
   ' zero feet in the alternate dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set the dimension display to a style that works with SuppressZeroFeet
    dimObj.UnitsFormat = acDimLArchitectural

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero feet in the dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero feet for the dimension value
            dimObj.SuppressZeroFeet = Not (dimObj.SuppressZeroFeet)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


SuppressZeroInches Example [ActiveX and VBA Reference: AAR]

SuppressZeroInches Example

Using Programming Languages other than VBA

Sub Example_SuppressZeroInches()
   ' This example creates an aligned dimension in model space and
   ' uses SuppressZeroInches to suppress or view the display of
   ' zero inches in the dimension display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 12: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Set the dimension display to a style that works with SuppressZeroInches
    dimObj.UnitsFormat = acDimLArchitectural

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to suppress or view the display of zero inches in the dimension", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero inches for the dimension value
            dimObj.SuppressZeroInches = Not (dimObj.SuppressZeroInches)
            ThisDrawing.Regen acAllViewports
        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


System Example [ActiveX and VBA Reference: AAR]

System Example

Using Programming Languages other than VBA

Sub Example_System()
    ' This example obtains a reference to the System Preferences object
    ' from the Application Preferences object, and reads one of the System
    ' preferences

    Dim ACADPref As AcadPreferencesSystem

    ' Obtain a reference to the System Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    MsgBox "You now have access to the properties and methods of the System Preferences object!"
    MsgBox "The System preference BeepOnError is set to: " & ACADPref.BeepOnError

    ' Release System Preferences object
    Set ACADPref = Nothing
    MsgBox "The System Preferences object has been released!"
End Sub


SysVarChanged Example [: AAR]

SysVarChanged Example

Using Programming Languages other than VBA

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples

Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.

    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub

Private Sub ACADApp_SysVarChanged(ByVal SysvarName As String, ByVal newVal As Variant)
    ' This example intercepts an Application SysVarChanged event.
    '
    ' This event is triggered when the value of a system variable is changed.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Change the value of a system variable in AutoCAD.
    '     For example: Type GRIDMODE on the command line and toggle the grid display on/off

    ' Use the "SysvarName" and "newVal" variables to determine which
    ' system variable has changed and its new value.
    MsgBox "The system variable " & SysvarName & " was just changed to: " & newVal
End Sub


Table Example [ActiveX and VBA Reference: AAR]

Table Example

Using Programming Languages other than VBA

Sub Example_Table()
     ' This example adds a table in model space

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Set MyTable = MyModelSpace.Addtable(pt, 5, 5, 10, 30)
    ZoomExtents

End Sub


TablesReadOnly Example [ActiveX and VBA Reference: AAR]

TablesReadOnly Example

Using Programming Languages other than VBA

Sub Example_TablesReadOnly()
    ' This example reads and modifies the preference value that controls
    ' whether to open database tables in read-only mode.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesSystem
    Dim originalValue As Variant, newValue As Variant

    ' Get the system preferences object
    Set ACADPref = ThisDrawing.Application.preferences.System

    ' Read and display the original value
    originalValue = ACADPref.TablesReadOnly
    MsgBox "The TablesReadOnly preference is set to: " & originalValue

    ' Modify the TablesReadOnly preference by toggling the value
    ACADPref.TablesReadOnly = Not (ACADPref.TablesReadOnly)
    newValue = ACADPref.TablesReadOnly
    MsgBox "The TablesReadOnly preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.TablesReadOnly = originalValue
    MsgBox "The TablesReadOnly preference was reset back to: " & originalValue
End Sub


TabOrder Example [ActiveX and VBA Reference: AAR]

TabOrder Example

Using Programming Languages other than VBA

Sub Example_TabOrder()
    ' This example creates two new Layouts, sets the TabOrder of the Layouts to be
    ' in alphabetic order, and displays a list of Layouts in the order they appear
    ' in the tabs.

    Dim Layout1 As ACADLayout, Layout2 As ACADLayout
    Dim SortLayoutRight As ACADLayout, SortLayoutLeft As ACADLayout
    Dim SortIt As New Collection
    Dim TabCount As Long, SortCount As Long, TabOrder As Long
    Dim TabName As String, SortText As String, msg As String
    Dim tempLayout As ACADLayout
    Dim AddedTab As Boolean

    ' Create new Layouts
    On Error Resume Next
    Set Layout1 = ThisDrawing.Layouts.Add("Z VIEW")
    Set Layout2 = ThisDrawing.Layouts.Add("A VIEW")
    On Error GoTo 0

    ' Alphabetize internally
    For TabCount = 0 To (ThisDrawing.Layouts.count - 1)
        AddedTab = False

        TabName = ThisDrawing.Layouts(TabCount).name

        If TabName = "Model" Then GoTo SKIP                 ' Skip modelspace

        If SortIt.count = 0 Then
            SortIt.Add TabName                              ' Add to beginning of list
        Else
            For SortCount = 1 To SortIt.count               ' Add to list by string
                SortText = SortIt(SortCount)
                If StrComp(TabName, SortText, vbTextCompare) = -1 Then
                    If SortCount = 1 Then
                        SortIt.Add TabName                  ' Add as first item
                    Else
                        SortIt.Add TabName, , SortCount     ' Add as previous item
                    End If
                    AddedTab = True
                    Exit For
                End If
            Next

            If Not (AddedTab) Then SortIt.Add TabName, , , SortIt.count  ' Add if we haven't yet
        End If

SKIP:
    Next

    ' Write new ACAD tab order
    For SortCount = 1 To SortIt.count
        Set tempLayout = ThisDrawing.Layouts(SortIt(SortCount))
        tempLayout.TabOrder = SortCount
    Next

    '-------------------------------
    ' Read and display New Tab Order
    '-------------------------------
    msg = "The tab order is now set to: " & vbCrLf & vbCrLf
    For TabCount = 0 To (ThisDrawing.Layouts.count - 1)
        TabName = ThisDrawing.Layouts(TabCount).name
        If TabName = "Model" Then GoTo SKIP2                ' Don't show modelspace
        TabOrder = ThisDrawing.Layouts(TabCount).TabOrder
        msg = msg & "(" & TabOrder & ")" & vbTab & TabName & vbCrLf

SKIP2:
    Next

    MsgBox msg, vbInformation

End Sub


TagString Example [ActiveX and VBA Reference: AAR]

TagString Example

Using Programming Languages other than VBA

Sub Example_TagString()
    ' This example creates an attribute definition in model space.
    ' It then queries the tag string for the attribute, changes
    ' the tag string, and displays the new tag string.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "NEW_TAG"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Find the current tag string for the attribute
    tag = attributeObj.TagString
    MsgBox "The current tag string for the attribute is " & tag, , "TagString Example"

    ' Change the tag string for the attribute
    attributeObj.TagString = "UPDATED_TAG"
    attributeObj.Update
    tag = attributeObj.TagString
    MsgBox "The new tag string for the attribute is " & tag, , "TagString Example"

End Sub


Target Example [ActiveX and VBA Reference: AAR]

Target Example

Using Programming Languages other than VBA

Sub Example_Target()
    ' This example changes the target for a model space viewport.

    ' Create a new model space viewport
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.Viewports.Add("NewViewport")

    ' Add a circle
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)

    ' Find the current target
    Dim currTarget As Variant
    currTarget = viewportObj.target
    MsgBox "The current target is " & viewportObj.target(0) & ", " & viewportObj.target(1) & ", " & viewportObj.target(2), , "Target Example"

    ' Change the target
    Dim newTarget(0 To 2) As Double
    newTarget(0) = 2#: newTarget(1) = 2#: newTarget(2) = 0
    viewportObj.target = newTarget
    ThisDrawing.ActiveViewport = viewportObj
    ThisDrawing.Regen acAllViewports
    MsgBox "The new target is " & viewportObj.target(0) & ", " & viewportObj.target(1) & ", " & viewportObj.target(2), , "Target Example"

End Sub


TempFileExtension Example [ActiveX and VBA Reference: AAR]

TempFileExtension Example

Using Programming Languages other than VBA

Sub Example_TempFileExtension()
    ' This example returns the current setting of
    ' TempFileExtension. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTempFileExtension As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TempFileExtension value
    currTempFileExtension = preferences.OpenSave.TempFileExtension
    MsgBox "The current value for TempFileExtension is " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"

    ' Change the value for TempFileExtension
    preferences.OpenSave.TempFileExtension = "@@@"
    MsgBox "The new value for TempFileExtension is " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"

    ' Reset TempFileExtension to its original value
    preferences.OpenSave.TempFileExtension = currTempFileExtension
    MsgBox "The TempFileExtension value is reset to " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"
End Sub


TempFilePath Example [ActiveX and VBA Reference: AAR]

TempFilePath Example

Using Programming Languages other than VBA

Sub Example_TempFilePath()
    ' This example returns the current setting of
    ' TempFilePath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTempFilePath As String
    Dim newTempFilePath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TempFilePath value
    currTempFilePath = preferences.Files.TempFilePath
    MsgBox "The current value for TempFilePath is " & currTempFilePath, vbInformation, "TempFilePath Example"

    ' Change the value for TempFilePath
    newTempFilePath = "C:\AutoCAD\"
    preferences.Files.TempFilePath = newTempFilePath
    MsgBox "The new value for TempFilePath is " & newTempFilePath, vbInformation, "TempFilePath Example"

    ' Reset TempFilePath to its original value
    preferences.Files.TempFilePath = currTempFilePath
    MsgBox "The TempFilePath value is reset to " & currTempFilePath, vbInformation, "TempFilePath Example"
End Sub


TemplateDwgPath Example [ActiveX and VBA Reference: AAR]

TemplateDWGPath Example

Using Programming Languages other than VBA

Sub Example_TemplateDWGPath()
    ' This example returns the current setting of
    ' TemplateDWGPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTemplateDWGPath As String
    Dim newTemplateDWGPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TemplateDWGPath value
    currTemplateDWGPath = preferences.Files.TemplateDwgPath
    MsgBox "The current value for TemplateDWGPath is " & currTemplateDWGPath, vbInformation, "TemplateDWGPath Example"

    ' Change the value for TemplateDWGPath
    newTemplateDWGPath = "TestTemplateDWGPath"
    preferences.Files.TemplateDwgPath = newTemplateDWGPath
    MsgBox "The new value for TemplateDWGPath is " & newTemplateDWGPath, vbInformation, "TemplateDWGPath Example"

    ' Reset TemplateDWGPath to its original value
    preferences.Files.TemplateDwgPath = currTemplateDWGPath
    MsgBox "The TemplateDWGPath value is reset to " & currTemplateDWGPath, vbInformation, "TemplateDWGPath Example"
End Sub


TempXRefPath Example [ActiveX and VBA Reference: AAR]

TempXRefPath Example

Using Programming Languages other than VBA

Sub Example_TempXRefPath()
    ' This example returns the current setting of
    ' TempXRefPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTempXRefPath As String
    Dim newTempXRefPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TempXRefPath value
    currTempXRefPath = preferences.Files.TempXrefPath
    MsgBox "The current value for TempXRefPath is " & currTempXRefPath, vbInformation, "TempXRefPath Example"

    ' Change the value for TempXRefPath
    newTempXRefPath = "TestTempXRefPath"
    preferences.Files.TempXrefPath = newTempXRefPath
    MsgBox "The new value for TempXRefPath is " & newTempXRefPath, vbInformation, "TempXRefPath Example"

    ' Reset TempXRefPath to its original value
    preferences.Files.TempXrefPath = currTempXRefPath
    MsgBox "The TempXRefPath value is reset to " & currTempXRefPath, vbInformation, "TempXRefPath Example"
End Sub


TextAlignmentPoint Example [ActiveX and VBA Reference: AAR]

TextAlignmentPoint Example

Using Programming Languages other than VBA

Sub Example_TextAlignmentPoint()
    ' This example creates a text object in model space.
    ' It then changes the TextAlignmentPoint and HorizontalAlignment
    ' properties of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The TextAlignmentPoint is set to the default " & textObj.TextAlignmentPoint(0) & ", " & textObj.TextAlignmentPoint(1) & ", " & textObj.TextAlignmentPoint(2), vbInformation, "TextAlignmentPoint Example"

    ' Change the value of the HorizontalAlignment and
    ' TextAlignmentPoint properties.
    ' Note that the HorizontalAlignment property must be changed first,
    ' and to a value that requires the TextAlignmentPoint, before the
    ' TextAlignmentPoint property will allow a value to be set.
    Dim alignmentPoint(0 To 2) As Double
    alignmentPoint(0) = 5: alignmentPoint(1) = 3: alignmentPoint(2) = 0
    textObj.HorizontalAlignment = acHorizontalAlignmentFit
    textObj.TextAlignmentPoint = alignmentPoint
    ZoomAll
    MsgBox "The TextAlignmentPoint is set to " & textObj.TextAlignmentPoint(0) & ", " & textObj.TextAlignmentPoint(1) & ", " & textObj.TextAlignmentPoint(2) & vbCrLf & "The HorizontalAlignment is set to acHorizontalAlignmentFit", vbInformation, "TextAlignmentPoint Example"

End Sub


TextColor Example [ActiveX and VBA Reference: AAR]

TextColor Example

Using Programming Languages other than VBA

Sub Example_TextColor()
   ' This example creates an aligned dimension in model space and
   ' uses the TextColor property to toggle the dimension text color to red

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 7: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension text color
    MsgBox "The dimension text color for this object is currently set to: " & dimObj.TextColor

    ' Change the dimension text color
    dimObj.TextColor = acRed
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension text color
    MsgBox "The dimension text color for this object is now set to: " & dimObj.TextColor & " (Red)"

End Sub


TextEditor Example [ActiveX and VBA Reference: AAR]

TextEditor Example

Using Programming Languages other than VBA

Sub Example_TextEditor()
    ' This example returns the current setting of
    ' TextEditor. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextEditor As String
    Dim newTextEditor As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextEditor value
    currTextEditor = preferences.Files.TextEditor
    MsgBox "The current value for TextEditor is " & currTextEditor, vbInformation, "TextEditor Example"

    ' Change the value for TextEditor
    newTextEditor = "TestTextEditor"
    preferences.Files.TextEditor = newTextEditor
    MsgBox "The new value for TextEditor is " & newTextEditor, vbInformation, "TextEditor Example"

    ' Reset TextEditor to its original value
    preferences.Files.TextEditor = currTextEditor
    MsgBox "The TextEditor value is reset to " & currTextEditor, vbInformation, "TextEditor Example"
End Sub


TextFont Example [ActiveX and VBA Reference: AAR]

TextFont Example

Using Programming Languages other than VBA

Sub Example_TextFont()
    ' This example returns the current setting of
    ' TextFont. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextFont As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextFont value
    currTextFont = preferences.DISPLAY.TextFont
    MsgBox "The current value for TextFont is " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"

    ' Change the value for TextFont
    preferences.DISPLAY.TextFont = "TestTextFont"
    MsgBox "The new value for TextFont is " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"

    ' Reset TextFont to its original value
    preferences.DISPLAY.TextFont = currTextFont
    MsgBox "The TextFont value is reset to " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"
End Sub


TextFontSize Example [ActiveX and VBA Reference: AAR]

TextFontSize Example

Using Programming Languages other than VBA

Sub Example_TextFontSize()
    ' This example returns the current setting of
    ' TextFontSize. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextFontSize As Integer

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextFontSize value
    currTextFontSize = preferences.DISPLAY.TextFontSize
    MsgBox "The current value for TextFontSize is " & preferences.DISPLAY.TextFontSize, vbInformation, "TextFontSize Example"

    ' Change the value for TextFontSize
    preferences.DISPLAY.TextFontSize = 12
    MsgBox "The new value for TextFontSize is " & preferences.DISPLAY.TextFontSize, vbInformation, "TextFontSize Example"

    ' Reset TextFontSize to its original value
    preferences.DISPLAY.TextFontSize = currTextFontSize
    MsgBox "The TextFontSize value is reset to " & preferences.DISPLAY.TextFontSize, vbInformation, "TextFontSize Example"
End Sub


TextFontStyle Example [ActiveX and VBA Reference: AAR]

TextFontStyle Example

Using Programming Languages other than VBA

Sub Example_TextFontStyle()
    ' This example returns the current setting of
    ' TextFontStyle. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextFontStyle As Integer
    Dim constant As String
    Dim newConstant As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextFontStyle value
    currTextFontStyle = preferences.DISPLAY.TextFontStyle
    constant = Choose(currTextFontStyle + 1, "acFontRegular", "acFontItalic", "acFontBold", "acFontBoldItalic")
    MsgBox "The current value for TextFontStyle is " & constant, vbInformation, "TextFontStyle Example"

    ' Change the value for TextFontStyle
    newConstant = "acFontBoldItalic"
    preferences.DISPLAY.TextFontStyle = acFontBoldItalic
    MsgBox "The new value for TextFontStyle is " & newConstant, vbInformation, "TextFontStyle Example"

    ' Reset TextFontStyle to its original value
    preferences.DISPLAY.TextFontStyle = currTextFontStyle
    MsgBox "The TextFontStyle value is reset to " & constant, vbInformation, "TextFontStyle Example"
End Sub


TextFrameDisplay Example [ActiveX and VBA Reference: AAR]

TextFrameDisplay Example

Using Programming Languages other than VBA

Sub Example_TextFrameDisplay()
    ' This example returns the current setting of
    ' TextFrameDisplay. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim currTextFrameDisplay As Boolean

    ' Retrieve the current TextFrameDisplay value
    currTextFrameDisplay = ThisDrawing.preferences.TextFrameDisplay
    MsgBox "The current value for TextFrameDisplay is " & preferences.TextFrameDisplay, vbInformation, "TextFrameDisplay Example"

    ' Change the value for TextFrameDisplay
    ThisDrawing.preferences.TextFrameDisplay = Not (currTextFrameDisplay)
    MsgBox "The new value for TextFrameDisplay is " & preferences.TextFrameDisplay, vbInformation, "TextFrameDisplay Example"

    ' Reset TextFrameDisplay to its original value
    ThisDrawing.preferences.TextFrameDisplay = currTextFrameDisplay
    MsgBox "The TextFrameDisplay value is reset to " & preferences.TextFrameDisplay, vbInformation, "TextFrameDisplay Example"
End Sub


TextGap Example [ActiveX and VBA Reference: AAR]

TextGap Example

Using Programming Languages other than VBA

Sub Example_TextGap()
   ' This example creates an aligned dimension in model space and
   ' uses the TextGap property to increase the distance between the
   ' dimension line and the dimension text

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension gap
    MsgBox "The dimension gap for this object is currently set to: " & dimObj.TextGap

    ' Increase the distance of the dimension gap
    dimObj.TextGap = 0.5
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension gap
    MsgBox "The dimension gap for this object is now set to: " & dimObj.TextGap

End Sub


TextGenerationFlag Example [ActiveX and VBA Reference: AAR]

TextGenerationFlag Example

Using Programming Languages other than VBA

Sub Example_TextGenerationFlag()
    ' This example creates a text object in model space.
    ' It then changes the TextGenerationFlag of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The TextGenerationFlag has not been set.", vbInformation, "TextGenerationFlag Example"

    ' Change the value of the TextGenerationFlag
    textObj.TextGenerationFlag = acTextFlagBackward
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagBackward.", vbInformation, "TextGenerationFlag Example"

    textObj.TextGenerationFlag = acTextFlagUpsideDown
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagUpsideDown.", vbInformation, "TextGenerationFlag Example"

    textObj.TextGenerationFlag = acTextFlagBackward & acTextFlagUpsideDown
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagBackward & acTextFlagUpsideDown.", vbInformation, "TextGenerationFlag Example"

End Sub


TextHeight Example [ActiveX and VBA Reference: AAR]

TextHeight Example

Using Programming Languages other than VBA

Sub Example_TextHeight()
   ' This example creates an aligned dimension in model space and
   ' uses the TextHeight property to increase the height of the
   ' dimension text

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension text height
    MsgBox "The dimension text height for this object is currently set to: " & dimObj.textHeight

    ' Increase the distance of the dimension gap
    dimObj.textHeight = 1
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension text height
    MsgBox "The dimension text height for this object is now set to: " & dimObj.textHeight

End Sub


TextInside Example [ActiveX and VBA Reference: AAR]

TextInside Example

Using Programming Languages other than VBA

Sub Example_TextInside()
   ' This example creates an aligned dimension in model space and
   ' allows the user to toggle, forcing the dimension text between the extension lines
   ' using the TextInside property

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle forcing the dimension text inside the extension lines", vbOKCancel)
        Case vbOK
            ' Toggle forcing the dimension text inside the extension lines
            dimObj.TextInside = Not (dimObj.TextInside)
            ThisDrawing.Regen acAllViewports

            ' Read and display the new dimension TextInside value
            CurrentValue = IIf(dimObj.TextInside, "is now", "is not")
            MsgBox "The dimension text " & CurrentValue & " forced inside the extension lines"

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle

End Sub


TextInsideAlign Example [ActiveX and VBA Reference: AAR]

TextInsideAlign Example

Using Programming Languages other than VBA

Sub Example_TextInsideAlign()
   ' This example creates an aligned dimension in model space and
   ' allows the user to toggle the TextInsideAlign value for the dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 6: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    dimObj.TextInside = True    ' The TextInsideAlign property will only work
                                ' when this property is active

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the TextInsideAlign value for this dimension", vbOKCancel)
        Case vbOK
            ' Toggle the TextInsideAlign value for this dimension
            dimObj.TextInsideAlign = Not (dimObj.TextInsideAlign)
            ThisDrawing.Regen acAllViewports

            ' Read and display the new dimension TextInsideAlign value
            MsgBox "TextInsideAlign is currently set to: " & dimObj.TextInsideAlign

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle

End Sub


TextManipulation Example [ActiveX and VBA Reference: AAR]

TextManipulation Example

Using Programming Languages other than VBA

Sub Example_TextManipulation()
    Dim oML As AcadMLeader
    Dim points(0 To 14) As Double

    ' Define the leader points
    points(0) = 1: points(1) = 1: points(2) = 0
    points(3) = 1: points(4) = 2: points(5) = 0
    points(6) = 2: points(7) = 2: points(8) = 0
    points(9) = 3: points(10) = 2: points(11) = 0
    points(12) = 4: points(13) = 4: points(14) = 0
    Dim i As Long
    Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)

    oML.TextLeftAttachmentType = acAttachmentBottomLine
    oML.TextRightAttachmentType = acAttachmentMiddleOfBottom
    oML.TextBackgroundFill = False
    oML.TextDirection = acLeftToRight
    oML.TextHeight = 2.3
    oML.TextJustify = acAttachmentPointMiddleLeft
    oML.TextLineSpacingDistance = 2.4
    oML.TextLineSpacingFactor = 1.2
    oML.TextLineSpacingStyle = acLineSpacingStyleExactly
    oML.TextWidth = 7.4

End Sub


TextMovement Example [ActiveX and VBA Reference: AAR]

TextMovement Example

Using Programming Languages other than VBA

Sub Example_TextMovement()
   ' This example creates two aligned dimensions in model space and
   ' sets the TextMovement property of each one differently to allow
   ' the user to see the differences this property makes when moving
   ' dimension text
   '
   ' To see the effects of this property:
   ' 1) Run this sample
   ' 2) Enter the drawing and move the dimension text of the leftmost object
   '    on the screen with the mouse or keyboard.
   ' 3) Notice the position of the dimension lines
   ' 4) Repeat with the rightmost object

    Dim dimObj1 As AcadDimAligned, dimObj2 As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim point3(0 To 2) As Double, point4(0 To 2) As Double
    Dim location1(0 To 2) As Double, location2(0 To 2) As Double

    ' Define the two dimensions
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 6: point2(1) = 5: point2(2) = 0
    location1(0) = 5: location1(1) = 7: location1(2) = 0

    point3(0) = 7: point3(1) = 5: point3(2) = 0
    point4(0) = 8: point4(1) = 5: point4(2) = 0
    location2(0) = 5: location2(1) = 7: location2(2) = 0

    ' Create the aligned dimension objects in model space
    Set dimObj1 = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location1)
    Set dimObj2 = ThisDrawing.ModelSpace.AddDimAligned(point3, point4, location2)

    ThisDrawing.Application.ZoomAll

    ' Set the text movement of the new dimensions to different values
    dimObj1.TextMovement = acMoveTextNoLeader
    dimObj2.TextMovement = acDimLineWithText

End Sub


TextOutsideAlign Example [ActiveX and VBA Reference: AAR]

TextOutsideAlign Example

Using Programming Languages other than VBA

Sub Example_TextOutsideAlign()
   ' This example creates an aligned dimension in model space and
   ' allows the user to toggle the TextOutsideAlign value for the dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5.5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the TextOutsideAlign value for this dimension", vbOKCancel)
        Case vbOK
            ' Toggle the TextOutsideAlign value for this dimension
            dimObj.TextOutsideAlign = Not (dimObj.TextOutsideAlign)
            dimObj.Update
            ThisDrawing.Regen acActiveViewport

            ' Read and display the new dimension TextOutsideAlign value
            MsgBox "TextOutsideAlign is currently set to: " & dimObj.TextOutsideAlign

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle

End Sub


TextOverride Example [ActiveX and VBA Reference: AAR]

TextOverride Example

Using Programming Languages other than VBA

Sub Example_TextOverride()
    ' This example creates an aligned dimension and then changes the
    ' TextOverride property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 3#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 3#: point2(2) = 0#
    location(0) = 7.5: location(1) = 5#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    MsgBox "The initial text string for the dimension contains only the dimension value.", vbInformation, "TextOverride Example"

    ' Change the text string for the dimension
    dimObj.TextOverride = "The value is <>"
    dimObj.Update
    MsgBox "The text string for the dimension has been replaced. However, the dimension value is still represented.", vbInformation, "TextOverride Example"

    ' Reset the text string for the dimension
    dimObj.TextOverride = ""
    dimObj.Update

    MsgBox "The text string for the dimension is reset.", vbInformation, "TextOverride Example"
End Sub


TextPosition Example [ActiveX and VBA Reference: AAR]

TextPosition Example

Using Programming Languages other than VBA

Sub Example_TextPosition()
    ' This example creates an aligned dimension and then changes the
    ' TextPosition property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 3#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 3#: point2(2) = 0#
    location(0) = 7.5: location(1) = 5#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    MsgBox "The current text position for the dimension is " & dimObj.TextPosition(0) & ", " & dimObj.TextPosition(1) & ", " & dimObj.TextPosition(2), vbInformation, "TextPosition Example"

    ' Change the text position location
    location(0) = 8.5: location(1) = 7: location(2) = 0
    dimObj.TextPosition = location
    dimObj.Update

    ' Return the endpoint of the first extension line
    ' Note that the return value is a Variant
    Dim retPoint As Variant
    retPoint = dimObj.TextPosition

    MsgBox "The new text position for the dimension is " & dimObj.TextPosition(0) & ", " & dimObj.TextPosition(1) & ", " & dimObj.TextPosition(2), vbInformation, "TextPosition Example"
End Sub


TextPrecision Example [ActiveX and VBA Reference: AAR]

TextPrecision Example

Using Programming Languages other than VBA

Sub Example_TextPrecision()
   ' This example creates a Dim3PointAngular object in model space and
   ' uses the TextPrecision property to set the precision of
   ' the dimension text to 4 decimal places

    Dim DimPointAngularObj As AcadDim3PointAngular
    Dim AngleVertex(0 To 2) As Double
    Dim FirstPoint(0 To 2) As Double, SecondPoint(0 To 2) As Double
    Dim TextPoint(0 To 2) As Double

    ' Define the new Dim3PointAngular object
    AngleVertex(0) = 0: AngleVertex(1) = 0: AngleVertex(2) = 0
    FirstPoint(0) = 2: FirstPoint(1) = 2: FirstPoint(2) = 0
    SecondPoint(0) = 1: SecondPoint(1) = 4: SecondPoint(2) = 0
    TextPoint(0) = 6: TextPoint(1) = 6: TextPoint(2) = 0

    ' Create the new Dim3PointAngular object in model space
    Set DimPointAngularObj = ThisDrawing.ModelSpace.AddDim3PointAngular(AngleVertex, FirstPoint, SecondPoint, TextPoint)
    ThisDrawing.Application.ZoomAll

    ' Read and display current dimension text precision
    MsgBox "The dimension text precision is currently set to: " & DimPointAngularObj.TextPrecision

    ' Increase the distance of the dimension gap
    DimPointAngularObj.TextPrecision = acDimPrecisionFour
    ThisDrawing.Regen acAllViewports

    ' Read and display current dimension text precision
    MsgBox "The dimension text precision is now set to: " & DimPointAngularObj.TextPrecision

End Sub


TextPrefix Example [ActiveX and VBA Reference: AAR]

TextPrefix Example

Using Programming Languages other than VBA

Sub Example_TextPrefix()
   ' This example creates an aligned dimension in model space and
   ' uses TextPrefix to allow the user to change the text prefix for the
   ' dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim prefix As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll

    ' Allow the user to change the text prefix for the dimension
    prefix = InputBox("Enter a new text prefix for the dimension", "Set Dimension Prefix", "PREFIX:")
    dimObj.TextPrefix = prefix   ' Commit changes to prefix

    ThisDrawing.Regen acAllViewports

    ' Read back and display the dimension text prefix
    prefix = dimObj.TextPrefix
    If prefix <> "" Then
        MsgBox "The prefix of the dimension has been changed to: " & prefix
    Else
        MsgBox "The prefix of the dimension has been removed"
    End If
End Sub


TextRotation Example [ActiveX and VBA Reference: AAR]

TextRotation Example

Using Programming Languages other than VBA

Sub Example_TextRotation()
    ' This example creates an aligned dimension and then changes the
    ' TextRotation property for that dimension.

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5#: point1(1) = 3#: point1(2) = 0#
    point2(0) = 10#: point2(1) = 3#: point2(2) = 0#
    location(0) = 7.5: location(1) = 5#: location(2) = 0#

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ZoomAll
    MsgBox "The current text rotation angle for the dimension is " & dimObj.TextRotation & " radians.", vbInformation, "TextRotation Example"

    ' Change the text rotation angle to 45 degrees (.707 radians)
    dimObj.TextRotation = 0.707
    dimObj.Update

    MsgBox "The new text rotation angle for the dimension is " & dimObj.TextRotation & " radians.", vbInformation, "TextRotation Example"
End Sub


TextString Example [ActiveX and VBA Reference: AAR]

TextString Example

Using Programming Languages other than VBA

Sub Example_TextString()
    ' This example creates a text object in model space.
    ' It then returns the text string for that object.

    Dim textObj As AcadText
    Dim text As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the text object
    text = "Hello, World."
    insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
    height = 0.5

    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(text, insertionPoint, height)
    ZoomAll

    ' Return the current text string for the object
    text = textObj.textString
    MsgBox "The TextString property equals: " & text, vbInformation, "TextString Example"

End Sub


TextStyle Example [ActiveX and VBA Reference: AAR]

TextStyle Example

Using Programming Languages other than VBA

Sub Example_TextStyle()
   ' This example creates an aligned dimension in model space and
   ' creates a new system text style.  The new text style is then assigned to
   ' the new dimension

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Create new text style
    Set newText = ThisDrawing.TextStyles.Add("MYSTYLE")
    newText.height = 0.5    ' Just set the height of the new style so we can differentiate

    ThisDrawing.Application.ZoomAll

    ' Read and display the current text style for this dimension
    MsgBox "The text style is currently set to: " & dimObj.textStyle

    ' Change the text style to use the new style we created
    dimObj.textStyle = "MYSTYLE"
    ThisDrawing.Regen acAllViewports

    ' Read and display the current text style for this dimension
    MsgBox "The text style is now set to: " & dimObj.textStyle

End Sub


TextStyles Example [ActiveX and VBA Reference: AAR]

TextStyles Example

Using Programming Languages other than VBA

Sub Example_TextStyles()
    ' This example finds the current Textstyles collection and
    ' adds a new Text style to that collection.

    Dim TextColl As AcadTextStyles
    Set TextColl = ThisDrawing.TextStyles

    ' Create a Text style named "TEST" in the current drawing
    Dim textStyle As AcadTextStyle
    Set textStyle = TextColl.Add("TEST")
    MsgBox "A new Text style called " & textStyle.name & " has been added to the Textstyles collection.", vbInformation, "Textstyles Example"
End Sub


TextSuffix Example [ActiveX and VBA Reference: AAR]

TextSuffix Example

Using Programming Languages other than VBA

Sub Example_TextSuffix()
   ' This example creates an aligned dimension in model space and
   ' uses TextSuffix to allow the user to change the text suffix for the
   ' dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim suffix As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll

    ' Allow the user to change the text suffix for the dimension
    suffix = InputBox("Enter a new text suffix for the dimension", "Set Dimension Suffix", ":SUFFIX")
    dimObj.TextSuffix = suffix   ' Commit changes to suffix

    ThisDrawing.Regen acAllViewports

    ' Read back and display the dimension text suffix
    suffix = dimObj.TextSuffix
    If suffix <> "" Then
        MsgBox "The suffix of the dimension has been changed to: " & suffix
    Else
        MsgBox "The suffix of the dimension has been removed"
    End If
End Sub


TextureMapPath Example [ActiveX and VBA Reference: AAR]

TextureMapPath Example

Using Programming Languages other than VBA

Sub Example_TextureMapPath()
    ' This example returns the current setting of
    ' TextureMapPath. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextureMapPath As String
    Dim newTextureMapPath As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextureMapPath value
    currTextureMapPath = preferences.Files.TextureMapPath
    MsgBox "The current value for TextureMapPath is " & currTextureMapPath, vbInformation, "TextureMapPath Example"

    ' Change the value for TextureMapPath
    newTextureMapPath = "TestTextureMapPath"
    preferences.Files.TextureMapPath = newTextureMapPath
    MsgBox "The new value for TextureMapPath is " & newTextureMapPath, vbInformation, "TextureMapPath Example"

    ' Reset TextureMapPath to its original value
    preferences.Files.TextureMapPath = currTextureMapPath
    MsgBox "The TextureMapPath value is reset to " & currTextureMapPath, vbInformation, "TextureMapPath Example"
End Sub


TextWinBackgrndColor Example [ActiveX and VBA Reference: AAR]

TextWinBackgrndColor Example

Using Programming Languages other than VBA

Sub Example_TextWinBackgrndColor()
    ' This example returns the current setting of
    ' TextWinBackgrndColor. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextWinBackgrndColor As OLE_COLOR

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextWinBackgrndColor value
    currTextWinBackgrndColor = preferences.DISPLAY.TextWinBackgrndColor
    MsgBox "The current value for TextWinBackgrndColor is " _
            & preferences.DISPLAY.TextWinBackgrndColor, vbInformation, "TextWinBackgrndColor Example"

    ' Change the value for TextWinBackgrndColor
    preferences.DISPLAY.TextWinBackgrndColor = vbBlue
    MsgBox "The new value for TextWinBackgrndColor is " _
            & preferences.DISPLAY.TextWinBackgrndColor, vbInformation, "TextWinBackgrndColor Example"

    ' Reset TextWinBackgrndColor to its original value
    preferences.DISPLAY.TextWinBackgrndColor = currTextWinBackgrndColor
    MsgBox "The TextWinBackgrndColor value is reset to " _
            & preferences.DISPLAY.TextWinBackgrndColor, vbInformation, "TextWinBackgrndColor Example"
End Sub


TextWinTextColor Example [ActiveX and VBA Reference: AAR]

TextWinTextColor Example

Using Programming Languages other than VBA

Sub Example_TextWinTextColor()
    ' This example returns the current setting of
    ' TextWinTextColor. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currTextWinTextColor As Long

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current TextWinTextColor value
    currTextWinTextColor = preferences.DISPLAY.TextWinTextColor
    MsgBox "The current value for TextWinTextColor is " _
            & preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"

    ' Change the value for TextWinTextColor
    preferences.DISPLAY.TextWinTextColor = vbGreen
    MsgBox "The new value for TextWinTextColor is " _
            & preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"

    ' Reset TextWinTextColor to its original value
    preferences.DISPLAY.TextWinTextColor = currTextWinTextColor
    MsgBox "The TextWinTextColor value is reset to " _
            & preferences.DISPLAY.TextWinTextColor, vbInformation, "TextWinTextColor Example"
End Sub


Thickness Example [ActiveX and VBA Reference: AAR]

Thickness Example

Using Programming Languages other than VBA

Sub Example_Thickness()
    ' This example creates a circle in model space
    ' and changes the thickness of the circle.

    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double

    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll

    ' Find the current thickness of the circle
    Dim currThickness As Double
    currThickness = circleObj.Thickness
    MsgBox "The thickness of the circle is " & circleObj.Thickness, vbInformation, "Thickness Example"

    ' Change the thickness of the circle
    circleObj.Thickness = currThickness + 3
    circleObj.Update

    ' Change the direction of the viewport so that you can
    ' view the change made to the thickness. Once you change
    ' the direction, you must reset the active viewport.
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    MsgBox "The thickness of the circle is now " & circleObj.Thickness, vbInformation, "Thickness Example"

End Sub


TimeServer Example [ActiveX and VBA Reference: AAR]

TimeServer Example

Using Programming Languages other than VBA

Sub Example_TimeServer()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True

    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP

    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"
    ' To set the TimeServer property, use a description followed by the Internet address in parentheses

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
End Sub


TimeStamp Example [ActiveX and VBA Reference: AAR]

TimeStamp Example

Using Programming Languages other than VBA

Sub Example_TimeStamp()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


Title Example [ActiveX and VBA Reference: AAR]

Title Example

Using Programming Languages other than VBA

Sub Example_Title()
    ' This example shows how to access drawing properties

    ' Add and display standard properties
    ThisDrawing.SummaryInfo.Author = "John Doe"
    ThisDrawing.SummaryInfo.Comments = "Includes all ten levels of Building Five"
    ThisDrawing.SummaryInfo.HyperlinkBase = "http://www.autodesk.com"
    ThisDrawing.SummaryInfo.Keywords = "Building Complex"
    ThisDrawing.SummaryInfo.LastSavedBy = "JD"
    ThisDrawing.SummaryInfo.RevisionNumber = "4"
    ThisDrawing.SummaryInfo.Subject = "Plan for Building Five"
    ThisDrawing.SummaryInfo.Title = "Building Five"

    Author = ThisDrawing.SummaryInfo.Author
    Comments = ThisDrawing.SummaryInfo.Comments
    HLB = ThisDrawing.SummaryInfo.HyperlinkBase
    KW = ThisDrawing.SummaryInfo.Keywords
    LSB = ThisDrawing.SummaryInfo.LastSavedBy
    RN = ThisDrawing.SummaryInfo.RevisionNumber
    Subject = ThisDrawing.SummaryInfo.Subject
    Title = ThisDrawing.SummaryInfo.Title
    MsgBox "The standard drawing properties are " & vbCrLf & _
            "Author = " & Author & vbCrLf & _
            "Comments = " & Comments & vbCrLf & _
            "HyperlinkBase = " & HLB & vbCrLf & _
            "Keywords = " & KW & vbCrLf & _
            "LastSavedBy = " & LSB & vbCrLf & _
            "RevisionNumber = " & RN & vbCrLf & _
            "Subject = " & Subject & vbCrLf & _
            "Title = " & Title & vbCrLf

    ' Add and display custom properties
    Dim Key0 As String
    Dim Value0 As String
    Dim Key1 As String
    Dim Value1 As String
    Dim CustomPropertyBranch As String
    Dim PropertyBranchValue As String
    Dim CustomPropertyZone As String
    Dim PropertyZoneValue As String

    CustomPropertyBranch = "Branch"
    PropertyBranchValue = "Main"
    CustomPropertyZone = "Zone"
    PropertyZoneValue = "Industrial"

    ' Add custom properties
    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 1) Then
        ThisDrawing.SummaryInfo.SetCustomByIndex 0, CustomPropertyBranch, PropertyBranchValue
    Else
        ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyBranch, PropertyBranchValue
    End If

    If (ThisDrawing.SummaryInfo.NumCustomInfo >= 2) Then
         ThisDrawing.SummaryInfo.SetCustomByKey CustomPropertyBranch, "Satellite"
    Else
         ThisDrawing.SummaryInfo.AddCustomInfo CustomPropertyZone, PropertyZoneValue
    End If

    'Get custom properties
    ThisDrawing.SummaryInfo.GetCustomByIndex 0, Key0, Value0
    Key1 = CustomPropertyZone
    ThisDrawing.SummaryInfo.GetCustomByKey Key1, Value1

    MsgBox "The custom drawing properties are " & vbCrLf & _
            "First property name = " & Key0 & vbCrLf & _
            "First property value = " & Value0 & vbCrLf & _
            "Second property name = " & Key1 & vbCrLf & _
            "Second property value = " & Value1 & vbCrLf
End Sub


TitleSuppressed Example [ActiveX and VBA Reference: AAR]

TitleSuppressed Example

Using Programming Languages other than VBA

Sub Example_TitleSuppressed()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


ToleranceDisplay Example [ActiveX and VBA Reference: AAR]

ToleranceDisplay Example

Using Programming Languages other than VBA

Sub Example_ToleranceDisplay()
   ' This example creates an aligned dimension in model space and
   ' turns on the tolerance display for the new dimension

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentDisplay As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ThisDrawing.Application.ZoomAll

    ' Read and display the current tolerance display for this dimension
    CurrentDisplay = IIf(dimObj.ToleranceDisplay = acTolNone, "Hidden", "Visible")
    MsgBox "The tolerance display is currently: " & CurrentDisplay

    ' Toggle the tolerance display for this dimension
    If dimObj.ToleranceDisplay = acTolNone Then
        dimObj.ToleranceDisplay = acTolSymmetrical
        CurrentDisplay = "Symmetrical"
    Else
        dimObj.ToleranceDisplay = acTolNone
        CurrentDisplay = "None"
    End If

    ThisDrawing.Regen acAllViewports

    ' Display the current tolerance display for this dimension
    MsgBox "The tolerance display is now set to: " & CurrentDisplay

End Sub


ToleranceHeightScale Example [ActiveX and VBA Reference: AAR]

ToleranceHeightScale Example

Using Programming Languages other than VBA

Sub Example_ToleranceHeightScale()
   ' This example creates an aligned dimension in model space and
   ' turns on the tolerance display for the new dimension.  The height
   ' of the tolerance text can then be adjusted by the user

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentScale As Integer

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Turn on the tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical

    ThisDrawing.Application.ZoomAll

Increase:
    ' Read and display the current tolerance height scale for this dimension
    If MsgBox("The tolerance height scale is currently set to: " & dimObj.ToleranceHeightScale & vbCrLf & _
               "Press OK to increase, or cancel to finish", vbOKCancel) = vbCancel Then

        Exit Sub
    End If

    ' Increase the tolerance height scale for this dimension
    dimObj.ToleranceHeightScale = dimObj.ToleranceHeightScale + 1

    ThisDrawing.Regen acAllViewports

    GoTo Increase
End Sub


ToleranceJustification Example [ActiveX and VBA Reference: AAR]

ToleranceJustification Example

Using Programming Languages other than VBA

Sub Example_ToleranceJustification()
   ' This example creates an aligned dimension in model space and
   ' sets the tolerance justification for the dimension to
   ' a couple of common values
   '
   ' * Note the vertical position of the tolerance text

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentDisplay As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Turn on tolerance display and increase the dimension text height,
    ' so the alignment of the tolerance is visible
    dimObj.ToleranceDisplay = acTolSymmetrical
    dimObj.textHeight = 1
    dimObj.ToleranceHeightScale = 0.25

    ThisDrawing.Application.ZoomAll

    ' Read and display the current tolerance justification for this dimension
    Select Case dimObj.ToleranceJustification
        Case acTolBottom: CurrentDisplay = "Bottom"
        Case acTolTop: CurrentDisplay = "Top"
        Case acTolMiddle: CurrentDisplay = "Middle"
    End Select

    MsgBox "The tolerance justification is currently: " & CurrentDisplay

    ' Set the tolerance justification for this dimension
    dimObj.ToleranceJustification = acTolBottom

    ThisDrawing.Regen acAllViewports

    ' Display the current tolerance justification for this dimension
    MsgBox "The tolerance display is now set to: Bottom"

End Sub


ToleranceLowerLimit Example [ActiveX and VBA Reference: AAR]

ToleranceLowerLimit Example

Using Programming Languages other than VBA

Sub Example_ToleranceLowerLimit()
   ' This example creates an aligned dimension in model space and
   ' sets the tolerance limits using the ToleranceLowerLimit and
   ' ToleranceUpperLimit properties

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Turn on tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical

    ThisDrawing.Application.ZoomAll

    ' Read and display the tolerance limits for the dimension
    MsgBox "The tolerance lower limit is set to: " & dimObj.ToleranceLowerLimit & vbCrLf & _
           "The tolerance upper limit is set to: " & dimObj.ToleranceUpperLimit

    ' Adjust the tolerance limits for this dimension
    dimObj.ToleranceLowerLimit = 0.0001
    dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Regen acAllViewports

    ' Read and display the tolerance limits for the dimension
    MsgBox "The tolerance lower limit is now set to: " & dimObj.ToleranceLowerLimit & vbCrLf & _
           "The tolerance upper limit is now set to: " & dimObj.ToleranceUpperLimit

End Sub


TolerancePrecision Example [ActiveX and VBA Reference: AAR]

TolerancePrecision Example

Using Programming Languages other than VBA

Sub Example_TolerancePrecision()
   ' This example creates an aligned dimension in model space and
   ' uses TolerancePrecision to allow the user to change the
   ' precision of the dimension tolerance

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim oldTolerance As String, newTolerance As String

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical
    dimObj.ToleranceLowerLimit = -0.0001
    dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Application.ZoomAll

    ' Store old tolerance value as default for input box
    oldTolerance = dimObj.TolerancePrecision

    ' Allow the user to change the precision for the dimension tolerance
    newTolerance = InputBox("Enter a new tolerance precision for the dimension.  The value must range from 0 to 8.", "Dimension Tolerance Precision", oldTolerance)

    Select Case newTolerance
        Case 0: newTolerance = acDimPrecisionZero
        Case 1: newTolerance = acDimPrecisionOne
        Case 2: newTolerance = acDimPrecisionTwo
        Case 3: newTolerance = acDimPrecisionThree
        Case 4: newTolerance = acDimPrecisionFour
        Case 5: newTolerance = acDimPrecisionFive
        Case 6: newTolerance = acDimPrecisionSix
        Case 7: newTolerance = acDimPrecisionSeven
        Case 8: newTolerance = acDimPrecisionEight
        Case Else
            MsgBox "The tolerance precision has not been changed."
            Exit Sub
    End Select

    dimObj.TolerancePrecision = newTolerance   ' Commit changes to tolerance precision

    ThisDrawing.Regen acAllViewports

    ' Read back and display the dimension tolerance precision
    newTolerance = dimObj.TolerancePrecision
    MsgBox "The tolerance precision has been set to " & newTolerance & " decimal places"
End Sub


ToleranceSuppressLeadingZeros Example [ActiveX and VBA Reference: AAR]

ToleranceSuppressLeadingZeros Example

Using Programming Languages other than VBA

Sub Example_ToleranceSuppressLeadingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses ToleranceSuppressLeadingZeros to toggle the display of leading zeros
   ' in the dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical
    dimObj.ToleranceLowerLimit = -0.0001: dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of leading zeros in the dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of leading zeros for the dimension tolerance value
            dimObj.ToleranceSuppressLeadingZeros = Not (dimObj.ToleranceSuppressLeadingZeros)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


ToleranceSuppressTrailingZeros Example [ActiveX and VBA Reference: AAR]

ToleranceSuppressTrailingZeros Example

Using Programming Languages other than VBA

Sub Example_ToleranceSuppressTrailingZeros()
   ' This example creates an aligned dimension in model space and
   ' uses ToleranceSuppressTrailingZeros to toggle the display of trailing zeros
   ' in the dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical
    dimObj.ToleranceLowerLimit = -0.0001: dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Application.ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of trailing zeros in the dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of trailing zeros for the dimension tolerance value
            dimObj.ToleranceSuppressTrailingZeros = Not (dimObj.ToleranceSuppressTrailingZeros)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


ToleranceSuppressZeroFeet Example [ActiveX and VBA Reference: AAR]

ToleranceSuppressZeroFeet Example

Using Programming Languages other than VBA

Sub Example_ToleranceSuppressZeroFeet()
   ' This example creates an aligned dimension in model space and
   ' uses ToleranceSuppressZeroFeet to toggle the display of zeros feet
   ' in the dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 6.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 8: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    dimObj.UnitsFormat = acDimLArchitectural

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolLimits
    dimObj.ToleranceLowerLimit = -0.0001: dimObj.ToleranceUpperLimit = 0.0001

    ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of zero feet in the dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero feet for the dimension tolerance value
            dimObj.ToleranceSuppressZeroFeet = Not (dimObj.ToleranceSuppressZeroFeet)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


ToleranceSuppressZeroInches Example [ActiveX and VBA Reference: AAR]

ToleranceSuppressZeroInches Example

Using Programming Languages other than VBA

Sub Example_ToleranceSuppressZeroInches()
   ' This example creates an aligned dimension in model space and
   ' uses ToleranceSuppressZeroInches to toggle the display of zeros inches
   ' in the dimension tolerance display

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 6.01: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 8: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    dimObj.UnitsFormat = acDimLArchitectural

    ' Enable and setup tolerance display
    dimObj.ToleranceDisplay = acTolLimits
    dimObj.ToleranceLowerLimit = -95#: dimObj.ToleranceUpperLimit = 95#

    ZoomAll

Toggle:
    Select Case MsgBox("Press OK to toggle the display of zero inches in the dimension tolerance", vbOKCancel)
        Case vbOK
            ' Toggle the display of zero inches for the dimension tolerance value
            dimObj.ToleranceSuppressZeroInches = Not (dimObj.ToleranceSuppressZeroInches)
            ThisDrawing.Regen acAllViewports

        Case vbCancel
            Exit Sub
    End Select

    GoTo Toggle
End Sub


ToleranceUpperLimit Example [ActiveX and VBA Reference: AAR]

ToleranceUpperLimit Example

Using Programming Languages other than VBA

Sub Example_ToleranceUpperLimit()
   ' This example creates an aligned dimension in model space and
   ' sets the tolerance limits using the ToleranceLowerLimit and
   ' ToleranceUpperLimit properties

    Dim dimObj As AcadDimAligned
    Dim newText As AcadTextStyle
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 5.5: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)

    ' Turn on tolerance display
    dimObj.ToleranceDisplay = acTolSymmetrical

    ThisDrawing.Application.ZoomAll

    ' Read and display the tolerance limits for the dimension
    MsgBox "The tolerance lower limit is set to: " & dimObj.ToleranceLowerLimit & vbCrLf & _
           "The tolerance upper limit is set to: " & dimObj.ToleranceUpperLimit

    ' Adjust the tolerance limits for this dimension
    dimObj.ToleranceLowerLimit = 0.0001
    dimObj.ToleranceUpperLimit = 0.005

    ThisDrawing.Regen acAllViewports

    ' Read and display the tolerance limits for the dimension
    MsgBox "The tolerance lower limit is now set to: " & dimObj.ToleranceLowerLimit & vbCrLf & _
           "The tolerance upper limit is now set to: " & dimObj.ToleranceUpperLimit

End Sub


Toolbars Example [ActiveX and VBA Reference: AAR]

Toolbars Example

Using Programming Languages other than VBA

Sub Example_Toolbars()
    ' This example finds the names of the all toolbars in the first menu group.

    Dim toolbarNames As String
    Dim toolbarCollection As AcadToolbars
    Dim toolbar As AcadToolbar

    Set toolbarCollection = ThisDrawing.Application.MenuGroups.Item(0).Toolbars
    toolbarNames = ""
    For Each toolbar In toolbarCollection
        toolbarNames = toolbarNames & toolbar.name & vbCrLf
    Next toolbar
    MsgBox toolbarNames
End Sub


ToolPalettePath Example [ActiveX and VBA Reference: AAR]

ToolPalettePath Example

Using Programming Languages other than VBA

Sub Example_ToolPalettePath()
    'This example changes the tool palette path
    'and then sets it to its original string

    Dim pref As AutoCAD.AcadPreferencesFiles
    Set pref = AcadApplication.Preferences.Files

    Dim defToolPalettePath As String
    Dim changedToolPalettePath As String

    defToolPalettePath = pref.ToolPalettePath
    MsgBox "The current tool palette path is " & defToolPalettePath

    pref.ToolPalettePath = "c:\winnt;c:\temp"
    changedToolPalettePath = pref.ToolPalettePath
    MsgBox "The changed tool palette path is " & changedToolPalettePath

    pref.ToolPalettePath = defToolPalettePath
End Sub


Top Example [ActiveX and VBA Reference: AAR]

Top Example

Using Programming Languages other than VBA

Sub Example_Top()
    ' This example creates a new toolbar called and inserts a
    ' button into it. The toolbar is then displayed and the top
    ' position is returned.
    ' To remove the toolbar after execution of this macro, use the Customize Menu
    ' option from the Tools menu.

    Dim currMenuGroup As acadMenuGroup
    Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)

    ' Create the new toolbar
    Dim newToolBar As AcadToolbar
    Set newToolBar = currMenuGroup.Toolbars.Add("TestToolbar")

    ' Add a button to the new toolbar.
    Dim newButton1 As AcadToolbarItem
    Dim openMacro As String

    ' Assign the macro string the VB equivalent of "ESC ESC _open "
    openMacro = Chr(3) & Chr(3) & Chr(95) & "open" & Chr(32)

    Set newButton1 = newToolBar.AddToolbarButton("", "NewButton1", "Open a file.", openMacro)

    ' Display the toolbar
    newToolBar.Visible = True

    'Find the top position
    Dim currTop As Integer
    currTop = newToolBar.Top
    MsgBox "The current value of Top is " & newToolBar.Top, , "Top Example"

    ' Change the value of Top
    newToolBar.Top = currTop + 100
    MsgBox "The new value of Top is " & newToolBar.Top, , "Top Example"

    ' Reset the value of Top
    newToolBar.Top = currTop
    MsgBox "The value of Top has been reset to " & newToolBar.Top, , "Top Example"

End Sub


TotalAngle Example [ActiveX and VBA Reference: AAR]

TotalAngle Example

Using Programming Languages other than VBA

Sub Example_TotalAngle()
    ' This example creates an Arc in model space and
    ' returns the total angle of the new Arc

    Dim arcObj As AcadArc
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim startAngleInDegree As Double, endAngleInDegree As Double
    Dim startAngleInRadian As Double, endAngleInRadian As Double

    ' Define the Arc
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#
    startAngleInDegree = 10#: endAngleInDegree = 230#

    ' Convert the angles in degrees to angles in radians
    startAngleInRadian = startAngleInDegree * 3.141592 / 180#
    endAngleInRadian = endAngleInDegree * 3.141592 / 180#

    ' Create the arc object in model space
    Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
    ThisDrawing.Application.ZoomAll

    ' Return length of new arc
    MsgBox "The total angle of the new Arc is: " & arcObj.TotalAngle
End Sub


TransformBy Example [ActiveX and VBA Reference: AAR]

TransformBy Example

Using Programming Languages other than VBA

Sub Example_TransformBy()
    ' This example creates a line and rotates it 90 degrees
    ' using a transformation matrix.

    ' Create a line
    Dim lineObj As AcadLine
    Dim startPt(0 To 2) As Double
    Dim endPt(0 To 2) As Double
    startPt(0) = 2: startPt(1) = 1: startPt(2) = 0
    endPt(0) = 5: endPt(1) = 1: endPt(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPt, endPt)
    lineObj.Update

    ' Initialize the transMat variable with a transformation matrix
    ' that will rotate an object by 90 degrees about the point(0,0,0)
    ' (More examples of transformation matrices are listed below)
    Dim transMat(0 To 3, 0 To 3) As Double
    transMat(0, 0) = 0#: transMat(0, 1) = -1#: transMat(0, 2) = 0#: transMat(0, 3) = 0#
    transMat(1, 0) = 1#: transMat(1, 1) = 0#: transMat(1, 2) = 0#: transMat(1, 3) = 0#
    transMat(2, 0) = 0#: transMat(2, 1) = 0#: transMat(2, 2) = 1#: transMat(2, 3) = 0#
    transMat(3, 0) = 0#: transMat(3, 1) = 0#: transMat(3, 2) = 0#: transMat(3, 3) = 1#

    ' Transform the line using the defined transformation matrix
    MsgBox "Transform the line.", , "TransformBy Example"
    lineObj.TransformBy (transMat)
    ZoomAll
    MsgBox "The line is transformed.", , "TransformBy Example"

' More examples of transformation matrices:

' Rotation Matrix: 90 Degrees about point 0,0,0
        ' 0.000000  -1.000000  0.000000  0.000000
        ' 1.000000  0.000000  0.000000  0.000000
        ' 0.000000  0.000000  1.000000  0.000000
        ' 0.000000  0.000000  0.000000  1.000000

' Rotation Matrix: 45 Degrees about point 5,5,0
        ' 0.70710678118654  -0.70710678118654  0.000000  5.000000
        ' 0.70710678118654  0.70710678118654  0.000000  -2.071068
        ' 0.000000  0.000000  1.000000  0.000000
        ' 0.000000  0.000000  0.000000  1.000000

' Translation Matrix: move an object by 10,10,0
        ' 1.000000  0.000000  0.000000  10.000000
        ' 0.000000  1.000000  0.000000  10.000000
        ' 0.000000  0.000000  1.000000  0.000000
        ' 0.000000  0.000000  0.000000  1.000000

' Scaling Matrix: scale by 10,10 at point 0,0,0
        ' 10.000000  0.000000  0.000000  0.000000
        ' 0.000000  10.000000  0.000000  0.000000
        ' 0.000000  0.000000  10.000000  0.000000
        ' 0.000000  0.000000  0.000000  1.000000

' Scaling Matrix: scale by 10 at point 2,2
        ' 10.000000  0.000000  0.000000  -18.000000
        ' 0.000000  10.000000  0.000000  -18.000000
        ' 0.000000  0.000000  10.000000  0.000000
        ' 0.000000  0.000000  0.000000  1.000000
End Sub


TranslateCoordinates Example [ActiveX and VBA Reference: AAR]

TranslateCoordinates Example

Using Programming Languages other than VBA

Sub Example_TranslateCoordinates()
    ' This example creates a UCS with an origin at 2, 2, 2.
    ' Next, a point is entered by the user. The WCS and UCS
    ' coordinates of that point are output in a Msgbox.

    ' Create a UCS named "New_UCS" in current drawing
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPnt(0 To 2) As Double
    Dim yAxisPnt(0 To 2) As Double

    ' Define the UCS
    origin(0) = 2#: origin(1) = 2#: origin(2) = 2#
    xAxisPnt(0) = 5#: xAxisPnt(1) = 2#: xAxisPnt(2) = 2#
    yAxisPnt(0) = 2#: yAxisPnt(1) = 6#: yAxisPnt(2) = 2#

    ' Add the UCS to the UserCoordinatesSystems collection
    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "New_UCS")
    ThisDrawing.ActiveUCS = ucsObj

    ' Get the active viewport and make sure the UCS icon is on
    Dim viewportObj As AcadViewport
    Set viewportObj = ThisDrawing.ActiveViewport
    viewportObj.UCSIconOn = True
    viewportObj.UCSIconAtOrigin = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Have the user enter a point
    Dim pointWCS As Variant
    pointWCS = ThisDrawing.Utility.GetPoint(, "Enter a point to translate:")

    ' Translate the point into UCS coordinates
    Dim pointUCS As Variant
    pointUCS = ThisDrawing.Utility.TranslateCoordinates(pointWCS, acWorld, acUCS, False)

    ' Display the coordinates of the point
    MsgBox "The point has the following coordinates:" & vbCrLf & _
            "WCS: " & pointWCS(0) & ", " & pointWCS(1) & ", " & pointWCS(2) & vbCrLf & _
            "UCS: " & pointUCS(0) & ", " & pointUCS(1) & ", " & pointUCS(2), , "TranslateCoordinates Example"

End Sub


TranslateIDs Example [ActiveX and VBA Reference: AAR]

TranslateIDs Example

Using Programming Languages other than VBA

Sub Example_TranslateIDs()
    ' This example creates a new XRecord if one doesn't exist,
    ' and toggles the setting for TranslateIDs

    Dim TrackingDictionary As AcadDictionary, TrackingXRecord As AcadXRecord
    Dim XRecordDataType As Variant, XRecordData As Variant
    Dim ArraySize As Long, iCount As Long
    Dim DataType As Integer, Data As String, msg As String

    ' Unique identifiers to distinguish our XRecordData from other XRecordData
    Const TYPE_STRING = 1
    Const TAG_DICTIONARY_NAME = "ObjectTrackerDictionary"
    Const TAG_XRECORD_NAME = "ObjectTrackerXRecord"

    ' Connect to the dictionary we store the XRecord in
    On Error GoTo CREATE
    Set TrackingDictionary = ThisDrawing.Dictionaries(TAG_DICTIONARY_NAME)
    Set TrackingXRecord = TrackingDictionary.GetObject(TAG_XRECORD_NAME)
    On Error GoTo 0

    ' Get current XRecordData
    TrackingXRecord.GetXRecordData XRecordDataType, XRecordData

    ' If we don't have an array already then create one
    If VarType(XRecordDataType) And vbArray = vbArray Then
        ArraySize = UBound(XRecordDataType) + 1       ' Get the size of the data elements returned
        ArraySize = ArraySize + 1                        ' Increase to hold new data

        ReDim Preserve XRecordDataType(0 To ArraySize)
        ReDim Preserve XRecordData(0 To ArraySize)
    Else
        ArraySize = 0
        ReDim XRecordDataType(0 To ArraySize) As Integer
        ReDim XRecordData(0 To ArraySize) As Variant
    End If

    ' Find the current value of TranslateIDs
    Dim currXlate As Boolean
    currXlate = TrackingXRecord.TranslateIDs
    MsgBox "The current setting of the TranslateIDs is " & currXlate

    ' Toggle the setting
    TrackingXRecord.TranslateIDs = Not currXlate
    MsgBox "The new setting for the TranslateIDs is " & TrackingXRecord.TranslateIDs

    ' Reset the value
    TrackingXRecord.TranslateIDs = currXlate
    MsgBox "TranslateIDs has been reset to " & TrackingXRecord.TranslateIDs

    Exit Sub

CREATE:
    ' Create the entities that hold our XRecordData
    If TrackingDictionary Is Nothing Then  ' Make sure we have our tracking object
        Set TrackingDictionary = ThisDrawing.Dictionaries.Add(TAG_DICTIONARY_NAME)
        Set TrackingXRecord = TrackingDictionary.AddXRecord(TAG_XRECORD_NAME)
    End If

    Resume
End Sub


Transparency Example [ActiveX and VBA Reference: AAR]

Transparency Example

Using Programming Languages other than VBA

Sub Example_Transparency()
    ' This example inserts a raster image and finds the current status
    ' of Transparency for the image. It then changes the Transparency
    ' status of the image.

    ' This example uses the "downtown.jpg" found in the sample
    ' directory. If you do not have the image, or it is located
    ' in a different directory, insert a valid path and name for the
    ' imageName variable below.
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double
    Dim rotAngleInDegree As Double, rotAngle As Double
    Dim imageName As String
    Dim raster As AcadRasterImage
    imageName = "C:\AutoCAD\sample\downtown.jpg"
    insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0#
    scalefactor = 1#
    rotAngleInDegree = 0#
    rotAngle = rotAngleInDegree * 3.141592 / 180#

    On Error Resume Next

    ' Creates a raster image in model space
    Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle)
    If Err.Description = "Filer error" Then
        MsgBox imageName & " could not be found."
        Exit Sub
    End If

    ' Find the current Transparency
    ThisDrawing.Regen True
    MsgBox "The Transparency is currently set to: " & raster.Transparency, vbInformation

    ' Change the Transparency
    If (raster.Transparency) Then
        raster.Transparency = False
    Else
        raster.Transparency = True
    End If
    ThisDrawing.Regen True
    MsgBox "The Transparency is now set to: " & raster.Transparency, vbInformation
End Sub


TrueColor Example [ActiveX and VBA Reference: AAR]

TrueColor Example

Using Programming Languages other than VBA

Sub Example_TrueColor()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)

    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    line.TrueColor = color
    Dim retcolor As AcadAcCmColor
    Set retcolor = line.TrueColor

    MsgBox "Red = " & retcolor.Red
    MsgBox "Green = " & retcolor.Green
    MsgBox "Blue = " & retcolor.Blue
End Sub


TrueColorImages Example [ActiveX and VBA Reference: AAR]

TrueColorImages Example

Using Programming Languages other than VBA

Sub Example_TrueColorImages()
    ' This example reads and modifies the preference value which determines
    ' if raster and render images are displayed at True Color or palletized color.
    ' When finished, this example resets the preference value back to
    ' it's original value.
    '
    ' This example uses the "watch.jpg" found in the sample
    ' directory. If you do not have this image, or it is located
    ' in a different directory, insert a valid path and file name
    ' for the imageName variable below.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant
    Dim insertionPoint(0 To 2) As Double
    Dim scalefactor As Double, rotationAngle As Double
    Dim imageName As String
    Dim rasterObj As AcadRasterImage

    imageName = "c:\program files\autocad\sample\watch.jpg"

    ' Define Raster object
    insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
    scalefactor = 5#: rotationAngle = 0

    On Error GoTo ERRORTRAP

    ' Loads a raster image into model space
    Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)
    ThisDrawing.Application.ZoomAll

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.TrueColorImages
    MsgBox "The TrueColorImages preference is set to: " & originalValue

    ' Modify the TrueColorImages preference by toggling the value
    ACADPref.TrueColorImages = Not (originalValue)
    newValue = ACADPref.TrueColorImages
    ThisDrawing.Regen acAllViewports

    MsgBox "The TrueColorImages preference has been set to: " & newValue

    ' Reset the preference back to it's original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.TrueColorImages = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The TrueColorImages preference was reset back to: " & originalValue

    Exit Sub

    ' If you got an error (most likely a problem with the file path),
    ' then display an error message

ERRORTRAP:
    If Err.Description <> "" Then
        MsgBox Err.Description
    End If
End Sub


TwistAngle Example [ActiveX and VBA Reference: AAR]

TwistAngle Example

Using Programming Languages other than VBA

Sub Example_TwistAngle()
    ' This example creates a new paper space viewport.
    ' It then displays the twist angle of the viewport.

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the pviewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the pviewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    pviewportObj.DISPLAY True
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj
    ThisDrawing.Regen acAllViewports

    ' Find the twist angle for the viewport
    Dim twistAngle As Double
    twistAngle = pviewportObj.twistAngle
    MsgBox "The twist angle of the paper space viewport is " & pviewportObj.twistAngle, , "TwistAngle Example"

End Sub


Type Example [ActiveX and VBA Reference: AAR]

Type Example

Using Programming Languages other than VBA

Sub Example_Type()
    ' This example creates a leader in model space.
    ' It then changes the type of the leader.

    Dim leaderObj As AcadLeader
    Dim points(0 To 8) As Double
    Dim leaderType As Integer
    Dim annotationObject As AcadEntity

    points(0) = 0: points(1) = 2: points(2) = 0
    points(3) = 4: points(4) = 4: points(5) = 0
    points(6) = 4: points(7) = 2: points(8) = 0
    leaderType = acLineNoArrow
    Set annotationObject = Nothing

    ' Create the leader object in model space
    Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
    ZoomAll

    ' Find the current leader type
    leaderType = leaderObj.Type
    MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"

    ' Change the leader type
    leaderObj.Type = acLineWithArrow
    leaderObj.Update
    MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"

    ' Change the leader type
    leaderObj.Type = acSplineNoArrow
    leaderObj.Update
    MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"

    ' Change the leader type
    leaderObj.Type = acSplineWithArrow
    leaderObj.Update
    MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"

End Sub


UCSIconAtOrigin Example [ActiveX and VBA Reference: AAR]

UCSIconAtOrigin Example

Using Programming Languages other than VBA

Sub Example_UCSIconAtOrigin()
    ' This example toggles the setting of UCSIconAtOrigin.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Make sure the UCS Icon is on, and a new UCS is defined.
    ' The new UCS defines the origin for the icon. When the icon
    ' is not displayed at the origin, it is displayed at the
    ' lower-left corner of the display.
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double
    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0
    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
    ThisDrawing.ActiveUCS = ucsObj
    viewportObj.UCSIconOn = True

    ' Display the current setting of UCSIconAtOrigin
    MsgBox "UCSIconAtOrigin is: " & IIf(viewportObj.UCSIconAtOrigin, "On", "Off"), , "UCSIconAtOrigin Example"

    ' Toggle the setting of UCSIconAtOrigin
    viewportObj.UCSIconAtOrigin = Not (viewportObj.UCSIconAtOrigin)

    ' Reset the active viewport to see the change
    ThisDrawing.ActiveViewport = viewportObj

    MsgBox "UCSIconAtOrigin is now: " & IIf(viewportObj.UCSIconAtOrigin, "On", "Off"), , "UCSIconAtOrigin Example"

End Sub


UCSIconOn Example [ActiveX and VBA Reference: AAR]

UCSIconOn Example

Using Programming Languages other than VBA

Sub Example_UCSIconOn()
    ' This example toggles the setting of UCSIconOn.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Display the current setting of UCSIconOn
    MsgBox "UCSIcon is: " & IIf(viewportObj.UCSIconOn, "On", "Off"), , "UCSIconOn Example"

    ' Toggle the setting of UCSIconOn
    viewportObj.UCSIconOn = Not (viewportObj.UCSIconOn)

    ' Reset the active viewport to see the change
    ThisDrawing.ActiveViewport = viewportObj

    MsgBox "UCSIcon is now: " & IIf(viewportObj.UCSIconOn, "On", "Off"), , "UCSIconOn Example"

End Sub


UCSPerViewport Example [ActiveX and VBA Reference: AAR]

UCSPerViewport Example

Using Programming Languages other than VBA

Sub Example_UCSPerViewport()
    ' This example creates a new paperspace viewport.
    ' It then finds the UCSPerViewport setting
    ' for that viewport.

    Dim pviewportObj As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the pviewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 40
    height = 40

    ' Change from model space to paperspace
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the pviewport
    Set pviewportObj = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    ThisDrawing.Regen acAllViewports

    ' Find the current setting of the UCSPerViewport property
    MsgBox "UCSPerViewport: " & pviewportObj.UCSPerViewport
End Sub


UCSs Example [ActiveX and VBA Reference: AAR]

UserCoordinateSystems Example

Using Programming Languages other than VBA

Sub Example_UserCoordinateSystems()
    ' This example finds the current UserCoordinateSystems collection and
    ' adds a new UCS to that collection.

    Dim UCSColl As AcadUCSs
    Set UCSColl = ThisDrawing.UserCoordinateSystems

    ' Create a UCS named "TEST" in the current drawing
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPnt(0 To 2) As Double
    Dim yAxisPnt(0 To 2) As Double

    ' Define the UCS
    origin(0) = 4#: origin(1) = 5#: origin(2) = 3#
    xAxisPnt(0) = 5#: xAxisPnt(1) = 5#: xAxisPnt(2) = 3#
    yAxisPnt(0) = 4#: yAxisPnt(1) = 6#: yAxisPnt(2) = 3#

    ' Add the UCS to the UserCoordinatesSystems collection
    Set ucsObj = UCSColl.Add(origin, xAxisPnt, yAxisPnt, "TEST")

    MsgBox "A new UCS called " & ucsObj.name & " has been added to the UserCoordinateSystems collection.", vbInformation, "UserCoordinateSystems Example"
End Sub


UnitsFormat Example [ActiveX and VBA Reference: AAR]

UnitsFormat Example

Using Programming Languages other than VBA

Sub Example_UnitsFormat()
   ' This example creates an aligned dimension in model space and
   ' uses UnitsFormat to cycle through some common unit formats
   ' for the dimension

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double

    ' Define the dimension
    point1(0) = 0: point1(1) = 5: point1(2) = 0
    point2(0) = 5.12345678: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Cycle through common unit formats

    dimObj.UnitsFormat = acDimLScientific     ' Change format to Scientific
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension units are now set to Scientific"

    dimObj.UnitsFormat = acDimLDecimal        ' Change format to Decimal
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension units are now set to Decimal"

    dimObj.UnitsFormat = acDimLArchitectural  ' Change format to Architectural
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension units are now set to Architectural"

    dimObj.UnitsFormat = acDimLWindowsDesktop ' Change format to WindowsDesktop
    ThisDrawing.Regen acAllViewports
    MsgBox "The dimension units are now set to Windows Desktop"

End Sub


Unload Example [ActiveX and VBA Reference: AAR]

Unload Example

Using Programming Languages other than VBA

Sub Example_Unload()
    On Error GoTo ERRORHANDLER

    ' Define external reference to be inserted
    Dim xrefHome As AcadBlock
    Dim xrefInserted As AcadExternalReference
    Dim insertionPnt(0 To 2) As Double
    Dim PathName As String
    insertionPnt(0) = 1
    insertionPnt(1) = 1
    insertionPnt(2) = 0
    PathName = "c:/AutoCAD/sample/City map.dwg"

    ' Add the external reference
    Set xrefInserted = ThisDrawing.ModelSpace. _
            AttachExternalReference(PathName, "XREF_IMAGE", _
            insertionPnt, 1, 1, 1, 0, False)
    ZoomAll
    MsgBox "The external reference is attached."

    ' Unload the external reference definition
    ThisDrawing.Blocks.Item(xrefInserted.name).Unload
    MsgBox "The external reference is unloaded."
    Exit Sub

ERRORHANDLER:
    MsgBox Err.Description
End Sub


UnloadARX Example [ActiveX and VBA Reference: AAR]

UnloadARX Example

Using Programming Languages other than VBA

Sub Example_UnLoadARX()
    ' This example unloads an ObjectARX application from the AutoCAD session.

    ' Note: The application listed here does not exist and
    ' will cause an error when run. Change the application name
    ' to the name of your ObjectARX application.
    On Error GoTo ERRORHANDLER
    ThisDrawing.Application.UnloadArx ("MyARXApp.dll")

ERRORHANDLER:
    MsgBox Err.Description, , "UnloadARX"

End Sub


UnloadDVB Example [ActiveX and VBA Reference: AAR]

UnloadDVB Example

Using Programming Languages other than VBA

Sub Example_UnloadDVB()
    ' This example loads a DVB file and runs a macro
    ' contained in the file using the RunMacro method.
    '
    ' This example uses a DVB file named drawline.dvb.
    ' You should change the example to use a file on your computer.
    '
    ' * Note: If you open a DVB file and then run the example to load it, there will be an error
    ' when the DVB file is unloaded.

    Dim FileName As String

    FileName = "c:\drawline.dvb"

    ' Load a sample VBA project DVB file
    LoadDVB FileName

    ' Run the drawline sample macro
    RunMacro "Module1.Drawline"

    ' Unload the drawline VBA project DVB file now that we are done
    UnloadDVB FileName

    MsgBox "The DVB file has been run!"
End Sub


Update Example [ActiveX and VBA Reference: AAR]

Update Example

Using Programming Languages other than VBA

Sub Example_Update()
    ' This example creates a line in model space. It displays a
    ' Msgbox immediately before the call to update the line and
    ' again after the call.
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    ' Create a Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    MsgBox "Before the update.", , "Update Example"
    ' The following code draws an object in AutoCAD window
    lineObj.Update
    MsgBox "After the update.", , "Update Example"

    ' The following call updates the entire drawing
    ThisDrawing.Application.Update

End Sub


UpdateEntry Example [ActiveX and VBA Reference: AAR]

UpdateEntry Example

Using Programming Languages other than VBA

Sub Example_UpdateEntry()
    'This example adds an entry to the File Dependency List, returns its Index, updates
    'the entry, and then removes the entry.

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim FDLIndex As Long
    FDLIndex = objFDLCol.CreateEntry("acad:xref", "c:\referenced.dwg", True, True)
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim IndexNumber As Long
    IndexNumber = objFDLCol.IndexOf("acad:xref", "c:\referenced.dwg")
    Dim IndexString As String
    IndexString = CStr(IndexNumber)
    MsgBox ("The index of the new entry is " & IndexString & ".")

    objFDLCol.UpdateEntry (FDLIndex)

    objFDLCol.RemoveEntry FDLIndex, True
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")
 End Sub


UpperRightCorner Example [ActiveX and VBA Reference: AAR]

UpperRightCorner Example

Using Programming Languages other than VBA

Sub Example_UpperRightCorner()
    ' This example creates a new viewport and makes it active.
    ' Then it splits the viewport into 4 windows.
    ' It then takes finds the upper right corner of each of the
    ' windows.
    Dim newViewport As AcadViewport

    ' Create a new viewport and make it active
    Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT")
    ThisDrawing.ActiveViewport = newViewport

    ' Split the viewport in 4 windows
    newViewport.Split acViewport4

    ' Make the newly split viewport active
    ThisDrawing.ActiveViewport = newViewport

    ' Iterate through the viewports. For each viewport,
    ' make that viewport active and display the coordinates
    ' of the upper right corner.
    Dim entry As AcadViewport
    Dim UpperRight As Variant
    For Each entry In ThisDrawing.Viewports
        entry.GridOn = True
        ThisDrawing.ActiveViewport = entry
        UpperRight = entry.UpperRightCorner
        MsgBox "The upper right corner of this viewport is " & UpperRight(0) & ", " & UpperRight(1), , "UpperRightCorner Example"
        entry.GridOn = False
    Next
End Sub


UpsideDown Example [ActiveX and VBA Reference: AAR]

UpsideDown Example

Using Programming Languages other than VBA

Sub Example_UpsideDown()
   ' This example creates a text object in model space and
   ' uses the UpsideDown property to flip the text vertically

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double

    ' Define the new Text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5

    ' Create the Text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)

    ThisDrawing.Application.ZoomAll

    MsgBox "The Text oject is now right side up"

    textObj.UpsideDown = True
    ThisDrawing.Regen acActiveViewport

    MsgBox "The Text object is now upside down"
End Sub


URL Example [ActiveX and VBA Reference: AAR]

URL Example

Using Programming Languages other than VBA

Sub Example_URL()
    ' This example creates a Circle object in model space and
    ' adds a new Hyperlink to its Hyperlink collection

    Dim Hyperlinks As AcadHyperlinks
    Dim Hyperlink As AcadHyperlink
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim HLList As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    ' Get reference to the Circle's Hyperlinks collection
    Set Hyperlinks = circleObj.Hyperlinks

    ' Add a new Hyperlink complete with all properties
    Set Hyperlink = Hyperlinks.Add("AutoDesk")
    Hyperlink.URL = "www.autodesk.com"
    Hyperlink.URLDescription = "Autodesk Main Site"
    Hyperlink.URLNamedLocation = "MY_LOCATION"

    ' Read and display a list of existing Hyperlinks and
    ' their properties for this object
    For Each Hyperlink In Hyperlinks
        HLList = HLList & "____________________________________" & vbCrLf   ' Separator
        HLList = HLList & "URL: " & Hyperlink.URL & vbCrLf
        HLList = HLList & "URL Description: " & Hyperlink.URLDescription & vbCrLf
        HLList = HLList & "URL Named Location: " & Hyperlink.URLNamedLocation & vbCrLf
    Next

    MsgBox "The circle has " & Hyperlinks.count & " Hyperlink: " & vbCrLf & HLList
End Sub


URLDescription Example [ActiveX and VBA Reference: AAR]

URLDescription Example

Using Programming Languages other than VBA

Sub Example_URLDescription()
    ' This example creates a Circle object in model space and
    ' adds a new Hyperlink to its Hyperlink collection

    Dim Hyperlinks As AcadHyperlinks
    Dim Hyperlink As AcadHyperlink
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim HLList As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    ' Get reference to the Circle's Hyperlinks collection
    Set Hyperlinks = circleObj.Hyperlinks

    ' Add a new Hyperlink complete with all properties
    Set Hyperlink = Hyperlinks.Add("AutoDesk")
    Hyperlink.URL = "www.autodesk.com"
    Hyperlink.URLDescription = "Autodesk Main Site"
    Hyperlink.URLNamedLocation = "MY_LOCATION"

    ' Read and display a list of existing Hyperlinks and
    ' their properties for this object
    For Each Hyperlink In Hyperlinks
        HLList = HLList & "____________________________________" & vbCrLf   ' Separator
        HLList = HLList & "URL: " & Hyperlink.URL & vbCrLf
        HLList = HLList & "URL Description: " & Hyperlink.URLDescription & vbCrLf
        HLList = HLList & "URL Named Location: " & Hyperlink.URLNamedLocation & vbCrLf
    Next

    MsgBox "The circle has " & Hyperlinks.count & " Hyperlink: " & vbCrLf & HLList
End Sub


URLNamedLocation Example [ActiveX and VBA Reference: AAR]

URLNamedLocation Example

Using Programming Languages other than VBA

Sub Example_URLNamedLocation()
    ' This example creates a Circle object in model space and
    ' adds a new Hyperlink to its Hyperlink collection

    Dim Hyperlinks As AcadHyperlinks
    Dim Hyperlink As AcadHyperlink
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    Dim HLList As String

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius = 5#

    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)

    ThisDrawing.Application.ZoomAll

    ' Get reference to the Circle's Hyperlinks collection
    Set Hyperlinks = circleObj.Hyperlinks

    ' Add a new Hyperlink complete with all properties
    Set Hyperlink = Hyperlinks.Add("AutoDesk")
    Hyperlink.URL = "www.autodesk.com"
    Hyperlink.URLDescription = "Autodesk Main Site"
    Hyperlink.URLNamedLocation = "MY_LOCATION"

    ' Read and display a list of existing Hyperlinks and
    ' their properties for this object
    For Each Hyperlink In Hyperlinks
        HLList = HLList & "____________________________________" & vbCrLf   ' Separator
        HLList = HLList & "URL: " & Hyperlink.URL & vbCrLf
        HLList = HLList & "URL Description: " & Hyperlink.URLDescription & vbCrLf
        HLList = HLList & "URL Named Location: " & Hyperlink.URLNamedLocation & vbCrLf
    Next

    MsgBox "The circle has " & Hyperlinks.count & " Hyperlink: " & vbCrLf & HLList
End Sub


Used Example [ActiveX and VBA Reference: AAR]

Used Example

Using Programming Languages other than VBA

Sub Example_Used()
    ' This example provides usage information for the layers
    ' in a drawing
    Dim MyLayers As IAcadLayers2
    Set MyLayers = ThisDrawing.Layers
    MyLayers.GenerateUsageData
    Dim MyLayerObj As IAcadLayer2
    For Each MyLayerObj In ThisDrawing.Layers
      MyLayerObj.Description = "Test"
      MsgBox (MyLayerObj.Used)
    Next MyLayerObj
End Sub


UseLastPlotSettings Example [ActiveX and VBA Reference: AAR]

UseLastPlotSettings Example

Using Programming Languages other than VBA

Sub Example_UseLastPlotSettings()
    ' This example reads and modifies the UseLastPlotSettings
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' it's original value.

    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Boolean

    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.Output

    ' Read and display the original value
    originalValue = ACADPref.UseLastPlotSettings
    MsgBox "The UseLastPlotSettings preference is set to: " & originalValue

    ' Modify the UseLastPlotSettings preference by toggling the value
    ACADPref.UseLastPlotSettings = Not ACADPref.UseLastPlotSettings

    MsgBox "The UseLastPlotSettings preference has been set to: " & ACADPref.UseLastPlotSettings

    ' Reset the preference back to it's original value
    ACADPref.UseLastPlotSettings = originalValue
    MsgBox "The UseLastPlotSettings preference was reset back to: " & originalValue
End Sub


User Example [ActiveX and VBA Reference: AAR]

User Example

Using Programming Languages other than VBA

Sub Example_User()
    ' This example obtains a reference to the User Preferences object
    ' from the Application Preferences object, and reads one of the User
    ' preferences

    Dim ACADPref As AcadPreferencesUser

    ' Obtain a reference to the User Preferences object
    Set ACADPref = ThisDrawing.Application.preferences.User

    MsgBox "You now have access to the properties and methods of the User Preferences object!"
    MsgBox "The User preference KeyboardAccelerator is set to: " & ACADPref.KeyboardAccelerator

    ' Release User Preferences object
    Set ACADPref = Nothing
    MsgBox "The User Preferences object has been released!"
End Sub


UseStandardScale Example [ActiveX and VBA Reference: AAR]

UseStandardScale Example

Using Programming Languages other than VBA

Sub Example_UseStandardScale()
    ' This example will access the Layouts collection for the current drawing
    ' and list the status of UseStandardScale for each Layout.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String

    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts

    msg = ""

    ' Get the UseStandardScale information of every layout in this drawing
    For Each Layout In Layouts
        If Layout.UseStandardScale Then
            msg = msg & Layout.name & " uses the standard scale." & vbCrLf
        Else
            msg = msg & Layout.name & " uses a custom scale." & vbCrLf
        End If
    Next

    ' Display the information
    MsgBox msg
End Sub


Utility Example [ActiveX and VBA Reference: AAR]

Utility Example

Using Programming Languages other than VBA

Sub Example_Utility()
    ' This example creates a spline in model space using the
    ' CreateTypedArray method off of the utility object.

    ' Create the spline
    Dim splineObj As AcadSpline
    Dim startTan As Variant
    Dim endTan As Variant
    Dim fitPoints As Variant
    Dim utilObj As Object   ' CreateTypedArray needs to be a late bound object
    Set utilObj = ThisDrawing.Utility

    utilObj.CreateTypedArray startTan, vbDouble, 0.5, 0.5, 0
    utilObj.CreateTypedArray endTan, vbDouble, 0.5, 0.5, 0
    utilObj.CreateTypedArray fitPoints, vbDouble, 1, 1, 0, 5, 5, 0, 10, 0, 0
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ZoomAll

End Sub


Value Example [ActiveX and VBA Reference: AAR]

Value Example

Using Programming Languages other than VBA

Sub Example_Value()
    ' This example creates two Circle objects and uses the CopyObjects
    ' method to copy them. It then returns the object IDs
    ' of the new objects using the Value property and uses the
    ' object IDs to remove the new (target) objects

    Dim circleObj1 As AcadCircle, circleObj2 As AcadCircle
    Dim circleObj1Copy As AcadCircle, circleObj2Copy As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius1 As Double, radius2 As Double
    Dim radius1Copy As Double, radius2Copy As Double
    Dim objCollection(0 To 1) As Object
    Dim retObjects As Variant
    Dim IDPairs As Variant
    Dim TargetObject As AcadObject

    ' Define the Circle object
    centerPoint(0) = 0: centerPoint(1) = 0: centerPoint(2) = 0
    radius1 = 5#: radius2 = 7#
    radius1Copy = 1#: radius2Copy = 2#

    ' Add two circles to the drawing
    Set circleObj1 = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius1)
    Set circleObj2 = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius2)
    ThisDrawing.Application.ZoomAll

    ' Copy objects
    '
    ' First put the objects to be copied into a form compatible with CopyObjects
    Set objCollection(0) = circleObj1
    Set objCollection(1) = circleObj2

    ' Copy object and get back a collection of the new objects (copies)
    retObjects = ThisDrawing.CopyObjects(objCollection, , IDPairs)

    ' Get newly created object and apply new properties to the copies
    Set circleObj1Copy = retObjects(0)
    Set circleObj2Copy = retObjects(1)

    circleObj1Copy.radius = radius1Copy
    circleObj2Copy.radius = radius2Copy

    ThisDrawing.Application.ZoomAll
    ThisDrawing.Regen acAllViewports

    ' Display the object IDs of the source objects used for the copy
    MsgBox "The first target object ID is: " & IDPairs(0).value & vbCrLf & _
           "The second target object ID is: " & IDPairs(1).value

    ' This key can be used with objectIDtoObject to reference the source objects,
    ' which is useful if the user manually selected the source objects.
    '
    ' Here we delete the source objects from the ID obtained
    Set TargetObject = ThisDrawing.ObjectIdToObject(IDPairs(0).value)
    TargetObject.Delete
    Set TargetObject = ThisDrawing.ObjectIdToObject(IDPairs(1).value)
    TargetObject.Delete

    ThisDrawing.Regen acAllViewports

    MsgBox "The target objects have been deleted!", vbInformation
End Sub


VBE Example [ActiveX and VBA Reference: AAR]

VBE Example

Using Programming Languages other than VBA

Sub Example_VBE()
    ' This example uses the VBA IDE extensibility model to dynamically
    ' create a VBA subroutine. After running this example, see the first line of code
    ' in the VBA IDE code window to see a new subroutine. Then
    ' remove the new subroutine before continuing.

    Dim VBEModel As Object
    Dim newRoutine As String

    Set VBEModel = VBE  ' Get the VBE object

    ' Define new subroutine to be added. This could be created dynamically from user feedback.
    newRoutine = "Sub Dynamic_Procedure()" & vbCrLf
    newRoutine = newRoutine & vbTab & "MsgBox ""New subroutine.""" & vbCrLf
    newRoutine = newRoutine & "End Sub" & vbCrLf

    ' Insert new subroutine
    VBEModel.CodePanes(1).CodeModule.InsertLines 1, newRoutine

    MsgBox "A new subroutine was added called Dynamic_Procedure."
End Sub


Verify Example [ActiveX and VBA Reference: AAR]

Verify Example

Using Programming Languages other than VBA

Sub Example_Verify()
    ' This example creates an attribute definition in model space.
    ' It then sets the definition to be verify, and queries the mode.

    Dim attributeObj As AcadAttribute
    Dim height As Double
    Dim mode As Long
    Dim prompt As String
    Dim insertionPoint(0 To 2) As Double
    Dim tag As String
    Dim value As String

    ' Define the attribute definition
    height = 1#
    mode = acAttributeModeVerify
    prompt = "New Prompt"
    insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0
    tag = "New Tag"
    value = "New Value"

    ' Create the attribute definition object in model space
    Set attributeObj = ThisDrawing.ModelSpace.AddAttribute(height, mode, prompt, insertionPoint, tag, value)
    ZoomAll

    ' Change the mode to be verify
    attributeObj.mode = acAttributeModeVerify
    attributeObj.Update

    ' Check to see if the attribute is set to verify
    MsgBox (IIf(attributeObj.Verify, "The attribute is set to verify", "The attribute is not set to verify"))
End Sub


Version Example [ActiveX and VBA Reference: AAR]

Version Example

Using Programming Languages other than VBA

Sub Example_Version()
    ' This example returns AutoCAD version as a string

    Dim version As String
    version = ThisDrawing.Application.version
    MsgBox "This is AutoCAD Version " & version, , "Version Example"

End Sub


VersionGUID Example [ActiveX and VBA Reference: AAR]

VersionGUID Example

Using Programming Languages other than VBA

Sub Example_VersionGUID()
    'This example reads information from a File Dependency List

    ThisDrawing.Application.Documents.Open ("c:\program files\autocad\sample\city map.dwg")
    ThisDrawing.Application.ZoomAll

    Dim objFDLCol As AutoCAD.AcadFileDependencies
    Dim objFDL As AutoCAD.AcadFileDependency

    Set objFDLCol = ThisDrawing.FileDependencies
    MsgBox ("The number of entries in the File Dependency List is " & objFDLCol.Count & ".")

    Dim strTemp As String
    For Each objFDL In objFDLCol
        strTemp = "Affects graphics?: " & vbTab & objFDL.AffectsGraphics
        strTemp = strTemp & vbCrLf & "Feature: " & vbTab & objFDL.Feature
        strTemp = strTemp & vbCrLf & "FileName: " & vbTab & objFDL.FileName
        strTemp = strTemp & vbCrLf & "FileSize: " & vbTab & objFDL.FileSize
        strTemp = strTemp & vbCrLf & "Fingerprint GUID: " & vbTab & objFDL.FingerprintGuid
        strTemp = strTemp & vbCrLf & "FoundPath: " & vbTab & objFDL.FoundPath
        strTemp = strTemp & vbCrLf & "FullFileName: " & vbTab & objFDL.FullFileName
        strTemp = strTemp & vbCrLf & "Index: " & vbTab & objFDL.Index
        strTemp = strTemp & vbCrLf & "Modified?: " & vbTab & objFDL.IsModified
        strTemp = strTemp & vbCrLf & "ReferenceCount: " & vbTab & objFDL.ReferenceCount
        strTemp = strTemp & vbCrLf & "Timestamp: " & vbTab & objFDL.TimeStamp
        strTemp = strTemp & vbCrLf & "Version GUID: " & vbTab & objFDL.VersionGuid
        MsgBox strTemp
    Next
End Sub


VertCellMargin Example [ActiveX and VBA Reference: AAR]

VertCellMargin Example

Using Programming Languages other than VBA

Sub Example_VertCellMargin()
    ' This example creates a TableStyle object and sets values for
    ' the style name and other attributes.

      Dim dictionaries As AcadDictionaries
      Set dictionaries = ThisDrawing.Database.dictionaries

      Dim dictObj As AcadDictionary
      Set dictObj = dictionaries.Item("acad_tablestyle")

      ' Create the custom TableStyle object in the dictionary
      Dim keyName As String
      Dim className As String
      Dim customObj As AcadTableStyle
      keyName = "NewStyle"
      className = "AcDbTableStyle"
      Set customObj = dictObj.AddObject(keyName, className)

      customObj.Name = "NewStyle"
      customObj.Description = "New Style for My Tables"

      customObj.FlowDirection = acTableBottomToTop
      customObj.HorzCellMargin = 0.22
      customObj.BitFlags = 1
      customObj.SetTextHeight AcRowType.acDataRow+AcRowType.acTitleRow, 1.3

      Dim col As New AcadAcCmColor
      col.SetRGB 12, 23, 45
      customObj.SetBackgroundColor AcRowType.acDataRow + AcRowType.acTitleRow, col
      customObj.SetBackgroundColorNone AcRowType.acDataRow + AcRowType.acTitleRow, False
      customObj.SetGridVisibility AcGridLineType.acHorzInside + AcGridLineType.acHorzTop _
            ,AcRowType.acDataRow + AcRowType.acTitleRow, True

      customObj.SetAlignment AcRowType.acDataRow + AcRowType.acTitleRow, acBottomRight
      col.SetRGB 244, 0, 0
      customObj.SetGridColor 3, 1, col

      MsgBox "Table Style Name = " & customObj.Name & vbCrLf & _
        "Style Description = " & customObj.Description & vbCrLf & _
        "Flow Direction = " & customObj.FlowDirection & vbCrLf & _
        "Horzontal Cell Margin = " & customObj.HorzCellMargin & vbCrLf & _
        "Bit Flags = " & customObj.BitFlags & vbCrLf & _
        "Title Row Text Height = " & customObj.GetTextHeight(acTitleRow) & vbCrLf & _
        "Grid Visibility for HorizontalBottom TitleRow  = " & customObj.GetGridVisibility(acHorzBottom, acTitleRow) & vbCrLf & _
        "Title Row Alignment = " & customObj.GetAlignment(acTitleRow) & vbCrLf & _
    "Header Suppression = " & customObj.HeaderSuppressed

End Sub


VerticalTextPosition Example [ActiveX and VBA Reference: AAR]

VerticalTextPosition Example

Using Programming Languages other than VBA

Sub Example_VerticalTextPosition()
    ' This example creates an aligned dimension in model space
    ' and cycles the dimension text through a couple of different
    ' vertical alignments

    Dim dimObj As AcadDimAligned
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim CurrentValue As String

    ' Define the dimension
    point1(0) = 5: point1(1) = 5: point1(2) = 0
    point2(0) = 9: point2(1) = 5: point2(2) = 0
    location(0) = 5: location(1) = 7: location(2) = 0

    ' Create an aligned dimension object in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location)
    ThisDrawing.Application.ZoomAll

    ' Read and display current text position
    Select Case dimObj.VerticalTextPosition
        Case acVertCentered:    CurrentValue = "centered"
        Case acAbove:           CurrentValue = "above"
        Case acOutside:         CurrentValue = "outside"
        Case acJIS:             CurrentValue = "to Japanesee industrial standards"
    End Select

    MsgBox "The vertical position of the dimension is: " & CurrentValue

    ' Change the position of the dimension text to be above the extesnion lines
    dimObj.VerticalTextPosition = acAbove
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension text is now aligned above extension lines"

    ' Change the position of the dimension text to be centered with the extension lines
    dimObj.VerticalTextPosition = acVertCentered
    ThisDrawing.Regen acAllViewports
    MsgBox "Dimension text is now centered with the extension lines"

End Sub


ViewportDefault Example [ActiveX and VBA Reference: AAR]

ViewportDefault Example

Using Programming Languages other than VBA

Sub Example_ViewportDefault()
    ' This example creates a new layer called "New_Layer".  It then uses
    ' the ViewportDefault property of each Layer to display whether or not that layer
    ' is frozen in new viewports.  The user has the ability to toggle whether or not
    ' each layer will be frozen in new viewports, and the final ViewportDefault status
    ' for all layers is displayed.

    Dim layerObj As AcadLayer, tempLayer As AcadLayer
    Dim msg As String

    ' Add the layer to the layers collection
    Set layerObj = ThisDrawing.Layers.Add("New_Layer")

    ' Make the new layer the active layer for the drawing
    ThisDrawing.ActiveLayer = layerObj

    ' Cycle through the layers and allow user to make them frozen in new viewports or not

    For Each tempLayer In ThisDrawing.Layers
        If tempLayer.ViewportDefault Then     ' Determine if this layer is fozen in new viewports
            If MsgBox("The layer '" & tempLayer.name & "' will be frozen in new viewports.  Would you like to make this layer unfrozen in new viewports?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.ViewportDefault = False     ' Change frozen state
            End If
        Else
            If MsgBox("The layer '" & tempLayer.name & "' will not be frozen in new viewports.  Would you like to make this layer frozen in new viewports?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.ViewportDefault = True      ' Change frozen state
            End If
        End If
    Next

    ' Display the new viewport freeze status of the layers in this drawing

    For Each tempLayer In ThisDrawing.Layers
        ' Determine if this layer is frozen in new viewports
        If tempLayer.ViewportDefault Then
            msg = msg & "The layer '" & tempLayer.name & "' will be frozen in new viewports." & vbCrLf
        Else
            msg = msg & "The layer '" & tempLayer.name & "' will not be frozen in new viewports." & vbCrLf
        End If
    Next

    MsgBox msg
End Sub


ViewportOn Example [ActiveX and VBA Reference: AAR]

ViewportOn Example

Using Programming Languages other than VBA

Sub Example_ViewportOn()
    ' This example creates two new paper space viewports.
    ' It then checks the status of the viewports.

    Dim pviewportObj1 As AcadPViewport
    Dim pviewportObj2 As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double

    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 10
    height = 10

    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace

    ' Create the paper space viewports
    Set pviewportObj1 = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    center(0) = 8: center(1) = 8: center(2) = 0
    width = 10
    height = 10
    Set pviewportObj2 = ThisDrawing.PaperSpace.AddPViewport(center, width, height)

    ' Before making a paper space viewport active,
    ' the mspace property needs to be True
    pviewportObj1.DISPLAY (True)
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj1
    ThisDrawing.Regen acAllViewports

    MsgBox "pviewportObj1 is " & (IIf(pviewportObj1.ViewportOn, "on.", "not on.")) & vbCrLf & _
           "pviewportObj2 is " & (IIf(pviewportObj2.ViewportOn, "on.", "not on."))

    ' Now turn on pviewportObj2 as well
    pviewportObj2.DISPLAY (True)
    MsgBox "pviewportObj1 is " & (IIf(pviewportObj1.ViewportOn, "on.", "not on.")) & vbCrLf & _
           "pviewportObj2 is " & (IIf(pviewportObj2.ViewportOn, "on.", "not on."))

End Sub


Viewports Example [ActiveX and VBA Reference: AAR]

Viewports Example

Using Programming Languages other than VBA

Sub Viewports()
    ' This example finds the current Viewports collection and
    ' adds a new viewport to that collection.

    Dim viewportColl As AcadViewports
    Set viewportColl = ThisDrawing.Viewports

    ' Create a viewport named "TEST" in the current drawing
    Dim viewportObj As AcadViewport
    Set viewportObj = viewportColl.Add("TEST")
    MsgBox "A new viewport called " & viewportObj.name & " has been added to the Viewports collection.", vbInformation, "Viewports Example"
End Sub


Views Example [ActiveX and VBA Reference: AAR]

Views Example

Using Programming Languages other than VBA

Sub Example_Views()
    ' This example finds the current views collection and
    ' adds a new view to that collection.

    Dim viewColl As AcadViews
    Set viewColl = ThisDrawing.Views

    ' Create a view named "TEST" in the current drawing
    Dim viewObj As AcadView
    Set viewObj = viewColl.Add("TEST")
    MsgBox "A new view called " & viewObj.name & " has been added to the views collection.", vbInformation, "Views Example"
End Sub


ViewToPlot Example [ActiveX and VBA Reference: AAR]

ViewToPlot Example

Using Programming Languages other than VBA

Sub Example_ViewToPlot()
    ' This example reads a list of available Named Views and displays a plot preview
    ' of the view selected by the user.  The current view to plot,
    ' if set, if preceded by an '*'
    '
    ' * Note: After previewing the plot, you will have to exit the
    ' plot preview before the VBA example will stop and control will be returned

    Dim ViewList As New Collection
    Dim View As AcadView
    Dim iCount As Long
    Dim msg As String
    Dim ViewName As String, ViewNum As String

    ' Get list of views available to plot
    For Each View In ThisDrawing.Views
        ViewList.Add View
    Next

    ' Are there any named views to plot
    If ViewList.count = 0 Then
        MsgBox "There are no named views to plot.", vbInformation
        Exit Sub
    End If

    ' Read and display the current plot style table path
    For iCount = 1 To ViewList.count
        ViewName = ViewList(iCount).name

        If ViewName = ThisDrawing.ActiveLayout.ViewToPlot Then  ' Is this the current view to plot
            ViewNum = iCount
            ViewName = "*" & ViewName
        End If

        msg = msg & "(" & iCount & ") " & vbTab & ViewName & vbCrLf
    Next

    ' Prompt user for the view to plot

RETRY:
    ViewNum = InputBox("Which view would you like to plot?" & vbCrLf & vbCrLf & msg, "View To Plot", ViewNum)

    If Trim(ViewNum) = "" Then
        Exit Sub
    End If

    If Not (IsNumeric(ViewNum)) Then
        MsgBox "You must supply a numeric value corresponding to one of the views listed above.", vbExclamation
        GoTo RETRY
    End If

    ' Tell the drawing which view to plot
    ThisDrawing.ActiveLayout.ViewToPlot = ViewList(CLng(ViewNum)).name

    ' Make sure you tell the drawing to plot a view, not some other plot style
    ThisDrawing.ActiveLayout.PlotType = acView

    ' Send Plot To Window
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub


VisibilityEdge1 Example [ActiveX and VBA Reference: AAR]

VisibilityEdge1 Example

Using Programming Languages other than VBA

Sub Example_VisibilityEdge1()
    ' This example creates a 3D Face in model space and allows the user to
    ' control the visibility of the edges

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double, _
        point3(0 To 2) As Double, point4(0 To 2) As Double
    Dim Edge1Msg As String, Edge2Msg As String, _
        Edge3Msg As String, Edge4Msg As String

    ' Define the four coordinates of the face
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 5: point2(1) = 0: point2(2) = 1
    point3(0) = 1: point3(1) = 10: point3(2) = 0
    point4(0) = 5: point4(1) = 5: point4(2) = 1

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ThisDrawing.Application.ZoomAll

    ' Display information about the visibility of the edges for this object

DisplayEdgeInformation:
    Edge1Msg = IIf(faceObj.VisibilityEdge1, "Edge1 of the new 3DFace is visible", "Edge1 of the new 3DFace is not visible")
    Edge2Msg = IIf(faceObj.VisibilityEdge2, "Edge2 of the new 3DFace is visible", "Edge2 of the new 3DFace is not visible")
    Edge3Msg = IIf(faceObj.VisibilityEdge3, "Edge3 of the new 3DFace is visible", "Edge3 of the new 3DFace is not visible")
    Edge4Msg = IIf(faceObj.VisibilityEdge4, "Edge4 of the new 3DFace is visible", "Edge4 of the new 3DFace is not visible")

    MsgBox Edge1Msg & vbCrLf & _
           Edge2Msg & vbCrLf & _
           Edge3Msg & vbCrLf & _
           Edge4Msg

    ' Allow user to toggle the visibility of one of the edges
    Select Case InputBox("Which edge of the 3DFace would you like to toggle the visibility of?", "Toggle Edge Visibility", 1)
        Case "1": faceObj.VisibilityEdge1 = Not (faceObj.VisibilityEdge1)
        Case "2": faceObj.VisibilityEdge2 = Not (faceObj.VisibilityEdge2)
        Case "3": faceObj.VisibilityEdge3 = Not (faceObj.VisibilityEdge3)
        Case "4": faceObj.VisibilityEdge4 = Not (faceObj.VisibilityEdge4)
        Case "":  Exit Sub
        Case Else: MsgBox "You must enter the number of an edge (1-4)", vbInformation
    End Select

    ' Refresh view
    ThisDrawing.Regen acAllViewports

    ' Return to display information about the edges
    GoTo DisplayEdgeInformation
End Sub


VisibilityEdge2 Example [ActiveX and VBA Reference: AAR]

VisibilityEdge2 Example

Using Programming Languages other than VBA

Sub Example_VisibilityEdge2()
    ' This example creates a 3D Face in model space and allows the user to
    ' control the visibility of the edges

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double, _
        point3(0 To 2) As Double, point4(0 To 2) As Double
    Dim Edge1Msg As String, Edge2Msg As String, _
        Edge3Msg As String, Edge4Msg As String

    ' Define the four coordinates of the face
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 5: point2(1) = 0: point2(2) = 1
    point3(0) = 1: point3(1) = 10: point3(2) = 0
    point4(0) = 5: point4(1) = 5: point4(2) = 1

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ThisDrawing.Application.ZoomAll

    ' Display information about the visibility of the edges for this object

DisplayEdgeInformation:
    Edge1Msg = IIf(faceObj.VisibilityEdge1, "Edge1 of the new 3DFace is visible", "Edge1 of the new 3DFace is not visible")
    Edge2Msg = IIf(faceObj.VisibilityEdge2, "Edge2 of the new 3DFace is visible", "Edge2 of the new 3DFace is not visible")
    Edge3Msg = IIf(faceObj.VisibilityEdge3, "Edge3 of the new 3DFace is visible", "Edge3 of the new 3DFace is not visible")
    Edge4Msg = IIf(faceObj.VisibilityEdge4, "Edge4 of the new 3DFace is visible", "Edge4 of the new 3DFace is not visible")

    MsgBox Edge1Msg & vbCrLf & _
           Edge2Msg & vbCrLf & _
           Edge3Msg & vbCrLf & _
           Edge4Msg

    ' Allow user to toggle the visibility of one of the edges
    Select Case InputBox("Which edge of the 3DFace would you like to toggle the visibility of?", "Toggle Edge Visibility", 1)
        Case "1": faceObj.VisibilityEdge1 = Not (faceObj.VisibilityEdge1)
        Case "2": faceObj.VisibilityEdge2 = Not (faceObj.VisibilityEdge2)
        Case "3": faceObj.VisibilityEdge3 = Not (faceObj.VisibilityEdge3)
        Case "4": faceObj.VisibilityEdge4 = Not (faceObj.VisibilityEdge4)
        Case "":  Exit Sub
        Case Else: MsgBox "You must enter the number of an edge (1-4)", vbInformation
    End Select

    ' Refresh view
    ThisDrawing.Regen acAllViewports

    ' Return to display information about the edges
    GoTo DisplayEdgeInformation

End Sub


VisibilityEdge3 Example [ActiveX and VBA Reference: AAR]

VisibilityEdge3 Example

Using Programming Languages other than VBA

Sub Example_VisibilityEdge3()
    ' This example creates a 3D Face in model space and allows the user to
    ' control the visibility of the edges

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double, _
        point3(0 To 2) As Double, point4(0 To 2) As Double
    Dim Edge1Msg As String, Edge2Msg As String, _
        Edge3Msg As String, Edge4Msg As String

    ' Define the four coordinates of the face
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 5: point2(1) = 0: point2(2) = 1
    point3(0) = 1: point3(1) = 10: point3(2) = 0
    point4(0) = 5: point4(1) = 5: point4(2) = 1

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ThisDrawing.Application.ZoomAll

    ' Display information about the visibility of the edges for this object

DisplayEdgeInformation:
    Edge1Msg = IIf(faceObj.VisibilityEdge1, "Edge1 of the new 3DFace is visible", "Edge1 of the new 3DFace is not visible")
    Edge2Msg = IIf(faceObj.VisibilityEdge2, "Edge2 of the new 3DFace is visible", "Edge2 of the new 3DFace is not visible")
    Edge3Msg = IIf(faceObj.VisibilityEdge3, "Edge3 of the new 3DFace is visible", "Edge3 of the new 3DFace is not visible")
    Edge4Msg = IIf(faceObj.VisibilityEdge4, "Edge4 of the new 3DFace is visible", "Edge4 of the new 3DFace is not visible")

    MsgBox Edge1Msg & vbCrLf & _
           Edge2Msg & vbCrLf & _
           Edge3Msg & vbCrLf & _
           Edge4Msg

    ' Allow user to toggle the visibility of one of the edges
    Select Case InputBox("Which edge of the 3DFace would you like to toggle the visibility of?", "Toggle Edge Visibility", 1)
        Case "1": faceObj.VisibilityEdge1 = Not (faceObj.VisibilityEdge1)
        Case "2": faceObj.VisibilityEdge2 = Not (faceObj.VisibilityEdge2)
        Case "3": faceObj.VisibilityEdge3 = Not (faceObj.VisibilityEdge3)
        Case "4": faceObj.VisibilityEdge4 = Not (faceObj.VisibilityEdge4)
        Case "":  Exit Sub
        Case Else: MsgBox "You must enter the number of an edge (1-4)", vbInformation
    End Select

    ' Refresh view
    ThisDrawing.Regen acAllViewports

    ' Return to display information about the edges
    GoTo DisplayEdgeInformation

End Sub


VisibilityEdge4 Example [ActiveX and VBA Reference: AAR]

VisibilityEdge4 Example

Using Programming Languages other than VBA

Sub Example_VisibilityEdge4()
    ' This example creates a 3D Face in model space and allows the user to
    ' control the visibility of the edges

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double, point2(0 To 2) As Double, _
        point3(0 To 2) As Double, point4(0 To 2) As Double
    Dim Edge1Msg As String, Edge2Msg As String, _
        Edge3Msg As String, Edge4Msg As String

    ' Define the four coordinates of the face
    point1(0) = 0: point1(1) = 0: point1(2) = 0
    point2(0) = 5: point2(1) = 0: point2(2) = 1
    point3(0) = 1: point3(1) = 10: point3(2) = 0
    point4(0) = 5: point4(1) = 5: point4(2) = 1

    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ThisDrawing.Application.ZoomAll

    ' Display information about the visibility of the edges for this object

DisplayEdgeInformation:
    Edge1Msg = IIf(faceObj.VisibilityEdge1, "Edge1 of the new 3DFace is visible", "Edge1 of the new 3DFace is not visible")
    Edge2Msg = IIf(faceObj.VisibilityEdge2, "Edge2 of the new 3DFace is visible", "Edge2 of the new 3DFace is not visible")
    Edge3Msg = IIf(faceObj.VisibilityEdge3, "Edge3 of the new 3DFace is visible", "Edge3 of the new 3DFace is not visible")
    Edge4Msg = IIf(faceObj.VisibilityEdge4, "Edge4 of the new 3DFace is visible", "Edge4 of the new 3DFace is not visible")

    MsgBox Edge1Msg & vbCrLf & _
           Edge2Msg & vbCrLf & _
           Edge3Msg & vbCrLf & _
           Edge4Msg

    ' Allow user to toggle the visibility of one of the edges
    Select Case InputBox("Which edge of the 3DFace would you like to toggle the visibility of?", "Toggle Edge Visibility", 1)
        Case "1": faceObj.VisibilityEdge1 = Not (faceObj.VisibilityEdge1)
        Case "2": faceObj.VisibilityEdge2 = Not (faceObj.VisibilityEdge2)
        Case "3": faceObj.VisibilityEdge3 = Not (faceObj.VisibilityEdge3)
        Case "4": faceObj.VisibilityEdge4 = Not (faceObj.VisibilityEdge4)
        Case "":  Exit Sub
        Case Else: MsgBox "You must enter the number of an edge (1-4)", vbInformation
    End Select

    ' Refresh view
    ThisDrawing.Regen acAllViewports

    ' Return to display information about the edges
    GoTo DisplayEdgeInformation

End Sub


Visible Example [ActiveX and VBA Reference: AAR]

Visible Example

Using Programming Languages other than VBA

Sub Visible()
    ' This example creates a line in model space.
    ' It then turns visibility of the line on or off, depending
    ' on the user's choice.

    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    ' Create the line
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll

    Dim response As Integer
    response = MsgBox("Do you want the new line to be visible?", vbYesNoCancel + vbQuestion)
    Select Case response
    Case vbYes
        lineObj.Visible = True
    Case vbNo
        lineObj.Visible = False
    Case vbCancel
        Exit Sub
    End Select

    ThisDrawing.Regen True
End Sub


Volume Example [ActiveX and VBA Reference: AAR]

Volume Example

Using Programming Languages other than VBA

Sub Example_Volume()
    ' This example creates a box in model space.
    ' It then returns the Volume for that box.

    Dim boxObj As Acad3DSolid
    Dim length As Double, width As Double, height As Double
    Dim center(0 To 2) As Double

    ' Define the box
    center(0) = 5#: center(1) = 5#: center(2) = 0
    length = 5#: width = 7: height = 10#

    ' Create the box (3DSolid) object in model space
    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    ' Change the viewing direction of the viewport to better see the box
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    ' Return the Volume for the box
    Dim Volume As Double
    Volume = boxObj.Volume
    MsgBox "The Volume for the box is " & Volume, , "Volume Example"

End Sub


WBlock Example [ActiveX and VBA Reference: AAR]

WBlock Example

Using Programming Languages other than VBA

Sub Example_WBlock()
    ' This example creates several objects in model space and
    ' adds them to a selection set. This selection set is then
    ' output as a new drawing file.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

    ZoomAll

    ' Create a selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("WBLOCKSET")

    ' Iterate through the model space collection and add
    ' each item found to an array of objects
    ReDim objsInModelSpace(0 To ThisDrawing.ModelSpace.count - 1) As AcadEntity
    Dim I As Integer
    For I = 0 To ThisDrawing.ModelSpace.count - 1
        Set objsInModelSpace(I) = ThisDrawing.ModelSpace.Item(I)
    Next

    ' Add the array of objects into the selection set
    ssetObj.AddItems objsInModelSpace

    ' Output the selection set to a new file
    ThisDrawing.Wblock "C:\AutoCAD\WBlock_example.dwg", ssetObj

End Sub


Weights Example [ActiveX and VBA Reference: AAR]

Weights Example

Using Programming Languages other than VBA

Sub Example_Weights()
   ' This example creates a Spline object in model space and
   ' returns the weight vector for the new Spline

    Dim splineObj As AcadSpline
    Dim startTan(0 To 2) As Double, endTan(0 To 2) As Double
    Dim fitPoints(0 To 8) As Double
    Dim weightVector As Variant

    ' Define the Spline object
    startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
    endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
    fitPoints(0) = 0: fitPoints(1) = 0: fitPoints(2) = 0
    fitPoints(3) = 5:    fitPoints(4) = 5: fitPoints(5) = 0
    fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0

    ' Create new Spline object
    Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)

    ' Add weights to the Spline
    splineObj.SetWeight 0, 1.5
    splineObj.SetWeight 1, 2
    splineObj.SetWeight 2, 4.5

    ThisDrawing.Application.ZoomAll

    ' Display the weight vector of the new Spline
    weightVector = splineObj.Weights
    MsgBox "The weight vector of the new Spline is: " & vbCrLf & _
                                            weightVector(0) & vbCrLf & _
                                            weightVector(1) & vbCrLf & _
                                            weightVector(2)
End Sub


Width Example [ActiveX and VBA Reference: AAR]

Width Example

Using Programming Languages other than VBA

Sub Example_Width()
    ' This example creates an MText object in model space.
    ' It then changes the width of the MText object.

    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0: corner(1) = 5: corner(2) = 0
    width = 10
    text = "This is the text String for the mtext Object"

    ' Creates the mtext Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll

    ' Find the current width of the mtext object
    width = MTextObj.width
    MsgBox "The current width of the mtext object is " & MTextObj.width, , "Width Example"

    ' Change the width of the mtext object
    MTextObj.width = width / 2
    MTextObj.Update
    MsgBox "The new width of the mtext object is " & MTextObj.width, , "Width Example"

End Sub


WindowChanged Example [: AAR]

WindowChanged Example

Using Programming Languages other than VBA

Private Sub AcadDocument_WindowChanged(ByVal WindowState As Long)
    ' This example intercepts a drawing WindowChanged event.
    '
    ' This event is triggered when the window state of the
    ' current drawing window is changed.
    '
    ' To trigger this example event: Change the window state of the drawing window
    '
    ' For example: Minimize or maximize the drawing window

    Dim CurrentState As String

    ' Use the "WindowState" variable to determine the new drawing window state
    Select Case WindowState
        Case acMin: CurrentState = "Minimized"
        Case acMax: CurrentState = "Maximized"
        Case acNorm: CurrentState = "Normal Size"
    End Select

    MsgBox "The drawing window is now: " & CurrentState
End Sub


WindowLeft Example [ActiveX and VBA Reference: AAR]

WindowLeft Example

Using Programming Languages other than VBA

Sub Example_WindowLeft()
    ' This example finds the WindowLeft (X coordinate) of the top of the
    ' AutoCAD window. It then changes that position to be 100 more
    ' than it currently is. Finally, it resets the window to the
    ' original value.

    ' Find the current value of the WindowLeft property
    Dim currWindowLeft As Integer
    currWindowLeft = ThisDrawing.Application.WindowLeft
    MsgBox "The current value of WindowLeft is " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"

    ' Change the value of WindowLeft
    ThisDrawing.Application.WindowLeft = currWindowLeft + 100
    MsgBox "The new value of WindowLeft is " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"

    ' Reset the value of WindowLeft
    ThisDrawing.Application.WindowLeft = currWindowLeft
    MsgBox "The value of WindowLeft has been reset to " & ThisDrawing.Application.WindowLeft, , "WindowLeft Example"

End Sub


WindowMovedOrResized Example [: AAR]

WindowMovedOrResized Example

Using Programming Languages other than VBA

Private Sub AcadDocument_WindowMovedOrResized(ByVal HWNDFrame As Long, ByVal bMoved As Boolean)
    ' This example intercepts a drawing WindowMovedOrResized event.
    '
    ' This event is triggered when the drawing window is moved or resized
    '
    ' To trigger this example event: Move or resize the drawing window

    Dim CurrentState As String

    ' Use the "bmoved" variable to determine if we moved or sized the drawing window
    CurrentState = IIf(bMoved, "Moving", "Sizing")

    MsgBox "The drawing window appearance was changed by: " & CurrentState
End Sub


WindowState Example [ActiveX and VBA Reference: AAR]

WindowState Example

Using Programming Languages other than VBA

Sub Example_WindowState()
    ' This example reads and displays the current window state of the AutoCAD application.

    Dim CurrentState As String

    ' Use the "WindowState" variable to determine the window state of AutoCAD
    Select Case WindowState
        Case acMin: CurrentState = "Minimized"
        Case acMax: CurrentState = "Maximized"
        Case acNorm: CurrentState = "Normal Size"
    End Select

    ' Display window state
    MsgBox "AutoCAD is now: " & CurrentState
End Sub


WindowTitle Example [ActiveX and VBA Reference: AAR]

WindowTitle Example

Using Programming Languages other than VBA

Sub Example_WindowTitle()
    ' This example cycles through the documents collection
    ' and uses the WindowTitle property to create a list of all open documents.

    Dim DOC As AcadDocument
    Dim msg As String

    ' If there are no open documents, then exit
    If Documents.count = 0 Then
        MsgBox "There are no open documents!"
        Exit Sub
    End If

    msg = vbCrLf & vbCrLf   ' Start with a space

    ' Cycle through all open drawings and get the window title of each drawing
    For Each DOC In Documents
        msg = msg & DOC.WindowTitle
    Next

    ' Display a list of open drawings
    MsgBox "The open drawing titles are: " & msg
End Sub


WindowTop Example [ActiveX and VBA Reference: AAR]

WindowTop Example

Using Programming Languages other than VBA

Sub Example_WindowTop()
    ' This example finds the WindowTop (X coordinate) of the WindowTop of the
    ' AutoCAD window. It then changes that position to be 100 more
    ' than it currently is. Finally, it resets the window to the
    ' original value.

    ' Find the current value of the WindowTop property
    Dim currWindowTop As Integer
    currWindowTop = ThisDrawing.Application.WindowTop
    MsgBox "The current value of WindowTop is " & ThisDrawing.Application.WindowTop, , "WindowTop Example"

    ' Change the value of WindowTop
    ThisDrawing.Application.WindowTop = currWindowTop + 100
    MsgBox "The new value of WindowTop is " & ThisDrawing.Application.WindowTop, , "WindowTop Example"

    ' Reset the value of WindowTop
    ThisDrawing.Application.WindowTop = currWindowTop
    MsgBox "The value of WindowTop has been reset to " & ThisDrawing.Application.WindowTop, , "WindowTop Example"

End Sub


WorkspacePath Example [ActiveX and VBA Reference: AAR]

WorkspacePath Example

Using Programming Languages other than VBA

Sub Example_WorkspacePath()
    ' This example reads and modifies the preference value that controls
    ' the path for the database workspace file.
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadPreferencesFiles
    Dim originalValue As Variant, newValue As Variant

    ' Get the files preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Files

    ' Read and display the original value
    originalValue = ACADPref.WorkspacePath
    MsgBox "The WorkspacePath preference is set to: " & originalValue

    ' Modify the WorkspacePath preference by changing the path to "C:\"
    ACADPref.WorkspacePath = "C:\"
    newValue = ACADPref.WorkspacePath
    MsgBox "The WorkspacePath preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.WorkspacePath = originalValue
    MsgBox "The WorkspacePath preference was reset back to: " & originalValue
End Sub


XRefDatabase Example [ActiveX and VBA Reference: AAR]

XRefDatabase Example

Using Programming Languages other than VBA

Sub Example_XRefDatabase()
    ' This example adds an external reference to the current drawing.
    ' It then cycles through each Block object in the drawing
    ' and determines the style of each Block by accessing the
    ' IsLayout and IsXRef properties of the Block. If the Block is an
    ' XRef Block, you obtain a reference to the external Database object
    ' for that Block and display the number of Blocks the Database contains.

    Dim InsertPoint(0 To 2) As Double
    Dim insertedBlock As AcadExternalReference
    Dim tempBlock As AcadBlock
    Dim msg As String, PathName As String

    ' Define external reference to be inserted
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    PathName = "c:\program files\autocad\sample\city map.dwg"

    ' Add the external block to model space
    Set insertedBlock = ThisDrawing.ModelSpace.AttachExternalReference(PathName, "XREF_IMAGE", InsertPoint, 1, 1, 1, 0, False)

    ThisDrawing.Application.ZoomAll

    msg = vbCrLf & vbCrLf

    For Each tempBlock In ThisDrawing.Blocks
        If tempBlock.IsXRef Then
            ' Block is an external reference, so add it to list
            msg = msg & tempBlock.name & " contains " & _
            tempBlock.XRefDatabase.Blocks.count & " blocks"

            msg = msg & vbCrLf      ' Insert line
        End If
    Next

    ' Display Block information for the XRefDatabase
    MsgBox "Externally referenced blocks attached to this drawing have the following block counts: " & msg

End Sub


XRefDemandLoad Example [ActiveX and VBA Reference: AAR]

XRefDemandLoad Example

Using Programming Languages other than VBA

Sub Example_XRefDemandLoad()
    ' This example returns the current setting of
    ' XRefDemandLoad. It then changes the value, and finally
    ' it resets the value back to the original setting.

    Dim preferences As AcadPreferences
    Dim currXRefDemandLoad As Integer
    Dim constant As String
    Dim newConstant As String

    Set preferences = ThisDrawing.Application.preferences

    ' Retrieve the current XRefDemandLoad value
    currXRefDemandLoad = preferences.OpenSave.XrefDemandLoad
    constant = Choose(currXRefDemandLoad + 1, "acDemandLoadDisabled", "acDemandLoadEnabled", "acDemandLoadEnabledWithCopy")
    MsgBox "The current value for XRefDemandLoad is " & constant, vbInformation, "XRefDemandLoad Example"

    ' Change the value for XRefDemandLoad
    newConstant = "acDemandLoadEnabledWithCopy"
    preferences.OpenSave.XrefDemandLoad = acDemandLoadEnabledWithCopy
    MsgBox "The new value for XRefDemandLoad is " & newConstant, vbInformation, "XRefDemandLoad Example"

    ' Reset XRefDemandLoad to its original value
    preferences.OpenSave.XrefDemandLoad = currXRefDemandLoad
    MsgBox "The XRefDemandLoad value is reset to " & constant, vbInformation, "XRefDemandLoad Example"
End Sub


XRefEdit Example [ActiveX and VBA Reference: AAR]

XRefEdit Example

Using Programming Languages other than VBA

Sub Example_XRefEdit()
    ' This example reads and modifies the preference value that controls
    ' whether the current drawing can be edited in place when being
    ' referenced by another user.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.XRefEdit
    MsgBox "The XRefEdit preference is set to: " & originalValue

    ' Modify the XRefEdit preference by toggling the value
    ACADPref.XRefEdit = Not (ACADPref.XRefEdit)
    newValue = ACADPref.XRefEdit
    MsgBox "The XRefEdit preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.XRefEdit = originalValue
    MsgBox "The XRefEdit preference was reset back to: " & originalValue
End Sub


XRefFadeIntensity Example [ActiveX and VBA Reference: AAR]

XRefFadeIntensity Example

Using Programming Languages other than VBA

Sub Example_XRefFadeIntensity()
    ' This example reads and modifies the preference value that controls
    ' the dimming intensity for xrefs. When finished, this example resets
    ' the preference value back to its original value.
    '
    ' * Note: Changes can only be observed when in-place editing of an Xref
    ' object is in progress and other entities are visible.

    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant

    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY

    ' Read and display the original value
    originalValue = ACADPref.XRefFadeIntensity
    MsgBox "The XRefFadeIntensity preference is: " & originalValue

    ' Modify the XRefFadeIntensity preference by setting it to 75
    ACADPref.XRefFadeIntensity = 75
    newValue = ACADPref.XRefFadeIntensity
    ThisDrawing.Regen acAllViewports

    MsgBox "The XRefFadeIntensity preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.XRefFadeIntensity = originalValue
    ThisDrawing.Regen acAllViewports

    MsgBox "The XRefFadeIntensity preference was reset back to: " & originalValue
End Sub


XRefLayerVisibility Example [ActiveX and VBA Reference: AAR]

XRefLayerVisibility Example

Using Programming Languages other than VBA

Sub Example_XRefLayerVisibility()
    ' This example reads and modifies the preference value that controls
    ' the visibility of xref-dependent layers and specifies if nested xref
    ' path changes are saved.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.

    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant

    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences

    ' Read and display the original value
    originalValue = ACADPref.XRefLayerVisibility
    MsgBox "The XRefLayerVisibility preference is set to: " & originalValue

    ' Modify the XRefLayerVisibility preference by toggling the value
    ACADPref.XRefLayerVisibility = Not (ACADPref.XRefLayerVisibility)
    newValue = ACADPref.XRefLayerVisibility
    MsgBox "The XRefLayerVisibility preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.XRefLayerVisibility = originalValue
    MsgBox "The XRefLayerVisibility preference was reset back to: " & originalValue
End Sub


XScaleFactor Example [ActiveX and VBA Reference: AAR]

XScaleFactor Example

Using Programming Languages other than VBA

Sub Example_XScaleFactor()
    ' This example creates a block containing a circle.
    ' It then inserts the block and changes the XScaleFactor.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")

    ' Add a circle to the block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)

    ' Find the current XScaleFactor for the block reference
    Dim currXScaleFactor As Double
    currXScaleFactor = blockRefObj.XScaleFactor
    ZoomAll
    MsgBox "The current XScaleFactor for the block reference is " & blockRefObj.XScaleFactor, , "XScaleFactor Example"

    ' Change the XScaleFactor for the block reference
    blockRefObj.XScaleFactor = currXScaleFactor + 2
    ZoomAll
    MsgBox "The new XScaleFactor for the block reference is " & blockRefObj.XScaleFactor, , "XScaleFactor Example"

End Sub


XVector Example [ActiveX and VBA Reference: AAR]

XVector Example

Using Programming Languages other than VBA

Sub Example_XVector()
    ' This finds the current setting of XVector for a given UCS.
    ' It then changes the XVector and resets the UCS.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the activeviewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Define a new UCS and turn on the UCS icon at the origin.
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double

    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0

    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
    ThisDrawing.ActiveUCS = ucsObj
    viewportObj.UCSIconOn = True
    viewportObj.UCSIconAtOrigin = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Display the current setting of the XVector
    MsgBox "The current XVector is: " _
            & ucsObj.XVector(0) & ", " & ucsObj.XVector(1) & ", " & ucsObj.XVector(2) & vbCrLf _
            & "The current YVector is: " _
            & ucsObj.YVector(0) & ", " & ucsObj.YVector(1) & ", " & ucsObj.YVector(2), , "XVector Example"

    ' Change the setting of XVector
    Dim newVector(0 To 2) As Double
    newVector(0) = 1: newVector(1) = 1: newVector(2) = 0
    ucsObj.XVector = newVector

    ' Reset the active UCS to see the change
    ThisDrawing.ActiveUCS = ucsObj

    MsgBox "The new XVector is: " _
            & ucsObj.XVector(0) & ", " & ucsObj.XVector(1) & ", " & ucsObj.XVector(2) & vbCrLf _
            & "The YVector is: " _
            & ucsObj.YVector(0) & ", " & ucsObj.YVector(1) & ", " & ucsObj.YVector(2), , "XVector Example"

End Sub


YScaleFactor Example [ActiveX and VBA Reference: AAR]

YScaleFactor Example

Using Programming Languages other than VBA

Sub Example_YScaleFactor()
    ' This example creates a block containing a circle.
    ' It then inserts the block and changes the YScaleFactor.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")

    ' Add a circle to the block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)
    ZoomAll

    ' Find the current YScaleFactor for the block reference
    Dim currYScaleFactor As Double
    currYScaleFactor = blockRefObj.YScaleFactor
    MsgBox "The current YScaleFactor for the block reference is " & blockRefObj.YScaleFactor, , "YScaleFactor Example"

    ' Change the YScaleFactor for the block reference
    blockRefObj.YScaleFactor = currYScaleFactor + 2
    ZoomAll
    MsgBox "The new YScaleFactor for the block reference is " & blockRefObj.YScaleFactor, , "YScaleFactor Example"

End Sub


YVector Example [ActiveX and VBA Reference: AAR]

YVector Example

Using Programming Languages other than VBA

Sub Example_YVector()
    ' This finds the current setting of YVector for a given UCS.
    ' It then changes the YVector and resets the UCS.

    Dim viewportObj As AcadViewport

    ' Set the viewportObj variable to the active viewport
    Set viewportObj = ThisDrawing.ActiveViewport

    ' Define a new UCS and turn on the UCS icon at the origin.
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double

    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0

    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
    ThisDrawing.ActiveUCS = ucsObj
    viewportObj.UCSIconOn = True
    viewportObj.UCSIconAtOrigin = True
    ThisDrawing.ActiveViewport = viewportObj

    ' Display the current setting of the vectors
    MsgBox "The current XVector is: " _
            & ucsObj.XVector(0) & ", " & ucsObj.XVector(1) & ", " & ucsObj.XVector(2) & vbCrLf _
            & "The current YVector is: " _
            & ucsObj.YVector(0) & ", " & ucsObj.YVector(1) & ", " & ucsObj.YVector(2), , "YVector Example"

    ' Change the setting of YVector
    Dim newVector(0 To 2) As Double
    newVector(0) = -1: newVector(1) = -1: newVector(2) = 0
    ucsObj.YVector = newVector

    ' Reset the active UCS to see the change
    ThisDrawing.ActiveUCS = ucsObj

    MsgBox "The new XVector is: " _
            & ucsObj.XVector(0) & ", " & ucsObj.XVector(1) & ", " & ucsObj.XVector(2) & vbCrLf _
            & "The YVector is: " _
            & ucsObj.YVector(0) & ", " & ucsObj.YVector(1) & ", " & ucsObj.YVector(2), , "YVector Example"

End Sub


ZoomAll Example [ActiveX and VBA Reference: AAR]

ZoomAll Example

Using Programming Languages other than VBA

Sub Example_ZoomAll()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZoomCenter Example [ActiveX and VBA Reference: AAR]

ZoomCenter Example

Using Programming Languages other than VBA

Sub Example_ZoomCenter()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZoomExtents Example [ActiveX and VBA Reference: AAR]

ZoomExtents Example

Using Programming Languages other than VBA

Sub Example_ZoomExtents()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZoomPickWindow Example [ActiveX and VBA Reference: AAR]

ZoomPickWindow Example

Using Programming Languages other than VBA

Sub Example_ZoomPickWindow()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZoomPrevious Example [ActiveX and VBA Reference: AAR]

ZoomPrevious Example

Using Programming Languages other than VBA

Sub Example_ZoomPrevious()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll"
    ZoomAll

' ZoomExtents
    MsgBox "Perform a ZoomExtents"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow"
    ZoomPickWindow

' ZoomPrevious
    MsgBox "Perform a ZoomPrevious"
    ZoomPrevious
End Sub


ZoomScaled Example [ActiveX and VBA Reference: AAR]

ZoomScaled Example

Using Programming Languages other than VBA

Sub Example_ZoomScaled()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZoomWindow Example [ActiveX and VBA Reference: AAR]

ZoomWindow Example

Using Programming Languages other than VBA

Sub Example_ZoomWindow()
    ' This example creates several objects in model space and
    ' then performs a variety of zooms on the drawing.

    ' Create a Ray object in model space
    Dim rayObj As AcadRay
    Dim basePoint(0 To 2) As Double
    Dim SecondPoint(0 To 2) As Double
    basePoint(0) = 3#: basePoint(1) = 3#: basePoint(2) = 0#
    SecondPoint(0) = 1#: SecondPoint(1) = 3#: SecondPoint(2) = 0#
    Set rayObj = ThisDrawing.ModelSpace.AddRay(basePoint, SecondPoint)

    ' Create a polyline object in model space
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 5) As Double
    points(0) = 3: points(1) = 7
    points(2) = 9: points(3) = 2
    points(4) = 3: points(5) = 5
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True

    ' Create a line object in model space
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
    endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ' Create a circle object in model space
    Dim circObj As AcadCircle
    Dim centerPt(0 To 2) As Double
    Dim radius As Double
    centerPt(0) = 20: centerPt(1) = 30: centerPt(2) = 0
    radius = 3
    Set circObj = ThisDrawing.ModelSpace.AddCircle(centerPt, radius)

    ' Create an ellipse object in model space
    Dim ellObj As AcadEllipse
    Dim majAxis(0 To 2) As Double
    Dim center(0 To 2) As Double
    Dim radRatio As Double
    center(0) = 5#: center(1) = 5#: center(2) = 0#
    majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
    radRatio = 0.3
    Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)

' ZoomAll
    MsgBox "Perform a ZoomAll", , "ZoomWindow Example"
    ZoomAll

' ZoomWindow
    MsgBox "Perform a ZoomWindow using the following coordinates:" & vbCrLf & _
           "1.3, 7.8, 0" & vbCrLf & _
           "13.7, -2.6, 0", , "ZoomWindow Example"

    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    point1(0) = 1.3: point1(1) = 7.8: point1(2) = 0
    point2(0) = 13.7: point2(1) = -2.6: point2(2) = 0
    ZoomWindow point1, point2

' ZoomScaled
    MsgBox "Perform a ZoomScaled using:" & vbCrLf & _
           "Scale Type: acZoomScaledRelative" & vbCrLf & _
           "Scale Factor: 2", , "ZoomWindow Example"
    Dim scalefactor As Double
    Dim scaletype As Integer
    scalefactor = 2
    scaletype = acZoomScaledRelative
    ZoomScaled scalefactor, scaletype

' ZoomExtents
    MsgBox "Perform a ZoomExtents", , "ZoomWindow Example"
    ZoomExtents

' ZoomPickWindow
    MsgBox "Perform a ZoomPickWindow", , "ZoomWindow Example"
    ZoomPickWindow

' ZoomCenter
    MsgBox "Perform a ZoomCenter using:" & vbCrLf & _
           "Center 3, 3, 0" & vbCrLf & _
           "Magnification: 10", , "ZoomWindow Example"
    Dim zcenter(0 To 2) As Double
    Dim magnification As Double
    zcenter(0) = 3: zcenter(1) = 3: zcenter(2) = 0
    magnification = 10
    zoomcenter zcenter, magnification

End Sub


ZScaleFactor Example [ActiveX and VBA Reference: AAR]

ZScaleFactor Example

Using Programming Languages other than VBA

Sub Example_ZScaleFactor()
    ' This example creates a block containing a circle.
    ' It then inserts the block and changes the ZScaleFactor.

    ' Create the block
    Dim blockObj As AcadBlock
    Dim insertionPnt(0 To 2) As Double
    insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
    Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")

    ' Add a circle to the block
    Dim circleObj As AcadCircle
    Dim center(0 To 2) As Double
    Dim radius As Double
    center(0) = 0: center(1) = 0: center(2) = 0
    radius = 1
    Set circleObj = blockObj.AddCircle(center, radius)

    ' Insert the block
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)
    ZoomAll

    ' Find the current ZScaleFactor for the block reference
    Dim currZScaleFactor As Double
    currZScaleFactor = blockRefObj.ZScaleFactor
    MsgBox "The current ZScaleFactor for the block reference is " & blockRefObj.ZScaleFactor, , "ZScaleFactor Example"

    ' Change the ZScaleFactor for the block reference
    blockRefObj.ZScaleFactor = currZScaleFactor + 2

    ' Change the viewing direction of the viewport
    ' to better see the zscale change
    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    ZoomAll

    MsgBox "The new ZScaleFactor for the block reference is " & blockRefObj.ZScaleFactor, , "ZScaleFactor Example"

End Sub


History, related topics

See Also

Properties:

Position property

ShowHistory property

SolidType property


Position, related topics

See Also

Properties:

History property

ShowHistory property

SolidType property


ShowHistory, related topics

See Also

Properties:

History property

Position property

SolidType property


SolidType, related topics

See Also

Properties:

History property

Position property

ShowHistory property


Comments?

Using this form sends your comments to the Autodesk Technical Publications group responsible for this documentation.

Topic title and location (do not edit):
Name (optional):
         Email (optional):
Comments:

Note: This form is not intended as a way for you to receive feedback or technical support. The information you provide will be used to enhance future updates to the documentation. Thanks!


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

AppActivate

WindowMovedOrResized

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Activate

ActiveDocument

ActiveLayer

ActiveLinetype

ActiveLayout

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport

StyleName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

ActiveDimStyle

ActiveDocument

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport

Add

Layer property

Layer object


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport

Add


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CopyProfile

DeleteProfile

ExportProfile

ImportProfile

RenameProfile

ResetProfile


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSpace

ActiveTextStyle

ActiveUCS

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveTextStyle

ActiveUCS

ActiveViewport

PViewport object


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveUCS

ActiveViewport

Regen

StyleName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDimStyle

ActiveDocument

ActiveLayer

ActiveLayout

ActiveLinetype

ActiveProfile

ActivePViewport

ActiveSelectionSet

ActiveSpace

ActiveTextStyle

ActiveViewport


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Name

LowerLeftCorner

Split

StatusID

UpperRightCorner


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ADCInsertUnitsDefaultTarget

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ADCInsertUnitsDefaultSource

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DMesh

Add3DPoly

AddSolid

SetInvisibleEdge

ActiveX and VBA Developer's Guide:

"Create 3D Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DFace

Add3DPoly

AddSolid

Type

MClose

NClose

ActiveX and VBA Developer's Guide:

"Create 3D Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DFace

Add3DMesh

AddSolid

Closed

ActiveX and VBA Developer's Guide:

"Create 3D Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DFace | Add3DMesh | Add3DPoly
AddArc | AddAttribute | AddBox
AddCircle | AddCone | AddCustomObject
AddCylinder | AddDimAligned | AddDimAngular
AddDimDiametric | AddDimOrdinate | AddDimRadial
AddDimRotated | AddEllipse | AddEllipticalCone
AddEllipticalCylinder | AddExtrudedSolid | AddExtrudedSolidAlongPath
AddHatch | AddLeader | AddLightweightPolyline
AddLine | AddMText | AddPViewport
AddPoint | AddPolyline | AddRaster
AddRay | AddRegion | AddRevolvedSolid
AddShape | AddSolid | AddSphere
AddSpline | AddText | AddTolerance
AddTorus | AddTrace | AddWedge
AddXLine | Load |

ActiveX and VBA Developer's Guide:

"Create a Selection Set"

"Create and Modify Text Styles"

"Create and Name Layers"

"Define a User Coordinate System"

"Define Blocks"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCircle

AddEllipse

ActiveX and VBA Developer's Guide:

"Create Curved Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

GetVariable

SetVariable

ActiveX and VBA Developer's Guide:

"Create Attributes Definitions and Attribute References"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCone

AddCylinder

AddSphere

AddTorus

AddWedge

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddArc

AddEllipse

ActiveX and VBA Developer's Guide:

"Create Curved Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddBox

AddCylinder

AddSphere

AddTorus

AddWedge

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddObject

LoadARX


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddBox

AddCone

AddSphere

AddTorus

AddWedge

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Create Angular Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Create Linear Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Create Angular Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Create Radial Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimRadial

AddDimRadialLarge

AddDimRotated

ActiveX and VBA Developer's Guide:

"Create Ordinate Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadialLarge

AddDimRotated

GetVariable

SetVariable

ActiveX and VBA Developer's Guide:

"Create Radial Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRotated

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDim3PointAngular

AddDimAligned

AddDimAngular

AddDimArc

AddDimDiametric

AddDimOrdinate

AddDimRadial

AddDimRadialLarge

ActiveX and VBA Developer's Guide:

"Create Linear Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddArc

AddCircle

AddEllipticalCone

AddEllipticalCylinder

ActiveX and VBA Developer's Guide:

"Create Curved Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddEllipse

AddEllipticalCylinder

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddEllipse

AddEllipticalCone

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddExtrudedSolidAlongPath

AddRegion

AddRevolvedSolid

ActiveX and VBA Developer's Guide:

"Create Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddExtrudedSolid

AddRegion

AddRevolvedSolid

ActiveX and VBA Developer's Guide:

"Create Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DeleteFitPoint

FitTolerance

GetFitPoint

SetFitPoint

NumberOfFitPoints

PurgeFitData

Update

Regen

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AppendInnerLoop

AppendOuterLoop

ActiveX and VBA Developer's Guide:

"Create Hatches"

"Edit Hatches"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Clear

Delete

Item

RemoveItems

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

AddTolerance

AddMText

ActiveX and VBA Developer's Guide:

"Add the Annotation to a Leader Line"

"Create a Leader Line"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLine

AddTrace

AddVertex

AddXLine

Coordinates

SetBulge

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Create Lines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddTrace

AddXLine

ActiveX and VBA Developer's Guide:

"Create Lines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddSeparator

AddSubMenu

ActiveX and VBA Developer's Guide:

"Add New Menu Items to a Menu"

"Use Variants in Methods and Properties"

AutoCAD Customization Guide:

"DIESEL Expressions in Menu Macros"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsertBlock

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddLine

AddTrace

AddXLine

ActiveX and VBA Developer's Guide:

"Create Lines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddText

InsertionPoint

Width

ActiveX and VBA Developer's Guide:

"Create Multiline Text"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetName

GetObject

LoadARX

Remove


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

AppendVertex

ActiveX and VBA Developer's Guide:

"Create Point Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddPolyline

ActiveX and VBA Developer's Guide:

"Create a Polyface Mesh"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddLine

SetBulge

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Create Lines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ClipBoundary

ImageVisibility

SupportPath

ActiveX and VBA Developer's Guide:

"Attach and Scale a Raster Image"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddLine

BasePoint

DirectionVector

ActiveX and VBA Developer's Guide:

"Create Rays"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddArc

AddLine

AddCircle

AddEllipse

AddSpline

Boolean

Explode

ActiveX and VBA Developer's Guide:

"Create Regions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddExtrudedSolid

AddExtrudedSolidAlongPath

AddRegion

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddMenuItem

AddSubMenu

ActiveX and VBA Developer's Guide:

"Add Separators to a Menu"

"Add Separators to a Toolbar"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

LoadShapeFile

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddExtrudedSolid

AddExtrudedSolidAlongPath

AddRevolvedSolid

GetVariable

SetVariable

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddBox

AddCone

AddCylinder

AddTorus

AddWedge

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

Closed

DeleteFitPoint

FitTolerance

GetFitPoint

NumberOfControlPoints

NumberOfFitPoints

PurgeFitData

SetControlPoint

SetFitPoint

SetWeight

ActiveX and VBA Developer's Guide:

"Create Curved Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddMenuItem

AddSeparator

Type

ActiveX and VBA Developer's Guide:

"Create Cascading Submenus"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Objects:

Table

TableStyle


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddMText

ActiveX and VBA Developer's Guide:

"Create Line Text"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DirectionVector

InsertionPoint

ActiveX and VBA Developer's Guide:

"Create Geometric Tolerances"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddSeparator

AttachToolbarToFlyout

ActiveX and VBA Developer's Guide:

"Add New Toolbar Buttons to a Toolbar"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddBox

AddCone

AddCylinder

AddSphere

AddWedge

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddLine

AddXLine

GetVariable

SetVariable

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

GetBulge

SetBulge

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Edit Polylines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddBox

AddCone

AddCylinder

AddSphere

AddTorus

ActiveX and VBA Developer's Guide:

"Create Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLightweightPolyline

AddLine

AddTrace

ActiveX and VBA Developer's Guide:

"Create Constuction XLines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetXRecordData

SetXRecordData

ActiveX and VBA Developer's Guide:

"Assign and Retrieve Extended Data"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Feature

FullFileName

FileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAlignmentPoint

InsertionPoint


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

FullScreenTrackingVector

PolarTrackingVector

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


All Drawing Objects [][AAR - ActiveX and VBA Reference: AAR]

All Drawing Objects

All of these objects can be defined as an AcadEntity object.
3DFace | 3DPolyline | 3DSolid
Arc | Attribute | AttributeReference
BlockRef | Circle | Dim3PointAngular
DimAligned | DimAngular | DimArcLength
DimDiametric | DimOrdinate | DimRadial
DimRadialLarge | DimRotated | Ellipse
ExternalReference | Hatch | Leader
LightweightPolyline | Line | MInsertBlock
MLine | MText | Point
PolyfaceMesh | PolygonMesh | Polyline
PViewport | Raster | Ray
Region | Shape | Solid
Spline | Table | Text
Tolerance | XLine |


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SingleDocumentMode

DisplayOLEScale

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AllowManualPositions


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AllowManualHeights


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MainDictionary

CustomDictionary

FontFileMap

TextEditor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Objects:

PreferencesFiles

PreferencesOutput


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltUnits

AltUnitsPrecision

AltUnitsScale

AltUnitsFormat


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltSuppressTrailingZeros

AltSuppressZeroInches

AltSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltSuppressLeadingZeros

AltSuppressZeroInches

AltSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltSuppressLeadingZeros

AltSuppressTrailingZeros

AltSuppressZeroInches


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltSuppressLeadingZeros

SuppressTrailingZeros

AltSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSavePath

DefaultInternetURL

HelpFilePath

LogFilePath

MenuFile


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltRoundDistance

AltTextSuffix

AltTolerancePrecision

AltUnits

AltUnitsFormat

AltUnitsPrecision

AltUnitsScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltRoundDistance

AltTextPrefix

AltTolerancePrecision

AltUnits

AltUnitsFormat

AltUnitsPrecision

AltUnitsScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltRoundDistance

AltTextPrefix

AltTextSuffix

AltUnits

AltUnitsPrecision

AltUnitsScale

AltUnitsFormat


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroInches

AltToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltToleranceSuppressLeadingZeros

AltToleranceSuppressZeroInches

AltToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroInches


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltToleranceSuppressLeadingZeros

AltToleranceSuppressTrailingZeros

AltToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltUnitsPrecision

AltUnitsScale

AltRoundDistance

AltTolerancePrecision

AltUnitsFormat

AltTextPrefix

AltTextSuffix


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltRoundDistance

AltTextPrefix

AltTextSuffix

AltTolerancePrecision

AltUnits

AltUnitsPrecision

AltUnitsScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltUnits

AltUnitsScale

AltRoundDistance

AltTolerancePrecision

AltUnitsFormat

AltTextPrefix

AltTextSuffix

TextPrecision


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltUnits

AltUnitsPrecision

AltRoundDistance

AltTolerancePrecision

AltUnitsFormat

AltTextPrefix

AltTextSuffix


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Delta

Length


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltUnitsFormat

UnitsFormat


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleToReal

AngleToString

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleFromXAxis

AngleToString

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleFromXAxis

AngleToReal

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1EndPoint

ExtLine2EndPoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Type

ActiveX and VBA Developer's Guide:

"Add the Annotation to a Leader Line"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

AppDeactivate

WindowMovedOrResized

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddHatch

AppendOuterLoop

NumberOfLoops

ActiveX and VBA Developer's Guide:

"Edit Hatch Boundaries"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Delete

Item

RemoveItems

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddHatch

AppendInnerLoop

Evaluate

NumberOfLoops

Regen

ActiveX and VBA Developer's Guide:

"Edit Hatch Boundaries"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

Closed

Coordinates

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Handle

ObjectID


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Center

Radius

StartAngle

StartPoint

EndAngle

EndPoint


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

RenderSmoothness

ContourLinesPerSurface

SegmentPerPolyline

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Center

Closed

Degree

Radius

ActiveX and VBA Developer's Guide:

"Calculate Areas"

"Create Composite Regions"

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Array Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

Copy

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

SnapRotationAngle

TransformBy

ActiveX and VBA Developer's Guide:

"Array Objects"

"Array in 3D"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead1Type

ArrowheadSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead1Block

Arrowhead2Type

ArrowheadSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead2Type

ArrowheadSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead1Type

Arrowhead2Block

ArrowheadSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrowheadType

ArrowheadSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead1Type

Arrowhead2Type

ArrowheadType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrowheadSize

ArrowheadBlock


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

ARXUnloaded

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

ARXLoaded

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Object:

SortentsTable


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddHatch

HatchStyle

NumberOfLoops

SetPattern

ActiveX and VBA Developer's Guide:

"Edit Hatches"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Bind

Detach

Reload

Unload

ActiveX and VBA Developer's Guide:

"Attach Xrefs"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DrawingDirection

Height

InsertionPoint

Rotation

StyleName

TextString

Width

ActiveX and VBA Developer's Guide:

"Format Multiline Text"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Flyout

Type

ActiveX and VBA Developer's Guide:

"Create Flyout Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Save

SaveAs


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

CreateBackup

FullCRCValidation

LogFileOn


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSavePath

CreateBackup

FullCRCValidation

IncrementalSavePercent

LogFileOn

TempFileExtension

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapMagnet

AutoSnapMarker

AutoSnapToolTip

AutoSnapMarkerColor

AutoSnapMarkerSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapAperture

AutoSnapMagnet

AutoSnapMarker

AutoSnapMarkerColor

AutoSnapMarkerSize

AutoSnapToolTip

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapMarker

AutoSnapToolTip

AutoSnapAperture

AutoSnapMarkerColor

AutoSnapMarkerSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapMagnet

AutoSnapToolTip

AutoSnapAperture

AutoSnapMarkerColor

AutoSnapMarkerSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapAperture

AutoSnapMagnet

AutoSnapMarker

AutoSnapToolTip

AutoSnapMarkerSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapAperture

AutoSnapMagnet

AutoSnapMarker

AutoSnapToolTip

AutoSnapMarkerColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSnapApertureSize

AutoSnapMagnet

AutoSnapMarker

AutoSnapAperture

AutoSnapMarkerColor

AutoSnapMarkerSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

LayoutCrosshairColor

ModelCrosshairColor

TextWinBackgrndColor

TextWinTextColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor Function

RGB Function


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

AddMText


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UpsideDown


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DirectionVector

ActiveX and VBA Developer's Guide:

"Query Constuction Xlines"

"Query Rays"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableStartupDialog

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginOpen

BeginQuit

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndCommand

BeginLISP

EndLISP

ActiveX and VBA Developer's Guide:

"Use Events"

ObjectARX Developer's Guide:

Command Stack


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginOpen

BeginQuit

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginRightClick

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginOpen

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndLISP

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndModal

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndOpen

NewDrawing

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndPlot

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginCommand

BeginOpen

BeginSave

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginShortcutMenuCommand

BeginShortcutMenuGrip

BeginDoubleClick

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

EndSave

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginShortcutMenuGrip

BeginRightClick

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuCommand

BeginShortcutMenuEdit

BeginShortcutMenuGrip

BeginRightClick

EndShortcutMenu

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuCommand

BeginShortcutMenuDefault

BeginShortcutMenuGrip

BeginRightClick

EndShortcutMenu

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuCommand

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginRightClick

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

FontFile

Height

LastHeight

Name

ObliqueAngle

TextGenerationFlag

Width

ActiveX and VBA Developer's Guide:

"Use Unicode and Big Fonts"

"Create and Modify Text Styles"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachExternalReference

Detach

Reload

Unload

ActiveX and VBA Developer's Guide:

"Bind Xrefs"


AddSection, related topics

No related topics found.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Layout


See also [ActiveX and VBA Reference: AAR]

See Also

NOTHING TO SEE HERE.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CheckInterference

SectionSolid

SliceSolid

ActiveX and VBA Developer's Guide:

"Create Composite Regions"

"Edit 3D Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BreakSpacing


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BreaksEnabled


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Contrast

Fade

ImageVisibility

Transparency

ActiveX and VBA Developer's Guide:

"Adjust Image Brightness, Contrast, and Fade"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetPaperSize

PaperUnits

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Label

Visible

AutoCAD Customization Guide:

"DIESEL Expressions in Menu Macros"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Radius

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotHidden

PlotType

ScaleLineweights

ShowPlotStyles

UseStandardScale

PlotViewportBorders

PlotViewportsFirst

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterMarkSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MomentOfInertia

PrincipalDirections

PrincipalMoments

ProductOfInertia

RadiiOfGyration

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Enable

ActiveX and VBA Developer's Guide:

"Explore the Properties of Menu Items"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Boolean

SectionSolid

SliceSolid

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Center

Diameter

Radius


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddItems

Delete

Erase

Item

RemoveItems

ActiveX and VBA Developer's Guide:

"Remove Objects from a Selection Set"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ClippingEnabled

ActiveX and VBA Developer's Guide:

"Clip Images"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GridOn

SnapOn

ViewportOn

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ClipBoundary

ActiveX and VBA Developer's Guide:

"Show and Hide Image Boundaries"

"Clip Images"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SingleDocumentMode

ActiveX and VBA Developer's Guide:

"Open, Save, and Close Drawings"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AppendVertex

Area

Coordinates

ActiveX and VBA Developer's Guide:

"Edit Polylines"

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Layer

Linetype

LinetypeScale

Normal

Thickness

Visible

ActiveX and VBA Developer's Guide:

"Work with Colors"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetColorBookColor


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorMethod

ColorName

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorName

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Rows


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Columns

Rows

RowSpacing


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TempFilePath

TemplateDWGPath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrinterConfigPath


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Invisible

Mode

Preset

Verify


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetWidth

SetWidth

ActiveX and VBA Developer's Guide:

"Edit Polylines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ContentBlockType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ContentBlockName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArcSmoothness

RenderSmoothness

SegmentPerPolyline

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Edit 3D Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Brightness

Fade

ImageVisibility

Transparency

ActiveX and VBA Developer's Guide:

"Adjust Image Brightness, Contrast, and Fade"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfControlPoints

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

AppendVertex

Closed

Coordinates

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Edit Polylines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

AppendVertex

Closed

Coordinate

TranslateCoordinates

ActiveX and VBA Developer's Guide:

"Edit Polylines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Copy an Object to the Same Location"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Copy

CopyObjects

ActiveX and VBA Developer's Guide:

"Copy an Object to the Same Location"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Copy an Object to the Same Location"

"Copy Multiple Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

ExportProfile

GetAllProfileNames

ImportProfile

ResetProfile

RenameProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddItems

AppendItems

Item

RemoveItems

ActiveX and VBA Developer's Guide:

"Iterate through a Collection"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

AutoSavePath

FullCRCValidation

IncrementalSavePercent

LogFileOn

TempFileExtension

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MoveContent()

DeleteContent()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IndexOf

Item

RemoveEntry

UpdateEntry

Application


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleToReal

GetDistance

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DockedVisibleLines

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltFontFile

FontFileMap

MainDictionary

TextEditor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Check Spelling"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StandardScale

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Document


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

Activate

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UnitsFormat


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltTabletMenuFile

AutoSavePath

HelpFilePath

LogFilePath

MenuFile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrinterSpoolAlert

PrinterPaperSizeAlert

PlotLegacy

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultPlotStyleForObjects

DefaultPlotStyleTable

PlotPolicy


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultPlotStyleForLayer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultPlotStyleForObjects

DefaultPlotStyleForLayer

PlotPolicy


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Closed

EndTangent

FitTolerance

IsRational

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Clear

Erase

DeleteConfiguration

ActiveX and VBA Developer's Guide:

"Delete Layers"

"Delete Linetypes"

"Remove Objects from a Selection Set"

"Use Named Views"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Delete


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateContent()

MoveContent()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

FitTolerance

GetFitPoint

SetFitPoint

NumberOfFitPoints

PurgeFitData

Regen

Update

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

CopyProfile

ExportProfile

GetAllProfileNames

ImportProfile

RenameProfile

ResetProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Angle

Length


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XRefDemandLoad

ProxyImage

ShowProxyDialogBox

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Name

ActiveX and VBA Developer's Guide:

"Change Linetype Descriptions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachExternalReference

Bind

Reload

Unload

ActiveX and VBA Developer's Guide:

"Detach Xrefs"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Circumference

Radius


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


DimensionLinetype, related topics

See Also

Properties:

ExtLine1Linetype property

ExtLine2Linetype property

ExtLineFixedLen property

ExtLineFixedLenSuppress property


ExtLine1Linetype, related topics

See Also

Properties:

DimensionLinetype property

ExtLine2Linetype property

ExtLineFixedLen property

ExtLineFixedLenSuppress property


ExtLine2Linetype, related topics

See Also

Properties:

DimensionLinetype property

ExtLine1Linetype property

ExtLineFixedLen property

ExtLineFixedLenSuppress property


ExtLineFixedLen, related topics

See Also

Properties:

DimensionLinetype property

ExtLine1Linetype property

ExtLine2Linetype property

ExtLineFixedLenSuppress property


ExtLineFixedLenSuppress, related topics

See Also

Properties:

DimensionLinetype property

ExtLine1Linetype property

ExtLine2Linetype property

ExtLineFixedLen property


TextFill, related topics

See Also

Properties:

TextFillColor property


TextFillColor, related topics

See Also

Properties:

TextFill property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtensionLinecolor

TextColor

ActiveX and VBA Developer's Guide:

"Work with Colors"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLineColor

DimensionLineWeight

ExtensionLineExtend


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLineColor

ExtensionLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimLine2Suppress


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimLine1Suppress


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimLine1Suppress

DimLine2Suppress


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLineColor

DimensionLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"

"Work with Dimension Styles"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DirectionVector

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BasePoint

Direction

InsertionPoint

ActiveX and VBA Developer's Guide:

"Query Constuction Xlines"

"Query Rays"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MSpace

ViewportOn

ZoomAll

ZoomCenter

ZoomExtents

ZoomPickWindow

ZoomScaled

ZoomWindow


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayGripsWithinBlocks

GripColorSelected

GripColorUnselected

GripSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayGrips

GripColorSelected

GripColorUnselected

GripSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayScrollBars

DisplayScreenMenu

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Clipped

ViewportOn

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SingleDocumentMode

AllowLongSymbolNames

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfCopies

PlotToDevice

PlotToFile

SetLayoutsToPlot

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayScrollBars

DisplayLayoutTabs

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayLayoutTabs

DisplayScreenMenu

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ImageFrameHighlight

ShowRasterImage

SolidFill

TextFrameDisplay

TrueColorImages

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleToReal

GetDistance

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DockStatus

Float

FloatingRows

ActiveX and VBA Developer's Guide:

"Float and Dock Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HistoryLines

CursorSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Dock

Float

ActiveX and VBA Developer's Guide:

"Float and Dock Toolbars"


ActiveMaterial, related topics

No related topics found.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Database


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDocument

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DogLegLength


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

Display

DatabasePreferences object

Files

OpenSave

Output

Profiles

Selection

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

Height

InsertionPoint

Rotation

StyleName

TextString

Width


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TemplateDWGPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


AdjustForBackground, related topics

See Also

Properties:

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

File property

Height property

ItemName property

Monochrome property

Position property

Rotation property

ScaleFactor property

UnderlayName property

UnderlayVisibility property

Width property


File, related topics

See Also

Properties:

AdjustForBackground property

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

Height property

ItemName property

Monochrome property

Position property

Rotation property

ScaleFactor property

UnderlayName property

UnderlayVisibility property

Width property


ItemName, related topics

See Also

Properties:

AdjustForBackground property

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

File property

Height property

Monochrome property

Position property

Rotation property

ScaleFactor property

UnderlayName property

UnderlayVisibility property

Width property


Monochrome, related topics

See Also

Properties:

AdjustForBackground property

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

File property

Height property

ItemName property

Position property

Rotation property

ScaleFactor property

UnderlayName property

UnderlayVisibility property

Width property


UnderlayName, related topics

See Also

Properties:

AdjustForBackground property

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

File property

Height property

ItemName property

Monochrome property

Position property

Rotation property

ScaleFactor property

UnderlayVisibility property

Width property


UnderlayVisibility, related topics

See Also

Properties:

AdjustForBackground property

ClipBoundary property

ClippingEnabled property

Contrast property

Fade property

File property

Height property

ItemName property

Monochrome property

Position property

Rotation property

ScaleFactor property

UnderlayName property

Width property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Name


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Degree

NumberOfControlPoints

NumberOfFitPoints

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HatchStyle

TranslateCoordinates


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ElevationPaperSpace

Limits


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ElevationModelSpace

Limits


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Check

ActiveX and VBA Developer's Guide:

"Explore the Properties of Menu Items"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsMergeAllEnabled()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BeepOnError

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndPoint

StartAngle

StartPoint

ActiveX and VBA Developer's Guide:

"Extend and Trim Objects"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginCommand

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginLISP

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginModal

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StartParameter


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginPlot

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndAngle

MajorAxis

Radius

RadiusRatio

StartAngle

StartPoint

ActiveX and VBA Developer's Guide:

"Extend and Trim Objects"

"Use Variants in Methods and Properties"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginSave

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginShortcutMenuDefault

BeginShortcutMenuEdit

BeginShortcutMenuGrip

BeginShortcutMenuOsnap

BeginRightClick

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddSubMenu

SubMenu

ActiveX and VBA Developer's Guide

"Create Cascading Submenus"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Closed

Degree

FitTolerance

IsRational

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StartUndoMark


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Clear

Delete

PurgeAll

Update

ActiveX and VBA Developer's Guide:

"Remove Objects from a Selection Set"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

RunMacro


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddLeader

AddHatch

ActiveX and VBA Developer's Guide:

"Edit Leader Associativity"

"Edit Hatches"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Block

Coordinates

Item

ActiveX and VBA Developer's Guide:

"Explode a Block Reference"

"Explode Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Import

Save

SaveAs

ActiveX and VBA Developer's Guide:

"Export to Other File Formats"

"Export and Import Saved Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

CopyProfile

DeleteProfile

GetAllProfileNames

ImportProfile

RenameProfile

ResetProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLinecolor

ExtensionLineOffset

ExtensionLineExtend

ExtensionLineWeight

TextColor

ActiveX and VBA Developer's Guide:

"Work with Colors"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLineExtend

ExtensionLineOffset

ExtensionLineColor

ExtensionLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtensionLineExtend

ExtensionLineColor

ExtensionLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtensionLineColor

DimensionLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1StartPoint

ExtLine2StartPoint

ExtLine2EndPoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine2Point

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1EndPoint

ExtLine2StartPoint

ExtLine2EndPoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine2Suppress


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1StartPoint

ExtLine1EndPoint

ExtLine2StartPoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1Point

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1StartPoint

ExtLine1EndPoint

ExtLine2EndPoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ExtLine1Suppress


Height, related topics

See Also

Properties:

Direction property

TaperAngle property


TaperAngle, related topics

See Also

Properties:

Direction property

Height property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Brightness

Contrast

ImageVisibility

Transparency

ActiveX and VBA Developer's Guide:

"Adjust Image Brightness, Contrast, and Fade"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

FullFileName

FileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Objects:

Text

MText


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Mode

PromptString

TagString

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences object

Display

Drafting

OpenSave

Output

Profiles

Selection

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FoundPath

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Arrowhead1Type

Arrowhead2Type

ArrowheadSize

Measurement

TextInside

TextOutsideAlign

TextOverride


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

Area

Closed

Degree

DeleteFitPoint

EndTangent

FitTolerance

GetFitPoint

IsRational

NumberOfControlPoints

NumberOfFitPoints

SetFitPoint

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Closed

Degree

EndTangent

IsRational

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Dock

FloatingRows

ActiveX and VBA Developer's Guide:

"Float and Dock Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DockStatus

Float

ActiveX and VBA Developer's Guide:

"Float and Dock Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StyleName

ActiveX and VBA Developer's Guide:

"Create Flyout Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BigFontFile

Height

LastHeight

Name

ObliqueAngle

Regen

TextGenerationFlag

Width

ActiveX and VBA Developer's Guide:

"Create and Modify Text Styles"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltFontFile

CustomDictionary

MainDictionary

TextEditor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Substitute Fonts"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextInsideAlign


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFormat()

SetFormat()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayerOn

Lock

ActiveX and VBA Developer's Guide:

"Freeze and Thaw Layers"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

AutoSavePath

CreateBackup

IncrementalSavePercent

LogFileOn

TempFileExtension

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Name

Path


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AlignmentPointAcquisition

AutoTrackingVecColor

PolarTrackingVector

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Object:

Layers


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsQuiescent


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetAlignment2()


See also [ActiveX and VBA Reference: AAR]

See Also

ActiveProfile

CopyProfile

DeleteProfile

ExportProfile

ImportProfile

RenameProfile

ResetProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddAttribute

HasAttributes

GetConstantAttributes

ActiveX and VBA Developer's Guide:

"Extract Attribute Information"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetAutoScale2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBitmaps

ActiveX and VBA Developer's Guide:

"Define the Toolbar Button Image"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBlockAttributeValue2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBlockAttributeValue32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBlockAttributeValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBlockTableRecordId2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetBlockTableRecordId32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IntersectWith

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableBreak()

SetBreakHeight()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

Coordinates

SetBulge

Type

ActiveX and VBA Developer's Guide:

"Edit Polylines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CanonicalMediaName

GetLocaleMediaName

RefreshPlotDeviceInfo

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellContentColor2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellDataType()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellFormat()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellState()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellStyle()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCellValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetColumnName()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddAttribute

HasAttributes

GetAttributes

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetContentLayout()


See also [ActiveX and VBA Reference: AAR]

See Also

Nothing to see here.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfControlPoints

SetControlPoint

SetWeight

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetCustomData()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PaperUnits

SetCustomScale

UseStandardScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetDataFormat()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetDataLink32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetDataLink()

RemoveDataLink()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetDataType2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HasExtensionDictionary


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetFieldId2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetFieldId232()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

DeleteFitPoint

FitTolerance

SetFitPoint

NumberOfFitPoints

PurgeFitData

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetFont


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetHasFormula()

SetFormula()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridColor2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridDoubleLineSpacing()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridLineStyle()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridLinetype32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridLinetype()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridLineWeight2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GridOn

SetGridSpacing


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridVisibility2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataLink()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFormula()

SetFormula()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LoadARX


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DFace

SetInvisibleEdge


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetOrientation

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

CanonicalMediaName

GetCanonicalMediaNames

RefreshPlotDeviceInfo


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AppendInnerLoop

AppendOuterLoop

NumberOfLoops

InsertLoopAt

ActiveX and VBA Developer's Guide:

"Edit Hatch Boundaries"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetMargin()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddObject

GetObject

Remove


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddObject

GetName

Remove


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetPoint

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetOverride()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotOrigin

PaperUnits

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PaperUnits

CanonicalMediaName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ConfigName

RefreshPlotDeviceInfo

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

ShowPlotStyles

DefaultPlotStyleForLayer

DefaultPlotStyleForObjects

RefreshPlotDeviceInfo

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetReal

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

PrintSpoolerPath

SupportPath

TemplateDWGPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetString

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsRemoteFile

IsURL

PutRemoteFile

LaunchBrowserDialog


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetRotation()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetScale()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetSnapSpacing

SnapOn


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetSubEntity

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetEntity

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

InitializeUserInput

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetFormat()

FormatValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetTextHeight2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetTextString()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetTextStyle2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Origin

TransformBy

UCSIconOn

XVector

YVector

ActiveX and VBA Developer's Guide:

"Define a User Coordinate System"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetValue()

SetValueFromText()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetVariable

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfControlPoints

GetControlPoint

SetControlPoint

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetWidth

Type

ActiveX and VBA Developer's Guide:

"Edit Polylines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetWindowToPlot

PlotOrigin

PaperUnits

PlotType

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetXData

ActiveX and VBA Developer's Guide:

"Assign and Retrieve Extended Data"

"Use Variants in Methods and Properties"

AutoLISP Developer's Guide:

"Extended Data—xdata"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddXRecord

SetXRecordData

GetXData

SetXData

ActiveX and VBA Developer's Guide:

"Assign and Retrieve Extended Data"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternDouble

PatternName

PatternScale

PatternSpace

PatternType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinModelBackgrndColor

LayoutCrosshairColor

ModelCrosshairColor

TextWinBackgrndColor

TextWinTextColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinLayoutBackgrndColor

LayoutCrosshairColor

ModelCrosshairColor

TextWinBackgrndColor

TextWinTextColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

GetGridSpacing

SetGridSpacing

SetVariable

SnapBasePoint

SnapOn

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayGrips

DisplayGripsWithinBlocks

GripColorUnselected

GripSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayGrips

DisplayGripsWithinBlocks

GripColorSelected

GripSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayGrips

DisplayGripsWithinBlocks

GripColorSelected

GripColorUnselected


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Application

ObjectID


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectIDToObject


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddAttribute

GetAttributes


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetExtensionDictionary


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddHatch

AssociativeHatch

NumberOfLoops

SetPattern

ActiveX and VBA Developer's Guide:

"Define the Hatch Boundaries"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DrawingDirection

ImageHeight

InsertionPoint

Rotation

StyleName

TextString

Width

ActiveX and VBA Developer's Guide:

"Change Image Scale, Rotation, Location, Width and Height"

"Control the Application Window"

"Create and Modify Text Styles"

"Edit Attribute Definitions"

"Set Text Height"


BaseRadius, related topics

See Also

Properties:

Constrain property

Height property

Position property

TopRadius property

TotalLength property

TurnHeight property

TurnSlope property

Turns property

Twist property


Constrain, related topics

See Also

Properties:

BaseRadius property

Height property

Position property

TopRadius property

TotalLength property

TurnHeight property

TurnSlope property

Turns property

Twist property


Position, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

TopRadius property

TotalLength property

TurnHeight property

TurnSlope property

Turns property

Twist property


TopRadius, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TotalLength property

TurnHeight property

TurnSlope property

Turns property

Twist property


TotalLength, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TopRadius property

TurnHeight property

TurnSlope property

Turns property

Twist property


TurnHeight, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TopRadius property

TotalLength property

TurnSlope property

Turns property

Twist property


Turns, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TopRadius property

TotalLength property

TurnHeight property

TurnSlope property

Twist property


TurnSlope, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TopRadius property

TotalLength property

TurnHeight property

Turns property

Twist property


Twist, related topics

See Also

Properties:

BaseRadius property

Constrain property

Height property

Position property

TopRadius property

TotalLength property

TurnHeight property

TurnSlope property

Turns property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltTabletMenuFile

AutoSavePath

DefaultInternetURL

LogFilePath

MenuFile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Caption

Check

Enable

ActiveX and VBA Developer's Guide:

"Create Status-Line Help for Menu Items and Toolbar Items"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Update

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

VerticalTextPosition


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SendCommand


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HyperlinkDisplayTooltip

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HyperlinkDisplayCursor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


StartTangent [ActiveX and VBA Reference: AAR]

StartTangent Property

Specifies the start tangent for the spline.

See Also | Example

Signature

object.StartTangent

object

Spline
The object or objects this property applies to.

StartTangent

Variant (three-element array of doubles); read-write
A 3D vector representing the start tangent for the spline.

Remarks

When a spline is elevated, it is converted from an interpolated (fit) spline to a control point spline. This means that after elevation, the spline no longer has fit tangents, and the StartTangent and EndTangent properties for the spline are no longer accessible. The only way to edit a control point spline is through the ControlPoints property, or the SetControlPoint or GetControlPoint methods.


Object Model, Preferences [ActiveX and VBA Reference: AAR]

Object Model, Preferences

Click on an object to view the description.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ImageHeight

ImageWidth

ImageVisibility

Name

ActiveX and VBA Developer's Guide:

"Change Image File Paths"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplaySilhouette

ShowRasterImage

SolidFill

TextFrameDisplay

TrueColorImages

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

ImageFile

ImageVisibility

ImageWidth

ActiveX and VBA Developer's Guide:

"Change Image File Paths"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Brightness

Contrast

Fade

Transparency

ActiveX and VBA Developer's Guide:

"Change Image Visibility"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ImageFile

ImageHeight

ImageVisibility

Width

ActiveX and VBA Developer's Guide:

"Change Image File Paths"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Export

New

Open

ActiveX and VBA Developer's Guide:

"Import Other File Formats"

"Use Variants in Methods and Properties"

"Export and Import Saved Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

CopyProfile

DeleteProfile

ExportProfile

GetAllProfileNames

RenameProfile

ResetProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SaveAsType

SavePreviewThumbnail

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Caption

Check

Enable

ActiveX and VBA Developer's Guide:

"Add New Menu Items to a Menu"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateEntry

Item

RemoveEntry

UpdateEntry

Application


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetDistance

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

ActiveX and VBA Developer's Guide:

"Control User Input"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

AddAttribute

ActiveX and VBA Developer's Guide:

"Insert Blocks"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsertRowsAndInherit()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddMenuItem

AddSeparator

AddSubMenu

ActiveX and VBA Developer's Guide:

"Insert Menus in the Menu Bar"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DrawingDirection

Height

Rotation

StyleName

TextString

Width

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"

"Format Line Text"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AppendInnerLoop

AppendOuterLoop

NumberOfLoops

GetLoopAt

ActiveX and VBA Developer's Guide:

"Edit Hatch Boundaries"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

RemoveMenuFromMenuBar

ActiveX and VBA Developer's Guide:

"Insert Menus in the Menu Bar"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsertColumnsAndInherit()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsUnitsFactor


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsUnits


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBoundingBox

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Constant

Preset

Mode

Verify


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsOwnerXlated

IsPrimary

Key

Value


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsFormatEditable()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Rows

Columns

SetText()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsContentEditable()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsXRef


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableMergeAll()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FoundPath

FingerprintGUID

VersionGUID

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsCloned

IsPrimary

Key

Value


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsPlanar

IsRational

Area

Closed

Degree

EndTangent

FitTolerance

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsPeriodic

IsRational

Area

Closed

Degree

EndTangent

FitTolerance

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsCloned

IsOwnerXlated

Key

Value


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAcadState


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsPeriodic

IsPlanar

Area

Closed

Degree

EndTangent

FitTolerance

NumberOfControlPoints

NumberOfFitPoints

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsRemoteFile

GetRemoteFile

PutRemoteFile

LaunchBrowserDialog


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsLayout

XRefDatabase


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddItems

Clear

Delete

RemoveItems

IAcadObject

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsCloned

IsOwnerXlated

IsPrimary

Value


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableStartupDialog

KeyboardPriority

ProxyImage

ShowProxyDialogBox

XRefDemandLoad

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableStartupDialog

KeyboardAccelerator

ProxyImage

ShowProxyDialogBox

XRefDemandLoad

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Weights

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Caption

Check

Enable

ActiveX and VBA Developer's Guide:

"Explore the Properties of Menu Items"

AutoCAD Customization Guide:

"DIESEL Expressions in Menu Macros"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBitmaps

SetBitmaps

ActiveX and VBA Developer's Guide:

"Define the Toolbar Button Image"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BigFontFile

FontFile

Height

Name

ObliqueAngle

TextGenerationFlag

Width


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsRemoteFile

IsURL

GetRemoteFile

PutRemoteFile


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveLayer

Color

Layer object

Linetype

LinetypeScale

Normal

Thickness

Visible


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Freeze

Lock


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Layouts

PlotConfigurations


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayoutShowPlotSetup

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

ModelCrosshairColor

TextWinBackgrndColor

TextWinTextColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayoutDisplayPaper

LayoutDisplayPaperShadow

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayoutDisplayMargins

LayoutDisplayPaperShadow

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayoutDisplayMargins

LayoutDisplayPaper

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LayoutCreateViewport

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

WindowChanged

WindowMovedOrResized

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddDimDiametric

AddDimRadial

TextPosition

TextRotation

ActiveX and VBA Developer's Guide:

"Create Radial Dimensions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LeaderLineType

LeaderLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LeaderLineColor

LeaderLineWeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LeaderLineColor

LeaderLineType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Top

Visible

Width


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Angle

Delta


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Target

TwistAngle

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ElevationModelSpace

ElevationPaperSpace

ZoomAll

ActiveX and VBA Developer's Guide:

"Display Drawing Limits and Extents"

"Scale a View"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ScaleFactor

AltUnitsScale


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

LineSpacingStyle


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LineSpacingStyle


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LineSpacingFactor


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveLinetype

Add

Load

ActiveX and VBA Developer's Guide:

"Assign a Linetype to a Layer"

"Sort Layers and Linetypes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Linetype

LinetypeScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Color

Layer

Linetype

Normal

Thickness

Visible

ActiveX and VBA Developer's Guide:

"Specify Linetype Scale"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LineweightDisplay


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Lineweight


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginLISP

EndLISP

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LoadARX

UnloadARX

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

LoadARX

LoadShapeFile

ActiveX and VBA Developer's Guide:

"Work with Linetypes"

"Use Variants in Methods and Properties"

AutoCAD Command Reference Topics:

MENU

MENULOAD


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BeepOnError

DisplayOLEScale

EnableStartupDialog

ShowWarningMessages

SingleDocumentMode

StoreSQLIndex

TablesReadOnly

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ListARX

UnloadARX


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UnloadDVB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddShape


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Version


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Freeze

LayerOn

ActiveX and VBA Developer's Guide:

"Lock and Unlock Layers"


EndDraftAngle, related topics

See Also

Properties:

Closed property

EndDraftMagnitude property

NumCrossSections property

NumGuidePaths property

StartDraftAngle property

StartDraftMagnitude property

SurfaceNormals property


EndDraftMagnitude, related topics

See Also

Properties:

Closed property

EndDraftAngle property

NumCrossSections property

NumGuidePaths property

StartDraftAngle property

StartDraftMagnitude property

SurfaceNormals property


NumCrossSections, related topics

See Also

Properties:

Closed property

EndDraftAngle property

EndDraftMagnitude property

NumGuidePaths property

StartDraftAngle property

StartDraftMagnitude property

SurfaceNormals property


NumGuidePaths, related topics

See Also

Properties:

Closed property

EndDraftAngle property

EndDraftMagnitude property

NumCrossSections property

StartDraftAngle property

StartDraftMagnitude property

SurfaceNormals property


StartDraftAngle, related topics

See Also

Properties:

Closed property

EndDraftAngle property

EndDraftMagnitude property

NumCrossSections property

NumGuidePaths property

StartDraftMagnitude property

SurfaceNormals property


StartDraftMagnitude, related topics

See Also

Properties:

Closed property

EndDraftAngle property

EndDraftMagnitude property

NumCrossSections property

NumGuidePaths property

StartDraftAngle property

SurfaceNormals property


SurfaceNormals, related topics

See Also

Properties:

Closed property

EndDraftAngle property

EndDraftMagnitude property

NumCrossSections property

NumGuidePaths property

StartDraftAngle property

StartDraftMagnitude property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

AutoSavePath

CreateBackup

FullCRCValidation

LogFilePath

IncrementalSavePercent

TempFileExtension

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltTabletMenuFile

AutoSavePath

DefaultInternetURL

HelpFilePath

LogFileOn

MenuFile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

Name

UpperRightCorner

ActiveX and VBA Developer's Guide:

"Make Another Tiled Viewport Current"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Caption

Check

Enable

ActiveX and VBA Developer's Guide:

"Create Macros"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltFontFile

CustomDictionary

FontFileMap

TextEditor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Check Spelling"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MinorAxis

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MajorAxis

MinorAxis

MinorRadius


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

LayerStateManager object

Save method

Restore method

ActiveX and VBA Developer's Guide:

"Use the LayerStateManager to Manage Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArcSmoothness

ContourLinesPerSurface

DisplaySilhouette

IncrementalSavePercent

RenderSmoothness

SegmentPerPolyline

ShowRasterImage

TextFrameDisplay

XRefDemandLoad

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayScreenMenu

DisplayScrollBars

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MDensity

MVertexCount

NClose

NDensity

NVertexCount

ActiveX and VBA Developer's Guide:

"Create Meshes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MClose

MVertexCount

NClose

NDensity

NVertexCount

ActiveX and VBA Developer's Guide:

"Create Meshes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextOverride

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsertInMenuBar

RemoveFromMenuBar

ActiveX and VBA Developer's Guide:

"Understand the MenuBar and MenuGroups Collections"

"Insert Menus in the Menu Bar"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Load

MenuFileName

Unload

ActiveX and VBA Developer's Guide:

"Load Menu Groups"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Load

MenuFile

Unload

ActiveX and VBA Developer's Guide:

"Load Menu Groups"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Load

MenuFile

MenuFileName

Unload

ActiveX and VBA Developer's Guide:

"Load Menu Groups"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Load

MenuFile

MenuFileName

Unload

ActiveX and VBA Developer's Guide:

"Load Menu Groups"

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MajorAxis

MajorRadius

MinorRadius

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Move

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Mirror in 3D"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Delete

GetVariable

SetVariable

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Mirror Objects"

"Use Variants in Methods and Properties"


MLineScale, related topics

No related topics found.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PromptString

TagString

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

LayoutCrosshairColor

TextWinBackgrndColor

TextWinTextColor

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotWithPlotStyles


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

ObjectAdded

ObjectErased

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

PrincipalDirections

PrincipalMoments

ProductOfInertia

RadiiOfGyration

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Offset

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Move Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateContent()

DeleteContent()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateBackup

FullCRCValidation

IncrementalSavePercent

LogFileOn

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveSpace

Display

ActiveX and VBA Developer's Guide:

"Switch to the Model Space Layout"

"Switch to a Paper Space Layout"


FieldCode, related topics

See Also

Properties:

BackgroundFill property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UpdateMTextAttribute()

MTextAttributeContent()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MClose

MDensity

NClose

NDensity

NVertexCount

Type

ActiveX and VBA Developer's Guide:

"Create Meshes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

EffectiveName

FullName

ImageFile

LogFilePath

NameNoMnemonic

PatternName

StyleName

ActiveX and VBA Developer's Guide:

"Create and Modify Text Styles"

"Create and Name Layers"

"Rename Linetypes"

"Rename Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

FullName

LogFilePath

Name

PatternName

StyleName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MClose

MDensity

MVertexCount

NDensity

NVertexCount

ActiveX and VBA Developer's Guide:

"Create Meshes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MClose

MDensity

MVertexCount

NClose

NVertexCount

ActiveX and VBA Developer's Guide:

"Create Meshes"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Import

Open


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

BeginOpen

EndOpen

ActiveX and VBA Developer's Guide:

"Use Events"


None .. go back!


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Color

Layer

Linetype

LinetypeScale

Thickness

TranslateCoordinates

Visible

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"

"Convert Coordinates"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Closed

Degree

EndTangent

FitTolerance

GetControlPoint

IsRational

NumberOfFitPoints

SetControlPoint

SetWeight

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

QuietErrorMode

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfVertices


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

Area

Closed

Degree

DeleteFitPoint

EndTangent

FitTolerance

GetFitPoint

IsRational

NumberOfControlPoints

SetFitPoint

StartTangent

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AppendInnerLoop

AppendOuterLoop

HatchStyle

ActiveX and VBA Developer's Guide:

"Define the Hatch Boundaries"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfFaces


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Coordinates

MClose

MDensity

MVertexCount

NClose

NDensity

Type

ActiveX and VBA Developer's Guide:

"Create Meshes"


Materials, related topics

No related topics found.


SectionManager, related topics

No related topics found.


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

ObjectErased

ObjectModified

ActiveX and VBA Developer's Guide:

"Use Events"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

ObjectAdded

ObjectModified

ObjectID

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Application

Handle

ObjectName

OwnerID


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HandleToObject


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Application

Handle

ObjectID


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetSnapSpacing

SetSnapSpacing


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPlotting

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortBySelection

ObjectSortBySnap


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySnap


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Rotation

ActiveX and VBA Developer's Guide:

"Set Obliquing Angle"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Offset Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

OLEQuality


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

OLELaunch

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

InsertInMenuBar

RemoveFromMenuBar

ShortcutMenu

ActiveX and VBA Developer's Guide:

"Insert Menus in the Menu Bar"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Import

New

ActiveX and VBA Developer's Guide:

"Opening, Save, and Closing a Draw"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences object

Display

Drafting

Files

Output

Profiles

Selection

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

AddRaster

GetPaperMargins

PaperUnits

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GridOn

SnapOn

ActiveX and VBA Developer's Guide:

"Use Ortho Mode"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences object

Display

Drafting

Files

OpenSave

Profiles

Selection

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ObjectID

ObjectIDToObject


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CanonicalMediaName

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Application


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Name

FullName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternDouble

PatternName

PatternScale

PatternSpace

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternAngle

PatternName

PatternScale

PatternSpace

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternAngle

PatternDouble

PatternScale

PatternSpace

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternAngle

PatternDouble

PatternName

PatternSpace

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternAngle

PatternDouble

PatternName

PatternScale

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddHatch

PatternAngle

PatternDouble

PatternName

PatternScale

PatternSpace

SetPattern

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Centroid


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickFirst

PickAuto

PickBoxSize

PickDrag

PickGroup


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickAdd

PickBoxSize

PickDrag

PickFirst

PickGroup


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickAdd

PickAuto

PickDrag

PickFirst

PickGroup


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickAdd

PickAuto

PickBoxSize

PickFirst

PickGroup


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickAdd

PickAuto

PickBoxSize

PickDrag

PickGroup


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveSelectionSet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PickFirst

PickAdd

PickDrag

PickAuto

PickBoxSize


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterPlot

ScaleLineweights

ShowPlotStyles

UseStandardScale

PlotViewportBorders

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultOutputDevice

PrinterSpoolAlert

PrinterPaperSizeAlert

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetPaperMargins

PaperUnits

Regen

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultPlotStyleForLayer

DefaultPlotStyleForObjects

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterPlot

PlotHidden

PlotType

PlotOrigin

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultPlotStyleForLayer

DefaultPlotStyleForObjects


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotStyleName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetLayoutsToPlot

PlotToFile

DisplayPlotPreview

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetLayoutsToPlot

PlotToDevice

DisplayPlotPreview

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StyleName

ViewToPlot

SetWindowToPlot

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterPlot

PlotHidden

ScaleLineweights

ShowPlotStyles

UseStandardScale

PlotViewportBorders


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotWithPlotStyles

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotWithLineweights

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetPoint

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AlignmentPointAcquisition

AutoTrackingVecColor

FullScreenTrackingVector

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrintFile

PrintSpoolerPath

PrintSpoolExecutable

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveDocument

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


CustomIconPath, related topics

See Also

Properties:

EnterpriseMenuFile property


EnterpriseMenuFile, related topics

See Also

Properties:

CustomIconPath property


AutomaticPlotLog, related topics

See Also

Properties:

ContinuousPlotLog property

DefaultPlotToFilePath property


ContinuousPlotLog, related topics

See Also

Properties:

AutomaticPlotLog property

DefaultPlotToFilePath property


DefaultPlotToFilePath, related topics

See Also

Properties:

AutomaticPlotLog property

ContinuousPlotLog property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Constant

Invisible

Mode

Verify


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

MomentOfInertia

PrincipalMoments

ProductOfInertia

RadiiOfGyration

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

MomentOfInertia

PrincipalDirections

ProductOfInertia

RadiiOfGyration

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrinterDescPath

PrinterStyleSheetPath

ConfigName

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrinterConfigPath

PrinterStyleSheetPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultOutputDevice

PrinterSpoolAlert

PlotLegacy

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DefaultOutputDevice

PrinterPaperSizeAlert

PlotLegacy

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrinterConfigPath

PrinterDescPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrintSpoolerPath

PrintSpoolExecutable

PostScriptPrologFile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolExecutable

SetProjectFilePath

SupportPath

TemplateDWGPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrintFile

PrintSpoolerPath

PostScriptPrologFile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

MomentOfInertia

PrincipalDirections

PrincipalMoments

RadiiOfGyration

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences

Display

Drafting

Files

OpenSave

Output

Selection

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAngle

GetCorner

GetEntity

GetInput

GetInteger

GetKeyword

GetOrientation

GetPoint

GetReal

GetString

InitializeUserInput


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Mode

TagString

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ShowProxyDialogBox

DemandLoadARXApp

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Erase

ActiveX and VBA Developer's Guide:

"Purge Named Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

DeleteFitPoint

FitTolerance

GetFitPoint

SetFitPoint

NumberOfFitPoints

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsRemoteFile

IsURL

GetRemoteFile

LaunchBrowserDialog


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

TemplateDWGPath


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StartBatchMode

NumberOfCopies


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Save

SaveAs

ActiveX and VBA Developer's Guide:

"Open, Save, and Close Drawings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

MomentOfInertia

PrincipalDirections

PrincipalMoments

ProductOfInertia

Volume

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Center


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Center

MajorAxis

MinorAxis


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleToReal

GetReal

ActiveX and VBA Developer's Guide:

"Calculate Points and Values"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

TimeStamp

FileSize


See also [ActiveX and VBA Reference: AAR]

See Also

GetCanonicalMediaNames

GetPlotDeviceNames

GetPlotStyleTableNames

GetLocaleMediaName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Update

ActiveX and VBA Developer's Guide:

"Update the Geometry in the Document Window"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachExternalReference

Bind

Detach

Unload

ActiveX and VBA Developer's Guide:

"Reload Xrefs"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddObject

GetName

GetObject


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetOverride()

SetOverride()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataLink()

SetDataLink()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateEntry

IndexOf

Item

UpdateEntry

Application


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

InsertMenuInMenuBar

ActiveX and VBA Developer's Guide:

"Remove Menus from the Menu Bar"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddExtrudedSolid

Freeze

LayerOn

ActiveX and VBA Developer's Guide:

"Use Shaded Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddItems

Clear

Delete

Erase

Item

ActiveX and VBA Developer's Guide:

"Remove Objects from a Selection Set"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

InsertMenuInMenuBar

RemoveFromMenuBar

ActiveX and VBA Developer's Guide:

"Remove Menus from the Menu Bar"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

CopyProfile

ExportProfile

GetAllProfileNames

ImportProfile

ResetProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArcSmoothness

ContourLinesPerSurface

SegmentPerPolyline

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Edit 3D Solids"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

RepeatTopLabels


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

RepeatBottomLabels


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveProfile

CopyProfile

DeleteProfile

ExportProfile

GetAllProfileNames

ImportProfile

RenameProfile

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Save method

Mask property

ActiveX and VBA Developer's Guide:

"Restore Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Degree

Closed

ActiveX and VBA Developer's Guide:

"Edit Splines"


AxisDirection, related topics

See Also

Properties:

AxisPosition property

RevolutionAngle property


AxisPosition, related topics

See Also

Properties:

AxisDirection property

RevolutionAngle property


RevolutionAngle, related topics

See Also

Properties:

AxisDirection property

AxisPosition property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Offset

Rotate

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Rotate in 3D"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Offset

Rotate3D

ScaleEntity

TransformBy

ActiveX and VBA Developer's Guide:

"Move Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DrawingDirection

Height

InsertionPoint

ObliqueAngle

ShowRotation

StyleName

TextString

Width

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"

"Edit Dimensions"

"Format Line Text"

"Format Multiline Text"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrimaryUnitsPrecision

ScaleFactor

UnitsFormat


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Columns


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Columns

ColumnSpacing

Rows


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Macro


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Export

SaveAs

Saved

ActiveX and VBA Developer's Guide:

"Open, Save, and Close Drawings"

"Use the LayerStateManager to Manage Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Export

Save

Saved

ActiveX and VBA Developer's Guide:

"Open, Save, and Close Drawings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SavePreviewThumbnail

IncrementalSavePercent

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SaveAsType

IncrementalSavePercent

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

TransformBy

ActiveX and VBA Developer's Guide:

"Scale Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Width

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"

"Format Line Text"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterPlot

PlotHidden

ShowPlotStyles

UseStandardScale

PlotViewportBorders

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ShortcutMenuDisplay

SCMDefaultMode

SCMEditMode

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ShortcutMenuDisplay

SCMEditMode

SCMCommandMode

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ShortcutMenuDisplay

SCMCommandMode

SCMDefaultMode

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

SCMCommandMode

SCMDefaultMode

SCMTimeValue

ShortcutMenuDisplay


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

SCMCommandMode

SCMDefaultMode

SCMTimeMode

ShortcutMenuDisplay


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BasePoint

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


BottomHeight, related topics

See Also

Properties:

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


CreateJog, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


GenerateSectionGeometry, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GetSettings method

HitTest method

RemoveVertex method


GetSettings, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

HitTest method

RemoveVertex method


HitTest, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

RemoveVertex method


IndicatorFillColor, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


IndicatorTransparency, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


LiveSectionEnabled, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


NumVertices, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


RemoveVertex, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method


State, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

TopHeight property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


TopHeight, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

VerticalDirection property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


VerticalDirection, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

Vertices property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


Vertices, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

ViewingDirection property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


ViewingDirection, related topics

See Also

Properties:

BottomHeight property

Coordinate property

Elevation property

IndicatorFillColor property

IndicatorTransparency property

LiveSectionEnabled property

Name property

Normal property

NumVertices property

State property

TopHeight property

VerticalDirection property

Vertices property

Methods:

AddVertex method

CreateJog method

GenerateSectionGeometry method

GetSettings method

HitTest method

RemoveVertex method


GetLiveSection, related topics

See Also

Properties:

Count property

Methods:

GetUniqueSectionName method

Item method


GetUniqueSectionName, related topics

See Also

Properties:

Count property

Methods:

GetLiveSection method

Item method


CurrentSectionType, related topics

No related topics found.


GetSectionTypeSettings, related topics

See Also

Properties:

CurrentSectionType property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Boolean

CheckInterference

SliceSolid

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


BackgroundLinesColor, related topics

See Also

Properties:

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesHiddenLine, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesLayer, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesLinetype, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesLinetypeScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesLineweight, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesPlotStyleName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


BackgroundLinesVisible, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesColor, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesLayer, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesLinetype, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesLinetypeScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesLineweight, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesPlotStyleName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


CurveTangencyLinesVisible, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


DestinationBlock, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


DestinationFile, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesColor, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesEdgeTransparency, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesFaceTransparency, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesHiddenLine, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesLayer, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesLinetype, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesLinetypeScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesLineweight, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesPlotStyleName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


ForegroundLinesVisible, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


GenerationOptions, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryColor, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryDivisionLines, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryLayer, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryLinetype, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryLinetypeScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryLineweight, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionBoundaryPlotStyleName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillColor, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillFaceTransparency, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillHatchAngle, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillHatchPatternName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillHatchPatternType, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillHatchScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillHatchSpacing, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillLayer, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillLinetype, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillLinetypeScale, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillLineweight, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillPlotStyleName property

IntersectionFillVisible property

SourceObjects property


IntersectionFillPlotStyleName, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillVisible property

SourceObjects property


IntersectionFillVisible, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

SourceObjects property


SourceObjects, related topics

See Also

Properties:

BackgroundLinesColor property

BackgroundLinesHiddenLine property

BackgroundLinesLayer property

BackgroundLinesLinetype property

BackgroundLinesLinetypeScale property

BackgroundLinesLineweight property

BackgroundLinesPlotStyleName property

BackgroundLinesVisible property

CurveTangencyLinesColor property

CurveTangencyLinesLayer property

CurveTangencyLinesLinetype property

CurveTangencyLinesLinetypeScale property

CurveTangencyLinesLineweight property

CurveTangencyLinesPlotStyleName property

CurveTangencyLinesVisible property

DestinationBlock property

DestinationFile property

ForegroundLinesColor property

ForegroundLinesEdgeTransparency property

ForegroundLinesFaceTransparency property

ForegroundLinesHiddenLine property

ForegroundLinesLayer property

ForegroundLinesLinetype property

ForegroundLinesLinetypeScale property

ForegroundLinesLineweight property

ForegroundLinesPlotStyleName property

ForegroundLinesVisible property

GenerationOptions property

IntersectionBoundaryColor property

IntersectionBoundaryDivisionLines property

IntersectionBoundaryLayer property

IntersectionBoundaryLinetype property

IntersectionBoundaryLinetypeScale property

IntersectionBoundaryLineweight property

IntersectionBoundaryPlotStyleName property

IntersectionFillColor property

IntersectionFillFaceTransparency property

IntersectionFillHatchAngle property

IntersectionFillHatchPatternName property

IntersectionFillHatchPatternType property

IntersectionFillHatchScale property

IntersectionFillHatchSpacing property

IntersectionFillLayer property

IntersectionFillLinetype property

IntersectionFillLinetypeScale property

IntersectionFillLineweight property

IntersectionFillPlotStyleName property

IntersectionFillVisible property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArcSmoothness

ContourLinesPerSurface

RenderSmoothness

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SelectAtPoint

SelectByPolygon

SelectOnScreen

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"

AutoLISP Developer's Guide:

"Selection Set Filter Lists"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Select

SelectByPolygon

SelectOnScreen

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"

AutoLISP Developer's Guide:

"Selection Set Filter Lists"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Select

SelectAtPoint

SelectOnScreen

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"

AutoLISP Developer's Guide:

"Selection Set Filter Lists"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences

Display

Drafting

Files

OpenSave

Output

Profiles

System

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

SysVarChanged

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Select

SelectAtPoint

SelectByPolygon

ActiveX and VBA Developer's Guide:

"Add Objects to a Selection Set"

"Use Variants in Methods and Properties"

AutoLISP Developer's Guide:

"Selection Set Filter Lists"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HWND

LoadDVB

ActiveX and VBA Developer's Guide:

"Access the AutoCAD Command Line"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAlignment2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetAutoScale2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBitmaps

ActiveX and VBA Developer's Guide:

"Define the Toolbar Button Image"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBlockAttributeValue2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBlockAttributeValue32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBlockAttributeValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBlockTableRecordId2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetBlockTableRecordId32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableBreak()

GetBreakHeight()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddVertex

Coordinates

GetBulge

Type

ActiveX and VBA Developer's Guide:

"Edit Polylines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellContentColor2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellDataType()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellFormat()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellState()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellStyle()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCellValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetColumnName()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetContentLayout()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetControlPoint

NumberOfControlPoints

SetWeight

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCustomData()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetCustomScale

PaperUnits

UseStandardScale

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

LayerStateManager object

ActiveX and VBA Developer's Guide:

"Use the LayerStateManager to Manage Layer Settings"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataFormat()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataLink32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataLink()

RemoveDataLink()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetDataType2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFieldId2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFieldId232()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddFitPoint

DeleteFitPoint

FitTolerance

GetFitPoint

NumberOfFitPoints

PurgeFitData

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFont


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetHasFormula()

GetFormula()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridColor2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridDoubleLineSpacing()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridLineStyle()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridLinetype32()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridLinetype()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridLineWeight2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GridOn

GetGridSpacing


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetGridVisibility2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add3DFace

GetInvisibleEdge

Regen


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotToDevice

PlotToFile

DisplayPlotPreview

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetMargin()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red

SetColorBookColor


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetOverride()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PatternAngle

PatternDouble

PatternName

PatternScale

PatternSpace

PatternType

ActiveX and VBA Developer's Guide:

"Edit Hatch Patterns"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blue

BookName

ColorIndex

ColorMethod

ColorName

EntityColor

Green

Red

SetColorBookColor

SetNames

SetRGB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetRotation()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetScale()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetSnapSpacing

SnapOn


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetFormat()

FormatValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetTextHeight2()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetTextString()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetValue()

SetValueFromText()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetValue()

SetValue()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetVariable

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SetGridSpacing

SetSnapSpacing

SetXData


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

NumberOfControlPoints

GetControlPoint

GetWeight

SetControlPoint

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetWidth

Type

ActiveX and VBA Developer's Guide:

"Edit Polylines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetWindowToPlot

PlotOrigin

PaperUnits

PlotType

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetXData

ActiveX and VBA Developer's Guide:

"Assign and Retrieve Extended Data"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetXRecordData

GetXData

SetXData

ActiveX and VBA Developer's Guide:

"Assign and Retrieve Extended Data"

"Use Variants in Methods and Properties"


EnableShadowDisplay, related topics

See Also

Properties:

ShadowDisplay property


ShadowDisplay, related topics

See Also

Properties:

EnableShadowDisplay property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

OnMenuBar


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SCMDefaultMode

SCMEditMode

SCMCommandMode

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CenterPlot

PlotHidden

ScaleLineweights

UseStandardScale

PlotViewportBorders

PlotViewportsFirst


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableStartupDialog

KeyboardAccelerator

KeyboardPriority

ProxyImage

XRefDemandLoad

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplaySilhouette

ImageFrameHighlight

SolidFill

TextFrameDisplay

TrueColorImages

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Rotation


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EnableStartupDialog

BeepOnError

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject

TimeServer


See also [ActiveX and VBA Reference: AAR]

See Also

Properties:

Action

Algorithm

Comment

Issuer

KeyLength

Password

ProviderName

ProviderType

SerialNumber

Subject


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplayOLEScale

AllowLongSymbolNames

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Boolean

CheckInterference

SectionSolid

ActiveX and VBA Developer's Guide:

"Edit 3D Solids"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetSnapSpacing

GridOn

Regen

SetSnapSpacing

SnapOn

SnapRotationAngle

Update

ActiveX and VBA Developer's Guide:

"Adjust Snap and Grid Alignment"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetSnapSpacing

GridOn

SetSnapSpacing

SnapBasePoint

SnapRotationAngle

ActiveX and VBA Developer's Guide:

"Adjust Snap and Grid Alignment"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetSnapSpacing

GridOn

Regen

SetSnapSpacing

SnapBasePoint

SnapOn

Update

ActiveX and VBA Developer's Guide:

"Adjust Snap and Grid Alignment"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplaySilhouette

ImageFrameHighlight

ShowRasterImage

TextFrameDisplay

TrueColorImages

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

LowerLeftCorner

UpperRightCorner

ActiveX and VBA Developer's Guide:

"Make Another Tiled Viewport Current"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CustomScale

Regen

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndAngle

EndPoint

StartPoint

ActiveX and VBA Developer's Guide:

"Extend and Trim Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotToDevice

PlotToFile

ActiveX and VBA Developer's Guide:

"Perform Basic Plotting"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndParameter

ActiveX and VBA Developer's Guide:

"Extend and Trim Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndAngle

EndPoint

MajorAxis

Radius

RadiusRatio

ActiveX and VBA Developer's Guide:

"Extend and Trim Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Area

Closed

Degree

EndTangent

FitTolerance

IsRational

NumberOfControlPoints

NumberOfFitPoints

ActiveX and VBA Developer's Guide:

"Edit Splines"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

EndUndoMark


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

Name


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TablesReadOnly

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DimStyle

DrawingDirection

Height

InsertionPoint

Rotation

TextString

TextStyle

Width

ActiveX and VBA Developer's Guide:

"Edit Dimensions"

"Edit Leaders"

"Format Line Text"

"Format Multiline Text"

"Work with Dimension styles"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotHidden

PlotOrigin

PlotRotation

PlotType

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddMenuItem

AddSubMenu

AddSeparator

Type

ActiveX and VBA Developer's Guide:

"Create Cascading Submenus"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByKey

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

Subject

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

SummaryInfo

Title


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AddCustomInfo

Author

Comments

GetCustomByIndex

GetCustomByKey

HyperlinkBase

Keywords

LastSavedBy

NumCustomInfo

RemoveCustomByIndex

RemoveCustomByKey

RevisionNumber

SetCustomByIndex

SetCustomByKey

Subject

SummaryInfo


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

TemplateDWGPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SuppressTrailingZeros

SuppressZeroInches

SuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SuppressLeadingZeros

SuppressZeroInches

SuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroInches


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SuppressLeadingZeros

SuppressTrailingZeros

SuppressZeroFeet


SurfaceType, related topics

See Also

Properties:

UIsolineDensity property

VIsolineDensity property


UIsolineDensity, related topics

See Also

Properties:

SurfaceType property

VIsolineDensity property


VIsolineDensity, related topics

See Also

Properties:

SurfaceType property

UIsolineDensity property


Bank, related topics

See Also

Properties:

Length property

ProfileRotation property

Twist property

scale property


ProfileRotation, related topics

See Also

Properties:

Bank property

Length property

Twist property

scale property


scale, related topics

See Also

Properties:

Bank property

Length property

ProfileRotation property

Twist property


Twist, related topics

See Also

Properties:

Bank property

Length property

ProfileRotation property

scale property


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences

Display

Drafting

Files

OpenSave

Output

Profiles

Selection

User

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

SelectionChanged

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TableBreakHeight


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TableBreakFlowDirection


See also [ActiveX and VBA Reference: AAR]

See Also

Objects:

TableStyle


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StoreSQLIndex

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


GetDataType, related topics

No related topics found.


GetFormat, related topics

No related topics found.


SetDataType, related topics

No related topics found.


SetFormat, related topics

No related topics found.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ScaleLineweights

ShowPlotStyles

StandardScale

StyleSheet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Mode

PromptString

ActiveX and VBA Developer's Guide:

"Edit Attribute Definitions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Center

TwistAngle

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSaveInterval

AutoSavePath

CreateBackup

FullCRCValidation

IncrementalSavePercent

LogFileOn

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TemplateDWGPath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TemplateDWGPath

TempFilePath

TextureMapPath

XRefDemandLoad

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Alignment

ActiveX and VBA Developer's Guide:

"Format Line Text"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextDirection

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DimensionLinecolor

ExtensionLineColor

ActiveX and VBA Developer's Guide:

"Work with Colors"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AltFontFile

CustomDictionary

FontFileMap

MainDictionary

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextWinBackgrndColor

TextWinTextColor

TextFontStyle

TextFontSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Assign Fonts"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextWinBackgrndColor

TextWinTextColor

TextFont

TextFontStyle

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Assign Fonts"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextWinBackgrndColor

TextWinTextColor

TextFont

TextFontSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Assign Fonts"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplaySilhouette

ImageFrameHighlight

ShowRasterImage

SolidFill

TrueColorImages

Regen

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextInside

TextOutsideAlign

Fit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAlignmentPoint

TextString

ActiveX and VBA Developer's Guide:

"Set Text Generation Flag"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextStyle

TextPrefix

TextSuffix

TextInside


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextInside

TextOutsideAlign


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextDirection

TextHeight

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingStyle

TextRotation

TextString

TextStyleName

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Fit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextInside

TextInsideAlign


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextPosition

ActiveX and VBA Developer's Guide:

"Format Multiline Text"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextRotation

ActiveX and VBA Developer's Guide:

"Create Radial Dimensions"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PrimaryUnitsPrecision


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextSuffix


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Rotation

TextPosition

ActiveX and VBA Developer's Guide:

"Create Radial Dimensions"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DrawingDirection

Height

InsertionPoint

Rotation

StyleName

Width

TextOverride

ActiveX and VBA Developer's Guide:

"Format Multiline Text"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextHeight

TextPrefix

TextSuffix

TextInside


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextWidth


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

UserCoordinateSystems

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextPrefix


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DriversPath

GetProjectFilePath

PrintSpoolerPath

SetProjectFilePath

SupportPath

TemplateDWGPath

TempFilePath

TempXRefPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TextAttachmentType

TextBackgroundFill

TextDirection

TextHeight

TextJustify

TextLineSpacingDistance

TextLineSpacingFactor

TextLineSpacingStyle

TextRotation

TextString

TextStyleName


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

LayoutCrosshairColor

ModelCrosshairColor

TextWinTextColor

TextFont

TextFontStyle

TextFontSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoTrackingVecColor

GraphicsWinLayoutBackgrndColor

GraphicsWinModelBackgrndColor

LayoutCrosshairColor

ModelCrosshairColor

TextWinBackgrndColor

TextFont

TextFontStyle

TextFontSize

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"

"Work with Colors"

VB/VBA Functions:

QBColor()

RGB()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Color

Layer

Linetype

LinetypeScale

Normal

Visible


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FoundPath

FingerprintGUID

VersionGUID

IsModified

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TolerancePrecision

ToleranceHeightScale

ToleranceLowerLimit

ToleranceJustification

ToleranceUpperLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TolerancePrecision

ToleranceLowerLimit

ToleranceDisplay

ToleranceJustification

ToleranceUpperLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TolerancePrecision

ToleranceHeightScale

ToleranceDisplay

ToleranceLowerLimit

ToleranceUpperLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TolerancePrecision

ToleranceHeightScale

ToleranceDisplay

ToleranceJustification

ToleranceUpperLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ToleranceHeightScale

ToleranceLowerLimit

ToleranceDisplay

ToleranceJustification

ToleranceUpperLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ToleranceSuppressLeadingZeros

ToleranceSuppressZeroInches

ToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroInches


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ToleranceSuppressLeadingZeros

ToleranceSuppressTrailingZeros

ToleranceSuppressZeroFeet


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

TolerancePrecision

ToleranceHeightScale

ToleranceDisplay

ToleranceJustification

ToleranceLowerLimit


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveX and VBA Developer's Guide:

"Create and Edit Toolbars"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

SupportPath


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Left

Visible

Width


zz [Blank Topic]

Blank Topic

This topic intentionally left blank.


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArcLength

EndAngle

StartAngle


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ArrayPolar

ArrayRectangular

Copy

Mirror

Mirror3D

Move

Offset

Rotate

Rotate3D

ScaleEntity

ActiveX and VBA Developer's Guide:

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleToReal

DistanceToReal

RealToString

Coordinate

Coordinates

Elevation

Normal

ActiveX and VBA Developer's Guide:

"Convert Coordinates"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CopyObjects

WBlock


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Brightness

Contrast

Fade

ImageVisibility

ActiveX and VBA Developer's Guide:

"Attach and Scale a Raster Image"

"Modify Bitonal Image Color and Transparency"

"Work with Raster Images"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DisplaySilhouette

ImageFrameHighlight

ShowRasterImage

SolidFill

TextFrameDisplay

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetTextHeight

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextStyle

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

TitleSuppressed

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

VertCellMargin


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

BitFlags

Description

FlowDirection

GetAlignment

GetBackgroundColor

GetBackgroundColorNone

GetColor

GetGridColor

GetGridLineWeight

GetGridVisibility

GetTextHeight

GetTextStyle

HeaderSuppressed

HorzCellMargin

SetAlignment

SetBackgroundColor

SetBackgroundColorNone

SetColor

SetGridColor

SetGridLineWeight

SetGridVisibility

SetTextHeight

SetTextStyle

TitleSuppressed


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Target


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StyleName

ViewToPlot

SetWindowToPlot


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UCSIconOn

ActiveX and VBA Developer's Guide:

"Define a User Coordinate System"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UCSIconAtOrigin

ActiveX and VBA Developer's Guide:

"Define a User Coordinate System"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AngleFormat

DecimalSeparator

FractionFormat

PrimaryUnitsPrecision


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachExternalReference

Bind

Detach

Load

Reload

ActiveX and VBA Developer's Guide:

"UnLoad Xrefs"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ListARX

LoadARX


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

LoadDVB


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Highlight

PurgeAll

Regen

ActiveX and VBA Developer's Guide:

"Update the Geometry in the Document Window"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UpdateDataLink()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

UpdateAllDataLinks()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

CreateEntry

IndexOf

Item

RemoveEntry

Application


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

MTextAttribute()

MTextAttributeContent()


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

LowerLeftCorner

Name

ActiveX and VBA Developer's Guide:

"Make Another Tiled Viewport Current"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Backward


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

URLNamedLocation

URLDescription


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

URLNamedLocation

URL


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

URL

URLDescription


See also [ActiveX and VBA Reference: AAR]

See Also

Object:

Layer


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotPolicy

DefaultPlotStyleTable

DefaultPlotStyleForObjects

DefaultPlotStyleForLayer

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Objects:

DatabasePreferences

Display

Drafting

Files

OpenSave

Output

Profiles

Selection

System

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

Utility

Viewports

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

StandardScale

SetCustomScale


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Viewports

Views

ActiveX and VBA Developer's Guide:

"Prompt for User Input"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsCloned

IsOwnerXlated

IsPrimary

Key


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HWND


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Constant

Invisible

Mode

Preset


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AffectsGraphics

Feature

FullFileName

FileName

FoundPath

FingerprintGUID

IsModified

TimeStamp

FileSize

ReferenceCount


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

HorizontalTextPosition

ActiveX and VBA Developer's Guide:

"Work with Colors"


See also [ActiveX and VBA Reference: AAR]

See Also

Object:

View


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Freeze


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveViewport

Display

GridOn

SnapOn

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Views

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Blocks

Dictionaries

DimStyles

Groups

Layers

Linetypes

ModelSpace

PaperSpace

Plot

RegisteredApplications

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

ActiveX and VBA Developer's Guide:

"The Collection Objects"

"Collection Objects"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

PlotType


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetInvisibleEdge

SetInvisibleEdge

VisibilityEdge2

VisibilityEdge3

VisibilityEdge4


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetInvisibleEdge

SetInvisibleEdge

VisibilityEdge1

VisibilityEdge3

VisibilityEdge4


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetInvisibleEdge

SetInvisibleEdge

VisibilityEdge1

VisibilityEdge2

VisibilityEdge4


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

GetInvisibleEdge

SetInvisibleEdge

VisibilityEdge1

VisibilityEdge2

VisibilityEdge3


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Color

Layer

Linetype

LinetypeScale

Normal

Thickness

ActiveX and VBA Developer's Guide:

"Control the Application Window"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Centroid

MomentOfInertia

PrincipalDirections

PrincipalMoments

ProductOfInertia

RadiiOfGyration


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Add

SaveAs

ActiveX and VBA Developer's Guide:

"Define Blocks"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Knots

ActiveX and VBA Developer's Guide:

"Edit Splines"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AttachmentPoint

DrawingDirection

Height

ImageWidth

InsertionPoint

Rotation

StyleName

TextString

ActiveX and VBA Developer's Guide:

"Change Image Scale, Rotation, Location, Width and Height"

"Control the Application Window"

"Create and Modify Text Styles"

"Edit Polylines"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

WindowMovedOrResized

WindowState

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Visible

Width

WindowTop

ActiveX and VBA Developer's Guide:

"Control the Application Window"


see also [ActiveX and VBA Reference: AAR]

See Also

Methods, Properties, and Events:

WindowChanged

ActiveX and VBA Developer's Guide:

"Use Events"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Left

Top

Visible

Width

ActiveX and VBA Developer's Guide:

"Control the Application Window"

"Control the Drawing Windows"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Left

Top

Visible

Width

ActiveX and VBA Developer's Guide:

"Control the Drawing Windows"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

Height

Visible

Width

WindowLeft

ActiveX and VBA Developer's Guide:

"Control the Application Window"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

AutoSavePath

DriversPath

HelpFilePath

TemplateDWGPath

TempFilePath

TempXRefPath

TextureMapPath

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

IsXRef

ActiveX and VBA Developer's Guide:

"Create Paper Space Viewports"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

DemandLoadARXApp

XRefEdit

XRefFadeIntensity

XRefLayerVisibility

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XRefDemandLoad

XRefFadeIntensity

XRefLayerVisibility


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XRefDemandLoad

XRefEdit

XRefLayerVisibility

ActiveX and VBA Developer's Guide:

"Set AutoCAD Preferences"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XRefDemandLoad

XRefEdit

XRefFadeIntensity


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

YScaleFactor

ZScaleFactor

ActiveX and VBA Developer's Guide:

"Work with Blocks"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveUCS

GetUCSMatrix

Origin

YVector

ActiveX and VBA Developer's Guide:

"Define a User Coordinate System"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XScaleFactor

ZScaleFactor

ActiveX and VBA Developer's Guide:

"Work with Blocks"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActiveUCS

GetUCSMatrix

Origin

XVector

ActiveX and VBA Developer's Guide:

"Define a User Coordinate System"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomCenter

ZoomExtents

ZoomPickWindow

ZoomPrevious

ZoomScaled

ZoomWindow

ActiveX and VBA Developer's Guide:

"Display Drawing Limits and Extents"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomExtents

ZoomPickWindow

ZoomPrevious

ZoomScaled

ZoomWindow

ActiveX and VBA Developer's Guide:

"Center Objects"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomCenter

ZoomPickWindow

ZoomPrevious

ZoomScaled

ZoomWindow

ActiveX and VBA Developer's Guide:

"Display Drawing Limits and Extents"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomCenter

ZoomExtents

ZoomPrevious

ZoomScaled

ZoomWindow

ActiveX and VBA Developer's Guide:

"Define a Zoom Window"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomCenter

ZoomPickWindow

ZoomScaled

ZoomWindow

ActiveX and VBA Developer's Guide:

"Display Drawing Limits and Extents"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomCenter

ZoomExtents

ZoomPickWindow

ZoomPrevious

ZoomWindow

ActiveX and VBA Developer's Guide:

"Scale a View"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

ActivePViewport

ActiveViewport

Display

ZoomAll

ZoomCenter

ZoomExtents

ZoomPickWindow

ZoomPrevious

ZoomScaled

ActiveX and VBA Developer's Guide:

"Define a Zoom Window"

"Use Variants in Methods and Properties"


See also [ActiveX and VBA Reference: AAR]

See Also

Methods and Properties:

XScaleFactor

YScaleFactor

ActiveX and VBA Developer's Guide:

"Work with Blocks"