ObjectARX .NET Developer's Guide
ObjectARX .NET Developer's Guide
ObjectARX .NET
Developer's Guide
April 2009
© 2009 Autodesk, Inc. All Rights Reserved. Except as otherwise permitted by Autodesk, Inc., this publication, or parts thereof, may not be
reproduced in any form, by any method, for any purpose.
Certain materials included in this publication are reprinted with the permission of the copyright holder.
Trademarks
The following are registered trademarks or trademarks of Autodesk, Inc., in the USA and other countries: 3DEC (design/logo), 3December,
3December.com, 3ds Max, ADI, Alias, Alias (swirl design/logo), AliasStudio, Alias|Wavefront (design/logo), ATC, AUGI, AutoCAD, AutoCAD
Learning Assistance, AutoCAD LT, AutoCAD Simulator, AutoCAD SQL Extension, AutoCAD SQL Interface, Autodesk, Autodesk Envision, Autodesk
Insight, Autodesk Intent, Autodesk Inventor, Autodesk Map, Autodesk MapGuide, Autodesk Streamline, AutoLISP, AutoSnap, AutoSketch,
AutoTrack, Backdraft, Built with ObjectARX (logo), Burn, Buzzsaw, CAiCE, Can You Imagine, Character Studio, Cinestream, Civil 3D, Cleaner,
Cleaner Central, ClearScale, Colour Warper, Combustion, Communication Specification, Constructware, Content Explorer, Create>what's>Next>
(design/logo), Dancing Baby (image), DesignCenter, Design Doctor, Designer's Toolkit, DesignKids, DesignProf, DesignServer, DesignStudio,
Design|Studio (design/logo), Design Web Format, Discreet, DWF, DWG, DWG (logo), DWG Extreme, DWG TrueConvert, DWG TrueView, DXF,
Ecotect, Exposure, Extending the Design Team, Face Robot, FBX, Filmbox, Fire, Flame, Flint, FMDesktop, Freewheel, Frost, GDX Driver, Gmax,
Green Building Studio, Heads-up Design, Heidi, HumanIK, IDEA Server, i-drop, ImageModeler, iMOUT, Incinerator, Inferno, Inventor, Inventor
LT, Kaydara, Kaydara (design/logo), Kynapse, Kynogon, LandXplorer, LocationLogic, Lustre, Matchmover, Maya, Mechanical Desktop, Moonbox,
MotionBuilder, Movimento, Mudbox, NavisWorks, ObjectARX, ObjectDBX, Open Reality, Opticore, Opticore Opus, PolarSnap, PortfolioWall,
Powered with Autodesk Technology, Productstream, ProjectPoint, ProMaterials, RasterDWG, Reactor, RealDWG, Real-time Roto, REALVIZ,
Recognize, Render Queue, Retimer,Reveal, Revit, Showcase, ShowMotion, SketchBook, Smoke, Softimage, Softimage|XSI (design/logo),
SteeringWheels, Stitcher, Stone, StudioTools, Topobase, Toxik, TrustedDWG, ViewCube, Visual, Visual Construction, Visual Drainage, Visual
Landscape, Visual Survey, Visual Toolbox, Visual LISP, Voice Reality, Volo, Vtour, Wire, Wiretap, WiretapCentral, XSI, and XSI (design/logo).
The following are registered trademarks or trademarks of Autodesk Canada Co. in the USA and/or Canada and other countries:
Backburner,Multi-Master Editing, River, and Sparks.
The following are registered trademarks or trademarks of MoldflowCorp. in the USA and/or other countries: Moldflow, MPA, MPA
(design/logo),Moldflow Plastics Advisers, MPI, MPI (design/logo), Moldflow Plastics Insight,MPX, MPX (design/logo), Moldflow Plastics Xpert.
All other brand names, product names or trademarks belong to their respective holders.
Disclaimer
THIS PUBLICATION AND THE INFORMATION CONTAINED HEREIN IS MADE AVAILABLE BY AUTODESK, INC. "AS IS." AUTODESK, INC. DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE REGARDING THESE MATERIALS.
Published by:
Autodesk, Inc.
111 Mclnnis Parkway
San Rafael, CA 94903, USA
Contents
Chapter 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Using the API Reference . . . . . . . . . . . . . . . . . . . . . . . . . .2
Setting Up Visual Studio . . . . . . . . . . . . . . . . . . . . . . . . . .2
AutoCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
iii
Chapter 5 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Annotation Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Expressions in Annotations . . . . . . . . . . . . . . . . . . . . . . . . 28
Inserting Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Updating and Refreshing Annotations . . . . . . . . . . . . . . . . . . 30
Annotation Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Chapter 6 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Events in the API Reference . . . . . . . . . . . . . . . . . . . . . . . . 33
List of Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Chapter 9 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Managing Feature Definition Files . . . . . . . . . . . . . . . . . . . . 51
Creating Feature Class Definitions . . . . . . . . . . . . . . . . . . . . 52
Classifying Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Chapter 10 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Basic Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Custom Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Chapter 11 Import/Export . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Importing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Exporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Chapter 12 Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
iv | Contents
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Drawing Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Creating Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Node Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Network Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Polygon Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Chapter 14 MapBook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
MapBook Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Creating a Map Book . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Contents | v
vi
Overview
1
Introduction
The AutoCAD® Map 3D 2008 .NET API provides access to AutoCAD Map 3D
functionality so you can modify and extend it for your own purposes. The API
can be used by any .NET language.
The snippets in this guide are mainly in VB.NET, but most samples are available
in VB.NET, C#, and C++.
Some of the short snippets in this guide write to the AutoCAD Map 3D console.
Ensure that the console is visible. Press CTRL+9 to display the or hide console.
Namespaces
The Autodesk.Gis.Map namespace contains the .NET classes for AutoCAD Map
3D. Some of the general-purpose classes are defined directly within the top-level
Autodesk.Gis.Map namespace, but most are grouped into lower-level namespaces
below Autodesk.Gis.Map.
For the sake of cleaner code, all examples within this guide will assume the
following Imports:
Imports Autodesk.Gis.Map
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
1
Certain chapters may define additional imports. For example, the chapter
about Object Data defines
Imports Autodesk.Gis.Map.ObjectData
Related Documentation
AutoCAD Map 3D includes the new Geospatial Platform API for working with
geospatial data. See the Geospatial Platform Developer’s Guide for details.
__gc
:: . .
This guide uses VB.NET for most examples. The sample applications are
available in VB.NET, C#, and C++;
2 | Chapter 1 Overview
Add the following references. The DLLs are in the AutoCAD Map 3D
installation folder:
■ acdbmgd.dll
■ acmgd.dll
■ ManagedMapApi.dll
■ Autodesk.AutoCAD.Colors
■ Autodesk.AutoCAD.ComponentModel
■ Autodesk.AutoCAD.DatabaseServices
■ Autodesk.AutoCAD.DatabaseServices.Filters
■ Autodesk.AutoCAD.Geometry
■ Autodesk.AutoCAD.GraphicsInterface
■ Autodesk.AutoCAD.GraphicsSystem
■ Autodesk.AutoCAD.LayerManager
■ Autodesk.AutoCAD.Runtime
■ Autodesk.AutoCAD.ApplicationServices
■ Autodesk.AutoCAD.EditorInput
■ Autodesk.AutoCAD.GraphicsSystem
■ Autodesk.AutoCAD.PlottingServices
■ Autodesk.AutoCAD.Publishing
■ Autodesk.AutoCAD.Runtime
■ Autodesk.AutoCAD.Windows
■ Autodesk.AutoCAD.Windows.ToolPalette
■ Autodesk.Gis.Map
■ Autodesk.Gis.Map.Annotation
■ Autodesk.Gis.Map.Classification
■ Autodesk.Gis.Map.Constants
■ Autodesk.Gis.Map.DisplayManagement
■ Autodesk.Gis.Map.Filters
■ Autodesk.Gis.Map.ImportExport
■ Autodesk.Gis.Map.MapBook
■ Autodesk.Gis.Map.ObjectData
■ Autodesk.Gis.Map.Project
■ Autodesk.Gis.Map.Query
■ Autodesk.Gis.Map.Topology
■ Autodesk.Gis.Map.Utilities
For each of the references, set the Copy Local property to False. Double-click
the reference to open the properties.
Set the reference path to the AutoCAD Map 3D installation directory.
On the Debug tab, set:
4 | Chapter 1 Overview
[CommandMethod("CustomCommand")]
public void CommandSub();
AutoCAD
AutoCAD Map 3D relies on AutoCAD for much of its functionality. It is
important to understand some basic AutoCAD concepts before writing
AutoCAD Map 3D applications. For complete details, refer to the AutoCAD
developer documentation.
In particular, managing objects in the AutoCAD database is important.
Transactions
The AutoCAD database uses a transaction model for access to all objects.
To use any object in the database, start a transaction and use the transaction
to open the database object in either read-only or read-write mode.
Transaction.Open() returns a generic reference. Cast that to the type of object
being returned. For example, given a database object id for a MapBook object,
the following will return a reference to the object:
Dim bookObj As MapBook.Book
bookObj = CType(trans.GetObject(mapBookId, OpenMode.ForWrite),
MapBook.Book)
Short examples in this guide may not include all the transaction processing,
so they can highlight the concepts being discussed. In all cases, though, if any
changes are being made to the drawing, it should be assumed that the
following general structure is in place:
AutoCAD | 5
Dim trans As Transaction = Nothing
Dim docs As DocumentCollection = Application.DocumentManager
Dim activeDoc As Document = docs.MdiActiveDocument
Try
trans = activeDoc.TransactionManager.StartTransaction()
'
' Open object(s)
'
Dim bookObj As MapBook.Book
bookObj = CType(trans.GetObject(mapBookId, OpenMode.ForWrite),
MapBook.Book)
'
' Insert code to process transaction
'
' Commit transaction
'
trans.Commit()
Catch
'
' Handle exception, and cancel transaction
'
Finally
trans.Dispose()
End Try
NOTE Many examples in this guide assume that activeDoc refers to the active
document.
6 | Chapter 1 Overview
Session and Project
2
Overview
An AutoCAD Map 3D session represents the active state of the Map 3D
application.
Most of the classes for working with the session are defined in the
Autodesk.Gis.Map namespace.
Autodesk.Gis.Map.HostMapApplicationServices
NOTE For historical reasons, the API uses the term project where the user interface
will normally use map or drawing.
7
The following processes all open projects:
Dim mapApp As MapApplication
mapApp = HostMapApplicationServices.Application
Dim projList As Project.ProjectCollection
projList = mapApp.Projects
For Each project As Project.ProjectModel In projList
' Process projects
Next
NOTE Many of the examples in this guide assume that mapApp and activeProj
have already been defined as in the example above.
■ Annotations
■ Database
■ DrawingSet
■ ODTables
■ Topologies
Overview | 9
For more details about the various properties, refer to the appropriate chapters
in this guide.
AutoCAD Database
The ProjectModel.Database property returns a reference to the AutoCAD
database. This is necessary for many AutoCAD operations.
Project Options
The ProjectModel.Options property returns a reference to the project’s options.
Drawing Objects
Drawing objects are the visible items in an AutoCAD drawing.
NOTE The AutoCAD developer documentation generally uses the term entity or
AcDb entity when discussing drawing objects.
■ Autodesk.AutoCAD.DatabaseServices.Handle
■ Autodesk.AutoCAD.DatabaseServices.ObjectID
Map Objects
Because a single AutoCAD Map 3D project can include more than one
AutoCAD drawing, an AutoCAD handle is not sufficient to uniquely identify
an object.
A MapObjectId, defined in the namespace Autodesk.Gis.Map.Utilities,
identifies an object by its AutoCAD handle and by its drawing identifier. The
MapObjectId.ObjectHandle property is the AutoCAD handle, and
Drawing Objects | 11
12
Object Data
3
Introduction
Object data provides a way of attaching additional information to drawing
objects. It is more powerful and flexible than AutoCAD block attributes because
object data can be attached to any object in a drawing.
NOTE Object data can only be attached to drawing objects. FDO feature sources
have a different way to handle feature properties.
The classes for handling object data are mostly within the ObjectData
namespace. Code in this chapter assumes the following:
Imports Autodesk.Gis.Map.ObjectData
Tables
Internally, object data is stored in tables. Each drawing has its own set of tables,
available from the ProjectModel.ODTables property. This returns an object of
type ObjectData.Tables.
For example, if mapApp is the Map application, the following will get the object
data tables for the active drawing:
Dim activeProject As Project.ProjectModel = mapApp.ActiveProject
Dim tableList As ObjectData.Tables = activeProject.ODTables
13
Dim table As ObjectData.Table = tableList.Item("table1")
or
Dim table As ObjectData.Table = tableList("table1")
Field Definitions
Columns in a table are defined by ObjectData.FieldDefinition objects, which
describe the data type and default value. The data types are defined in the
Constants.DataType enum:
■ UnknownType
■ Integer
■ Real
■ Character
■ Point
Records
Each row in the table is of type ObjectData.Record. Every record in the table
is associated with a drawing object.
The Item property of an ObjectData.Record contains the values for the record,
one for each field definition in the table. Each item is of type
Utilities.MapValue, which is a general-purpose class for storing data.
Creating a Table
Creating a table requires:
■ Creating the table by adding the field definitions to the ODTables object
for the drawing
Get a reference to the ODTables property for the drawing, and add the field
defintions to create a new table.
Dim tables As ObjectData.Tables
tables = mapApp.ActiveProject.ODTables
tables.Add("NewTable", fieldDefs, "Description", True)
Removing a Table
To remove a table, get a reference to the ODTables property for the drawing,
and call Tables.RemoveTable().
Dim tables As ObjectData.Tables
tables = mapApp.ActiveProject.ODTables
tables.RemoveTable("NewTable")
Add the record to the table with Table.AddRecord() and associate it with an
object. This requires a Record and either an AutoCAD DBObject or ObjectId
as parameters.
newTable.AddRecord(rec, objId)
A single drawing object may have more than one object data record in a given
table.
■ Get the ObjectData.Records collection for the object, using one of the
GetObjectTableRecords() methods.
■ Get the ObjectData.Records collection for the object, using one of the
GetObjectRecords() methods.
NOTE When you have finished processing the records, release any of the disposable
objects with their Dispose() methods. This applies to any classes inheriting
Autodesk.AutoCAD.Runtime.DisposableWrapper, like ObjectData.Table,
ObjectData.Records, or Utilities.MapValue.
Dim ie As IEnumerator
ie = recs.GetEnumerator()
ie.MoveNext()
recs.RemoveRecord()
recs.Dispose()
19
To add a new option to the Data Connect dialog, complete the following
steps:
■ Ensure the FDO provider DLL is installed with AutoCAD Map 3D.
■ Autodesk.Gis.Plugins.dll
■ AcMapDataConnectPlugins.dll
Using Visual Studio, create a new project. Add a UserControl to the project.
The control will be embedded in the Data Connect dialog.
The plugin class must implement the IDataConnectConnectionPlugin interface.
It also requires a DataConnectPluginAttribute with the FDO provider name.
The provider name must match the name in providers.xml. For example:
// IDataConnectPlugin implementation
Similarly, the implementation for IPlugin needs methods to get and set
properties. The properties are used to describe the plugin. They may be
displayed to the user and should be localized. The Dependencies property is
not currently used.
Property Description
Annotation Templates
An annotation template is a special block in the drawing. It defines the fixed
and variable parts of the annotation.
NOTE For more information about blocks, refer to the AutoCAD developer
documentation.
25
Internally, annotation templates use a special naming convention. The names
of all blocks containing annotation templates begin with
ACMAP_ANN_TEMPLATE_. This prefix is defined in the
Annotations.TemplateNameBlockTableRecordPrefix property.
Annotation API calls, though, use the annotation name as it appears in the
UI. For example, an annotation template named ParcelName would be stored
in a block named ACMAP_ANN_TEMPLATE_ParcelName, but it would be created
with a call to Annotations.CreateAnnotationTemplate("ParcelName").
The ProjectModel.Annotations property returns an Annotations object that
can be used for managing the annotations and annotation templates.
Attributes
An AutoCAD block can contain attribute definitions, which are text entities
that can define informational text for each block reference.
In an annotation template, attribute definitions are used to define the variable
parts of the annotation. For example, if the annotations include object data,
then attribute definitions in the block template define what object data should
appear and how it will be displayed.
The AttributeDefinition class inherits the DBText class, which inherits the
Entity class. These have properties such as Color and Height that define how
the annotation will appear in the drawing. For example, to set the text height
for an annotation, set the Height property of the attribute definition used for
the annotation.
NOTE The properties used for the attribute definition can also be modified using
expression strings. See Expressions in Annotations on page 28 for details.
■ Start a transaction.
26 | Chapter 5 Annotation
used to rotate the block reference to match the rotation of the object being
annotated.
■ If required, add fixed drawing objects to the annotation template. Get the
AutoCAD block id using the AnnotationTemplate.BlockDefinitionId
property and add drawing objects to the template using standard AutoCAD
API calls.
■ Set the display properties of the annotation text by setting properties for
the attribute definition.
If required, set block properties for the annotation template. See Expressions
in Annotations on page 28 for details.
newTemplate.SetExpressionString(_
Annotation.AnnotationExpressionFields.BlockRotation, ".ANGLE")
Add objects to the template. They can be normal drawing objects or annotation
text.
To add normal drawing objects, use standard AutoCAD methods.
Annotation Templates | 27
Dim line As New Line
line.StartPoint = New Geometry.Point3d(0.0, -0.6, 0.0)
line.EndPoint = New Geometry.Point3d(2.0, -0.6, 0.0)
Dim blockTableRec As BlockTableRecord
blockTableRec = newTemplateId.GetObject(OpenMode.ForWrite)
blockTableRec.AppendEntity(line)
trans.AddNewlyCreatedDBObject(line, True)
To add annotation text, create an annotation text object. This is a special type
of AutoCAD attribute definition. AnnotationTemplate.CreateAnnotationText()
returns the AutoCAD ObjectId of the attribute definition. Open this object
for writing and cast to an AttributeDefinition object:
Dim expressionTextId As ObjectId
expressionTextId = newTemplate.CreateAnnotationText()
Dim attDef As AttributeDefinition
attDef = _
CType(trans.GetObject(expressionTextId, OpenMode.ForWrite), _
AttributeDefinition)
Most of the properties for the annotation template can be set using the
AttributeDefinition properties. For example:
attDef.Position = _
New Autodesk.AutoCAD.Geometry.Point3d(0.0, 0.0, 0.0)
attDef.Tag = "testTag"
attDef.Height = 0.5
attDef.VerticalMode = TextVerticalMode.TextVerticalMid
attDef.HorizontalMode = TextHorizontalMode.TextCenter
attDef.AlignmentPoint =
New Autodesk.AutoCAD.Geometry.Point3d(0.0, 0.0, 0.0)
Expressions in Annotations
Use expressions to set the text or the display properties of the annotation.
Some of the items that can use expressions are:
■ Annotation text
■ Text color
■ Text size
28 | Chapter 5 Annotation
■ Rotation angle
NOTE For more details about expressions, including a list of functions and variables,
see the Map 3D Help. In the Reference Guide section there is a chapter about the
Expression Evaluator.
Example
To set the annotation text based on object data, use the syntax
:fieldname@tablename. For example:
Imports Autodesk.Gis.Map.Annotation
annotations.SetExpressionString(attDef, _
AnnotationExpressionFields.AttributeDefinitionAnnotationString, _
":PARCEL_OWNER@ParcelData")
Inserting Annotations
To insert an annotation, call one of the
AnnotationTemplate.InsertReference() methods. They all require an
ObjectId or ObjectIdCollection as parameter, to identify the drawing objects
to be annotated.
Inserting Annotations | 29
This creates a block reference in the drawing. It evaluates the annotation
expressions and uses the results to set the text or other properties of the
reference.
An inserted annotation reference can also have overrides that change the
display properties. See Annotation Overrides on page 30 for details.
■ Updating
■ Refreshing
Updating removes and recreates all the annotations that use a template.
Refreshing re-evaluates the annotation expressions, but does not remove
out-of-date annotations.
To update annotations, call AnnotationTemplate.UpdateReferences().
newTemplate.UpdateReferences(True)
Annotation Overrides
An annotation override can be applied when an annotation reference is created.
It changes selected properties of the annotation template. For example, an
annotation override can change the color or text size of the annotation.
Annotation overrides can apply to the static properties of the annotation,
which are set using the AttributeDefinition properties, or the dynamic
properties, which are set using expressions.
Annotation overrides correspond to the Insert Options and Insert Properties
of the Insert Annotation dialog in the UI.
30 | Chapter 5 Annotation
For example, to override the static color, set the ColorOverride property of
the annotation override. To override a color set using an expression, set the
ColorExpressionOverride property.
annTemplate.InsertReference(objId, annOverrides)
Annotation Overrides | 31
32
Events
6
Overview
Events and event handlers provide a way for applications to respond to changes
in the Map application. For example, opening a new project can fire an event
handler to perform additional processing.
The API uses standard .NET mechanisms for handling events. Applications
wanting to handle events subscribe to the events. When the event is fired all
handlers subscribed to that event are called.
Event handlers accept two parameters:
■ Event arguments
The class definition for the event arguments is usually specific to the event
being handled.
■ Class definition for the event arguments. The names of these classes usually
begin with the event name and end with “EventArgs”. In some cases the
event uses System.EventArgs instead of defining a new class.
■ Methods for adding and removing event handlers. The names of these
methods begin with “add_” or “remove_”. Do not call these methods directly.
Instead use the correct syntax for the language.
33
■ Type definition for the event handler.
■ ProjectOpenedEventArgs class
■ ProjectOpenedEventHandler type
NOTE The actual event name is not used in the API reference. It can always be
inferred from the corresponding add_ or remove_ methods.
Example: VB.NET
To define an event handler for the ProjectOpened event, create a subroutine:
Sub handleProjectOpened(ByVal pSender As Object, _
ByVal pArgs As ProjectOpenedEventArgs)
' Insert code to handle event
End Sub
Example: C#
To define an event handler for the ProjectOpened event, create a subroutine:
void handleProjectOpened(Object sender,
ProjectOpenedEventArgs args)
{
// Insert code to handle event
}
34 | Chapter 6 Events
To subscribe to the event:
mapApp.ProjectOpened += new ProjectOpenedEventHandler(
handleProjectOpened);
List of Events
Namespace Autodesk.Gis.Map
Aliases class
MapApplication class
List of Events | 35
Event name Description
Namespace Autodesk.Gis.Map.Classification
ClassificationManager class
36 | Chapter 6 Events
Namespace Autodesk.Gis.Map.DisplayManagement
DisplayManager class
CategoryAppended
CategoryModified
CategoryUnappended
MapAppended
MapGoodBye
MapSetCurrentEnd
MapSetCurrentFails
MapUnappended
StyleAppendedToCategory
StyleModified
StyleUnappended
Map class
CurrentScaleModified
DismissStylizationBegin
DismissStylizationCancel
DismissStylizationEnd
ItemAppended
List of Events | 37
Event name Description
ItemErased
ItemModified
ScaleAdded
ScaleErased
ScaleModified
StyleAppended
StyleErased
StyleReferenceAppended
StyleReferenceErased
StyleReferenceModified
UpdateStylizationBegin
UpdateStylizationCancel
UpdateStylizationEnd
Namespace Autodesk.Gis.Map.ImportExport
Exporter class
ExportRecordError
RecordExported
RecordReadyForExport
38 | Chapter 6 Events
Importer class
ImportRecordError
RecordImported
RecordReadyForImport
Namespace Autodesk.Gis.Map.MapBook
BookManager class
MapBookAppended
MapBookErased
MapBookModified
MapBookSetCurrent
MapBookTileModified
MapBookTileWillBeErased
MapBookTreeNodeModified
MapBookWillBeErased
Namespace Autodesk.Gis.Map.Project
DrawingSet class
DrawingActivated
DrawingActivationCancelled
DrawingAttachCancelled
DrawingAttached
List of Events | 39
Event name Description
DrawingDeactivated
DrawingDetached
DrawingSettingsModified
DrawingToBeActivated
DrawingToBeAttached
ProjectModel class
AbortCSChange
AbortSwapId
BeginClose
BeginCSChange
BeginDestroy
BeginOpen
BeginQuery
BeginSave
BeginSaveBack
BeginSwapId
BeginTransform
EndClose
EndCSChange
EndOpen
40 | Chapter 6 Events
Event name Description
EndQuery
EndSave
EndSaveBack
EndSwapId
EndTransform
IntOptionModified
StringOptionModified
Namespace Autodesk.Gis.Map.Query
QueryLibrary class
QueryAdded
QueryCategoryAdded
QueryCategoryDeleted
QueryCategoryRenamed
QueryDeleted
QueryModified
QueryRenamed
List of Events | 41
42
Drawing Sets
7
Overview
Drawing sets provide a way for a single map to combine objects from multiple
drawings. One drawing, the project drawing, can attach multiple source
drawings. The source drawings, in turn, can attach other source drawings to
form a tree of attached drawings.
Running a query on the attached drawings copies selected objects into the
project drawing, where they can be displayed and edited. Unless an object from
an attached drawing has been “queried in” it does not appear in the project
drawing. See Queries and Save Sets on page 45 for more details.
Drive Aliases
Attached drawings are often shared between different users on different
computers. Because of this, the paths to the attached drawings can be different
for each user. Aliases help manage these files.
Each alias maps an alias name to a directory path. Each AutoCAD Map 3D user
can define different paths for the aliases. The locations of attached drawings
are always identified using the aliases, so users can have different paths to the
atttached drawings, as long as the aliases are the same.
The DriveAlias class in the Autodesk.Gis.Map namespace represents an
individual alias. It has two properties: Name and Path.
The Aliases property of the map application returns an Aliases object for
managing the aliases in the session. Aliases.Item() returns an individual drive
alias, either by alias name or index number.
43
Dim aliasList As Aliases
aliasList = mapApp.Aliases
Aliases objects have methods for adding and removing aliases, and event
handlers for detecting when aliases have been added or removed.
■ objects that have been modified in the project drawing that should also be
modified in the attached drawings
■ objects that have been deleted from the project drawing and should be
deleted from the attached drawings
■ new objects that have been added to the project drawing that should also
be added to an attached drawing
Objects that have been queried into the project drawing are not added to the
save set automatically.
Queries
A query is a tree structure containing branches (QueryBranch objects) and
conditions (DataCondition, LocationCondition, PropertyCondition, and
SqlCondition objects). All of these objects are subclassed from QueryUnit.
45
This returns an empty QueryModel object.
A simple query can have a root branch with a single condition. More complex
queries combine branches and conditions.
The criteria that the query uses to select objects are expressed in query
conditions. There are four types of query conditions.
Description
Location Boundaries
There are several types of location boundaries. They are all represented by
descendents of the LocationBoundary class, as illustrated in the following
diagram.
To build a query
Queries | 47
3 Create one or more query branches using the constructor for QueryBranch.
4 Build the query tree by appending query conditions and branches using
QueryBranch.AppendOperand().
To execute a query
1 You may want to set the mode, enable or disable property alteration, or
create a report template for the query.
The query mode determines if the objects from the attached drawings are
displayed as a preview or cloned into the project drawing.
QueryModel.Execute() returns a list of objects that have been queried in.
Query Libraries
Query libraries provide a way to save and re-use queries. The queries can be
saved internally in the project file or externally. Each project has its own
library, available with ProjectModel.QueryCategories.
Libraries are divided into categories, where each category is a container for
saved queries. The saved queries are represented by QueryAttribute objects.
To add a query to the library, first add a category then add the query.
Dim queryLib As Query.QueryLibrary = activeProject.QueryCategories
Dim queryCat As Query.QueryCategory
queryCat = queryLib.AddCategory("catName")
queryCat.AddQuery("queryName", "query description", queryObj)
Save Sets | 49
50
Classification
9
Overview
Object classification is a way of tagging drawing objects with an object class
name. This can help organize the objects in the drawing, and enforce drawing
standards.
NOTE For historical reasons, the API uses the terms feature and feature class for
object classification. These are different from FDO features and feature classes. It is
important not to confuse the two.
NOTE In the UI, feature definition files are called object class definition files.
51
current user must have administrative privileges in the Map session. To
check, test ClassificationManager.CanCurrentUserAlterSchema.
52 | Chapter 9 Classification
Dim classMgr As Classification.ClassificationManager
Dim newDef As Classification.FeatureClassDefinition
classMgr = activeProj.ClassificationManager
classMgr.SaveCurrentFeatureDefinitionFile()
54 | Chapter 9 Classification
Filters
10
Overview
Filters provide a simple mechanism for selecting drawing objects that meet
certain criteria. In the AutoCAD Map 3D UI, a basic filter can be used to select
drawing objects for an export operation.
A basic filter has options for filtering based on combinations of layer names,
object classification, and block names. Custom filters can filter based on other
criteria. Both types are based on the Filters.ObjectFilter class.
An ObjectFilterGroup can combine multiple filters into a single filter operation.
Objects for working with filters are in the Autodesk.Gis.Map.Filters namespace.
Basic Filters
The FilterObjects() method for any filter takes a list of drawing objects to be
filtered and returns a list of drawing objects that meet the filtering criteria.
To create a basic filter, call the constructor with a list of layer names, feature
class names, and block names. Separate multiple values with commas. An asterisk
(“*”) wild card selects all objects matching the criterion.
Dim newFilter As Autodesk.Gis.Map.Filters.BasicFilter
newFilter = New Autodesk.Gis.Map.Filters.BasicFilter
("Parcels, Lots", "*", "*"))
To run a filter, call its FilterObjects() method with the output and input
ObjectIdCollection objects.
55
Custom Filters
Custom filters can implement additional filtering capabilities. To create a
custom filter, define a new class based on the ObjectFilter class. At a
minimum, the custom filter must define a FilterObjects() method. It can
define any other methods needed for creating and modifying the filter.
56 | Chapter 10 Filters
Import/Export
11
Overview
The AutoCAD Map 3D application maintains lists of available import and export
formats. It is not possible to modify these lists using the API. The application
Importer and Exporter classes can import and export data using these formats.
■ Importing or exporting
The particular options will vary depending on the type of data being imported
or exported, but the overall procedure is the same.
Importing
The import procedure brings in objects from external files and creates new
drawing objects. Some external files have a single layer, while others have more
than one.
To start an import process, get the Importer object for the application and
initialize it with the import format name and the location of the file or files to
import. For example::
myImporter.Init("SHP", fileName)
57
This sets up the available layers for the import. Iterate through the layers. For
each layer, determine if objects from the layer will be imported. Set
InputLayer.ImportFromInputLayerOn.
Any attribute data attached to objects in the layers can be brought into the
drawing as object data. Each attribute in the source file corresponds to a
column in the input layer. These columns can be mapped to fields in object
data tables.
To map input columns, set the object data table name using
InputLayer.SetDataMapping(). Then iterate through each column, setting
the mapping for the column using Column.SetColumnDataMapping().
Different import drivers will have different options. The default options are
stored in MapImport.ini. To modify the options, get the options using
Importer.DriverOptions(). This returns a name-value collection. Modify the
options in the collection and call Importer.SetDriverOptions().
Some drivers also have an options dialog. For those drivers, call
Importer.InvokeDriverOptionsDialog() to have the user set the options.
When all the mappings and driver options have been set up properly, call
Importer.Import(). This returns an ImportResults object, which contains
details of the import.
Import Events
The RecordReadyForImport event handler can be used to control which records
are imported. The handler is fired for every record, before the import has been
completed. To stop the import for a record, set
RecordReadyForImportEventArgs.ContinueImport to false.
Exporting
Exporting is similar to importing, with some small differences.
To select which drawing objects should be exported, call
Exporter.SetSelectionSet(). To export all drawing objects, set
Exporter.ExportAll to true. To filter the list of objects, set the
Exporter.FeatureClassFilter or Exporter.LayerFilter properties.
58 | Chapter 11 Import/Export
Items in an ExpressionTargetCollection object are name-value pairs, where
the name corresponds to an object data expression and the value is the
attribute name in the exported file. For details about object data expressions
see Expressions in Annotations on page 28 or the Map 3D Help.
Export Events
The RecordReadyForExport event handler is similar to RecordReadyForImport.
To stop the export of a record, set RecordReadyForExport.ContinueExport to
false.
Exporting | 59
60
Topology
12
Overview
A network topology contains a set of edges or links. Each link has a node at
each end. Multiple links can intersect at a single node.
A polygon topology represents an area coverage.
Topologies describe relationships between drawing objects. There are three types
of topology:
■ Network
■ Polygon
61
Internally, the relationship between drawing objects and topologies is
implemented using object data tables. For a topology named topol_name, the
following tables are used:
■ TMPCNTR_topol_name
■ TPMDESC_topol_name
■ TPMID_topol_name
■ TPMLINK_topol_name
■ TPMNODE_topol_name
TPMDESC and TPMID are not attached to any drawing objects. They are used to
store information about the topology itself. TPMDESC contains the parameters
used to create the topology, such as topology type, colors, and layer names.
TPMID contains a single value for the last id assigned for the topology.
TPMNODE data is attached to nodes in the topology. Each node has an ID and
a resistance value.
TPMLINK data is attached to links between nodes. For network topologies the
link has values for the ID, start and end node, direction of the link, and
resistance values for traversing the link in each direction. For polygon
topologies the link also has values for the polygons on either side of the link.
TPMCNTR data is attached to the centroids of polygons in a polygon topology.
Each centroid has values for the ID, area, perimeter, and number of links that
form the edges of the polygon.
In most cases, applications do not need to manage the object data directly.
The topology API calls perform all the necessary updates. An application
needing to know which topologies have been defined in the drawing, however,
should check the object data tables for names beginning with “TMPDESC_”.
Drawing Cleanup
Drawing cleanup is essential for polygon and network topologies. It ensures
that the objects in the topology can be connected properly. For more details
about the various types of cleanup actions, refer to the UI documentation.
62 | Chapter 12 Topology
A drawing cleanup operation involves combining one or more cleanup actions.
Each action is identified by an action number. Many of the actions have
additional settings.
Drawing Cleanup | 63
The same class, Topology.Variable, is used for both actions and settings. To
create a drawing cleanup action, create a settings variable and set its values:
Dim toleranceVal As New DatabaseServices.TypedValue _
(Autodesk.AutoCAD.DatabaseServices.DxfCode.Real, 25.5)
Dim toleranceSetting As New DatabaseServices.ResultBuffer
toleranceSetting.Add(toleranceVal)
Create an action variable and add the action and its settings:
Dim action As New Topology.Variable
action.InsertActionToList(-1, 8, settings)
If the operation will include more than one action, repeat the process and
insert more actions and their corresponding settings into the same action
variable.
To perform the cleanup, create a TopologyClean object and initialize it with
the action variable and a set of drawing objects to clean.
Dim cleanObj As New Topology.TopologyClean
cleanObj.Init(action, Nothing)
Each individual action in the action variable is a cleanup group. Start the
cleanup and go through the groups until all actions have been completed.
Commit the changes using TopologyClean.End().
cleanObj.Start()
cleanObj.GroupNext()
Do While Not cleanObj.Completed
cleanObj.GroupFix()
cleanObj.GroupNext()
Loop
cleanObj.End()
For finer control over the objects being cleaned, step through the errors in a
group using TopologyClean.ErrorCur(). Fix or ignore each one individually.
Set TopologyClean.ErrorPoint to change the location for the fix.
64 | Chapter 12 Topology
To save a profile for later use, call Variable.SaveProfile() using an action
variable object. To reload the profile, call Variable.LoadProfile().
Creating Topologies
To create a new topology, get the Topologies object for the project. Select the
drawing objects to include in the topology. Call Topologies.Create(). Get a
reference to the newly created topology using Topologies.Item(), which takes
a string parameter.
Once a topology has been created, it must be opened using
TopologyModel.Open(). When the topology is no longer needed, close it with
TopologyModel.Close().
Node Topology
A node topology represents a group of related points. Node topologies are
often used as part of network or polygon topologies, to represent the endpoints
of the links in the topology.
TopologyModel.GetNodes() returns the collection of nodes. For each node,
Node.Entity returns the associated drawing object. If the node does not have
a drawing object associated with it, Node.Entity throws a MapException.
NOTE Do not update items in a NodeCollection object using methods like Add(),
Insert(), and Remove(). Instead, call the appropriate methods for the
TopologyModel object, like AddPointObject().
Network Topology
A network topology represents a group of related nodes and the connections
between the nodes. The connections between nodes are links or edges in the
topology.
Each full edge is composed of two half edges, representing travel in opposite
directions between the nodes. Each half edge can have its own resistance
value, which is used in certain types of network analysis.
TopologyModel.GetFullEdges() returns the collection of full edges. For each
edge, FullEdge.Entity returns the associated drawing object. If the edge does
Creating Topologies | 65
not have a drawing object associated with it, FullEdge.Entity throws a
MapException.
Polygon Topology
A polygon topology represents an area coverage, with polygons inside the
area bounded by edges. Any polygon in the topology must be entirely enclosed
within its edges.
Each polygon must have a centroid.
TopologyModel.GetPolygons() returns the collection of polygons. For each
edge, FullEdge.Entity returns the associated drawing object. If the edge does
not have a drawing object associated with it, FullEdge.Entity throws a
MapException.
66 | Chapter 12 Topology
Display Manager
13
Overview
Display Manager provides a way to organize and style layers in AutoCAD Map
3D.
NOTE The Display Manager API only manages layers that contain drawing objects.
To manage layers containing FDO data use the Geospatial Platform API. See the
Geospatial Platform Developer’s Guide and the Geospatial Platform API Reference
for details.
managerId = DisplayManager.Create(activeProject).MapManagerId( _
activeProject, True)
manager = trans.GetObject(managerId, OpenMode.ForRead)
67
Elements
Display Manager elements represent the different layers in the map. Elements
can be of the following types, all subclassed from DisplayManagement.Element:
■ DisplayManagement.BaseElement
■ DisplayManagement.LayerElement
■ DisplayManagement.AttachedDwgsQueryElement
■ DisplayManagement.TopologyElement
■ DisplayManagement.TopologyQueryElement
■ DisplayManagement.FeatureElement
■ DisplayManagement.RasterElement
Do While (iterator.MoveNext())
Dim itemId As ObjectId = iterator.Current
Dim thisItem As Object = _
trans.GetObject(itemId, OpenMode.ForRead)
If (thisItem.GetType().Equals(elementType) Or _
thisItem.GetType().IsSubclassOf(elementType)) Then
Dim mapElement As Item = thisItem
' Process element (layer)
ElseIf (thisItem.GetType().Equals(groupType)) Then
Dim thisGroup As DisplayManagement.Group = thisItem
' Process group
Else
' Not a Display Manager object, probably contains FDO data
End If
Loop
RasterElement objects are not generally used. Instead, use FDO data with the
Geospatial Platform API.
■ AcquisitionCriteriaString
■ AcquisitionCriteria
AttachedDwgsQueryElement
TopologyQueryElement
To add a new element, create the element and its associated data source
descriptor, then add it to the map. The following example adds a LayerElement
that references an AutoCAD layer named “Layer1”. For other element types,
create the appropriate data source descriptor.
Try
trans = activeDoc.TransactionManager.StartTransaction()
trans.Commit()
trans = Nothing
Catch e As Autodesk.AutoCAD.Runtime.Exception
' Handle exception
Style
Display Manager elements can have style associated with them.
DisplayManagement.Style is the base class for all the style classes. It is based
on AutoCAD.DatabaseServices.DBObject, so it must be managed using
AutoCAD transactions. The available style classes are:
■ DefaultStyle
■ EntityStyle
■ StylizationEntityAnnotationStyle
■ StylizationEntityHatchStyle
■ StylizationEntityTextStyle
■ RasterStyle
■ ThematicStyle
' Open the element for write, so the style can be added
Dim layer As Element = trans.GetObject(layerId, _
OpenMode.ForWrite)
Dim id As ObjectId
id = layer.AddStyle(styleEntity, styleRefIterator)
trans.AddNewlyCreatedDBObject(styleEntity, True)
trans.Commit()
trans = Nothing
Catch e As System.Exception
' Process exception
Finally
If Not trans Is Nothing Then
trans.Abort()
trans = Nothing
End If
End Try
Style | 73
74
MapBook
14
Overview
A Map Book is a way to divide a large map into smaller tiles, by creating a
separate layout for each tile.
Each project has its own MapBook manager. Call
MapApplication.GetBookManager() to get the book manager for a database.
A Map Book requires a template file that defines the layout for each sheet in
the book.
MapBook Templates
A Map Book template is an AutoCAD template (.dwt) file with some special
characteristics.
The template file must define at least one layout. The layout can contain
viewports for the following purposes:
■ Map view, which displays the map for the area covered by a particular sheet
■ Key view, which displays a small image of the entire map, outlining the area
covered by the map sheet
The layout can also contain special blocks that show links to adjacent map
sheets. Within AutoCAD Map 3D or a DWF file, the links can be used to jump
directly to an adjacent sheet.
The layout can also contain a title block.
75
To identify objects in the template as any of the special views or blocks, call
the static function MapBook.SheetTemplate.MarkElement() with the object
id and element type. For example, to mark an object as the map view, call
MapBook.SheetTemplate.MarkElement(objId, _
MapBook.TemplateElementType.MapView)
■ Top
■ Bottom
■ Right
■ Left
■ TopRight
■ TopLeft
■ BottomRight
■ BottomLeft
76 | Chapter 14 MapBook
Index
A Autodesk.AutoCAD.ApplicationServices
namespace 3
AbortCSChange event 40 Autodesk.AutoCAD.Colors namespace 3
AbortSwapId event 40 Autodesk.AutoCAD.ComponentModel
acdbmgd assembly 3 namespace 3
ACMAP_ANN_TEMPLATE_ 26 Autodesk.AutoCAD.DatabaseServices
AcMapDataConnectPlugins assembly 20 namespace 3
acmgd assembly 3 Autodesk.AutoCAD.DatabaseServices.Filters
activeDoc 6 namespace 3
activeProj 8 Autodesk.AutoCAD.EditorInput
AliasAdded event 35 namespace 3
AliasDeleted event 35 Autodesk.AutoCAD.Geometry
annotation expressions 28 namespace 3
annotation overrides 30 Autodesk.AutoCAD.GraphicsInterface
annotation references, inserting 29 namespace 3
annotation templates 25 Autodesk.AutoCAD.GraphicsSystem
creating 26 namespace 3
internal names 26 Autodesk.AutoCAD.LayerManager
annotation text 28 namespace 3
annotations 25 Autodesk.AutoCAD.PlottingServices
updating and refreshing 30 namespace 3
Annotations, ProjectModel class 26 Autodesk.AutoCAD.Publishing
Annotations.CreateAnnotationTemplate()27 namespace 3
Annotations.Item() 27 Autodesk.AutoCAD.Runtime
Annotations.TemplateNameBlockTableRecordPrefix26 namespace 3
AnnotationTemplate.CreateAnnotationText()28 Autodesk.AutoCAD.Windows
AnnotationTemplate.InsertReference() 29 namespace 3
AnnotationTemplate.SetExpressionString()27 Autodesk.AutoCAD.Windows.ToolPalette
AnnotationTemplate.UpdateReferences()30 namespace 3
application 7 Autodesk.Gis.Map namespace 1
assemblies, required 2 Autodesk.Gis.Plugins assembly 20
AttachFeatureDefinitionFile(), in
ClassificationManager 52
attaching object data 15 B
attribute definitions BeginClose event 40
overriding properties 29 BeginCSChange event 40
attributes, in annotation templates 26 BeginDestroy event 40
AutoCAD database object 5 BeginOpen event 40
AutoCAD document, and Map project 8 BeginQuery event 40
AutoCAD RXClass objects 52 BeginSave event 40
AutoCAD transactions 5 BeginSaveBack event 40
Index | 77
BeginSwapId event 40 drawing 7
BeginTransform event 40 drawing objects 10
DrawingActivated event 39
DrawingActivationCancelled event 39
C DrawingAttachCancelled event 39
CanCurrentUserAlterSchema property, in DrawingAttached event 39
ClassificationManager 51 DrawingDeactivated event 40
CategoryAppended event 37 DrawingDetached event 40
CategoryModified event 37 DrawingSettingsModified event 40
CategoryUnappended event 37 DrawingToBeActivated event 40
ClassificationManager property, in DrawingToBeAttached event 40
ProjectModel class 51
ClassificationManager.AttachFeatureDefinitionFile()52 E
ClassificationManager.CanCurrentUserAlterSchema
property 51 EndClose event 40
ClassificationManager.CreateFeatureClassDefinition()52 EndCSChange event 40
ClassificationManager.CreateFeatureDefinitionFile()51 EndOpen event 40
ClassificationManager.DetachCurrentFeatureDefinitionFile52 EndQuery event 41
ClassificationManager.GetAllTags() 54 EndSave event 41
ClassificationManager.GetProperties() 52 EndSaveBack event 41
ClassificationManager.GetUnclassifiedEntities()54 EndSwapId event 41
ClassificationManager.SaveCurrentFeatureDefinitionFile()53 EndTransform event 41
ClassificationManager.Unclassify() 54 entity, and drawing object 10
classifying objects 54 events, list of 35
CreateAnnotationTemplate(), Annotations ExportRecordError event 38
class 27 expressions, in annotations 28
CreateAnnotationText(),
AnnotationTemplate class 28
CreateFeatureClassDefinition(), in F
ClassificationManager 52 feature class definitions
CreateFeatureDefinitionFile(), in creating 52
ClassificationManager 51 feature definition files 51
creating object data tables 14 attaching and detaching 52
CurrentScaleModified event 37 creating 51
FeatureClassDefinition.SetCreateMethod()52
D FeatureClassDefinitionCreated event 36
FeatureClassDefinitionDeleted event 36
database object id 5 FeatureClassDefinitionModified event 36
debugger 4 FeatureClassDefinitionRenamed
deleting object data records 18 event 36
DetachCurrentFeatureDefinitionFile(), in FeatureClassPropertyCollection 53
ClassificationManager 52 FeatureDefinitionFileAttached event 36
DismissStylizationBegin event 37 FeatureDefinitionFileModified event 36
DismissStylizationCancel event 37 field definitions, for object data tables 14
DismissStylizationEnd event 37
document, and Map project 8
78 | Index
G MapSetCurrentBegin event 37
MapSetCurrentEnd event 37
GetAllTags(), in MapSetCurrentFails event 37
ClassificationManager 54 MapUnappended event 37
GetProperties(), in
ClassificationManager 52
getting object data 16 N
GetUnclassifiedEntities(), in namespaces 1
ClassificationManager 54
O
H
object class definition files 51
Handle 10 object classification 51, 54
HostMapApplicationServices.Application7 object data 13
attaching to objects 15
I getting 16
updating and deleting records 18
ImportRecordError event 39 object data tables 13
InsertReference(), in AnnotationTemplate object data tables, creating 14
class 29 object data tables, removing 15
IntOptionModified event 35, 41 ObjectData.FieldDefinition 14
Item(), Annotations class 27 ObjectData.Record 14
ItemAppended event 37 ObjectId 5, 10
ItemErased event 38 ODTables property, in ProjectModel 13
ItemModified event 38
P
M
project, and AutoCAD document 8
ManagedMapApi assembly 3 ProjectBeginClose event 35
map 7 ProjectCreated event 35
Map 3D session 7 ProjectModel 7
map application 7 ProjectModel properties 9
mapApp 8 ProjectModel.Annotations 26
MapAppended event 37 ProjectModel.ClassificationManager
MapApplication.Projects 7 property 51
MapBookAppended event 39 ProjectModel.ODTables property 13
MapBookErased event 39 ProjectOpened event 35
MapBookModified event 39 projects 7
MapBookSetCurrent event 39 Projects 7
MapBookTileModified event 39 properties
MapBookTileWillBeErased event 39 of ProjectModel 9
MapBookTreeNodeModified event 39
MapBookWillBeErased event 39
MapGoodBye event 37 Q
MapObjectId 10 queries 45
Index | 79
QueryAdded event 41 StringOptionModified event 36, 41
QueryCategoryAdded event 41 StyleAppended event 38
QueryCategoryDeleted event 41 StyleAppendedToCategory event 37
QueryCategoryRenamed event 41 StyleErased event 38
QueryDeleted event 41 StyleModified event 37
QueryModified event 41 StyleReferenceAppended event 38
QueryRenamed event 41 StyleReferenceErased event 38
StyleReferenceModified event 38
StyleUnappended event 37
R
RecordExported event 38 T
RecordImported event 39
RecordReadyForExport event 38 tables, for object data 13
RecordReadyForImport event 39 Transaction.Open() 5
records, in object data tables 14 transactions 5
references, required 2
refreshing annotations 30
removing object data tables 15 U
RXClass objects 52 Unclassify(), in ClassificationManager 54
UnloadApp event 36
S UpdateReferences, in AnnotationTemplate
class 30
SaveCurrentFeatureDefinitionFile(), in UpdateStylizationBegin event 38
ClassificationManager 53 UpdateStylizationCancel event 38
ScaleAdded event 38 UpdateStylizationEnd event 38
ScaleErased event 38 updating annotations 30
ScaleModified event 38 updating object data records 18
session 7
SetCreateMethod(), in
FeatureClassDefinition 52 V
SetExpressionString(), AnnotationTemplate Visual Studio debugger 4
class 27 Visual Studio, setting up 2
80 | Index