autodesk aec base activex and vba reference guide · object in the autocad activex and vba...

899
Objects Aec2dSection AEC 2D section object. AecAnchor Base class for all AEC anchor objects. AecAnchorEntToCurve Binds one AEC object to another AEC or AutoCAD object, such as a roof, wall, line, or arc. AecAnchorEntToGridAssembly Attaches entity objects, such as doors and windows, to grid assemblies, such as curtain walls and window assemblies. AecAnchorEntToLayoutCell Attaches objects, such as light fixtures, to cells on a 2D layout grid. AecAnchorEntToLayoutNode Attaches objects, such as columns, to nodes on a layout grid. AecAnchorEntToLayoutVolume Attaches objects, such as furniture, to volumes on a 3D layout grid. AecAnchorLeadEntToNode Connects an object to a layout node with a leader between the two objects. AecAnchorToRef Base class for referencing objects from an anchor. AecBaseApplication Application object extending AcadApplication to provide support for AEC Applications. AecBaseDatabase AEC database object extending AcadDatabase to provide support for general AEC objects. AecBaseDatabasePreferences A derivative of AecDatabasePreferences, providing base desktop database preferences support. AecBaseDocument An AEC drawing object, extending the AcadDocument to provide support for general AEC objects. AecBaseDocuments The collection of all AEC drawings open in the

Upload: others

Post on 24-Mar-2020

135 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectsAec2dSectionAEC2Dsectionobject.

AecAnchorBaseclassforallAECanchorobjects.

AecAnchorEntToCurveBindsoneAECobjecttoanotherAECorAutoCADobject,suchasaroof,wall,line,orarc.

AecAnchorEntToGridAssemblyAttachesentityobjects,suchasdoorsandwindows,togridassemblies,suchascurtainwallsandwindowassemblies.

AecAnchorEntToLayoutCellAttachesobjects,suchaslightfixtures,tocellsona2Dlayoutgrid.

AecAnchorEntToLayoutNodeAttachesobjects,suchascolumns,tonodesonalayoutgrid.

AecAnchorEntToLayoutVolumeAttachesobjects,suchasfurniture,tovolumesona3Dlayoutgrid.

AecAnchorLeadEntToNodeConnectsanobjecttoalayoutnodewithaleaderbetweenthetwoobjects.

AecAnchorToRefBaseclassforreferencingobjectsfromananchor.

AecBaseApplicationApplicationobjectextendingAcadApplicationtoprovidesupportforAECApplications.

AecBaseDatabaseAECdatabaseobjectextendingAcadDatabasetoprovidesupportforgeneralAECobjects.

AecBaseDatabasePreferencesAderivativeofAecDatabasePreferences,providingbasedesktopdatabasepreferencessupport.

AecBaseDocumentAnAECdrawingobject,extendingtheAcadDocumenttoprovidesupportforgeneralAECobjects.

AecBaseDocumentsThecollectionofallAECdrawingsopeninthe

Page 2: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

currentsession.

AecBasePreferencesAECAutoCADpreferencesobject.

AecBlockRefAninstanceofanAECblockinadrawing.

AecCameraAECcameraobject.

AecCellLayoutToolBaseClassforthelayoutgridobjects.

AecClipVolClipVolumeentitydefininganextrudedregionforclipping.

AecClipVolResClipVolumeResultwhichcapturestheresultinggraphicsforasectionorelevationforinsertionintothedrawing.

AecDatabaseAECDatabaseobjectextendingtheAcadDatabaseobject.

AecDatabasePreferencesExtendstheAutoCADDatabasePreferencesobjecttoincludeAECpropertiesandmethods.

AecDictionaryAECDictionarycontainingacollectionofAECobjects.

AecDictRecordAnAECDictionaryitem.

AecEditInPlaceProfileIn-placeeditprofileobject.

AecEntityBaseclassforallAECentities.

AecEntRefAreferencetoanyentityinthedrawing,similartoablockreference.

AecGeoProvideslocation,rotationandanchoringcapabilitiesforAECentities.

AecGridAssemblyBaseclassforgridassemblies.

AecLayerKeyLayerkeydefinition,whichspecifiesthelayerpropertiesgeneratedfromaparticularkey.

AecLayerKeysThecollectionoflayerkeydefinitionsinalayerkeystyle.

Page 3: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecLayerKeyStyleAcollectionoflayerkeys.

AecLayerKeyStylesThecollectionoflayerkeystylesinthespecifieddrawing.

AecLayerOverrideSettingAlayerkeystyleoverridesetting.

AecLayerOverrideSettingsThecollectionofoverridesettingsinalayerkeystyle.

AecLayoutCurveAsingledimensionalgridwithnodesalongasinglecurve.

AecLayoutCurveNodeAnodeinalayoutcurve.

AecLayoutCurveNodesThecollectionofnodesinalayoutcurve.

AecLayoutGrid2DLayoutgridentityusedtolayoutanyAECobjectwithina2Dgrid.

AecLayoutGrid2DNodeAnodeina2Dlayoutgrid.

AecLayoutGrid2DNodesThecollectionofnodesina2Dlayoutgrid.

AecLayoutGrid2DXNodeAnodealongtheXaxisofa2Dlayoutgrid.

AecLayoutGrid2DXNodesCollectionofnodesalongtheXaxisofa2Dlayoutgrid.

AecLayoutGrid2DYNodeAnodealongtheYaxisofa2Dlayoutgrid.

AecLayoutGrid2DYNodesCollectionofnodesalongtheYaxisofa2Dlayoutgrid.

AecLayoutGrid3DAlayoutvolumeforarrangingobjectsina3Dgrid.

AecLayoutGrid3DNodeAnodeofa3DLayoutGrid.

AecLayoutGrid3DNodesThecollectionofnodesina3Dlayoutgrid.

AecLayoutGrid3DXNodeAnodealongtheXaxisofalayoutvolume.

Page 4: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecLayoutGrid3DXNodesCollectionofnodesalongtheXaxisofalayoutvolume.

AecLayoutGrid3DYNodeAnodealongtheYaxisofalayoutvolume.

AecLayoutGrid3DYNodesCollectionofnodesalongtheYaxisofalayoutvolume.

AecLayoutGrid3DZNodeAnodealongtheZaxisofalayoutvolume.

AecLayoutGrid3DZNodesCollectionofnodesalongtheZaxisofalayoutvolume.

AecLayoutNodeProvidescommonpropertiessharedbyalltypesoflayoutnodes.

AecLayoutNodesCollectionoflayoutnodes.

AecLayoutToolProvidescommonfunctionalityforlayoutcurveandlayoutgridobjects.

AecMaskBlockRefAninstanceofamaskblock,atwo-dimensionalblockthatcoverspartofanAECobjectinaplan(2D)view.

AecMaskBlockStyleDefinesthepropertiesofamaskblockobject.

AecMaskBlockStylesThecollectionofmaskblockstylesinthespecifieddrawing.

AecMassElementAnobjectthathasbehaviorsbasedonitsshape.

AecMassElementStyleDefinesthepropertiesofamasselementobject.

AecMassElementStylesThecollectionofmasselementstylesinthespecifieddrawing.

AecMassGroupAgroupofmasselementscombinedtoformacomplexshape.

AecMassGroupsThecollectionofmassgroupsinthespecifieddrawing.

Page 5: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecMVBlockRefAninstanceofablockthatcanhavedifferentrepresentationsindifferentviewdirections.

AecMVBlockStyleDefinesthepropertiesofamulti-viewblockobject.

AecMVBlockStylesThecollectionofmulti-viewblockstylesinthespecifieddrawing.

AecObjectProvidescommonfunctionalityforAECdatabaseobjects.

AecPolygonAnAecPolygonobject.

AecPolygonStyleDefinesthepropertiesofanAecPolygonobject.

AecPolygonStylesThecollectionofAecPolygonstylesinthespecifieddrawing.

AecProfileDefinesthepropertiesofaprofilestyle.

AecProfileStyleAcustomshapedefinedbytwo-dimensionalclosedpolylines.

AecProfileStylesThecollectionofprofilestylesinthespecifieddrawing.

AecRingAclosedloopofpolylinesegments,oftenusedasagroupinsideanAecProfileobject.

AecRingsThecollectionofringsinanAecProfileobject.

AecSliceSliceofamassinggrouporanyAECobject,typicallyusedtogeneratefloorplatesandspaceboundaries.

AecViewBlockViewblockusedfordisplayrepresentationsbyamulti-viewblock.

AecViewBlocksAcollectionofviewblocksusedfordisplayrepresentationsbyamulti-viewblock.

AecVolumeLayoutToolProvidesstandardfunctionalityforall3Dlayouttools.

Page 6: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AECBaseObjectModel

Clickonanobjecttoviewthedescription.

Page 7: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through
Page 8: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

2DSectionObject

AEC2Dsectionobject.

VBAobjectname: Aec2dSection

Createusing: AddCustomObject("Aec2dSection")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

Properties

Application

ClipVol

Description

Page 9: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Document

Handle

HasExtensionDictionary

Hyperlinks

LayerLinetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 10: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorObject

BaseclassforallAECanchorobjects.

VBAobjectname: AecAnchor

Createusing: NewAecAnchor

Accessvia: AecGeo.GetAnchor

YoucanuseAecAnchorasagenericreferencetoanchorobjects.

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

Properties

Application

Description

Document

Handle

HasExtensionDictionary

Events

Modified

Page 11: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

SetXDataObjectID

ObjectName

OwnerID

Page 12: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorEntitytoCurveObject

BindsoneAECobjecttoanotherAECorAutoCADobject,suchasaroof,wall,line,orarc.

VBAobjectname: AecAnchorEntToCurve

Createusing: NewAecAnchorEntToCurve

Accessvia: AecGeo.GetAnchor

Properties

Application

Description

Document

FlipX

FlipY

Page 13: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

FlipY

FlipZ

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Reference

XDistance

XPositionFrom

XPositionTo

XRotation

YDistance

YPositionFrom

YPositionTo

ZDistance

ZPositionFrom

ZPositionTo

ZRotation

Events

Modified

Page 14: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecAnchorEntToEntObject

BindsoneAECobjecttoanother.

VBAobjectname: AecAnchorEntToEnt

Createusing: NewAecAnchorEntToEnt

Accessvia: AecGeo.GetAnchor

Methods

AttachEntity

Delete

GetExtensionDictionary

Properties

Application

Description

Document

Handle

HasExtensionDictionary

Events

Modified

Page 15: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

SetXData

ObjectID

ObjectName

OwnerID

Reference

Page 16: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorEntitytoGridAssemblyObject

Attachesentityobjects,suchasdoorsandwindows,togridassemblies,suchascurtainwallsandwindowassemblies.

VBAobjectname: AecAnchorEntToGridAssembly

Createusing: N/A

Accessvia: AecGeo.GetAnchor

Properties

AdjustSizing

AllowVariation

Application

BottomOffset

Cell

Page 17: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

Cell

Description

Document

FlipX

FlipY

FlipZ

Handle

HasExtensionDictionary

LeftOffset

ObjectID

ObjectName

OwnerID

Reference

RightOffset

TopOffset

YAlignment

YOffset

Events

Modified

Page 18: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorEntitytoLayoutCellObject

Attachesobjectstocellsona2Dlayoutgrid.

VBAobjectname: AecAnchorEntToLayoutCell

Createusing: NewAecAnchorEntToLayoutCell

Accessvia: AecGeo.GetAnchor

Properties

Application

ApplyResize

CenterOnNode

Description

Document

Page 19: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

FlipX

FlipY

FlipZ

Handle

HasExtensionDictionary

Node

ObjectID

ObjectName

Offset

OwnerID

Reference

ResizeOffset

UseNodeCS

XRotation

YRotation

ZRotation

Events

Modified

Page 20: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorEntitytoLayoutNodeObject

Attachesobjects,suchascolumns,tonodesonalayoutgrid.

VBAobjectname: AecAnchorEntToLayoutNode

Createusing: NewAecAnchorEntToLayoutNode

Accessvia: AecGeo.GetAnchor

Properties

Application

CenterOnNode

Description

Document

FlipX

Page 21: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

FlipY

FlipZ

Handle

HasExtensionDictionary

Node

ObjectID

ObjectName

Offset

OwnerID

Reference

UseNodeCS

XRotation

YRotation

ZRotation

Events

Modified

Page 22: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorEntitytoLayoutVolumeObject

Attachesobjectstovolumesona3Dlayoutgrid.

VBAobjectname: AecAnchorEntToLayoutVolume

Createusing: NewAecAnchorEntToLayoutVolume

Accessvia: AecGeo.GetAnchor

Properties

Application

ApplyResize

CenterOnNode

Description

Document

Page 23: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

FlipX

FlipY

FlipZ

Handle

HasExtensionDictionary

Node

ObjectID

ObjectName

Offset

OwnerID

Reference

ResizeOffset

UseNodeCS

XRotation

YRotation

ZRotation

Events

Modified

Page 24: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecAnchorExtendedTagToEntObject

Attachesatagtoanobjecttodisplayscheduledata.

VBAobjectname: AecAnchorExtendedTagToEnt

Createusing: NewAecAnchorExtendedTagToEnt

Accessvia: AecGeo.GetAnchor

ThisobjectisavailableifthedrawingcontainsanyMVBlockstyles.

Methods

AttachEntity

Delete

Properties

Application

Description

Document

ForceHorizontal

Page 25: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Delete

GetExtensionDictionary

GetXData

SetXData

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Reference

Page 26: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchorLeaderEntitytoNodeObject

Connectsanobjecttoalayoutnodewithaleaderbetweenthetwoobjects.

VBAobjectname: AecAnchorLeadEntToNode

Createusing: NewAecAnchorLeadEntToNode

Accessvia: AecGeo.GetAnchor

Properties

AngleFromNode

Application

CenterOnNode

Description

Document

Page 27: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

AttachEntity

Delete

GetExtensionDictionary

GetXData

SetXData

Document

FlipX

FlipY

FlipZ

Handle

HasExtensionDictionary

LeaderExtension1

LeaderExtension2

Node

ObjectID

ObjectName

Offset

OwnerID

Reference

UseNodeCS

XRotation

YRotation

ZRotation

Events

Modified

Page 28: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnchortoReferenceObject

Baseclassforreferencingobjectsfromananchor.

VBAobjectname: AecAnchorToRef

Createusing: NewAecAnchorToRef

Accessvia: AecGeo.GetAnchor

Methods

AttachEntity

Delete

GetExtensionDictionary

Properties

Application

Description

Document

Handle

HasExtensionDictionary

Events

Modified

Page 29: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

SetXData

ObjectID

ObjectName

OwnerID

Reference

Page 30: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBaseApplicationObject

ApplicationobjectextendingAcadApplicationtoprovidesupportforAECApplications.

VBAobjectname: AecBaseApplication

Createusing:

ForVB:GetObject("Acad.Application")orCreateObject("Acad.Application")thenGetInterfaceObject("AecBase.Application")

ForVBA:notapplicable.Theapplicationisalwaysavailable.

Accessvia: ApplicationProperty

ThepropertiesassociatedwiththeAecBaseApplicationobjectreflectthepropertiesofthemainapplicationwindow.Themethodscontroltheloadingorlistingofthecurrentlyloadedexternalapplicationsandinterfaceobjects.

Page 31: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Theactivedocument(AutodeskArchitecturalDesktopdrawing)canbeaccessedusingtheActiveDocumentproperty.SeetheAcadApplicationobjectintheAutoCADActiveXandVBAReferenceforinformationregardingtheMethods,PropertiesandEventsprovidedthroughthisobject.

Methods

Eval

GetAcadState

GetInterfaceObject

Init

ListArx

LoadArx

LoadDVB

Quit

RunMacro

UnloadArx

UnloadDVB

Update

ZoomAll

ZoomCenter

ZoomExtents

ZoomPickWindow

Properties

ActiveDocument

Application

Caption

Documents

FullName

Height

LocaleId

MenuBar

MenuGroups

Name

Path

Preferences

StatusId

VBE

Version

Visible

Page 32: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZoomPrevious

ZoomScaled

ZoomWindow

Width

WindowLeft

WindowState

WindowTop

Page 33: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBaseDatabaseObject

AECdatabaseobjectextendingAcadDatabasetoprovidesupportforgeneralAECobjects.

VBAobjectname: AecBaseDatabase

Createusing: N/A

Accessvia: ModelSpace.Item

Note:AllpropertiesandmethodsoftheAecBaseDatabaseobjectareavailablethroughtheAecBaseDocumentobject.

Properties

Blocks

Dictionaries

DimStyles

Page 34: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

CopyObjects

HandleToObject

Init

ObjectIdToObject

DisplayConfigurations

DisplayRepresentations

DisplaySets

ElevationModelSpace

ElevationPaperSpace

Groups

LayerKeyStyles

Layers

Layouts

Limits

Linetypes

MaskBlockStyles

MassElementStyles

MassGroups

ModelSpace

MVBlockStyles

PaperSpace

PlotConfigurations

PolygonStyles

Preferences

Page 35: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyles

RegisteredApplications

TextStyles

UserCoordinateSystems

Viewports

Views

Page 36: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBaseDatabasePreferencesObject

AderivativeofAecDatabasePreferences,providingbasedesktopdatabasepreferencessupport.

VBAobjectname: AecBaseDatabasePreferences

Createusing: N/A

Accessvia: AecBaseDatabase.PreferencesAecBaseDocument.Preferences

Properties

AllowLongSymbolNames

AlwaysImportLayerStandard

AngularAzimuth

AngularDisplayFormat

AngularPrecision

Page 37: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

ConvertToCurrentAreaDisplay

AngularPrecision

Application

AreaDisplayUnit

AreaPrecision

AreaSuffixBasePoint

BasePointNE

BlockBasedLayerOffBehavior

ContourLinesPerSurface

CoordinatePrecision

CreateDimscaleOverride

Database

DatabaseScale

DisplaySilhouette

ElevationPrecision

FacetDeviation

FacetMaxiumum

LayerFile

LayerStandard

LinearDisplayFormat

LinearPrecision

Page 38: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ConvertToCurrentAreaDisplay

ConvertToCurrentVolumeDisplay

Init

SaveAsDefault

LinearUnit

Lineweight

LineWeightDisplay

MaxActiveViewports

MeasurementUnit

NorthRotation

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap

OLELaunch

ProjectName

RenderSmoothness

ScaleOnInsert

SegmentPerPolyline

SolidFill

TextFrameDisplay

TextHeight

VerticalScale

Page 39: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VerticalScale

VolumeDisplayUnit

VolumePrecision

VolumeSuffix

XRefEdit

XRefLayerVisibility

XrefOverlaysUseOwnDisplayConfig

Page 40: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBaseDocumentObject

AnAECdrawingobject,extendingtheAcadDocumenttoprovidesupportforgeneralAECobjects.

Note:ThisobjectisactuallyacomponentoftheAecXUIBaseobjectmodel,whichrepresentsuserinterfaceobjects.

VBAobjectname: AecBaseDocument

Createusing:Documents.AddDocuments.OpenDocument.New

Accessvia: Documents.ItemApplication.ActiveDocument

ThePreferencespropertyprovidesaccesstodrawingsettings.

TheactivedocumentcanbeaccessedthroughtheActiveDocumentpropertyoftheAecBaseApplicationobject,afterinitializing

Page 42: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Activate

AuditInfo

Close

CopyObjects

EndUndoMark

Export

GetVariable

HandleToObject

Import

Init

LoadShapeFile

New

ObjectIdToObject

Open

PurgeAll

Regen

Save

DimStyles

DisplayConfigurations

DisplayRepresentations

DisplaySets

ElevationModelSpace

ElevationPaperSpace

FullName

Groups

Height

HWND

LayerKeyStyles

Layers

Layouts

Limits

Linetypes

MaskBlockStyles

MassElementStyles

MassGroups

ModelSpace

MSpace

Page 43: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SaveAs

SendCommand

SetVariable

StartUndoMark

Wblock

MVBlockStyles

Name

ObjectSnapMode

PaperSpace

Path

PickfirstSelectionSet

Plot

PlotConfigurations

PolygonStyles

Preferences

ProfileStyles

ReadOnly

RegisteredApplications

Saved

SelectionSets

TextStyles

UserCoordinateSystems

Utility

Viewports

Views

Page 44: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Width

WindowState

WindowTitle

Page 45: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBaseDocumentsCollection

ThecollectionofallAECdrawingsopeninthecurrentsession.

Note:ThisobjectisactuallyacomponentoftheAecXUIBaseobjectmodel,whichrepresentsuserinterfaceobjects.

VBAobjectname: AecBaseDocuments

Createusing: N/A

Accessvia: AecBaseApplication.Documents

Methods

Add

Close

Init

Item

Properties

Application

Count

Page 46: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Item

Open

Page 47: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecBasePreferencesObject

AECAutoCADpreferencesobject.

VBAobjectname: AecBasePreferences

Createusing: N/A

Accessvia: AecBaseApplication.Preferences

TheAecBasePreferencesobjectholdsalltheoptionsstoredexternaltothedrawing,suchasUserPreferences.Theoptionsarestoredinseparateobjects,groupedbycategory.UsethepropertiesoftheAecBasePreferencesobjecttoaccesseachcategory.

OptionsthatresideinthedrawingcanbeaccessedthroughtheAecBaseDatabasePreferencesobject.

Currently,AecBasePreferencesdoesnotprovideaccesstoAEC-specificoptions;itisequivalenttoAcadPreferences.RefertoAcadPreferencesintheAutoCADActiveXandVBAReferenceforinformationaboutthis

Page 48: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

object'smethodsandproperties.

Methods

Init

Properties

Application

Display

Drafting

Files

OpenSave

Output

Profiles

Selection

System

User

Page 49: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AECBlockObject

AninstanceofanAECblockinadrawing.

VBAobjectname: AecBlockRef

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

AecBlockRefisthebaseobjectfortheAecMVBlockRefandAecMaskBlockRefobjects.

Methods

ArrayPolar

ArrayRectangular

Properties

Application

Color

Description

Page 50: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchorGetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Description

Document

Handle

HasExtensionDictionary

HyperlinksLayer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

ScaleX

ScaleY

ScaleZ

TrueColor

Visible

Events

Modified

Page 51: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CameraObject

AECcameraobject.

VBAobjectname: AecCamera

Createusing: AddCustomObject("AecCamera")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Properties

Application

Color

Description

Document

Page 52: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionaryGetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Name

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Zoom

Events

Modified

Page 53: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CellLayoutToolObject

BaseClassforthelayoutgridobjects.

VBAobjectname: AecCellLayoutTool

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Thisisthebaseclassforallrectangularcelllayouttools,includingAecLayoutGrid2DandAecLayoutGrid3d.YoucanuseAecCellLayoutToolasagenericreferencetolayoutgridobjects.

Methods

ArrayPolarProperties

Page 54: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

ClosestNode

Copy

DeleteGetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Properties

Application

Color

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 55: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Update

Page 56: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClipVolumeObject

ClipVolumeentitydefininganextrudedregionforclipping.

VBAobjectname: AecClipVol

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

ThisisthebaseclassforADTbuildingelevationandsectionlineobjects.

Methods

ArrayPolar

Properties

Angle1

Angle2

Application

Page 57: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

Color

Description

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

LowerExtension

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

Side1

Events

Modified

Page 58: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TransformBy

Update

Side2

TrueColor

UseModelExtents

Visible

Page 59: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClipVolumeResultObject

ClipVolumeResultwhichcapturestheresultinggraphicsforasectionorelevationforinsertionintothedrawing.

VBAobjectname: AecClipVolRes

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

ThisisthebaseclassfortheADTsectionlineobject.

Methods

ArrayPolar

ArrayRectangular

Properties

Application

Page 60: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Color

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 61: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDatabaseObject

AECDatabaseobjectextendingtheAcadDatabaseobject.

VBAobjectname: AecDatabase

Createusing: N/A

Accessvia: ModelSpace.Item

Note:AccessallpropertiesandmethodsoftheAecDatabaseobjectthroughtheAecBaseDocumentobject.

Properties

Blocks

Dictionaries

DimStyles

ElevationModelSpace

ElevationPaperSpace

Page 62: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

CopyObjects

HandleToObject

Init

ObjectIdToObject

ElevationPaperSpace

Groups

Layers

Layouts

Limits

Linetypes

ModelSpace

PaperSpace

PlotConfigurations

Preferences

RegisteredApplications

TextStyles

UserCoordinateSystems

Viewports

Views

Page 63: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDatabasePreferencesObject

ExtendstheAutoCADDatabasePreferencesobjecttoincludeAECpropertiesandmethods.

VBAobjectname: AecDatabasePreferences

Createusing: N/A

Accessvia: ModelSpace.Item

Note:UseAecBaseDatabasePreferencesinsteadofAecDatabasePreferences.

Properties

AllowLongSymbolNames

Application

ContourLinesPerSurface

Page 64: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Init

DisplaySilhouette

Lineweight

LineWeightDisplay

MaxActiveViewports

ObjectSortByPlotting

ObjectSortByPSOutput

ObjectSortByRedraws

ObjectSortByRegens

ObjectSortBySelection

ObjectSortBySnap

OLELaunch

RenderSmoothness

SegmentPerPolyline

SolidFill

TextFrameDisplay

XRefEdit

XRefLayerVisibility

Page 65: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDictionaryObject

AECDictionarycontainingacollectionofAECobjects.

VBAobjectname: AecDictionary

Createusing: N/A

Accessvia: N/A

AecDictionaryisthebaseclassforAECstylecollections,suchasAecLayerKeyStylesandAecMaskBlockStyles.ThesecollectionscanbeaccessedfromtheAecBaseDocumentobject.

Methods

Delete

GetExtensionDictionary

GetXData

Properties

Application

Count

Document

HandleEvents

Page 66: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Has

Remove

Rename

SetXData

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Modified

Page 67: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDictionaryRecordObject

AnAECDictionaryitem.

VBAobjectname: AecDictRecord

Createusing: N/A

Accessvia: N/A

ThisisthebaseclassforallAECStyleobjects,suchasAecLayerKeyStyleandAecMaskBlockStyle.

Methods

Delete

Properties

AlternateName

Application

Description

Document

Page 68: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Delete

GetExtensionDictionary

GetXData

SetXData

Document

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified

Page 69: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayComponentObject

AnentityorhatchcomponentofatheAecDisplayComponentscollection.

VBAobjectname: AecDisplayComponent

Createusing: N/A

Accessvia: AecDisplayComponents.Item

AecDisplayComponentisabaseclass.ThederivedclassesareAecDisplayComponentEntityorAecDisplayComponentHatch.ChecktheobjecttypereturnedbytheAecDisplayComponents.Itemfortheunderlyingobject.

Methods

Properties

Index

Name Events

Page 70: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Owner

Page 71: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayComponentEntityObject

Theentitypropertiesforthedisplaycomponent.

VBAobjectname: AecDisplayComponentEntity

Createusing: N/A

Accessvia: AecDisplayComponents.Item

AecDisplayComponentEntityisaderivedclass.AecDisplayComponentisthebaseclass.CheckthetypereturnedbytheAecDisplayComponents.Itemmethodfortheunderlyingobject.

Properties

AllowByMaterial

ByMaterial

Index

Page 72: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Layer

Linetype

Linetypescale

LineWeight

Name

Owner

PlotStyleName

TrueColor

Visible

Events

Page 73: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayComponentHatchObject

Thehatchpropertiesforthedisplaycomponent.

VBAobjectname: AecDisplayComponentHatch

Createusing: N/A

Accessvia: AecDisplayComponents.Item

AecDisplayComponentHatchisaderivedclass.AecDisplayComponentisthebaseclass.CheckthetypereturnedbytheAecDisplayComponents.Itemmethodfortheunderlyingobject.

Properties

Angle

DoubleHatch

HatchType

Page 74: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Index

Name

Owner

PatternName

Scale

Spacing

UseAngleOfObject

XOffset

YOffset

Events

Page 75: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayComponentsCollection

Thecollectionofdisplaycomponentsinadisplayrepresentation.

VBAobjectname: AecDisplayComponents

Createusing: N/A

Accessvia: AecDisplayProperties.DisplayComponents

ThedisplaycomponentscollectioncontainsAecDisplayComponentEntityandAecDisplayComponentHatchobjects.

Methods

Item

Properties

Count

Owner

Events

Page 76: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayConfigurationObject

Adisplayconfiguration.

VBAobjectname: AecDisplayConfiguration

Createusing: N/A

Accessvia: AecDisplayConfiguration.Item

Methods

Properties

AlternameName

CutPlaneDisplayAbove

CutPlaneDisplayBelow

CutPlaneHeight

DisplaySet

Events

Modified

Page 77: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FixedViewDirection

Name

UseFixedViewDirection

Page 78: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayConfigurationsObject

Acollectionofdisplayconfigurations.

VBAobjectname: AecDisplayConfigurations

Createusing: N/A

Accessvia: AecBaseDatabase.DisplayConfigurationsAecBaseDocument.DisplayConfigurations

Methods

Add

Has

Import

Item

Remove

Properties

ActiveConfiguration

Count

Events

Modified

Page 79: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remove

Rename

Page 80: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayPropertiesObject

Acollectonofdisplaypropertiesforadisplayrepresentation.

VBAobjectname: AecDisplayProperties

Createusing: N/A

Accessvia: AecDisplayRepresentation.DefaultDisplayPropertiesAecDisplayRepresentation.OverrideDisplayProperties

UsetheAecDisplayPropertiescollectiontoaccessthematerialproperties,entitycomponentpropertiesandhatchcomponentpropertiesofthedisplayrepresentation.

AecDisplayPropertiesisabaseclass.ThederivedclassisAecDisplayPropertiesMaterial.CheckthetypereturnedbytheDefaultDisplayPropertiesmethodandOverrideDisplayPropertiesmethodfortheunderlyingobject.

Properties

Page 81: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MethodsDisplayComponents Events

Page 82: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayPropertiesMaterialObject

Thematerialdisplaypropertiesforadisplayrepresentation.

VBAobjectname: AecDisplayPropertiesMaterial

Createusing: N/A

Accessvia: AecDisplayRepresentation.DefaultDisplayPropertiesAecDisplayRepresentation.OverrideDisplayProperties

AecDisplayPropertiesMaterialisaderivedclass.AecDisplayPropertiesisthebaseclass.CheckthetypereturnedbytheDefaultDisplayPropertiesmethodandOverrideDisplayPropertiesmethodfortheunderlyingobject.

Properties

DisplayComponents

DisplayHiddenLinework

Page 83: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

ExcludeFrom2dSectionShrinkwrap

SectionedBodyRenderingMaterialName

SectionRenderingMaterialName

SurfaceHatchPlacement

SurfaceRenderingMaterialName

SurfaceRenderMaterialMapping

MergeCommonMaterials

Events

Page 84: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayRepresentationObject

Adisplayrepresentation.

VBAobjectname: AecDisplayRepresentation

Createusing: AecDisplayRepresentation.Duplicate

Accessvia: AecDisplayRepresentations.Item

Name

Methods

AddOverride

DeleteOverride

Duplicate

Properties

AlternameName

ClassName

DefaultDisplayProperties

DisplayName

Events

Modified

Page 85: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverrideDisplayProperties

Page 86: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecDisplayRepresentationsObject

Thecollectionofdisplayrepresentations.

VBAobjectname: AecDisplayRepresentations

Createusing: N/A

Accessvia:AecDisplaySet.DisplayRepresentationsAecBaseDatabase.DisplayRepresentationsAecBaseDocument.DisplayRepresentations

Methods

Append

Has

Item

Remove

Properties

Count

Owner

Events

Page 87: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Edit-In-PlaceProfileObject

In-placeeditprofileobject.

VBAobjectname: AecEditInPlaceProfile

Createusing: AddCustomObject("AecEditInPlaceProfile")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Properties

Application

Description

Document

Page 88: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Handle

HasExtensionDictionary

Hyperlinks

InsertionPoint

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Profile

ProfileStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 89: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecEntityObject

BaseclassforallAECentities.

VBAobjectname: AecEntity

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

AlthoughAecEntitycanbeusedasagenericreferencetoanyAECobject,itisbettertouseAecGeoasagenericAECobjectreference.AecGeoisthegreatestcommondominatorforallAECobjects.

Methods

ArrayPolar

ArrayRectangular

Properties

Application

Color

Page 90: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Copy

Delete

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Color

Description

Document

Handle

HasExtensionDictionaryHyperlinks

Layer

Linetype

LinetypeScale

Lineweight

ObjectID

ObjectName

OwnerID

PlotStyleName

TrueColor

Visible

Events

Modified

Page 91: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecEntityReferenceObject

Areferencetoanyentityinthedrawing,similartoablockreference.

VBAobjectname: AecEntRef

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

Properties

Application

Color

Description

Page 92: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

Offset

OwnerID

PlotStyleName

Rotation

ScaleX

ScaleY

ScaleZ

TrueColor

Events

Modified

Page 93: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseOffset

Visible

Page 94: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecGeoObject

Provideslocation,rotationandanchoringcapabilitiesforAECentities.

VBAobjectname: AecGeo

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

UseAecGeoasagenericreferencetoAECobjects.

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Properties

Application

Color

Description

Page 95: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Description

Document

Handle

HasExtensionDictionary

HyperlinksLayer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 96: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GridAssemblyObject

Baseclassforgridassemblies.

VBAobjectname: AecGridAssembly

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

YoucanuseAecGridAssemblyasagenericreferencetogrids,butnopropertiesormethodsspecifictogridsarecurrentlyexposedthroughthisobject.

Methods

ArrayPolarProperties

Page 97: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

Properties

Application

Color

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 98: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TransformBy

Update

Page 99: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyObject

Layerkeydefinition,whichspecifiesthelayerpropertiesgeneratedfromaparticularkey.

VBAobjectname: AecLayerKey

Createusing: AecLayerKeys.Add

Accessvia: AecLayerKeys.Item

Methods

Properties

Color

Description

Index

Layer

LayerKeyStyle

Linetype

Page 100: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

None Linetype

LineWeight

Name

PlotStyleName

PlottableRemoveable

Page 101: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeysCollectionObject

Thecollectionoflayerkeydefinitionsinalayerkeystyle.

VBAobjectname: AecLayerKeys

Createusing: N/A

Accessvia: AecLayerKeyStyle.Keys

Methods

Add

Item

Remove

Properties

Count

LayerKeyStyle

Page 102: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStyleObject

Acollectionoflayerkeys.

VBAobjectname: AecLayerKeyStyle

Createusing: N/A

Accessvia: AecLayerKeyStyles.Item

Methods

Delete

ExpandKey

Properties

AlternateName

Application

Description

Document

Handle

Page 103: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExpandKey

GenerateLayer

GetExtensionDictionary

GetXData

SetXData

HasExtensionDictionary

Keys

Name

ObjectID

ObjectName

OverridesEnabled

OverrideSettings

OwnerID

Events

Modified

Page 104: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStylesCollection

Thecollectionoflayerkeystylesinthespecifieddrawing.

VBAobjectname: AecLayerKeyStyles

Createusing: N/A

Accessvia: AecBaseDatabase.LayerKeyStyles

Methods

Add

Delete

GetExtensionDictionary

GetXData

Has

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Events

Modified

Page 105: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Item

Remove

SetXData

ObjectID

ObjectName

OwnerID

Page 106: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyOverrideSettingObject

Alayerkeystyleoverridesetting.

VBAobjectname: AecLayerOverrideSetting

Createusing: N/A

Accessvia: AecLayerOverrideSettings.Item

Methods

None

Properties

Index

LayerKeyStyle

Name

Value

Page 107: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStyleOverrideSettingsCollection

Thecollectionofoverridesettingsinalayerkeystyle.

VBAobjectname: AecLayerOverrideSettings

Createusing: N/A

Accessvia: AecLayerKeyStyle.OverrideSettings

Methods

Item

Properties

Count

LayerKeyStyle

Page 108: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutCurveObject

Asingledimensionalgridwithnodesalongasinglecurve.

VBAobjectname: AecLayoutCurve

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

YoucannotcreateanewlayoutcurvethroughActiveX,andmanypropertiesofthisobjectarenotyetexposed.

Methods

Properties

Application

Color

Page 109: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayPolar

ArrayRectangular

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

Count

Description

Document

EndOffset

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Nodes

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

Spacing

Events

Modified

Page 110: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetXData

TransformBy

Update

StartOffset

TrueColor

Type

Value

Visible

Page 111: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutCurveNodeObject

Anodeinalayoutcurve.

VBAobjectname: AecLayoutCurveNode

Createusing: N/A

Accessvia: AecLayoutCurveNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutCurve

Spacing

Page 112: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutCurveNodesCollection

Thecollectionofnodesinalayoutcurve.

VBAobjectname: AecLayoutCurveNodes

Createusing: N/A

Accessvia: AecLayoutCurve.Nodes

Youcanaccessthemembersofthecollection,buttheycurrentlycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutCurve

Events

None

Page 113: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DObject

LayoutgridentityusedtolayoutanyAECobjectwithina2Dgrid.

VBAobjectname: AecLayoutGrid2D

Createusing: AddCustomObject("AecLayoutGrid2D")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Properties

Angle

Application

BayAngle

Page 114: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

ClosestNode

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Boundary

Color

Depth

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

InsideRadius

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

Events

Modified

Page 115: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Shape

TrueColor

Visible

Width

XCount

XEndOffset

XNodes

XSpacing

XStartOffset

XType

YCount

YEndOffset

YNodes

YSpacing

YStartOffset

YType

ZCount

ZSpacing

Page 116: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DNodeObject

Anodeina2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DNode

Createusing: N/A

Accessvia: AecLayoutGrid2DNodes.Item(Butseenotebelow.)

Thisobjectisnotcurrentlyaccessible.Youcanaccess2DnodeobjectsthroughAecLayoutGrid2DXNodeandAecLayoutGrid2DYNode,butmostoftheirpropertiesarenotexposed.

Methods

None

Properties

Index

LayoutGrid2D

Spacing

Events

None

Page 117: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Spacing

Page 118: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DNodesCollection

Thecollectionofnodesina2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DNodes

Createusing: N/A

Accessvia: N/A

Thiscollectionisnotaccessible.UseAecLayoutGrid2DXNodesandAecLayoutGrid2DYNodesinstead.

Methods

Item

Properties

Count

LayoutGrid2D

Events

None

Page 119: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DXNodeObject

AnodealongtheXaxisofa2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DXNode

Createusing: N/A

Accessvia: AecLayoutGrid2DXNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutGrid2D

Spacing

Events

None

Page 120: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DXNodesCollection

CollectionofnodesalongtheXaxisofa2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DXNodes

Createusing: N/A

Accessvia: AecLayoutGrid2D.XNodes

Youcanaccessthemembersofthiscollection,buttheycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutGrid2D

Events

None

Page 121: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DYNodeObject

AnodealongtheYaxisofa2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DYNode

Createusing: N/A

Accessvia: AecLayoutGrid2DYNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutGrid2D

Spacing

Events

None

Page 122: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DYNodesCollection

CollectionofnodesalongtheYaxisofa2Dlayoutgrid.

VBAobjectname: AecLayoutGrid2DYNodes

Createusing: N/A

Accessvia: AecLayoutGrid2D.YNodes

Youcanaccessthemembersofthiscollection,buttheycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutGrid2D

Events

None

Page 123: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DObject

Alayoutvolumeforarrangingobjectsina3Dgrid.

VBAobjectname: AecLayoutGrid3D

Createusing: AddCustomObject("AecLayoutGrid3D")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Properties

Application

Color

Depth

Page 124: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

Description

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Width

Events

Modified

Page 125: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

XCount

XEndOffset

XNodes

XSpacing

XStartOffset

XType

YCount

YEndOffset

YNodes

YSpacing

YStartOffset

YType

ZCount

ZEndOffset

ZNodes

ZSpacing

ZStartOffset

ZType

Page 126: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DNodeObject

Anodeofa3DLayoutGrid.

VBAobjectname: AecLayoutGrid3DNode

Createusing: N/A

Accessvia: AecLayoutGrid3DNodes.Item(Butseenotebelow.)

Thisobjectisnotcurrentlyaccessible.Youcanaccess3DnodeobjectsthroughAecLayoutGrid3DXNodeandAecLayoutGrid3DYNode,butmostoftheirpropertiesarenotexposed.

Methods

None

Properties

Index

LayoutGrid3D

Spacing

Events

None

Page 127: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Spacing

Page 128: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DNodesCollection

Thecollectionofnodesina3Dlayoutgrid.

VBAobjectname: AecLayoutGrid3DNodes

Createusing: N/A

Accessvia: N/A

Thiscollectionisnotaccessible.UseAecLayoutGrid3DXNodesandAecLayoutGrid3DYNodesinstead.

Methods

Item

Properties

Count

LayoutGrid3D

Events

None

Page 129: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DXNodeObject

AnodealongtheXaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DXNode

Createusing: N/A

Accessvia: AecLayoutGrid3DXNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutGrid3D

Spacing

Events

None

Page 130: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DXNodesCollection

CollectionofnodesalongtheXaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DXNodes

Createusing: N/A

Accessvia: AecLayoutGrid3D.XNodes

Youcanaccessthemembersofthiscollection,buttheycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutGrid3D

Page 131: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DYNodeObject

AnodealongtheYaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DYNode

Createusing: N/A

Accessvia: AecLayoutGrid3DYNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutGrid3D

Spacing

Events

None

Page 132: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DYNodesCollection

CollectionofnodesalongtheYaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DYNodes

Createusing: N/A

Accessvia: AecLayoutGrid3D.YNodes

Youcanaccessthemembersofthiscollection,buttheycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutGrid3D

Page 133: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DZNodeObject

AnodealongtheZaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DZNode

Createusing: N/A

Accessvia: AecLayoutGrid3DZNodes.Item

MostnodepropertieshavenotbeenexposedthroughActiveX.

Methods

None

Properties

Index

LayoutGrid3D

Spacing

Page 134: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DZNodesCollection

CollectionofnodesalongtheZaxisofalayoutvolume.

VBAobjectname: AecLayoutGrid3DZNodes

Createusing: N/A

Accessvia: AecLayoutGrid3D.ZNodes

Youcanaccessthemembersofthiscollection,buttheycontainnousefulinformation.

Methods

Item

Properties

Count

LayoutGrid3D

Page 135: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutNodeObject

Providescommonpropertiessharedbyalltypesoflayoutnodes.

VBAobjectname: AecLayoutNode

Createusing: N/A

Accessvia: AecLayoutNodes.Item

Methods

None

Properties

SpacingEvents

None

Page 136: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutNodesCollection

Collectionoflayoutnodes.

VBAobjectname: AecLayoutNodes

Createusing: N/A

Accessvia: AecLayoutCurve.Nodes

Methods

Item

Properties

Count

Page 137: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutToolObject

Providescommonfunctionalityforlayoutcurveandlayoutgridobjects.

VBAobjectname: AecLayoutTool

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

AecLayoutToolcanbeusedasagenericreferencetolayoutobjects.

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Properties

Application

Color

Page 138: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Color

Description

Document

Handle

HasExtensionDictionaryHyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 139: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaskBlockObject

Aninstanceofamaskblock,atwo-dimensionalblockthatcoverspartofanAECobjectinaplan(2D)view.

VBAobjectname: AecMaskBlockRef

Createusing: Modelspace.AddCustomObject("AecMaskBlockRef")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

Properties

Application

Color

CutProfile

Page 140: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

ScaleX

ScaleY

ScaleZ

Style

Events

Modified

Page 141: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StyleName

TrueColor

Visible

Page 142: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaskBlockStyleObject

Definesthepropertiesofamaskblockobject.

VBAobjectname: AecMaskBlockStyle

Createusing: AecMaskBlockStyles.Add("Name")

Accessvia: AecMaskBlockStyles.Item

MostmaskblockstylepropertiesarenotyetexposedthroughActiveX.

Methods

Delete

Properties

AlternateName

Application

Description

DocumentEvents

Page 143: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetExtensionDictionary

GetXData

SetXData

Handle

HasExtensionDictionary

Name

ObjectID

ObjectNameOwnerID

Events

Modified

Page 144: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaskBlockStylesCollection

Thecollectionofmaskblockstylesinthespecifieddrawing.

VBAobjectname: AecMaskBlockStyles

Createusing: N/A

Accessvia: AecBaseDatabase.MaskBlocks

Useofthiscollectionismostlylimitedtolistingthenameanddescriptionofthestyles.

Methods

Add

Delete

GetExtensionDictionary

GetXData

Properties

Application

Count

Document

HandleEvents

Page 145: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

Has

Item

Remove

SetXData

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Modified

Page 146: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassElementObject

Anobjectthathasbehaviorsbasedonitsshape.

VBAobjectname: AecMassElement

Createusing: AddCustomObject("AecMassElement")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Properties

Application

Color

Depth

Page 147: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

Delete

ExportFreeForm

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

ImportFreeForm

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Description

Deviation

Document

Handle

HasExtensionDictionary

Height

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

MassGroup

MassGroupName

Normal

ObjectID

ObjectName

Operation

OwnerID

PlotStyleName

Events

Modified

Page 148: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Profile

ProfileStyle

ProfileStyleName

Radius

Rise

Rotation

Style

StyleName

Subtype

TrueColor

Type

Visible

Volume

Width

Page 149: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassElementStyleObject

Definesthepropertiesofamasselementobject.

VBAobjectname: AecMassElementStyle

Createusing: AecMassElementStyles.Add("Name")

Accessvia: AecMassElementStyles.Item

Methods

Delete

GetExtensionDictionary

Properties

AlternateName

Application

Description

Document

HandleEvents

Modified

Page 150: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

SetXData

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Modified

Page 151: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassElementStylesCollection

Thecollectionofmasselementstylesinthespecifieddrawing.

VBAobjectname: AecMassElementStyles

Createusing: N/A

Accessvia: AecBaseDatabase.MassElementStyles

Methods

Add

Delete

GetExtensionDictionary

GetXData

Has

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Events

Modified

Page 152: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Item

Remove

Rename

SetXData

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Page 153: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupObject

Agroupofmasselementscombinedtoformacomplexshape.

VBAobjectname: AecMassGroup

Createusing: AecMassGroups.Add

Accessvia: AecMassGroups.Item

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

Properties

Application

Color

Description

Document

Handle

HasExtensionDictionary

Page 154: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Delete

ExportFreeForm

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

MassGroup

MassGroupName

Name

Normal

ObjectID

ObjectName

Operation

OwnerID

PlotStyleName

Rotation

SupportsAnchoring

TrueColor

Visible

Volume

Events

Modified

Page 155: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupsCollection

Thecollectionofmassgroupsinthespecifieddrawing.

VBAobjectname: AecMassGroups

Createusing: N/A

Accessvia: AecBaseDatabase.MassGroups

Methods

Item

Properties

Count

Database

Page 156: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecMVBlockDisplayRepDefObject

Adisplayrepresentationdefinitionforamulti-viewblockstyle.

VBAobjectname: AecMVBlockDisplayRepDef

Createusing: N/A

Accessvia: AecMVBlockDisplayRepDefs.Item

Methods

Properties

DisplayName

Index

Owner

ViewBlockDefs

Events

Page 157: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecMVBlockDisplayRepDefsCollection

Thecollectionofdisplayrepresentationdefinitionsforamulti-viewblockstyle.

VBAobjectname: AecMVBlockDisplayRepDefs

Createusing: N/A

Accessvia: AecMVBlockStyle.DisplayRepDefs

Methods

Item

Properties

Count

Owner

Events

Page 158: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Multi-ViewBlockObject

Aninstanceofablockthatcanhavedifferentrepresentationsindifferentviewdirections.

VBAobjectname: AecMVBlockRef

Createusing: AddCustomObject("AecMVBlockRef")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

Properties

Application

Color

Description

Page 159: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayPolar

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

ScaleX

ScaleY

ScaleZ

Style

StyleName

Events

Modified

Page 160: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Update TrueColor

ViewBlocks

Visible

Page 161: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Multi-ViewBlockStyleObject

Definesthepropertiesofamulti-viewblockobject.

VBAobjectname: AecMVBlockStyle

Createusing: AecMVBlockStyles.Add("Name")

Accessvia: AecMVBlockStyles.Item

Mostmulti-viewblockstylepropertiesarenotyetexposedthroughActiveX.

Methods

Properties

AlternateName

Application

Description

DisplayRepDefs

Page 162: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

DisplayRepDefs

Document

Handle

HasExtensionDictionary

InterferenceBlockName

Name

ObjectID

ObjectName

OwnerID

Events

Modified

Page 163: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Multi-ViewBlockStylesCollection

Thecollectionofmulti-viewblockstylesinthespecifieddrawing.

VBAobjectname: AecMVBlockStyles

Createusing: N/A

Accessvia: AecBaseDatabase.MVBlockStyles

Useofthiscollectionismostlylimitedtolistingthenameanddescriptionofthestyles.

Methods

Add

Delete

GetExtensionDictionary

GetXData

Properties

Application

Count

Document

HandleEvents

Page 164: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXData

Has

Item

Remove

SetXData

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Modified

Page 165: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecObjectObject

ProvidescommonfunctionalityforAECdatabaseobjects.

VBAobjectname: AecObject

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

AlthoughAecObjectcanbeusedasagenericreferencetoAECobjects,itisbettertouseAecGeoasagenericreference.AecGeoisthegreatestcommondominatorforallAECobjects.

Methods

Properties

Application

Description

Page 166: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

Delete

GetExtensionDictionary

GetXData

SetXData

Description

Document

Handle

HasExtensionDictionary

ObjectID

ObjectName

OwnerID

Events

Modified

Page 167: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AECPolygonObject

AnAecPolygonobject.

VBAobjectname: AecPolygon

Createusing: Modelspace.AddCustomObject("AecPolygon")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

YoucanmodifyexistingAECPolygonobjects.AlthoughyoucancreateAECPolygons,youcannotcontrolthenumberorlengthofitssides,soit'snotveryuseful.

Methods

ArrayPolar

Properties

Application

Color

Page 168: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Profile

Rotation

Style

StyleName

TrueColor

Events

Modified

Page 169: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Visible

Page 170: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AECPolygonStyleObject

DefinesthepropertiesofanAecPolygonobject.

VBAobjectname: AecPolygonStyle

Createusing: AecPolygonStyles.Add("Name")

Accessvia: AecPolygonStyles.Item

Methods

Delete

Properties

AlternateName

Application

Description

Document

EdgeWidthEvents

Page 171: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetExtensionDictionary

GetXData

SetXData

EdgeWidthJustify

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Events

Modified

Page 172: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AECPolygonStylesCollection

ThecollectionofAecPolygonstylesinthespecifieddrawing.

VBAobjectname: AecPolygonStyles

Createusing: N/A

Accessvia: AecBaseDatabase.PolygonStyles

Methods

Add

Delete

GetExtensionDictionary

GetXData

Has

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Events

Modified

Page 173: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Item

Remove

SetXData

ObjectID

ObjectName

OwnerID

Page 174: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileObject

Definesthepropertiesofaprofilestyle.

VBAobjectname: AecProfile

Createusing: NewAecProfile

Accessvia: AecProfileStyle.Profile

Methods

Add

Clear

CopyFrom

Intersect

ScaleXY

Properties

Area

Bounds

Centroid

Coordinates

Rings

Perimeter

Page 175: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Subtract SelfIntersects

Valid

Page 176: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyleObject

Acustomshapedefinedbytwo-dimensionalclosedpolylines.

VBAobjectname: AecProfileStyle

Createusing: AecProfileStyles.Add("Name")

Accessvia: AecProfileStyles.Item

Note:Profilesareinsertedintodrawingsaspolylines,notasAECobjects.

Methods

Delete

Properties

AlternateName

Application

Description

Document

Handle

Page 177: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetExtensionDictionary

GetXData

SetXData

Handle

HasExtensionDictionary

Name

ObjectID

ObjectName

OwnerID

Profile

Events

Modified

Page 178: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStylesCollection

Thecollectionofprofilestylesinthespecifieddrawing.

VBAobjectname: AecProfileStyles

Createusing: N/A

Accessvia: AecBaseDatabase.ProfileStyles

Methods

Add

Delete

GetExtensionDictionary

GetXData

Has

Properties

Application

Count

Document

Handle

HasExtensionDictionary

Events

Modified

Page 179: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Item

Remove

SetXData

ObjectID

ObjectName

OwnerID

Page 180: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecRingObject

Aclosedloopofpolylinesegments,oftenusedasagroupinsideanAecProfileobject.

VBAobjectname: AecRing

Createusing: AecRings.Add

Accessvia: AecRings.Item

Methods

Clear

Contains

CopyFrom

FromPoints

FromPolyline

Properties

Coordinates

Index

Profile

Valid

Void

Page 181: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecRingsCollection

ThecollectionofringsinanAecProfileobject.

VBAobjectname: AecRings

Createusing: N/A

Accessvia: AecProfile.Rings

Methods

Add

Item

Remove

Properties

Count

Profile

Page 182: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SliceObject

SliceofamassinggrouporanyAECobject,typicallyusedtogeneratefloorplatesandspaceboundaries.

VBAobjectname: AecSlice

Createusing: AddCustomObject("AecSlice")

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

Methods

ArrayPolar

ArrayRectangular

AttachAnchor

Properties

Application

Area

Color

Page 183: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Update

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlaneDepth

PlaneWidth

PlotStyleName

Profile

Rotation

TrueColor

Events

Modified

Page 184: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Visible

Page 185: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecViewBlockObject

Viewblockusedfordisplayrepresentationsbyamulti-viewblock.

VBAobjectname: AecViewBlock

Createusing: N/A

Accessvia: AecViewBlocks.Item

Methods

None

Properties

Index

MVBlockRef

Name

XOffset

YOffset

Events

None

Page 186: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZOffset

Page 187: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecViewBlocksCollection

Acollectionofviewblocksusedfordisplayrepresentationsbyamulti-viewblock.

VBAobjectname: AecViewBlocks

Createusing: N/A

Accessvia: AecMVBlockRef.ViewBlocks

Youcannotaddnewviewblocks.

Methods

Item

Properties

Count

MVBlockRef

Page 188: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecViewBlockDefObject

Aviewblockdefinitionforamulti-viewblockdisplayrepresentationdefinition.

VBAobjectname: AecViewBlockDef

Createusing: N/A

Accessvia: AecViewBlockDefs.Item

Methods

Properties

Block

Index

Owner

ViewDirection

Events

Page 189: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecViewBlockDefsCollection

Thecollectionofviewblockdefinitionsforamulti-viewblockdisplayrepresentationdefinition.

VBAobjectname: AecViewBlockDefs

Createusing: N/A

Accessvia: AecMVBlockDisplayRepDef.ViewBlockDefs

Methods

Add

Item

Remove

Properties

Count

Owner

Events

Page 190: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeLayoutToolObject

Providesstandardfunctionalityforall3Dlayouttools.

VBAobjectname: AecVolumeLayoutTool

Createusing: N/A

Accessvia:

ModelSpace.ItemPaperSpace.ItemBlock.ItemSelectionSet.ItemGroup.Item

AecVolumeLayoutToolcanbeusedasagenericreferenceto3Dlayout(volume)gridobjects,butyouwouldnormallyuseAecLayoutGrid3D.

Methods

ArrayPolar

ArrayRectangularProperties

Page 191: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangular

AttachAnchor

ClosestNode

Copy

Delete

GetAnchor

GetBoundingBox

GetExtensionDictionary

GetXData

Highlight

IntersectWith

Mirror

Mirror3D

Move

NodeLocation

ReleaseAnchor

Rotate

Rotate3D

ScaleEntity

SetXData

TransformBy

Application

Color

Description

Document

Handle

HasExtensionDictionary

Hyperlinks

Layer

Linetype

LinetypeScale

Lineweight

Location

Normal

ObjectID

ObjectName

OwnerID

PlotStyleName

Rotation

TrueColor

Visible

Events

Modified

Page 192: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Update

Page 193: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AllDrawingObjects

AlloftheseobjectscanbedefinedasanAcadEntityobject.AecAnchorEntToGridAssembly AecAnchor AecAnchorEntToCurve

AecAnchorEntToLayoutCell AecAnchorEntToLayoutNode

AecAnchorEntToLayoutVolume

AecAnchorLeadEntToNode AecAnchorToRef AecBlockRefAecCamera AecCellLayoutTool AecClipVolAecClipVolRes AecDictionary AecDictRecordAecEntity AecEntRef AecGeoAecGridAssembly AecLayoutGrid2D AecLayoutGrid3DAecLayerKeyStyle AecLayerKeyStyles AecLayoutToolAecMaskBlockRef AecMaskBlockStyle AecMaskBlockStylesAecMassElement AecMassGroup AecMVBlockStyleAecMVBlockStyles AecObject AecPolygonAecPolygonStyle AecPolygonStyles AecProfileStyleAecProfileStyles AecSlice AecVolumeLayoutTool

Page 194: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Methods

image image image image image image image image image image image image image image image image image image image image image image image image image image

A

AddAddsanobjecttoacollection,oraddstwoAecProfileobjects.

ArrayPolarCreatesapolararrayofobjectsgivenaNumberOfObjects,AngleToFill,andCenterPoint.

ArrayRectangularCreatesa2Dor3Drectangulararrayofobjects.

AttachAnchorAttachesananchortoanAECEntity

AttachEntityAnchorsoneAecGeoobjecttoanother.

B

C

ClearClearsAecRingsandAecProfilesofsegmentsorrings.

ClosestNodeReturnstheindexofthenodeclosesttoagivenpoint.

ContainsTeststoseeifaringisinsideanotherring.

ConvertToCurrentAreaDisplayConvertsanareavalueusingtheLinearUnitandAreaDisplayUnitsettings.

ConvertToCurrentVolumeDisplayConvertsavolumevalueusingtheLinearUnitandVolumeDisplayUnitsettings.

CopyDuplicatesthegivenobjecttothesamelocation.

CopyFromCopiesAecRingsandAecProfiles.

Page 195: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyObjectsDuplicatesmultipleobjects(deepcloning).

D

DeleteDeletesthespecifiedobject.

E

ExpandKeyCalculatesandreturnstheLayerNamethatwouldbegeneratedgiventhesupplied'Key'.

ExportFreeFormExportsaFreeFormrepresentationtoafile.

F

FromPointsMakesaringfrom2DPoints.

FromPolylineMakesaringfroma2DPolyline.

G

GenerateLayerGeneratethelayerrecord,givenaLayerKey.

GetAnchorReturnstheanchorattachedtoanobject.

GetBoundingBoxGetstwopointsofaboxenclosingthespecifiedobject.

GetExtensionDictionaryGetstheextensiondictionaryassociatedwithanobject.

GetXdataGetstheextendeddata(XData)associatedwithanobject.

H

HandleToObjectGetstheobjectthatcorrespondstothegivenhandle.

HasDeterminesifanobjectisamemberofthespecifiedcollection.

HighlightSetsthehighlightstatusforthegivenobject,orforallobjectsinagivenselectionset.

Page 196: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

I

ImportFreeFormImportsaFreeFormrepresentationfromafile.

InitInitializationfunctionwhichmustbecalledbeforetheAECdatabaseobjectcanbeaccessed

IntersectBooleanIntersectsanAecProfilewiththecurrentAecProfile.

IntersectWithGetsthepointswhereoneobjectintersectsanotherobjectinthedrawing.

ItemReturnsamemberobjectofacollection.

J

K

L

M

MirrorCreatesamirrorimagecopyofaplanarobjectaroundanaxis.

Mirror3dCreatesamirrorimageofthegivenobjectaboutaplane.

MoveMovesanobjectalongavector.

N

NodeLocationReturnsthelocationofthenodeatagivenindex.

O

ObjectIDToObjectGetstheobjectthatcorrespondstothegivenobjectID.

P

Q

R

Page 197: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ReleaseAnchorRemovesananchorfromanobject.

RemoveRemovesanitemfromacollection.

RenameRenamesaniteminanAecDictionary.

RotateRotatesanobjectaroundabasepoint.

Rotate3dRotatesanobjectarounda3Daxis.Point1andPoint2definethelinethatbecomestheaxisofrotation.

S

SaveAsDefaultSavestheDatabasePreferencestotheregistry.

ScaleEntityScalesanobjectequallyinthe

ScaleXYScalesaprofileintheXandYdirections.

SetXdataSetstheextendeddata(XData)associatedwithanobject.

SubtractSubtractsanAecProfilefromthecurrentAecProfile.

T

TransformByMoves,scales,orrotatesanobjectgivena4x4transformationmatrix.

U

UpdateUpdatestheobjectinthedrawingwindow.

V

W

X

Y

Z

Page 198: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AddMethodAddsanobjecttoacollection,oraddstwoAecProfileobjects.

SeeAlso|Example

Signatures:Overview

LayerKeys,LayerKeyStyles,MaskBlockStyles,MassElementStyles,Multi-viewBlockStyles,PolygonStyles,ProfileStyles,DisplayConfigurations,DisplaySets

RetVal=collection.Add(Name)

Profilesobject.Add(profile)

RingsRetVal=collection.Add()

ViewBlockDefsRetVal=collection.Add(AcadBlock)

Signatures:Detail

RetVal=collection.Add(Name)

Page 199: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

collectionAecLayerKeys,AecLayerKeyStyles,AecMassElementStyles,AecMaskBlockStyles,AecMVBlockStyles,AecPolygonStyles,AecProfileStyles,AecDisplayConfigurations,AecDisplaySets,AecViewBlockDefsThecollectiontheobjectisbeingaddedto.

NameString;input-onlyNameoftheobjecttobeaddedtothecollection.

RetValAecLayerKey,AecLayerKeyStyle,AecMaskBlockStyle,AecMassElementStyle,AecMVBlockStyle,AecPolygonStyle,AecProfileStyle,AecDisplayConfigurations,AecDisplaySets,AecViewBlockDefsThenewlyaddedobject.

object.Add(profile)

objectAecProfileTheprofileyouareaddinganewprofileobjectto.

profileAecProfile;input-onlyAecProfiletoaddtothefirstAecProfile

RetVal=collection.Add()

collectionAecRingsThecollectionyouareaddinganewringdefinitionto.

Page 200: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RetValAecRingThenewlyaddedobject.

RetVal=collection.Add(AcadBlock)

collectionAecViewBlockDefsThecollectionyouareaddinganewblockto.

AcadBlockAcadBlockobject;input-onlyTheblocktoaddtothecollection.

RetValAecViewBlockDefThenewlycreatedviewblockdefinitionobject.

Page 201: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AppendMethodAppendsanexistingdisplayrepresentationtothecollection.

SeeAlso|Example

Signature

object.AppendDisplayRepresentation

ObjectAecDisplayRepresentationsTheobjectorobjectsthismethodappliesto.

DisplayRepresentationAecDisplayRepresentation;input-onlyThedisplayrepresentationtoaddtothecollection.

Remarks

Thismethodappliestoadisplayrepresentationscollectioninadisplayset.

Page 202: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayPolarMethodCreatesapolararrayofobjectsgivenaNumberOfObjects,AngleToFill,andCenterPoint.

SeeAlso|Example

Signature

RetVal=object.ArrayPolar(NumberOfObjects,AngleToFill,CenterPoint)

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

NumberOfObjectsInteger;input-onlyThenumberofobjectstobecreatedinthepolararray.Thismustbeapositiveintegergreaterthan1.

AngleToFillDouble;input-onlyTheangletofillinradians.Apositivevaluespecifiescounterclockwiserotation.Anegativevaluespecifiesclockwiserotation.Anerrorisreturnedforananglethatequals0.

CenterPointVariant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthecenterpointforthepolararray.

Page 203: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RetValVariantArray(arrayofobjects)Thearrayofnewobjects.

Remarks

AutoCADdeterminesthedistancefromthearray'scenterpointtoareferencepointonthelastobjectselected.Thereferencepointuseddependsonthetypeofobjectpreviouslyselected.AutoCADusesthecenterpointofacircleorarc,theinsertionpointofablockorshape,thestartpointoftext,andoneendpointofalineortrace.

PolararraywithNumberOfObjects=5,AngleToFill=180,CenterPoint=0,0,0.

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 204: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangularMethodCreatesa2Dor3Drectangulararrayofobjects.

SeeAlso|Example

Signature

RetVal=object.ArrayRectangular(NumberOfRows,NumberOfColumns,NumberOfLevels,DistBetweenRows,DistBetweenColumns,DistBetweenLevels)

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

NumberOfRowsInteger;input-onlyThenumberofrowsintherectangulararray.Thismustbeapositivenumber.Ifthisnumberis1,thenNumberOfColumnsmustbegreaterthan1.

NumberOfColumnsInteger;input-onlyThenumberofcolumnsintherectangulararray.Thismustbeapositivenumber.Ifthisnumberis1,thenNumberOfRowsmustbegreaterthan1.

NumberOfLevelsInteger;input-onlyThenumberoflevelsina3Darray.

Page 205: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DistBetweenRowsDouble;input-onlyThedistancebetweentherows.Ifthedistancebetweenrowsisapositivenumber,rowsareaddedupwardfromthebaseentity.Ifthedistanceisanegativenumber,rowsareaddeddownward.

DistBetweenColumnsDouble;input-onlyThedistancebetweenthecolumns.Ifthedistancebetweencolumnsisapositivenumber,columnsareaddedtotherightofthebaseentity.Ifthedistanceisanegativenumber,columnsareaddedtotheleft.

DistBetweenLevelsDouble;input-onlyThedistancebetweenthearraylevels.Ifthedistancebetweenlevelsisapositivenumber,levelsareaddedinthepositivedirectionfromthebaseentity.Ifthedistanceisanegativenumber,levelsareaddedinthenegativedirection.

RetValVariantArray(arrayofobjects)Thearrayofnewlycreatedobjects.

Remarks

Fora2Darray,specifytheNumberOfRows,NumberOfColumns,DistBetweenRow,andDistBetweenColumns.Forcreatinga3Darray,specifytheNumberOfLevelsandDistBetweenLevelsaswell.

Arectangulararrayisconstructedbyreplicatingtheobjectintheselectionsettheappropriatenumberoftimes.Ifyoudefineonerow,youmustspecifymorethanonecolumnandviceversa.

Theobjectintheselectionsetisassumedtobeinthelowerleft-handcorner,andthearrayisgeneratedupandtotheright.Ifthedistancebetweenrowsisanegativenumber,rowsareaddeddownward.Ifthe

Page 206: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

distancebetweencolumnsisanegativenumber,thecolumnsareaddedtotheleft.

AutoCADbuildstherectangulararrayalongabaselinedefinedbythecurrentsnaprotationangle.

RectangulararraywithNumberOfRows=4,NumberOfColumns=3,DistBetweenRows=a,DistBetweenColumns=b.Thebaseentityisrepresentedinblue.

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 207: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachAnchorMethodAttachesananchortoanAECEntity.

SeeAlso|Example

Signature

object.AttachAnchoranchor

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthismethodappliesto.

anchorAecAnchor;TheanchorthatwillbeattachedThiscanbeanyoftheAECAnchorobjects.

Page 208: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachEntityMethodAnchorsanAECentitytoanAutoCADorAECentity.

SeeAlso|Example

Signature

object.AttachEntityentity

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRefTheobjectthismethodappliesto.

entityAecEntity;input-onlyTheAECentitytobeattachedtotheanchoredobject.

Remarks

AlthoughAecAnchorEntToGridAssemblyinheritstheAttachEntitymethodfromAecAnchor,itisdisabled.

Page 209: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClearMethodClearsAecRingsandAecProfilesofsegmentsorrings.

SeeAlso|Example

Signature

object.Clear()

objectAecRing,AecProfileTheobjecttobecleared.

Page 210: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClosestNodeMethodReturnstheindexofthenodeclosesttoagivenpoint.

SeeAlso|Example

Signature

RetVal=object.ClosestNode(Point)

ObjectAecCellLayoutTool,AecClipVol,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecSlice,AecVolumeLayoutToolTheobjectthismethodappliesto.

PointVariant(three-elementarrayofdoubles);input-onlyA3Dpointnearalayoutnode.

RetValLongTheindexoftheclosestnode.

Remarks

ThenodeindexisalsoreturnedbytheNodepropertyofAecAnchorEntToLayoutNode.

Page 211: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ContainsMethodTeststoseeifaringisinsideanotherring.

SeeAlso|Example

Signature

RetVal=object.Contains(Ring)

objectAecRingTheobjectthismethodappliesto.

RingAecRing;input-onlyTheAecRingtocheck.

RetValBooleanTRUE:Theringisinside.FALSE:Theringisnotinside.

Page 212: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ConvertToCurrentAreaDisplayMethodConvertsanareavalueusingtheLinearUnitandAreaDisplayUnitsettings.

SeeAlso|Example

Signature

RetVal=object.ConvertToCurrentAreaDisplay(Area)

objectDatabasePreferencesTheobjectthismethodappliesto.

AreaDouble;input-onlyTheareatoconvert.

RetValDoubleTheresultingarea.

Page 213: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ConvertToCurrentVolumeDisplayMethodConvertsavolumevalueusingtheLinearUnitandVolumeDisplayUnitsettings.

SeeAlso|Example

Signature

RetVal=object.ConvertToCurrentVolumeDisplay(Volume)

objectDatabasePreferencesTheobjectthismethodappliesto.

VolumeDouble;input-onlyThevolumetoconvert.

RetValDoubleTheresultingvolume.

Page 214: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyMethodDuplicatesthegivenobjecttothesamelocation.

SeeAlso|Example

Signature

RetVal=object.Copy

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjecttobecopied.

RetValObjectThenewlycreatedduplicateobject.

Remarks

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 215: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyFromMethodCopiesAecRingsandAecProfiles.

SeeAlso|Example

Signature

object.CopyFromSourceObject

objectAecProfile,AecRingTheobjectbeingcopiedto.

SourceObjectThesourceobjecttobecopied;inputonly

WhencopyingaProfile,thesourceobjectmustbeanAecProfileobject.

WhencopyingaRing,thesourceobjectmustbeanAecRingobject.

Page 216: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyObjectsMethodDuplicatesmultipleobjects(deepcloning).

SeeAlso|Example

Signature

RetVal=object.CopyObjects(Objects[,Owner][,IDPairs])

ObjectAecBaseDatabase,AecDatabaseTheobjectorobjectsthismethodappliesto.

ObjectsVariant(arrayofobjects);input-onlyThearrayofprimaryobjectstobecopied.Alltheobjectsmusthavethesameowner,andtheownermustbelongtothedatabaseordocumentthatiscallingthismethod.

OwnerVariant(asingleobject);input-only;optionalThenewownerforthecopiedobjects.Ifnoownerisspecified,theobjectswillbecreatedwiththesameownerastheobjectsintheObjectsarray.

IDPairsVariant(arrayofIDPairobjects);input-output;optionalInformationonwhathappenedduringthecopyandtranslationprocess.Input:anemptyvariant.Output:anarrayofIDPairobjects.

RetValVariant(arrayofobjects)Anarrayofnewlycreatedduplicateobjects.Only

Page 217: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

primaryobjectsarereturnedinthisarray.FormoreinformationonwhatoccuredduringtheCopyObjectsoperation,oralistofobjectsownedbyprimaryobjectsthatwerealsocopied,consulttheIDPairsarray.

Remarks

Tocopyobjectstoanotheropendrawing,settheOwnerparametertotheotherdrawing'smodelspace.

DuringtheCopyObjectsoperation,objectsthatareownedorreferencedbytheprimaryobjectsintheObjectsparameterwillalsobecopied.

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 218: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DeleteMethodDeletesthespecifiedobject.

SeeAlso|Example

Signature

object.Delete

objectTheobjecttobedeleted.

Page 219: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExpandKeyMethodCalculatesandreturnstheLayerNamethatwouldbegeneratedgiventhesupplied'Key'.

SeeAlso|Example

Signature

RetVal=object.ExpandKey(key)

objectAecLayerKeyStyleTheobjectthismethodappliesto.

keyString;input-onlyThekeytoconvert.

RetValString;LayerName

Remarks

IftheKeyisnotvalid,anemptystringisreturned.

Page 220: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExportFreeFormMethodExportsafreeformrepresentationtoafile.

SeeAlso|Example

Signatures:Overview

MassElementsobject.ExportFreeForm("FileName"[,CenterAtOrigin])

MassGroupsobject.ExportFreeForm("FileName")

Signatures:Detail

object.ExportFreeForm("FileName"[,CenterAtOrigin])

objectAecMassElementTheobjectbeingexported.

FileNameString;input-onlyThenameofthefiletoexportthefreeformrepresentationto.

CenterAtOriginBoolean;optionalDetermineswhethertheoriginalcoordinatesoftheboundaryrepresentationarestored,orthecoordinatesaretranslatedtoWCS.

Page 221: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TRUE:Usetheoriginalcoordinatesoftheboundaryrepresentation.FALSE:TranslatetheverticesoftheboundaryrepresentationtoWCS.

ThedefaultisTRUE.

object.ExportFreeForm("FileName")

objectAecMassGroupTheobjectbeingexported.

FileNameString;input-onlyThenameofthefiletoexportthefreeformrepresentationto.

Remarks

IfnopathisspecifiedforFileName,thefileiscreatedinthecurrentdrawing'sdirectory.Ifyoudonotspecifyafileextension,noneisadded.

Page 222: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FromPointsMethodMakesaringfrom2DPoints.

SeeAlso|Example

Signature

object.FromPoints(points)

objectAecRingTheobjectthismethodappliesto.

pointsVariant(n-elementarrayofdoubles);input-onlyListof2Dpoints.

Remarks

Theinputforthismethodtakesavariantarrayofdoublesrepresenting2Dpoints.

Page 223: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FromPolylineMethodMakesaringfroma2DPolyline.

SeeAlso|Example

Signature

object.FromPolyline(polyline)

objectAecRingTheobjectthismethodappliesto.

polylineAcadLWPolyline;input-only2Dpolylinetocopythegraphicsfrom.

Page 224: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GenerateLayerMethodGeneratethelayerrecord,givenaLayerKey.

SeeAlso|Example

Signature

RetVal=object.GenerateLayer(Key)

objectAecLayerKeyStyleTheobjectthismethodappliesto.

KeyString;input-only

RetValAcadLayerTheAcadLayerwillbecreatedifnecessary,usingthesettingsfromtheLayerStandardforName,Color,Linetype,etc.

Page 225: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetAnchorMethodReturnstheanchorattachedtoanobject.

SeeAlso|Example

Signature

RetVal=object.GetAnchor()

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjecttheanchorisattachedto.

RetValAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNode,AecAnchorToRefTheanchorattachedtotheobject.

Remarks

Page 226: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseanAecAnchorobjectasagenericreturnargument.(TheexamplecodeforthismethoddemonstrateshowtoaccessananchorattachedtoanyAECobject.)

Page 227: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetBoundingBoxMethod

Getstwopointsofaboxenclosingthespecifiedobject.

SeeAlso|Example

Signature

object.GetBoundingBoxMinPoint,MaxPoint

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

MinPointVariant(three-elementarrayofdoubles);output-onlyThe3DWCScoordinatesspecifyingtheminimumpointoftheobject'sboundingbox.

MaxPointVariant(three-elementarrayofdoubles);output-onlyThe3DWCScoordinatesspecifyingthemaximumpointoftheobject'sboundingbox.

Remarks

ThecornersarereturnedinWCScoordinateswiththeboxedgesparalleltotheWCSX,Y,andZaxes.

MaxPoint

Page 228: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MinPoint

Page 229: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetExtensionDictionaryMethodGetstheextensiondictionaryassociatedwithanobject.

SeeAlso|Example

Signature

RetVal=object.GetExtensionDictionary

ObjectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

RetValDictionary;output-onlyTheextensiondictionaryfortheobject.

Page 230: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

Ifanobjectdoesnothaveanextensiondictionary,thismethodwillcreateanewextensiondictionaryforthatobjectandreturnitinthereturnvalue.

YoucanqueryanobjecttoseeifithasanextensiondictionarybyusingtheHasExtensionDictionaryproperty.

Page 231: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXDataMethodGetstheextendeddata(XData)associatedwithanobject.

SeeAlso|Example

Signature

object.GetXDataAppName,XDataType,XDataValue

ObjectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNode,AecAnchorExtendedTagToEntAecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

AppNameString;input-onlyANULLstringwillreturnallthedataattachedtotheobject,regardlessoftheapplicationthatcreatedit.

Page 232: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Supplyinganapplicationnamewillreturnonlythedatathatwascreatedbythespecifiedapplication.

XDataTypeVariant(arrayofshorts);output-only

XDataValueVariant(arrayofvariants);output-only

Remarks

Extendeddatacanbeusedtostoreinstance-specificdatacreatedbycustomapplications.Thisdatacanbeaddedtoanyobject.Thisdatafollowstheobject'sdefinitiondata,andismaintainedintheorderthatitwassavedintothedocument.(AutoCADmaintainsthisinformation,butdoesn'tuseit.)

Page 233: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HandleToObjectMethodGetstheobjectthatcorrespondstothegivenhandle.

SeeAlso|Example

Signature

RetVal=object.HandleToObject(Handle)

ObjectAecBaseDatabase,AecDatabaseTheobjectorobjectsthismethodappliesto.

HandleString;input-onlyThehandleoftheobjecttoreturn.

RetValObjectTheobjectthatcorrespondstothegivenhandle.

Remarks

Thismethodcanonlyreturnobjectsinthecurrentdocument.

Page 234: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HasMethodDeterminesifanobjectisamemberofthespecifiedcollection.

SeeAlso|Example

Signature

RetVal=object.Has("Name")

objectAecLayerKeyStyles,AecMaskBlockStyles,AecMVBlockStyles,AecPolygonStyles,AecProfileStyles,AecDisplayRepresentationsThecollectionthismethodappliesto.

NameString;input-onlyThenameoftheobjecttocheckfor.

RetValBooleanTRUE:Collectioncontainstheobject.FALSE:Collectiondoesnotcontaintheobject.

Page 235: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HighlightMethodSetsthehighlightstatusforthegivenobject,orforallobjectsinagivenselectionset.

SeeAlso|Example

Signature

object.HighlightHighlightFlag

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

HighlightFlagBoolean;input-only

TRUE:Theobjectishighlighted.

FALSE:Theexistinghighlightisremovedfromtheobject.

Remarks

Oncethehighlightflagforanobjecthasbeenset,acalltotheUpdateorRegenmethodisrequiredtoviewthechange.

Notethatthisfunctiondoesnotreturnthecurrenthighlightstatusofanobject.

Page 236: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ImportFreeFormMethodImportsafreeformrepresentationfromafile.

SeeAlso|Example

Signature

object.ImportFreeForm("FileName"[,CenterAtLocation])

objectAecMassElementTheobjectbeingimportedto.Thismustbeafreeformmasselement(Type=aecMassElementTypeFreeForm).

FileNameString;input-onlyThenameofthefiletoimportthefreeformrepresentationfrom.

CenterAtLocationBoolean;optional.Controlswhetherthetheverticesoftheimportedboundaryrepresentationaretranslatedtotheinsertionpointofthemasselement.TRUE:Translatetheboundaryrepresentationtothemasselementinsertionpoint.FALSE:Usethecoordinatessavedwiththeexportedboundaryrepresentation.

ThedefaultisFALSE.

Page 237: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

IfnopathisspecifiedforFileName,thecurrentdrawing'sdirectoryissearched.

Page 238: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InitMethodInitializationfunctionwhichmustbecalledbeforetheAECdatabaseobjectcanbeaccessed

SeeAlso|Example

Signature

object.Init(AcadDatabaseObject)

objectAecBaseDatabase,AecBaseDatabasePreferencesTheobjectthismethodappliesto.

AcadDatabaseObjectAcadDatabase;input-onlyThedatabase.

Page 239: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IntersectMethodBooleanIntersectsanAecProfilewiththecurrentAecProfile.

SeeAlso|Example

Signature

object.Intersect(Profile)

objectAecProfileTheobjectthismethodappliesto.

ProfileAecProfile;input-onlyTheprofiletointersectwiththecurrentprofile.

Page 240: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IntersectWithMethod

Getsthepointswhereoneobjectintersectsanotherobjectinthedrawing.

SeeAlso|Example

Signature

RetVal=object.IntersectWith(IntersectObject,ExtendOption)

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

IntersectObjectObject,input-only;Thiscanbeanydrawingentityobject.

ExtendOptionAcExtendOptionenum;input-onlyThisoptionspecifiesifoneortheother,both,ornoneoftheentitiesaretobeextendedinordertoattemptanintersection.

acExtendNone Doesnotextendeitherobject.

acExtendThisEntity Extendsthebaseobject.

Page 241: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

acExtendOtherEntity Extendstheobjectpassedasanargument.

acExtendBoth Extendsbothobjects.

RetValVariant(arrayofdoubles)Thearrayofpointswhereoneobjectintersectsanotherobjectinthedrawing.

Remarks

Ifthetwoobjectsdonotintersect,nodataisreturned.Youcanrequestthepointofintersectionthatwouldoccurifoneorbothoftheobjectswereextendedtomeettheother.Forexample,supposeadrawingcontainsthethreelinesshownintheillustrationbelow.Line1isthebaseobjectfromwhichthismethodwascalledandline3istheobjectpassedasaparameter.IftheExtendOptionpassedisacExtendThisEntity,pointAisreturnedasthepointwhereline1wouldintersectline3ifline1wereextended.IftheExtendOptionisacExtendOtherEntity,nodataisreturnedbecauseevenifline3wereextended,itwouldnotintersectline1.

IftheintersectiontypeisacExtendBothEntitiesandline2ispassedastheparameterentity,pointBisreturned.IftheExtendOptionisacExtendNoneandline2istheparameterentity,nodataisreturned.

line3

line2

line1

Page 242: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ItemMethodReturnsamemberobjectofacollection.

SeeAlso|Example

Signature

RetVal=object.Item(Index)

objectAllCollections,AecDisplayConfigurations,AecDisplaySets,AecDisplayRepresentations,AecDisplayComponents,AecMVBlockDisplayRepDefs,AecViewBlockDefs,AecsConnectionNodesThecollectionthismethodappliesto.

IndexVariant;input-onlyTheindexlocationinthecollectionforthememberitemtoquery.Theindexmustbeeitheranintegerorastring.Ifaninteger,theindexmustbebetween0andN-1,whereNisthenumberofobjectsinthecollection.

RetValObject;Theobjectatthegivenindexlocationinthecollection.

Remarks

Page 243: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thismethodsupportscase-sensitivestringbasediteration.Forexample,youcouldreferencetheMulti-ViewBlockdefinitionnamed"Fixture1"throughthefollowingstatement:

SetmvBlock=cMvBlocks.Item("Fixture1")

Page 244: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MirrorMethod

Createsamirrorimagecopyofaplanarobjectaroundanaxis.

SeeAlso|Example

Signature

RetVal=object.Mirror(Point1,Point2)

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

Point1Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthefirstpointofthemirroraxis.

Point2Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthesecondpointofthemirroraxis.

RetValMirroredobjectThiscanbeanydrawingentityobject.

Remarks

Page 245: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thetwopointsspecifiedasparametersbecometheendpointsofalinearoundwhichthebaseobjectisreflected.

Selectedobject

Point1andPoint2specifyingthemirroraxis

Mirroredobject

Thismethodplacesthereflectedimageintothedrawingandretainstheoriginalobject.Toremovetheoriginalobject,usetheDeletemethod.

YoucanmirroraViewportobjectinpaperspace,althoughdoingsohasnoaffectonitsmodelspacevieworonmodelspaceobjects.

AutoCADcheckstoseeiftheobjecttobecopiedownsanyotherobject.Ifitdoes,itperformsacopyonthoseobjectsaswell.Theprocesscontinuesuntilallownedobjectshavebeencopied.

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 246: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Mirror3DMethodCreatesamirrorimageofthegivenobjectaboutaplane.

SeeAlso|Example

Signature

RetVal=object.Mirror3D(Point1,Point2,Point3)

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

Point1Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthefirstpointofthemirrorplane.

Point2Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthesecondpointofthemirrorplane.

Point3Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthethirdpointofthemirrorplane.

RetValMirroredobject

Page 247: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thisobjectcanbeanydrawingentityobject.

Remarks

Objectmirroredaboutaplanedefinedbythreepoints

AutoCADcheckstoseeiftheobjecttobecopiedownsanyotherobject.Ifitdoes,itperformsacopyonthoseobjectsaswell.Theprocesscontinuesuntilallownedobjectshavebeencopied.

NOTEYoucannotexecutethismethodwhilesimultaneouslyiteratingthroughacollection.Aniterationwillopentheworkspaceforaread-onlyoperation,whilethismethodattemptstoperformaread-writeoperation.Completeanyiterationbeforeyoucallthismethod.

Page 248: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MoveMethod

Movesanobjectalongavector.

SeeAlso|Example

Signature

object.MovePoint1,Point2

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

Point1Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthefirstpointofthemovevector.

Point2Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthesecondpointofthemovevector.

Remarks

Thetwopointsyouspecifydefineadisplacementvectorindicatinghowfarthegivenobjectistobemovedandinwhatdirection.

Page 249: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Givenobjectwithtwopointsindicated Movedobject

Page 250: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NodeLocationMethodReturnsthelocationofthenodeatagivenindex.

SeeAlso|Example

Signature

RetVal=object.NodeLocation(Node)

ObjectAecCellLayoutTool,AecClipVol,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecSlice,AecVolumeLayoutToolTheobjectthismethodappliesto.

NodeLong;input-onlyIndexofthenode.

RetValVariant(three-elementarrayofdoubles)Thelocationofthenode.

Remarks

ThenodeindexisreturnedbytheNodepropertyofAecAnchorEntToLayoutNode.

Page 251: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectIDToObjectMethodGetstheobjectthatcorrespondstothegivenobjectID.

SeeAlso|Example

Signature

RetVal=object.ObjectIDToObject(ID)

ObjectAecBaseDatabase,AecDatabaseTheobjectorobjectsthismethodappliesto.

IDLong;input-onlyTheobjectIDoftheobjecttoreturn.

RetValObjectTheobjectthatcorrespondstothegivenobjectID.

Remarks

Thismethodcanonlyreturnobjectsinthecurrentdocument.

Page 252: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ReleaseAnchorMethodRemovesananchorfromanobject.

SeeAlso|Example

Signature

object.ReleaseAnchor()

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthismethodappliesto.

Page 253: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RemoveMethodRemovesanitemfromacollection.

SeeAlso|Example

Signatures:Overview

AecDictionary,LayerKeyStyles,MaskBlockStyles,MassElementStyles,Multi-viewBlockStyles,PolygonStyles,ProfileStyles

collection.Remove(Name)

LayerKeys,Rings

collection.Remove(Index)

ViewBlockDefscollection.Remove(AcadBlock)

Signatures:Detail

object.Remove(Name)

objectAecDictionary,AecLayerKeyStyles,AecMaskBlockStyles,AecMassElementStyles,AecMVBlockStyles,AecPolygonStyles,

Page 254: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecProfileStyles,AecDisplayRepresentations,AecViewBlockDefsThecollectionthismethodappliesto.

NameString;input-onlyThenameoftheitemtoberemoved.

object.Remove(Index)

objectAecLayerKeys,AecRingsThecollectionthismethodappliesto.

IndexLong;input-onlyTheindexnumbervalueoftheitemtoremovefromthecollection.

object.Remove(AcadBlock)

objectAecViewBlockDefsThecollectionyouareremovingablockfrom.

AcadBlockAcadBlockobject;input-onlyTheblocktoremovefromthecollection.

Page 255: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RenameMethodRenamesaniteminanAecDictionary.

SeeAlso|Example

Signature

RetVal=object.Rename(OrigName,NewName)

ObjectAecDictionary,AecLayerKeyStyles,AecMaskBlockStyles,AecMassElementStyles,AecMVBlockStyles,AecPolygonStyles,AecProfileStylesTheobjectthismethodappliesto.

OrigNameString;input-onlyTheoriginalnameoftheitem.

NewNameString;input-onlyThenewnameoftheitem.

Remarks

Objectswillmaintaintheirreferencetoastyleevenifithasbeenrenamed.

Page 256: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RotateMethod

Rotatesanobjectaroundabasepoint.

SeeAlso|Example

Signature

object.RotateBasePoint,RotationAngle

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

BasePointVariant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthepointthroughwhichtheaxisofrotationisdefinedasparalleltotheZaxisoftheUCS.

RotationAngleDouble;input-onlyTheangleinradianstorotatetheobject.Thisangledetermineshowfaranobjectrotatesaroundthebasepointrelativetoitscurrentlocation.

Remarks

Page 257: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Rotate3DMethod

Rotatesanobjectarounda3Daxis.Point1andPoint2definethelinethatbecomestheaxisofrotation.

SeeAlso|Example

Signature

object.Rotate3DPoint1,Point2,RotationAngle

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

Point1Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthefirstpointoftheaxisline.

Point2Variant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthesecondpointoftheaxisline.

RotationAngleDouble;input-onlyTheangleinradianstorotatetheobjectabouttheselectedaxis.

Page 258: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

Page 259: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SaveAsDefaultMethodSavestheDatabasePreferencestotheregistry.

SeeAlso|Example

Signature

object.SaveAsDefault()

objectAecBaseDatabasePreferencesTheobjectthismethodappliesto.

Page 260: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleEntityMethod

ScalesanobjectequallyintheX,Y,andZdirections.

SeeAlso|Example

Signature

object.ScaleEntityBasePoint,ScaleFactor

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

BasePointVariant(three-elementarrayofdoubles);input-onlyThe3DWCScoordinatesspecifyingthebasepoint.

ScaleFactorDouble;input-onlyThefactorbywhichtoscaletheobject.Thedimensionsoftheobjectaremultipliedbythescalefactor.Ascalefactorgreaterthan1enlargestheobject.Ascalefactorbetween0and1reducestheobject.Thescalefactormustbegreaterthan0.0.

Remarks

Page 261: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BasePoint

ScaleFactor=0.5andScaleFactor=2

Page 262: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleXYMethodScalesaprofileintheXandYdirections.

SeeAlso|Example

Signature

object.ScaleXY(X,Y)

objectAecProfileTheobjectthismethodappliesto.

XDouble;input-onlyTheXfactortoscaleby.

YDouble;input-onlyTheYfactortoscaleby.

Page 263: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetXDataMethodSetstheextendeddata(XData)associatedwithanobject.

SeeAlso|Example

Signature

object.SetXDataXDataType,XData

ObjectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

XDataTypeVariant(arrayofshort);input-only

Page 264: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

See ExtendedDataintheDXFReferencefortheextendeddatagroupcodestospecifyforthisargument.

XDataArrayofVariant;input-only

Remarks

Extendeddatacanbeusedforstoringinstance-specificdatacreatedbycustomapplications.Thisdatacanbeaddedtoanyentity.Thisdatafollowstheentity'sdefinitiondataandismaintainedintheorderinwhichitwassavedintothedocument.(AutoCADmaintainsthisinformationbutdoesn'tuseit.)

Page 265: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubtractMethodSubtractsanAecProfilefromthecurrentAecProfile.

SeeAlso|Example

Signature

object.Subtract(Profile)

objectAecProfileTheobjectthismethodappliesto.

ProfileAecProfile;input-onlyTheprofiletosubtract.

Page 266: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TransformByMethodMoves,scales,orrotatesanobjectgivena4x4transformationmatrix.

SeeAlso|Example

Signature

object.TransformByTransformationMatrix

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

TransformationMatrixVariant(4x4arrayofdoubles);input-onlyA4x4matrixspecifyingthetransformationtoperform.

Remarks

Thefollowingtabledemonstratesthetransformationmatrixconfiguration,whereR=Rotation,andT=Translation:

R00 R01 R02 T0

R10 R11 R12 T1

R20 R21 R22 T2

Page 267: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

0 0 0 1

Thismethodwillreturnanerrorifthetransformationmatrixisnotcorrect.

Sampletransformationmatricesareprovidedintheexamplecodeforthismethod.

Page 268: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UpdateMethodUpdatestheobjectinthedrawingwindow.

SeeAlso|Example

Signature

object.Update

ObjectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthismethodappliesto.

Page 269: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Properties

image image image image image image image image image image image image image image image image image image image image image image image image image image

A

AdjustSizingSpecifiesifthesizeoftheanchoredobjectisadjustedtomatchthesizeofthegridcell.

AllowLongSymbolNamesDeterminesifsymbolnamesmayincludeextendedcharactersets,ormorethan31characters.

AllowVariationSpecifiesiftheanchoredobjectisallowedtovary.

AlternateNameTheAlternateNameoftheStyle.

AlwaysImportLayerStandardSpecifieswhethertoalwaysimportanewerlayerstandard.

AngleSpecifiestheangleofthelayoutgrid.

Angle1Deviationofcutplaneatstartingedgewherezeroisperpendiculartotheclipline.

Angle2DeviationofcutplaneatendingedgewherezeroisperpendiculartotheclipLine.

AngleFromNodeSpecifiestheanglefromtheanchoredentitytothenode.

AngularAzimuthTheformatusedtodisplayangles.

AngularDisplayFormatSpecifiestheunitusedwhenangularmeasurementsaredisplayed.

AngularPrecisionSpecifiestheangularprecisionforthedrawing.

Page 270: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ApplicationGetstheApplicationobject.

ApplyResizeSpecifiesiftheanchoredobjectisresizedwhenthelayoutcellisresized.

AreaGetstheareaofanobject.

AreaDisplayUnitTheunitusedwhenareameasurementsaredisplayed.

AreaPrecisionTheprecisiontowhichareameasurementsaredisplayed.

AreaSuffixThesuffixdisplayedafteranareaunitinthedrawing.

B

BasePointGetsandsetsthebasepointforthedrawingasanXYZ.

BasePointNEGetsandsetsthebasepointforthedrawingasanENZ.

BayAngleSpecifiesthebayangleofthelayoutgrid.

BlockBasedLayerOffBehaviorImmediateandindependentlayeron/offcontrolofdisplaycomponents.

BlocksGetstheBlockscollectionforthedrawing.

BottomOffsetSpecifiesthebottomoffsetoftheanchoredobjecttothegriditisattachedto.

BoundarySpecifiestheboundaryobjectattachedtothegrid.

BoundsGetstheupperleftandlowerrightcornersoftheprofile.

C

CellSpecifiesthegridcelltoanchortheentityto.

CenterOnNodeSpecifiesiftheanchoredobjectiscenteredonthelayoutnode.

CentroidGetsthecenterofareaormassforaprofileshape.

Page 271: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ColorSpecifiestheobject'scolor.

ContourlinesPerSurfaceSpecifiesthenumberofcontourlines(isolines)persurfaceonobjects.

CoordinatePrecisionSpecifiestheprecisiontowhichcoordinatemeasurementsaredisplayed.

CoordinatesReturnstheverticesofaringorprofile.

CountGetsthenumberofitemsinthecollection.

CreateDimscaleOverrideAutomaticallycreateadimscaleoverride.

D

DatabaseGetsthedatabaseinwhichtheobjectbelongs.

DatabaseScaleSpecifiesthedatabasescaleatwhichthehorizontalaxisofthedrawingisdisplayed.

DepthGetsorsetsthesizeofthegridormasselementinitsrelativeYdirection.

DescriptionGetsorsetstextdescribingtheAECObject.

DictionariesGetstheDictionariescollectionforthedocument.

DimStylesGetstheDimStylescollectionforthedocument.

DisplaySilhouetteControlsifsilhouettecurvesofsolidobjectsaredisplayedinWireframemode.

DocumentGetsthedocument(drawing)inwhichtheobjectbelongs.

E

EdgeWidthSpecifiestheedgewidthofthepolygonstyle.

EdgeWidthJustifySpecifieswhetheredgesaredisplayedinside,outside,orcenteredontheAECPolygonvertices.

Page 272: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationModelSpaceSpecifiestheelevationsettinginthemodelspace.

ElevationPaperSpaceSpecifiestheelevationsettinginthepaperspace.

ElevationPrecisionSpecifiestheprecisiontowhichelevationmeasurementsaredisplayedinthedrawing.

EndOffsetSpecifiestheoffsetdistancefromtheendpointofthecurve,whichmaybeusedtoreducetheeffectivelayoutcurvelength.

F

FacetDeviationSpecifiesthealloweddeviationwhenfacettingcurvedlinesandsurfaces.

FacetMaximumSpecifiesthemaximumnumberoffacetsusedforacircle.

FlipXDeterminesiftheanchoredobjectisflippedabouttheXaxisofthecurveitisanchoredto.

FlipYDeterminesiftheanchoredobjectisflippedabouttheYaxisofthecurveitisanchoredto.

FlipZDeterminesiftheanchoredobjectisflippedabouttheZaxisofthecurveitisanchoredto.

G

GroupsGetstheGroupscollectionforthedocument.

H

HandleGetsthehandleofanobject.

HasExtensionDictionaryDeterminesiftheobjecthasanextensiondictionaryassociatedwithit.

HeightSpecifiestheheightoftheobject.

HyperlinksGetstheHyperlinkscollectionforanentity.

Page 273: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

I

IndexReturnsthepositionoftheitemwithinitscollection.

InsertionPointSpecifiestheinsertionpointoftheprofile.

InsideRadiusSpecifiestheinsideradiusofthelayoutgrid.

J

K

KeysReturnsthecollectionoflayerkeysinalayerkeystyle.

L

LayerSpecifiesthelayertheobjectison.

LayerFileSpecifiesthenameofthefilecontainingdefaultlayerstandardandkeystyledefinitions.

LayerKeyStyleSpecifiesthelayerkeystylefortheobject.

LayerKeyStylesReturnsthecollectionoflayerkeystylesinthecurrentdrawing.

LayersGetstheLayerscollectionforthedocument.

LayerStandardThelayerstandardtoapplytothedrawing.

LayoutCurveProvidesaccesstolayoutcurvegeometry.

LayoutGrid2DIdentifiesthe2Dlayoutgridthatownstheobject.

LayoutGrid3DIdentifiesthe3Dlayoutgridthatownstheobject.

LayoutsGetstheLayoutscollectionforthedocument.

LeaderExtension1Specifiesthefirstleaderextension.

LeaderExtension2Specifiesthesecondleaderextension.

Page 274: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeftOffsetSpecifiestheleftoffsetfortheanchoredobject.

LimitsSpecifiesthedrawinglimits.

LinearDisplayFormatSpecifiestheformatusedtodisplaylinearmeasurementvalues.

LinearPrecisionSpecifiesthelinearprecisionforthedrawing.

LinearUnitSpecifiestheunitusedtodisplaylinearvalues.

LineTypeSpecifiesthelinetypeoftheobject.

LinetypesGetstheLinetypescollectionforthedocument.

LinetypeScaleSpecifiesthelinetypescaleofanentity.

LineWeightSpecifiesthelineweightoftheobject.

LineweightDisplaySpecifieswhetherlineweightsaredisplayedinmodelspaceforthedrawing.

LocationSpecifiestheinsertionpositionoftheobject.

LowerExtensionSpecifiesthedistanceofthelowercutplanebelowtheclipvolumeposition.

M

MaskBlockStylesReturnsthecollectionofmaskblockstylesinthespecifieddrawingdocumentordatabase.

MassElementStylesReturnsthecollectionofmasselementstylesinthespecifieddrawingdatabase.

MassGroupGetsorsetstheparentmassgroupofamasselementormassgroup.

MassGroupNameSpecifiesthemassgroupthatthemasselementorgroupiscurrentlyattachedto.

Page 275: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupsReturnsthecollectionofmassgroupsinadocumentordatabase.

MaxActiveViewportsSpecifiesthemaximumnumberofactiveviewports.

MeasurementUnitIdentifiesthesystemofunitsusedtodisplaymeasurementsinthedrawing.

ModelSpaceGetstheModelSpacecollectionforthedocument.

MVBlockRefGetsorsetsamulti-viewblockreferenceforaviewblockorcollectionofviewblocks.

MVBlockStylesReturnsthecollectionofmulti-viewblockstylesinthespecifieddocumentordatabase.

N

NameReturnsthenameoftheobject.

NodeSpecifiesthelayoutnodetheanchorattachesanobjectto.

NodesReturnsthecollectionofnodesonthelayoutcurve.

NormalSpecifiesthenormalvectoroftheAECobject.

NorthRotationSpecifiestheanglealignedtonorthwithinadrawing.

O

ObjectIDGetstheobjectIDoftheobject.

ObjectNameGetstheAutoCADclassnameoftheobject.

ObjectSortByPlottingTogglessortingofdrawingobjectsbyplottingorder.

ObjectSortByPSOutputTogglessortingofdrawingobjectsbyPostScriptoutputorder.

ObjectSortByRedrawsTogglessortingofdrawingobjectsbyredraworder.

Page 276: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByRegensTogglessortingofdrawingobjectsbyregenerationorder.

ObjectSortBySelectionTogglessortingofdrawingobjectsbyobjectselection.

ObjectSortBySnapTogglessortingofdrawingobjectsbyobjectsnap.

OffsetSpecifiestheoffsetfromthelayoutnode.

OLELaunchDetermineswhethertolaunchtheparentapplicationwhenplottingOLEobjects.

OperationSpecifieshowobjectsarecombined.

OverridesEnabledSpecifieswhetherlayeroverridesareappliedtothestylewhenalayerisgeneratedfromakey.

OverrideSettingsReturnsthecollectionoflayerkeyoverridesettingsforalayerkeystyle.

OwnerIDGetstheobjectIDoftheowner(parent)object.

P

PaperSpaceGetsthePaperSpacecollectionforthedocument.

PlotConfigurationsGetsthePlotConfigurationscollectionforthedocument.

PlotStyleNameSpecifiestheplotstylenamefortheobject.

PlottableSpecifieswhetherthelayergeneratedfromthekeyisplottable.

PolygonStylesReturnsthecollectionofpolygonstylesinthespecifieddrawingdatabase.

PreferencesReturnsthePreferencesobjectforthespecifieddrawing.

ProfileReturnsorsetstheobject'sprofile.

Page 277: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyleSpecifiestheprofilestyleofthemasselement.

ProfileStyleNameSpecifiesthenameofthemasselement'sprofilestyle.

ProfileStylesReturnsthecollectionofprofilesinthespecifieddrawingdatabase.

ProjectNameSpecifiesthenameoftheprojectthatthedrawingbelongsto.

Q

R

RadiusSpecifiestheradiusofcurvedmasselements.

ReferenceSpecifiestheobjectbeinganchoredto.

RegisteredApplicationsGetstheRegisteredApplicationscollectionforthedocument.

RemoveableSpecifieswhetheryoucanremovethelayerkeyfromthelayerkeystyle.

RenderSmoothnessSpecifiesthesmoothnessofshaded,rendered,andhiddenline-removedobjects.

ResizeOffsetSpecifiestheoffsetoftheanchoredobjecttothecellboundarywhenthecellisresized.

RightOffsetSpecifiestherightoffsetfortheanchoredobject.

RingsReturnsthecollectionofringsthatmakeuptheprofile.

RiseSpecifiestheriseofgabledmasselements.

RotationSpecifiestherotationreferenceanglefortheobject.

S

ScaleOnInsertSpecifieswhetherobjectsareautomaticallyscaledwhen

Page 278: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

insertedintothedrawing.

ScaleXSpecifiestheXdirectionscalefactoroftheinsertedblockorentity.

ScaleYSpecifiestheYdirectionscalefactoroftheinsertedblockorentity.

ScaleZSpecifiestheZdirectionscalefactoroftheinsertedblockorentity.

SegmentPerPolylineSpecifiesthenumberoflinesegmentstobegeneratedforeachpolylinecurve.

SelfIntersectsDeterminesiftheprofileisself-intersecting.

ShapeSpecifiestheshapeofthelayoutgrid.

Side1Specifiesthelengthofthecutplanealongthestartingedge.

Side2Specifiesthelengthofthecutplanealongtheendingedge.

SolidFillSpecifiesifmultilines,traces,solids,allhatches(includingsolid-fill)andwidepolylinesarefilledin.

SpacingSpecifiesthespacingbetweennodesorforanindividualnodeonalayouttool.

StartOffsetSpecifiestheoffsetdistancefromthestartpointofthecurve,whichmaybeusedtoreducetheeffectivelayoutcurvelength.

StyleSpecifiesthestyleoftheobject.

StyleNameSpecifiesthenameofthestylethatappliestotheobject.

T

TextFrameDisplayTogglesthedisplayofframesfortextobjectsinsteadofdisplayingthetextitself.

TextHeightSpecifiesthedefaultheightoftextinthedrawing.

Page 279: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextStylesGetstheTextStylescollectionforthedocument.

TopOffsetSpecifythetopoffsetfortheanchoredobject.

TrueColorReturnsthetruecoloroftheobject.

TypeForlayoutcurves,specifieshownodesarespecifiedalongthecurve;formasselements,specifiestheshapeofthemasselement.

U

UseModelExtentsDeterminesiftheheightandlowerextensionaresetautomaticallyusingmodelextents.

UseNodeCSSpecifieswhethertousethecoordinatesystemofthelayoutnode.

UserCoordinateSystemsGetstheUCSscollectionforthedocument.

V

ValidTeststhevalidityoftheobject.

ValueForlayeroverrides,specifiesthevalueofthelayerkeystyleoverride;forlayoutcurves,specifieseitherthespacingbetweennodesorthenumberofnodesonthelayoutcurve.

VerticalScaleSpecifiesthescaleatwhichtheverticalaxisofthedrawingisdisplayed(inLandDevelopmentDesktoponly).

ViewBlocksReturnsthecollectionofviewblocksusedfordisplayrepresentationsbythemulti-viewblockreference.

ViewportsGetstheViewportscollectionforthedocument.

ViewsGetstheViewscollectionforthedocument.

VisibleSpecifieswhethertheobjectorapplicationisvisible.

VoidSpecifiesifaringproducesavoidinaprofile.

Page 280: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeReturnsthevolumeofthemasselementormassgroup.

VolumeDisplayUnitSpecifiestheunitsusedtodisplayvolumemeasurements.

VolumePrecisionSpecifiesthenumberofdecimalplacesdisplayedforvolumemeasurements.

VolumeSuffixThesuffixstringaddedwhenvolumemeasurementsaredisplayedinthedrawing.

W

WidthSpecifiesthewidthoftheobject.

WindowStateSpecifiesthestateoftheapplicationordocumentwindow.

WindowTitleGetsthetitleofthedocumentwindow.

X

XCountSpecifiesthenumberofnodesalongtheXdirection.

XDistanceSpecifiesthedistancealongthecurve'sXaxistotheanchoredobject.

XEndOffsetSpecifiestheoffsetdistancefromtheendpointalongtheXdirectiongridcurve,whichmaybeusedtoreducethegridsize.

XNodesReturnsthecollectionofnodesalongtheXdirectionofthelayoutgrid.

XOffsetSpecifiestheoffsetintheXdirectionoftheviewblockwithinthemulti-viewblock.

XPositionFromSpecifiesthepositiononthecurvefromwhichtheXDistancetoananchoredobjectismeasured.

XPositionToSpecifiesthepositionontheanchoredobjecttomeasureXDistanceto.

Page 281: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRefEditDeterminesifthecurrentdrawingcanbeeditedinplacewhenbeingreferencedbyanotheruser.

XRefLayerVisibilityDeterminesthevisibilityofxref-dependentlayersandspecifiesifnestedxrefpathchangesaresaved.

XrefOverlaysUseOwnDisplayConfigWhenusedasanXrefOverlay,usethisdrawing'sdefaultdisplayconfigurationinitially.

XRotationSpecifiestherotationoftheanchoredobjectaroundtheXaxis.

XSpacingSpecifiesthespacingbetweennodesalongtheXdirectionofthelayoutgrid.

XStartOffsetSpecifiestheoffsetdistancefromthestartpointalongtheXdirectiongridcurve,whichmaybeusedtoreducethegridsize.

XTypeSpecifiestherulecontrollingnodespacingalongtheXdirection.

Y

YAlignmentSpecifiesthealignmentoftheanchoredobjectinrelationtothebaselineoftheassembly.

YCountSpecifiesthenumberofnodesalongtheydirection.

YDistanceSpecifiesthedistancealongthecurve'sYaxistotheanchoredobject.

YEndOffsetSpecifiestheoffsetdistancefromtheendpointalongtheYdirectiongridcurve,whichmaybeusedtoreducethegridsize.

YNodesReturnsthecollectionofnodesalongtheYdirectionofthelayoutgrid.

YOffsetSpecifiestheYoffsetoftheanchoredobject,ortheoffsetintheYdirectionoftheviewblockwithinthemulti-viewblock.

YPositionFromSpecifiesthepositiononthecurvefromwhichtheYDistancetoananchoredobjectismeasured.

Page 282: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YPositionToSpecifiesthepositionontheanchoredobjecttomeasureYDistanceto.

YRotationSpecifiestherotationoftheanchoredobjectaroundthelayoutnode'sYaxis.

YSpacingSpecifiesthespacingbetweennodesalongtheYdirectionofthelayoutgrid.

YStartOffsetSpecifiestheoffsetdistancefromthestartpointalongtheYdirectiongridcurve,whichmaybeusedtoreducethegridsize.

YTypeSpecifiestherulecontrollingnodespacingalongtheYdirection.

Z

ZCountSpecifiesthenumberofnodesalongtheZdirection.

ZDistanceSpecifiesthedistanceabovethecurvetotheanchoredobject.

ZEndOffsetSpecifiestheoffsetdistancefromtheendpointalongtheZdirectiongridcurve,whichmaybeusedtoreducethegridsize.

ZNodesReturnsthecollectionofnodesalongtheZdirectionofthe3Dlayoutgrid.

ZOffsetSpecifiestheoffsetintheZdirectionoftheviewblockwithinthemulti-viewblock.

ZoomSpecifiesthefocallengthofthecamera,inmillimeters.

ZPositionFromSpecifiesthepositiononthecurvefromwhichtheZDistancetoananchoredobjectismeasured.

ZPositionToSpecifiesthepositionontheanchoredobjecttomeasureZDistanceto.

ZRotationSpecifiestherotationoftheanchoredobjectaroundtheZaxis.

ZSpacingSpecifiesthespacingbetweennodesalongtheZdirectionofthelayoutgrid.

Page 283: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZStartOffsetSpecifiestheoffsetdistancefromthestartpointalongtheZdirectiongridcurve,whichmaybeusedtoreducethegridsize.

ZTypeSpecifiestherulecontrollingnodespacingalongtheZdirection.

Page 284: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ActiveSetPropertyReturnstheactivedisplaysetforthespecifiedviewport.

SeeAlso|Example

Signature

RetVal=object.ActiveSet(ViewPort)

objectAecDisplaySetsTheobjectthispropertyappliesto.

ViewPortAcadObject;input-onlyTheAcadViewportorAcadPViewportthatthedisplayconfigurationappliesto.

RetValAecDisplaySetTheactivedisplaysetforthespecifiedviewport.

Page 285: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AdjustSizingPropertySpecifieswhetheryoucanoverridethedefaultoffsetvaluesoftheanchoredobject,thuschangingitssize.

SeeAlso|Example

Signature

object.AdjustSizing

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

AdjustSizingBoolean;read-writeTRUE:Offsetscanbemodified.FALSE:Offsetscannotbemodified.

Page 286: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AllowByMaterialPropertyDeterminesiftheByMaterialpropertyshouldbeapplied.

SeeAlso|Example

Signature

object.AllowByMaterial

objectAecDisplayComponentEntityTheobjectthispropertyappliesto.

AllowByMaterialBoolean;read-write

Remarks

Thisisanadvancedsettingthatshouldrarelyneedtobechanged.

Page 287: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AllowVariationPropertySpecifiesiftheanchoredobjectisallowedtovary.

SeeAlso|Example

Signature

object.AllowVariation

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

AllowVariationBoolean;read-writeTRUE:Allowvariation.FALSE:Don'tallowvariation.

Page 288: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AlternateNamePropertyTheAlternateNameoftheStyle.

SeeAlso|Example

Signature

object.AlternateName

objectAecMaskBlockStyle,AecLayerKeyStyle,AecDictRecord,AecMVBlockStyle,AecPolygonStyle,AecProfileStyleTheobjectthispropertyappliesto.

AlternateNameString;read-writeTheAlternateNameoftheStyle.

Page 289: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AlwaysImportLayerStandardPropertySpecifieswhethertoalwaysimportanewerlayerstandard.

SeeAlso|Example

Signature

object.AlwaysImportLayerStandard

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AlwaysImportLayerStandardBoolean;read-writeSpecifieswhethertoalwaysimportanewerlayerstandard.

Page 290: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AnglePropertySpecifiestheangleofthelayoutgrid,ortheangleofthehatchpatternforadisplaycomponent.

SeeAlso|Example

Signature

object.Angle

objectAecDisplayComponentHatch,AecLayoutGrid2DTheobjectthispropertyappliesto.

AngleACAD_ANGLE;read-writeTheangleofthelayoutgrid,ortheangleofthehatchpatternforadisplaycomponent.

Page 291: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Angle1PropertyDeviationofcutplaneatstartingedgewherezeroisperpendiculartotheclipline.

SeeAlso|Example

Signature

object.Angle1

objectAecClipVolTheobjectthispropertyappliesto.

Angle1Double(radians);read-write

Remarks

Theangleisspecifiedinradians.

Page 292: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Angle2PropertyDeviationofcutplaneatendingedgewherezeroisperpendiculartotheclipLine.

SeeAlso|Example

Signature

object.Angle2

objectAecClipVolTheobjectthispropertyappliesto.

Angle2Double(radians);read-write

Remarks

Theangleisspecifiedinradians.

Page 293: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngleFromNodePropertySpecifiestheanglefromtheanchoredentitytothenode.

SeeAlso|Example

Signature

object.AngleFromNode

objectAecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

AngleFromNodeDouble;read-writeTheangle,inradians,fromtheanchoredentitytothenode.

Page 294: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularAzimuthProperty

Theformatusedtodisplayangles.

SeeAlso|Example

Signature

object.AngularAzimuth

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AngularAzimuthLong;read-write

0: UseBearings

1: UseNorthAzimuths

2: UseSouthAzimuths

Page 295: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularDisplayFormatProperty

Specifiestheunitusedwhenangularmeasurementsaredisplayed.

SeeAlso|Example

Signature

object.AngularDisplayFormat

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AngularDisplayFormatLong;read-write

0: UseDegrees

1: UseDegrees/Minutes/Seconds

2: UseGrads

3: UseRadians

4: UseSurveyor

Remarks

Page 296: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WhenyoutypedegreesatAutoCADcommandprompts,typetheminthedecimalformatindicated(DD.MMSS).Useaperiod(.)betweenthedegreevalueandtheminutesandseconds.Forexample,toenter67°45’15"typethevalueas67.4515.Ifyouusebearings,thentypethebearingquadrantfirst,andthentheangleindegrees.

Page 297: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularPrecisionPropertySpecifiestheangularprecisionforthedrawing.

SeeAlso|Example

Signature

object.AngularPrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AngularPrecisionLong;read-writeThenumberofdecimalstotherightofthedecimalpoint.

Remarks

Thisisusedtodisplayminutesandseconds.

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.AutoCADcommandsalwayscalculateallnumbersuptothehighestinternalprecision.

Page 298: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ApplicationPropertyGetstheApplicationobject.

SeeAlso|Example

Signature

object.Application

objectAllobjects.Theobjectorobjectsthispropertyappliesto.

ApplicationApplicationobject;read-only

Remarks

TheApplicationobjectrepresentstheapplication'sframecontrolsandpathsettings,andprovidesthemeanstonavigatedowntheobjecthierarchy.

Page 299: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ApplyResizePropertySpecifiesiftheanchoredobjectisresizedwhenthelayoutcellisresized.

SeeAlso|Example

Signature

object.ApplyResize

objectAecAnchorEntToLayoutVolume,AecAnchorToLayoutCellTheobjectthispropertyappliesto.

ApplyResizeBoolean;read-writeTRUE:Applyresize.FALSE:Don'tapplyresize.

Remarks

IfyouwanttosettheResizeOffsetproperty,youmustfirstsetApplyResizetoTrueinorderforthespecifiedoffsettotakeaffect.

Page 300: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaPropertyGetstheareaofanobject.

SeeAlso|Example

Signature

object.Area

objectAecProfile,AecSliceTheobjectthispropertyappliesto.

AreaDouble;read-onlyTheareaenclosedbytheobject.

Page 301: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaDisplayUnitPropertyTheunitusedwhenareameasurementsaredisplayed.

SeeAlso|Example

Signature

object.AreaDisplayUnit

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AreaDisplayUnitAecBuiltInUnitenum;read-write

Page 302: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaPrecisionPropertyTheprecisiontowhichareameasurementsaredisplayed.

SeeAlso|Example

Signature

object.AreaPrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AreaPrecisionLong;read-writeThedisplayprecisionusedforareas.

Remarks

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.

Page 303: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaSuffixPropertyThesuffixdisplayedafteranareaunitinthedrawing.

SeeAlso|Example

Signature

object.AreaSuffix

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

AreaSuffixString;read-writeThesuffixdisplayedfollowingtheareaunit.

Remarks

Thedefaultvalueis"Sq.Ft."or"m2",dependingonthevalueoftheMeasurementUnitproperty.Thevaluemustbenolongerthan255charactersinlength.

Page 304: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BasePointPropertyGetsandsetsthebasepointforthedrawingasanXYZ.

SeeAlso|Example

Signature

object.BasePoint

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

BasePointVariant(3elementarrayofdoubles);read-writeThebasepointinWCSX,Y,Z.

Remarks

SetthisvaluetoindicatetheWCSX,Y,ZthatcorrespondstothevalueoftheBasePointNEproperty.InthedefaultcoordinatesystemX,Yis0,0andtheNorthing/Eastingis0,0.

Page 305: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BasePointNEPropertyGetsandsetsthebasepointforthedrawingasanENZ.

SeeAlso|Example

Signature

object.BasePointNE

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

BasePointNEVariant(3elementarrayofdoubles);read-writeThebasepointinWCSX,Y,Z.

Remarks

SetthisvaluetoindicatetheEasting,NorthingandelevationthatcorrespondstothevalueoftheBasePointproperty.Inthedefaultcoordinatesystem,X,Yis0,0andtheNorthing/Eastingis0,0.

Page 306: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BayAnglePropertySpecifiesthebayangleofthelayoutgrid.

SeeAlso|Example

Signature

object.BayAngle

objectAecLayoutGrid2DTheobjectthispropertyappliesto.

BayAngleACAD_ANGLE;read-writeThebayangleofthelayoutgrid.

Page 307: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BlockPropertyGetsorsetstheAcadBlockfortheview.

SeeAlso|Example

Signature

object.Block

objectAecViewBlockDefTheobjectthispropertyappliesto.

BlockAcadBlock;read-write

Page 308: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BlockBasedLayerOffBehaviorPropertyImmediateandindependentlayeron/offcontrolofdisplaycomponents.

SeeAlso|Example

Signature

object.BlockBasedLayerOffBehavior

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

BlockBasedLayerOffBehaviorBoolean;read-writeImmediateandindependentlayeron/offcontrolofdisplaycomponents.

Page 309: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BlocksPropertyGetstheBlockscollectionforthedrawing.

SeeAlso|Example

Signature

object.Blocks

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

BlocksBlockscollection;read-onlyTheBlockscollectionforthedrawing.

Page 310: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BottomOffsetPropertySpecifiesthebottomoffsetoftheanchoredobject.

SeeAlso|Example

Signature

object.BottomOffset

objectAecAnchorEntToGridAssemblyTheanchorobjectthispropertyappliesto.

BottomOffsetDouble;read-writeThebottomoffsetoftheanchoredobject.(SeeRemarks.)

Remarks

TochangetheBottomOffsetvalue,youmustfirstsetAdjustSizingtoTrue.ModifyingBottomOffsetwhenAdjustSizingisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Page 311: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BoundaryPropertySpecifiestheboundaryobjectattachedtothegrid.

SeeAlso|Example

Signature

object.Boundary

objectAecLayoutGrid2DTheobjectthispropertyappliesto.

BoundaryAcadEntity;read-writeTheboundaryobjectattachedtothegrid.

Page 312: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BoundsPropertyGetstheupperleftandlowerrightcornersoftheprofile.

SeeAlso|Example

Signature

object.Bounds

objectAecProfileTheobjectthispropertyappliesto.

BoundsVariant(arrayof4doubles);read-onlyTopleft/Bottomrightcornerofprofile.

Page 313: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ByMaterialPropertySpecifiesifthedisplaypropertiesaredeterminedbythematerialassignedtothedisplaycomponent.

SeeAlso|Example

Signature

object.ByMaterial

objectAecDisplayComponentEntityTheobjectthispropertyappliesto.

ByMaterialBoolean;read-write

Page 314: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CellPropertySpecifiesthegridcelltoanchortheentityto.

SeeAlso|Example

Signature

object.Cell

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

CellLong;read-writeTheindexofthegridcelltheobjectisanchoredto.

Page 315: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CenterOnNodePropertySpecifiesiftheanchoredobjectiscenteredonthelayoutnode.

SeeAlso|Example

Signature

object.CenterOnNode

objectAecAnchorEntToLayoutVolume,AecAnchorLeadEntToNode,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutCellTheobjectthispropertyappliesto.

CenterOnNodeBoolean;read-writeTRUE:Centeronnode.FALSE:Don'tcenteronnode.

Page 316: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CentroidPropertyGetsthecenterofareaormassforaprofileshape.

SeeAlso|Example

Signature

object.Centroid

objectAecProfileTheobjectthispropertyappliesto.

CentroidVariant(two-elementarrayofdoubles);read-onlyCentroidpointoftheprofile.

Page 317: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClassNamePropertyTheclassnameoftheobject.

SeeAlso|Example

Signature

object.ClassName

objectAecDisplayRepresentationTheobjectthispropertyappliesto.

ClassNameString;read-write

Page 318: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClipVolPropertySpecifiestheclipvolumeofthe2dsection.

SeeAlso|Example

Signature

object.ClipVol

objectAec2dSectionTheobjectthispropertyappliesto.

ClipVolAecClipVol;read-write

Page 319: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ContourLinesPerSurfaceProperty

Specifiesthenumberofcontourlines(isolines)persurfaceonobjects.

SeeAlso|Example

Signature

object.ContourLinesPerSurface

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ContourLinesPerSurfaceInteger;read-writeThevalidrangeis0to2047.

Systemvariables

ThevalueofthispropertyisstoredintheISOLINESsystemvariable.

Remarks

Theinitialvalueforthispropertyis4.

AtoruswithContourLinesPerSurfacesetto4

AtoruswithContourLinesPerSurfacesetto20

Page 320: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CoordinatePrecisionPropertySpecifiestheprecisiontowhichcoordinatemeasurementsaredisplayed.

SeeAlso|Example

Signature

object.CoordinatePrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

CoordinatePrecisionLong;read-writeThenumberofdecimalstotherightofthedecimalpoint.

Remarks

ThisisusedtodisplayallNorthing/Eastingcoordinateinformation.

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.

Page 321: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CoordinatesPropertyReturnstheverticesofaringorprofile.

SeeAlso|Example

Signature

object.Coordinates

objectAecRing,AecProfileTheobjectthispropertyappliesto.

CoordinatesVariant(n-elementarrayofdoubles);read-onlyListof2Dpoints.Theverticesofthisringorprofile.

Page 322: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CountPropertyGetsthenumberofitemsinacollection,orthenumberofnodesinalayoutcurve.

SeeAlso|Example

Signature

object.Count

objectAllCollections,AecLayoutCurve,AecDisplayRepresentations,AecDisplayComponents,AecMVBlockDisplayRepDefs,AecViewBlockDefs,AecsConnectionNodesTheobjectthispropertyappliesto.

CountLong;read-onlyThenumberofitems.

Page 323: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CreateDimscaleOverridePropertyAutomaticallycreateadimscaleoverride.

SeeAlso|Example

Signature

object.CreateDimscaleOverride

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

CreateDimscaleOverrideBoolean;read-writeAutomaticallycreateadimscaleoverride.

Page 324: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CutPlaneDisplayAbovePropertyGetsorsetstheupperrangeabovethecutplanetodisplayobjects.

SeeAlso|Example

Signature

object.CutPlaneDisplayAbove

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

CutPlaneDisplayAboveDouble;read-write

Page 325: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CutPlaneDisplayBelowPropertyGetsorsetsthelowerrangebelowthecutplanetodisplayobjects.

SeeAlso|Example

Signature

object.CutPlaneDisplayBelow

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

CutPlaneDisplayBelowDouble;read-write

Page 326: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CutPlaneHeightPropertyGetsorsetstheheightofthecutplane.

SeeAlso|Example

Signature

object.CutPlaneHeight

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

CutPlaneHeightDouble;read-write

Page 327: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CutProfilePropertyReturnsthecutprofilefortheobject.

SeeAlso|Example

Signature

object.CutProfile

objectAecMaskBlockRefTheobjectthispropertyappliesto.

CutProfileAecProfile;read-only

Page 328: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DatabasePropertyGetsthedatabaseinwhichtheobjectbelongs.

SeeAlso|Example

Signature

object.Database

objectAecBaseDatabasePreferences,AecMassGroupsTheobjectorobjectsthispropertyappliesto.

DatabaseAcadDatabaseobject;read-onlyTheDatabaseobjectthatcontainstheobject.

Page 329: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DatabaseScalePropertySpecifiesthedatabasescaleatwhichthehorizontalaxisofthedrawingisdisplayed.

SeeAlso|Example

Signature

object.DatabaseScale

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

DatabaseScaleDouble;read-writeThedatabase(horizontal)scale.Forexample,fora1:200scale,type200.

Remarks

Thedatabase(horizontal)scalecontrolsthesizeofannotationplacedinthedrawing,includingtext,scaledblocksandspeciallines.Itdoesnotaffectthelinelengthsorpointcoordinatesbecausetheyarealwaysdefinedinrealworldcoordinates,nottoanyscale.Neitherdoesitaffectanydesigndatainthedrawingorprojectfiles.

IfyouchangetheDatabaseScalepropertyinthemiddleofadrawingsession,thenanyannotationaddedsubsequentlyisscaledaccordingly.

Page 330: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DepthPropertyGetsorsetsthesizeofthegridormasselementinitsrelativeYdirection.

SeeAlso|Example

Signature

object.Depth

objectAecLayoutGrid2D,AecLayoutGrid3D,AecMassElementTheobjectthispropertyappliesto.

DepthDouble;read-writeThesizeoftheobjectinitsrelativeYdirection;seeRemarks.

Remarks

Forradial2Dlayoutgrids,Depthisanangle,inradians.

Page 331: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DefaultDisplayPropertiesPropertyThecollectionofdefaultdisplaypropertiesforthedisplayrepresentation.

SeeAlso|Example

Signature

object.DefaultDisplayProperties

objectAecDisplayRepresentationTheobjectthispropertyappliesto.

DefaultDisplayPropertiesAecDisplayProperties;read-write

Page 332: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DescriptionPropertyGetsorsetstextdescribingtheAECObject.

SeeAlso|Example

Signature

object.Description

objectAecAnchorExtendedTagToEntAecObjectTheobjectthispropertyappliesto.

DescriptionString;read-writeDescriptionoftheAECObject.

Page 333: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DeviationPropertySpecifiesthedeviationofthemasselement.

SeeAlso|Example

Signature

object.Deviation

objectAecMassElementTheobjectthispropertyappliesto.

DeviationDouble;read-write

Page 334: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DictionariesPropertyGetstheDictionariescollectionforthedocument.

SeeAlso|Example

Signature

object.Dictionaries

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

DictionariesDictionariescollection;read-onlyTheDictionariescollectionforthedocument.

Page 335: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimStylesPropertyGetstheDimStylescollectionforthedocument.

SeeAlso|Example

Signature

object.DimStyles

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

DimStylesAcadDimStylescollection;read-onlyTheDimStylescollectionforthedocument.

Page 336: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayComponentsPropertyGetsthecollectionofdisplaycomponentsforthedisplayrepresentation.

SeeAlso|Example

Signature

object.DisplayComponents

objectAecDisplayPropertiesTheobjectthispropertyappliesto.

DisplayComponentsAecDisplayComponents;read-write

Remarks

ThedisplaycomponentscollectioncontainsAecDisplayComponentEntityandAecDisplayComponentHatchobjects.

Page 337: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayConfigurationsPropertyReturnsthedisplayconfigurationscollection.

SeeAlso|Example

Signature

object.DisplayConfigurations

objectAecBaseDatabase,AecBaseDocumentTheobjectthispropertyappliesto.

DisplayConfigurationsAecDisplayConfigurations;read-write

Page 338: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayHiddenLineworkPropertySpecifieswhetherhiddenlineworkisdisplayed.

SeeAlso|Example

Signature

object.DisplayHiddenLinework

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

DisplayHiddenLineworkBoolean;read-write

Page 339: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayNamePropertyThenamedisplayedfortheobject.

SeeAlso|Example

Signature

object.DisplayName

objectAecDisplayRepresentation,AecMVBlockDisplayRepDefTheobjectthispropertyappliesto.

DisplayNameString;read-write

Page 340: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayRepDefsPropertyReturnsthedisplayrepresentationdefinitionsforthemulti-viewblockstyle.

SeeAlso|Example

Signature

object.DisplayRepDefs

objectAecMVBlockStyleTheobjectthispropertyappliesto.

MVBlockDisplayRepDefsAecMVBlockDisplayRepDefs;read-write

Page 341: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplayRepresentationsPropertyGetsthedisplayrepresentationscollection.

SeeAlso|Example

Signature

object.DisplayRepresentations

objectAecDisplaySet,AecBaseDatabase,AecBaseDocumentTheobjectthispropertyappliesto.

DisplayRepresentationsAecDisplayRepresentations;read-write

Remarks

YoucanappendtoorremovefromtheDisplayRepresentationscollectionwhenaccessedfromtheDisplaySet.

Page 342: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplaySetPropertyGetsorsetsthethedisplaysetforagivenviewdirection.

SeeAlso|Example

Signature

RetVal=object.DisplaySet(ViewDir)

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

ViewDirAecViewDirection;input-onlyTheviewdirection.

RetValAecDisplaySetThedisplaysetthatappliesusedfortheviewdirection.

Page 343: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplaySetsPropertyReturnsthecollectionofdisplaysets.

SeeAlso|Example

Signature

object.DisplaySets

objectAecBaseDatabase,AecBaseDocumentTheobjectthispropertyappliesto.

DisplaySetsAecDisplaySets;read-write

Page 344: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplaySilhouettePropertyControlsifsilhouettecurvesofsolidobjectsaredisplayedinWireframemode.

SeeAlso|Example

Signature

object.DisplaySilhouette

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

DisplaySilhouetteBoolean;read-write

TRUE:Displayonlysilhouettelinesforsolidobjects.

FALSE:Displayisolinesforsolidobjects.

Systemvariables

ThevalueofthispropertyisstoredintheDISPSILHsystemvariable.

Remarks

TheinitialvalueforthispropertyisFALSE.

Page 345: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DocumentPropertyGetsthedocument(drawing)inwhichtheobjectbelongs.

SeeAlso|Example

Signature

object.Document

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

DocumentDocumentobject;read-onlyThedocument(drawing)thatcontainstheobject.

Page 346: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DoubleHatchPropertySpecifiesifdoublehatchingisused.

SeeAlso|Example

Signature

object.DoubleHatch

objectAecDisplayComponentHatchTheobjectthispropertyappliesto.

DoubleHatchBoolean;read-write

Remarks

TheDoubleHatchpropertyapplieswhentheHatchTypeissettoaecHatchTypeUserDefined.

Page 347: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EdgeWidthPropertySpecifiestheedgewidthofthepolygonstyle.

SeeAlso|Example

Signature

object.EdgeWidth

objectAecPolygonStyleTheobjectthispropertyappliesto.

EdgeWidthDouble;read-writeTheedgewidthofthepolygonstyle.

Page 348: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EdgeWidthJustifyPropertySpecifieswhetheredgesaredisplayedinside,outside,orcenteredontheAECPolygonvertices.

SeeAlso|Example

Signature

object.EdgeWidthJustify

objectAecPolygonStyleTheobjectthispropertyappliesto.

EdgeWidthJustifyAecPolygonStyleEdgeWidthJustificationenum;read-writeTheedgejustificationofthepolygonstyle.

Page 349: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationModelSpacePropertySpecifiestheelevationsettinginthemodelspace.

SeeAlso|Example

Signature

object.ElevationModelSpace

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

ElevationModelSpaceDouble;read-writeTheelevationsettingformodelspace.

Remarks

ThecurrentelevationistheZvaluethatisusedwhenevera3DpointisexpectedbutonlytheXandYvaluesaresupplied.Thecurrentelevationismaintainedseparatelyinmodelspaceandpaperspace.

Page 350: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationPaperSpacePropertySpecifiestheelevationsettinginthepaperspace.

SeeAlso|Example

Signature

object.ElevationPaperSpace

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

ElevationPaperSpaceDouble;read-writeTheelevationforpaperspace.

Remarks

ThecurrentelevationistheZvaluethatisusedwhenevera3DpointisexpectedbutonlytheXandYvaluesaresupplied.Thecurrentelevationismaintainedseparatelyinmodelspaceandpaperspace.

Page 351: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationPrecisionPropertySpecifiestheprecisiontowhichelevationmeasurementsaredisplayedinthedrawing.

SeeAlso|Example

Signature

object.ElevationPrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

ElevationPrecisionLong;read-writeThenumberofdecimalstotherightofthedecimalpoint.

Remarks

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.

Page 352: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndOffsetPropertySpecifiestheoffsetdistancefromtheendpointofthecurve,whichmaybeusedtoreducetheeffectivelayoutcurvelength.

SeeAlso|Example

Signature

object.EndOffset

objectAecLayoutCurveTheobjectthispropertyappliesto.

EndOffsetDouble;read-writeOffsetdistancefromendpointofthecurve.

Page 353: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExcludeFrom2dSectionShrinkwrapPropertySpecifieswhetherthematerialisexcludedfromtheshrinkwrapofa2Dsection.

SeeAlso|Example

Signature

object.ExcludeFrom2dSectionShrinkwrap

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

ExcludeFrom2dSectionShrinkwrapBoolean;read-write

Page 354: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FacetDeviationPropertySpecifiesthealloweddeviationwhenfacettingcurvedlinesandsurfaces.

SeeAlso|Example

Signature

object.FacetDeviation

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

FacetDeviationDouble;read-writeThefacetdeviationofAEC3DObjects.

Systemvariables

ThevalueofthispropertyisstoredintheFACETDEVsystemvariable.

Remarks

FacetdeviationissimilartoFacetResforACISbodies.

Page 355: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FacetMaximumPropertySpecifiesthemaximumnumberoffacetsusedforacircle.

SeeAlso|Example

Signature

object.FacetMaximum

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

FacetMaximumInteger;read-writeThemaximumnumberoffacetsusedforacircle.

Page 356: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FixedViewDirectionPropertyGetsorsetsafixedviewdirectionforadisplayconfiguration.

SeeAlso|Example

Signature

object.FixedViewDirection

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

FixedViewDirectionAecFixedViewDirection;read-write

Page 357: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipXPropertyDeterminesiftheanchoredobjectisflippedabouttheXaxisofthecurveitisanchoredto.

SeeAlso|Example

Signature

object.FlipX

objectAecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

FlipXBoolean;read-writeTRUE:AnchoredobjectisflippedaroundtheXaxis.FALSE:AnchoredobjectisnotflippedaroundtheXaxis.

Page 358: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipYPropertyDeterminesiftheanchoredobjectisflippedabouttheYaxisofthecurveitisanchoredto.

SeeAlso|Example

Signature

object.FlipY

objectAecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

FlipYBoolean;read-writeTRUE:AnchoredobjectisflippedaroundtheYaxis.FALSE:AnchoredobjectisnotflippedaroundtheYaxis.

Page 359: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipZPropertyDeterminesiftheanchoredobjectisflippedabouttheZaxisofthecurveitisanchoredto.

SeeAlso|Example

Signature

object.FlipZ

objectAecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

FlipZBoolean;read-writeTRUE:AnchoredobjectisflippedaroundtheZaxis.FALSE:AnchoredobjectisnotflippedaroundtheZaxis.

Page 360: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GroupsPropertyGetstheGroupscollectionforthedocument.

SeeAlso|Example

Signature

object.Groups

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

GroupsAcadGroupscollection;read-onlyTheGroupscollectionforthedocument.

Page 361: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HandlePropertyGetsthehandleofanobject.

SeeAlso|Example

Signature

object.Handle

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

HandleString;read-onlyThehandleoftheentity.

Page 362: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

AnobjectIDandauniquehandlearethetwowaysofreferencinganobject.Ahandleispersistent(staysthesame)inadrawingforthelifetimeoftheobject.

Ingeneral,useahandleunlessyouplantoworkwithcertainObjectARXfunctionsthatrequireanobjectID.

Page 363: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HasExtensionDictionaryPropertyDeterminesiftheobjecthasanextensiondictionaryassociatedwithit.

SeeAlso|Example

Signature

object.HasExtensionDictionary

ObjectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

HasExtensionDictionaryBoolean;read-only

TRUE:Theobjecthasanextensiondictionaryassociated

Page 364: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

withit.

FALSE:Theobjectdoesnothaveanextensiondictionaryassociatedwithit.

Remarks

Youcancreateanextensiondictionaryforanobject,orqueryanexistingextensiondictionarybyusingtheGetExtensionDictionarymethod.

Page 365: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HatchTypePropertyGetsorsetsthehatchtypeforthedisplaycomponent.

SeeAlso|Example

Signature

object.HatchType

objectAecDisplayComponentHatchTheobjectthispropertyappliesto.

HatchTypeAecHatchType;read-write

Page 366: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HeightPropertySpecifiestheheightoftheobject.

SeeAlso|Example

Signature

object.Height

objectAecClipVol,AecLayoutGrid3D,AecMassElementTheobjectthispropertyappliesto.

HeightDouble;read-writeTherelativeheightoftheobject.

Page 367: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HyperlinksPropertyGetstheHyperlinkscollectionforanentity.

SeeAlso|Example

Signature

object.Hyperlinks

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

HyperlinksAcadHyperlinks;read-onlyTheHyperlinkscollectionfortheentity.

Page 368: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IndexPropertyReturnsthepositionoftheitemwithinitscollection.

SeeAlso|Example

Signature

object.Index

objectAecRingAecLayerOverrideSetting,AecLayoutCurveNode,AecLayoutGrid2DNode,AecLayoutGrid2DXNode,AecLayoutGrid2DYNode,AecLayoutGrid3DNode,AecLayoutGrid3DXNode,AecLayoutGrid3DYNode,AecLayoutGrid3DZNode,AecViewBlock,AecLayerKey,AecDisplayComponent,AecMVBlockDisplayRepDef,AecViewBlockDef,AecsConnectionNodeTheobjectthispropertyappliesto.

IndexLong,exceptforAecLayerOverrideSetting,whichisaString;read-onlyThepositionoftheobjectwithinitscollection.

Remarks

AecLayerOverrideSettingisindexedrandomly,byname.

Page 369: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InsertionPointPropertySpecifiestheinsertionpointoftheprofile.

SeeAlso|Example

Signature

object.InsertionPoint

objectAecEditInPlaceProfileTheobjectthispropertyappliesto.

InsertionPointVariant(three-elementarrayofdoubles);read-writeTheinsertionpointoftheprofile.

Page 370: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InsideRadiusPropertySpecifiestheinsideradiusofthelayoutgrid.

SeeAlso|Example

Signature

object.InsideRadius

objectAecLayoutGrid2DTheobjectthispropertyappliesto.

InsideRadiusDouble;read-writeTheinsideradiusofthelayoutgrid.

Page 371: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InterferenceBlockNamePropertySpecifiesthenameoftheinterferenceblockfortheMulti-viewblock.

SeeAlso|Example

Signature

object.InterferenceBlockName

objectAecMVBlockStyleTheobjectthispropertyappliesto.

InterferenceBlockNameString;read-write

Page 372: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

KeysPropertyReturnsthecollectionoflayerkeysinalayerkeystyle.

SeeAlso|Example

Signature

object.Keys

objectAecLayerKeyStyleTheobjectthispropertyappliesto.

KeysAecLayerKeys;read-onlyReturnsthecollectionofAecLayerKeys.

Page 373: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerPropertySpecifiesthelayertheobjectison.

SeeAlso|Example

Signature

object.Layer

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKey,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

LayerString;read-writeThenameoftheobject'slayer.

Page 374: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerFilePropertySpecifiesthenameofthefilecontainingdefaultlayerstandardandkeystyledefinitions.

SeeAlso|Example

Signature

object.LayerFile

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

LayerFileString;read-writeThenameofthelayerfile.

Remarks

Thelayerfileisstoredasaglobalsettingintheregistry,andnotonaper-drawingbasis.AnentryismaintainedforeachMeasurementUnit.

Page 375: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStylePropertySpecifiesthelayerkeystylefortheobject.

SeeAlso|Example

Signature

object.LayerKeyStyle

objectAecLayerKey,AecLayerKeys,AecLayerOverrideSetting,AecLayerOverrideSettingsTheobjectthispropertyappliesto.

LayerKeyStyleAecLayerKeyStyle;read-writeLayerkeystyleoftheobject.

Page 376: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayersPropertyGetstheLayerscollectionforthedocument.

SeeAlso|Example

Signature

object.Layers

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

LayersAcadLayerscollection;read-onlyTheLayerscollectionforthedocument.

Page 377: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerStandardPropertyThelayerstandardtoapplytothedrawing.

SeeAlso|Example

Signature

object.LayerStandard

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

LayerStandardString;read-writeThenameofthelayerstandard.

Remarks

Thelayerstandardsarestoredonaperdrawingbasisinthedictionary.

Page 378: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutCurvePropertyProvidesaccesstolayoutcurvegeometry.

SeeAlso|Example

Signature

object.LayoutCurve

objectAecLayoutCurveNode,AecLayoutCurveNodesTheobjectthispropertyappliesto.

LayoutCurveAecLayoutCurve;read-writeAlayoutcurveobject.

Page 379: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DPropertyIdentifiesthe2Dlayoutgridthatownstheobject.

SeeAlso|Example

Signature

object.LayoutGrid2D

objectAecLayoutGrid2DNode,AecLayoutGrid2DNodes,AecLayoutGrid2DXNode,AecLayoutGrid2DXNodes,AecLayoutGrid2DYNode,AecLayoutGrid2DYNodesTheobjectthispropertyappliesto.

LayoutGrid2DAecLayoutGrid2D;read-writeThelayoutgridthatownsthelayoutgridnodeorcollectionofnodes.

Page 380: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DPropertyIdentifiesthe3Dlayoutgridthatownstheobject.

SeeAlso|Example

Signature

object.LayoutGrid3D

objectAecLayoutGrid3DNode,AecLayoutGrid3DNodes,AecLayoutGrid3DXNode,AecLayoutGrid3DXNodes,AecLayoutGrid3DYNode,AecLayoutGrid3DYNodes,AecLayoutGrid3DZNode,AecLayoutGrid3DZNodesTheobjectthispropertyappliesto.

LayoutGrid3DAecLayoutGrid3D;read-writeThe3Dlayoutgridthatownsthelayoutgridnodeorcollectionofnodes.

Page 381: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutsPropertyGetstheLayoutscollectionforthedocument.

SeeAlso|Example

Signature

object.Layouts

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

LayoutsAcadLayoutsobject;read-onlyTheLayoutscollectionforthedocument.

Page 382: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeaderExtension1PropertySpecifiesthefirstleaderextension.

SeeAlso|Example

Signature

object.LeaderExtension1

objectAecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

LeaderExtension1Double;read-writeThefirstleaderextension.

Page 383: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeaderExtension2PropertySpecifiesthesecondleaderextension.

SeeAlso|Example

Signature

object.LeaderExtension2

objectAecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

LeaderExtension2Double;read-writeThesecondleaderextension.

Page 384: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeftOffsetPropertySpecifiestheleftoffsetfortheanchoredobject.

SeeAlso|Example

Signature

object.LeftOffset

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

LeftOffsetDouble;read-writeTheleftoffsetfortheanchoredobject.(SeeRemarks.)

Remarks

TochangetheLeftOffsetvalue,youmustfirstsetAdjustSizingtoTrue.ModifyingLeftOffsetwhenAdjustSizingisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Page 385: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LimitsPropertySpecifiesthedrawinglimits.

SeeAlso|Example

Signature

object.Limits

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

LimitsVariant(arrayofdoubles);read-writeAnarrayoffourvalues.ThefirstpairofvaluesdefinetheXandYcoordinatesofthelower-leftlimit,thesecondpairofvaluesdefinetheXandYcoordinatesoftheupper-rightlimit.

Systemvariables

Thelower-leftlimitcontrolstheLIMMINsystemvariable.Theupper-rightlimitcontrolstheLIMMAXsystemvariable.TheLIMCHECKsystemvariableturnslimitscheckingonandoffforthecurrentspace.

Remarks

Thedrawinglimitsaretwo-dimensionalpointsintheWorldCoordinateSystem(WCS)thatrepresentalower-leftandanupper-rightlimit.YoucannotimposelimitsontheZdirection.

ThedrawinglimitsalsogoverntheportionofthedrawingcoveredbythevisiblegridanddeterminetheminimumareathattheZoomAllmethoddisplays.

Page 386: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearDisplayFormatProperty

Specifiestheformatusedtodisplaylinearmeasurementvalues.

SeeAlso|Example

Signature

object.LinearDisplayFormat

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

LinearDisplayFormatLong;read-writeTheformatusedtodisplaylinearmeasurementvalues.Canbeoneofthefollowing:

1: Scientific

2: Decimal

3: Engineering

4: Architectural

5: Fractional

Page 387: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearPrecisionPropertySpecifiesthelinearprecisionforthedrawing.

SeeAlso|Example

Signature

object.LinearPrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

LinearPrecisionLong;read-writeThenumberofdecimalstotherightofthedecimalpoint.

Remarks

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.

Page 388: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearUnitPropertySpecifiestheunitusedtodisplaylinearvalues.

SeeAlso|Example

Signature

object.LinearUnit

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

LinearUnitsAecBuiltInUnitenum;read-writeTheunitusedtodisplaylinearvalues.Specifyoneofthefollowing:

aecUnitInch: Inches

aecUnitFoot: Feet

aecUnitMillimeter: Millimeters

aecUnitCentimeter: Centimeters

aecUnitDecimeter: Decimeters

aecUnitMeter: Meters

Page 389: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

Usethispropertytospecifywhetheryouwanttousefeetormetersinyourdrawing.

Thelinearunitsthatyouselectmustbethesameforalldrawingsinaproject.Youcannotmixfoot-baseddrawingswithmeter-baseddrawingsinthesameproject.

Page 390: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinetypePropertySpecifiesthelinetypeoftheobject.

SeeAlso|Example

Signature

object.Linetype

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKey,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

LinetypeString;read-writeThenameofthelinetypeoftheobject.

Page 391: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinetypesPropertyGetstheLinetypescollectionforthedocument.

SeeAlso|Example

Signature

object.Linetypes

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

LinetypesAcadLineTypescollection;read-onlyTheLinetypescollectionforthedocument.

Page 392: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinetypeScaleProperty

Specifiesthelinetypescaleofanentity.

SeeAlso|Example

Signature

object.LinetypeScale

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

LinetypeScaleDouble;read-writeThisvaluemustbeapositiverealnumber.Thedefaultis1.0.

Remarks

Thelinetypescaleofanobjectspecifiestherelativelengthofdash-dotlinetypesperdrawingunit.

Linetypescale=1.0

Linetypescale=0.5

Page 393: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Linetypescale=0.25

Page 394: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LineWeightPropertySpecifiesthelineweightoftheobject.

SeeAlso|Example

Signature

object.LineWeight

objectAecBaseDatabasePreferences,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDatabasePreferences,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKey,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

LineWeightAcLineWeightorACAD_LWEIGHTenum;read-writeLineweightoftheobject.

Page 395: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LineweightDisplayPropertySpecifieswhetherlineweightsaredisplayedinmodelspaceforthedrawing.

SeeAlso|Example

Signature

object.LineweightDisplay

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

LineweightDisplayBoolean;read-write

TRUE:Lineweightsaredisplayedinmodelspace.

FALSE:Lineweightsarenotdisplayedinmodelspace.

Remarks

TheinitialvalueforthispropertyisTRUE.

Regenerationtimeincreaseswithlineweightsthatarerepresentedbymorethanonepixel.SetthispropertytoFALSEifperformanceslowsdownwhenworkingwithlargelineweights.

Page 396: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LocationPropertySpecifiestheinsertionpositionoftheobject.

SeeAlso|Example

Signature

object.Location

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

LocationVariant(three-elementarrayofdoubles);read-writeInsertionpositionoftheobject.

Page 397: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LowerExtensionPropertySpecifiesthedistanceofthelowercutplanebelowtheclipvolumeposition.

SeeAlso|Example

Signature

object.LowerExtension

objectAecClipVolTheobjectthispropertyappliesto.

LowerExtensionDouble;read-writeDistanceofthelowercutplanebelowclipvolumeposition.

Page 398: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassElementStylesPropertyReturnsthecollectionofmasselementstylesinthespecifieddrawingdatabase.

SeeAlso|Example

Signature

object.MassElementStyles

objectAecBaseDatabaseTheobjectthispropertyappliesto.

MassElementStylesAecMassElementStyles;read-writeThecollectionofmasselementstyles.

Page 399: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupPropertyGetsorsetstheparentmassgroupofamasselementormassgroup.

SeeAlso|Example

Signature

object.MassGroup

objectAecMassElement,AecMassGroupTheobjectthispropertyappliesto.

MassGroupAecMassGroup;read-writeTheparentmassgroup,ifany.

Page 400: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupNamePropertySpecifiesthemassgroupthatthemasselementorgroupiscurrentlyattachedto.

SeeAlso|Example

Signature

object.MassGroupName

objectAecMassElement,AecMassGroupTheobjectthispropertyappliesto.

MassGroupNameString;read-writeSpecifiesthemassgroupthatthemasselementorgroupiscurrentlyattachedto.

Page 401: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaxActiveViewportsPropertySpecifiesthemaximumnumberofactiveviewports.

SeeAlso|Example

Signature

object.MaxActiveViewports

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

MaxActiveViewportsInteger;read-writeThemaximumnumberofactiveviewports.2<=MaxActiveViewports<=48

Systemvariables

ThevalueofthispropertyisstoredintheMAXACTVPsystemvariable.

Remarks

Inactiveviewportsareblank,sotheircontentsarenotregenerated.Youcan,therefore,improveperformancebyspecifyingalowvalue.Theinitialvalueis48.

Page 402: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MeasurementUnitProperty

Identifiesthesystemofunitsusedtodisplaymeasurementsinthedrawing.

SeeAlso|Example

Signature

object.MeasurementUnit

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

MeasurementUnitAcMeasurementUnitenum;read-onlyThesystemofunitsusedtodisplaymeasurements.Canbeoneofthefollowing:

acEnglish: English(Imperial)units

acMetric: Metricunits

Page 403: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MergeCommonMaterialsPropertySpecifieswhethercommonmaterialsaremergedintoonecomponent.

SeeAlso|Example

Signature

object.MergeCommonMaterials

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

MergeCommonMaterialsBoolean;read-write

Page 404: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ModelSpacePropertyGetstheModelSpacecollectionforthedocument.

SeeAlso|Example

Signature

object.ModelSpace

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

ModelSpaceAcadModelSpacecollection;read-onlyTheModelSpacecollectionforthedocument.

Page 405: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MVBlockRefPropertyGetsorsetsamulti-viewblockreferenceforaviewblockorcollectionofviewblocks.

SeeAlso|Example

Signature

object.MVBlockRef

objectAecViewBlock,AecViewBlocksTheobjectthispropertyappliesto.

MVBlockRefAecMVBlockRef;read-writeReferenceofamulti-viewblockinsertedintoadrawing.

Page 406: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NamePropertyReturnsthenameoftheobject.

SeeAlso|Example

Signature

object.Name

objectAecCamera,AecDictRecord,AecLayerKey,AecLayerKeyStyle,AecLayerOverrideSetting,AecMaskBlockStyle,AecMassGroup,AecMVBlockStyle,AecPolygonStyle,AecProfileStyle,AecViewBlock,AecDisplayComponentTheobjectthispropertyappliesto.

NameString;read-onlyforallobjectsexceptAecCamera.Thenameoftheobject.

Page 407: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NodePropertySpecifiesthelayoutnodetheanchorattachesanobjectto.

SeeAlso|Example

Signature

object.Node

objectAecAnchorEntToLayoutNode,AecAnchorLeadEntToNode,AecAnchorEntToLayoutVolume,AecAnchorEntToLayoutCellTheanchorobjectthispropertyappliesto.

NodeLong;read-writeNodeentityisanchoredto.Thefirstnodeonthegridis1.

Page 408: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NodesPropertyReturnsthecollectionofnodesonthelayoutcurve.

SeeAlso|Example

Signature

object.Nodes

objectAecLayoutCurveTheobjectthispropertyappliesto.

NodesAecLayoutNodes;read-onlyThecollectionofnodesonthecurve.

Page 409: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NorthRotationPropertySpecifiestheanglealignedtonorthwithinadrawing.

SeeAlso|Example

Signature

object.NorthRotation

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

NorthRotationDouble;read-writeThenorthrotationangle.Theangleisinradiansandmeasuredcounter-clockwisefromtheXaxis(East).

Remarks

Theinitialvalueforthispropertyis0.

IfyouchangetheNorthRotationinanexistingdrawingthenyoumustmoveanyobjectsinthedrawingtomatchthenewcoordinatesystem.

Page 410: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectIDPropertyGetstheobjectIDoftheobject.

SeeAlso|Example

Signature

object.ObjectID

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

ObjectIDLong;read-onlyTheobjectIDofanentity.

Page 411: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Remarks

AnobjectIDandauniquehandlearebothwaysofreferencinganobject.

Ingeneral,useahandleunlessyouplantoworkwithcertainObjectARXfunctionsthatrequireanobjectID.

Page 412: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectNamePropertyGetstheAutoCADclassnameoftheobject.

SeeAlso|Example

Signature

object.ObjectName

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

ObjectNameString;read-onlyTheAutoCADclassnameofanentity.

Page 413: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByPlottingPropertyTogglessortingofdrawingobjectsbyplottingorder.

SeeAlso|Example

Signature

object.ObjectSortByPlotting

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortByPlottingBoolean;read-write

TRUE:Enablesortbyplottingorder.

FALSE:Disablesortbyplottingorder.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisTRUE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 414: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByPSOutputPropertyTogglessortingofdrawingobjectsbyPostScriptoutputorder.

SeeAlso|Example

Signature

object.ObjectSortByPSOutput

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortByPSOutputBoolean;read-write

TRUE:EnablesortbyPostScriptoutputorder.

FALSE:DisablesortbyPostScriptoutputorder.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisTRUE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 415: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByRedrawsPropertyTogglessortingofdrawingobjectsbyredraworder.

SeeAlso|Example

Signature

object.ObjectSortByRedraws

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortByRedrawsBoolean;read-write

TRUE:Enablesortbyredraworder.

FALSE:Disablesortbyredraworder.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisFALSE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 416: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByRegensPropertyTogglessortingofdrawingobjectsbyregenerationorder.

SeeAlso|Example

Signature

object.ObjectSortByRegens

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortByRegensBoolean;read-write

TRUE:Enablesortbyregenerationorder.

FALSE:Disablesortbyregenerationorder.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisFALSE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 417: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortBySelectionPropertyTogglessortingofdrawingobjectsbyobjectselection.

SeeAlso|Example

Signature

object.ObjectSortBySelection

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortBySelectionBoolean;read-write

TRUE:Enablesortbyobjectselection.

FALSE:Disablesortbyobjectselection.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisFALSE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 418: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortBySnapPropertyTogglessortingofdrawingobjectsbyobjectsnap.

SeeAlso|Example

Signature

object.ObjectSortBySnap

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

ObjectSortBySnapBoolean;read-write

TRUE:Enablesortbyobjectsnap.

FALSE:Disablesortbyobjectsnap.

Systemvariables

ThevalueofthispropertyisstoredintheSORTENTSsystemvariable.

Remarks

TheinitialvalueofthispropertyisFALSE.

Initially,sortingisenabledforplottingandPostScriptoutputonly.Settingadditionalsortingoptionscanresultinslowerregenerationandredrawingtimes.

Page 419: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OffsetPropertySpecifiestheoffsetfromtheobject.

SeeAlso|Example

Signature

object.Offset

objectAecAnchorLeadEntToNode,AecAnchorEntTolayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecEntRefTheobjectthispropertyappliesto.

OffsetVariant;read-writeOffsetfromthelayoutnodeorentityreference.

Page 420: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OLELaunchPropertyDetermineswhethertolaunchtheparentapplicationwhenplottingOLEobjects.

SeeAlso|Example

Signature

object.OLELaunch

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

OLELaunchBoolean;read-write

TRUE:TheparentapplicationofanOLEobjectislaunchedtoprintit.

FALSE:TheOLEobjectisprintedfromthecurrentapplication.

Systemvariables

ThevalueofthispropertyisstoredintheOLESTARTUPsystemvariable.

Remarks

TheinitialvalueofthispropertyisFALSE.

Plottingfromtheparentapplicationachievesahigherqualityplot;however,thespeedoftheplotisdecreased.

Page 421: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OperationPropertySpecifieshowobjectsarecombined.

SeeAlso|Example

Signature

object.Operation

objectAecMassElement,AecMassGroupTheobjectthispropertyappliesto.

OperationAecMassOperationenum;read-writeBooleanoperation:addition,subtraction,orintersection.

Page 422: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverrideDisplayPropertiesPropertyThecollectionofdisplaypropertyoverridesforthedisplayrepresentation.

SeeAlso|Example

Signature

object.OverrideDisplayPropertiesAecObject

objectAecDisplayRepresentationTheobjectthispropertyappliesto.

OverrideDisplayPropertiesAecDisplayProperties;read-write

AecObjectAecObject;input-onlyAnobjectinstanceorstyleoverride.

Remarks

Overridescanbeappliedbyobjectorbystyle.

Page 423: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverridesEnabledPropertySpecifieswhetherlayeroverridesareappliedtothestylewhenalayerisgeneratedfromakey.

SeeAlso|Example

Signature

object.OverridesEnabled

objectAecLayerKeyStyleTheobjectthispropertyappliesto.

OverridesEnabledBoolean;read-writeTRUE:Overridesareapplied.FALSE:Overridesarenotapplied.

Page 424: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverrideSettingsPropertyReturnsthecollectionoflayerkeyoverridesettingsforalayerkeystyle.

SeeAlso|Example

Signature

object.OverrideSettings

objectAecLayerKeyStyleTheobjectthispropertyappliesto.

OverrideSettingsAecLayerOverrideSettings;read-onlyThecollectionoflayerkeyoverridesettings.

Page 425: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OwnerIDPropertyGetstheobjectIDoftheowner(parent)object.

SeeAlso|Example

Signature

object.OwnerID

objectAecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

OwnerIDLong;read-onlyTheobjectIDofanobject'sowner.

Page 426: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PaperSpacePropertyGetsthePaperSpacecollectionforthedocument.

SeeAlso|Example

Signature

object.PaperSpace

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

PaperSpaceAcadPaperSpacecollection;read-onlyThePaperSpacecollectionforthedocument.

Page 427: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PatternNamePropertyGetsorsetsthenameofthecustomhatchpattern.

SeeAlso|Example

Signature

object.PatternName

objectAecDisplayComponentHatchTheobjectthispropertyappliesto.

PatternNameString;read-write

Remarks

ThePatternNameapplieswhentheHatchTypeissettoaecHatchTypeCustomDefined.

Page 428: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PerimeterPropertySpecifiestheperimeteroftheprofile.

SeeAlso|Example

Signature

object.Perimeter

objectAecProfileTheobjectthispropertyappliesto.

PerimeterDouble;read-only

Page 429: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlaneDepthPropertySpecifiestheplanedepthoftheslice.

SeeAlso|Example

Signature

object.PlaneDepth

objectAecSliceTheobjectthispropertyappliesto.

PlaneDepthDouble;read-write

Page 430: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlaneWidthPropertySpecifiestheplanewidthoftheslice.

SeeAlso|Example

Signature

object.PlaneWidth

objectAecSliceTheobjectthispropertyappliesto.

PlaneWidthDouble;read-write

Page 431: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlotConfigurationsPropertyGetsthePlotConfigurationscollectionforthedocument.

SeeAlso|Example

Signature

object.PlotConfigurations

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

PlotConfigurationsAcadPlotConfigurationscollection;read-onlyThePlotConfigurationscollectionforthedocument.

Page 432: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlotStyleNamePropertySpecifiestheplotstylenamefortheobject.

SeeAlso|Example

Signature

object.PlotStyleName

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKey,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

PlotStyleNameString;read-writeThenameoftheobject'splotstyle.

Page 433: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlottablePropertySpecifieswhetherthelayergeneratedfromthekeyisplottable.

SeeAlso|Example

Signature

object.Plottable

objectAecLayerKeyTheobjectthispropertyappliesto.

PlottableBoolean;read-writeTRUE:LayerisplottableFALSE:Layerisnotplottable

Page 434: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PolygonStylesPropertyReturnsthecollectionofpolygonstylesinthespecifieddrawingdatabase.

SeeAlso|Example

Signature

object.PolygonStyles

objectAecBaseDatabaseTheobjectthispropertyappliesto.

PolygonStylesAecPolygonStyles;read-onlyThecollectionofpolygonstyles.

Page 435: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PreferencesPropertyReturnsthePreferencesobjectforthespecifieddrawing.

SeeAlso|Example

Signature

object.Preferences

objectAecBaseDatabase,AecDatabaseTheobjectthispropertyappliesto.

Preferences

AcadDatabasePreferences;read-onlyThePreferencesobjectforthedrawing.

Page 436: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfilePropertyReturnsorsetstheobject'sprofile.

SeeAlso|Example

Signature

object.Profile

objectAecEditInPlaceProfile,AecPolygon,AecProfileStyle,AecRing,AecRings,AecMassElement,AecSliceTheobjectthispropertyappliesto.

ProfileAecProfile;read-writeTheobject'sprofile.

Page 437: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStylePropertySpecifiestheprofilestyleofthemasselement.

SeeAlso|Example

Signature

object.ProfileStyle

objectAecMassElementTheobjectthispropertyappliesto.

ProfileStyleAecProfileStyle;read-writeTheprofilestyleofthemasselement.

Page 438: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyleNamePropertySpecifiesthenameoftheobject'sprofilestyle.

SeeAlso|Example

Signature

object.ProfileStyleName

objectAecEditInPlaceProfile,AecMassElementTheobjectsthispropertyappliesto.

ProfileStyleNameString;read-writeThenameoftheprofilestyle.

Page 439: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProjectNamePropertySpecifiesthenameoftheprojectthatthedrawingbelongsto.

SeeAlso|Example

Signature

object.ProjectName

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

ProjectNameString;read-writeTheprojectname.

Remarks

Theprojectnamecanbenomorethan255charactersinlength.

Page 440: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RadiusPropertySpecifiestheradiusofcurvedmasselements.

SeeAlso|Example

Signature

object.Radius

objectAecMassElementTheobjectthispropertyappliesto.

RadiusDouble;read-writeTheradiusofthemasselement.

Page 441: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ReferencePropertySpecifiestheobjectbeinganchoredto.

SeeAlso|Example

Signature

object.Reference

objectAecAnchorEntToLayoutCell,AecAnchorEntToCurve,AecAnchorLeadEntToNode,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorExtendedTagToEntAecAnchorToRefTheobjectthispropertyappliesto.

ReferenceAcadEntity;read-write,exceptforAecAnchorEntToGridAssembly,whichisread-only.Theobjectbeinganchoredto.

Page 442: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RegisteredApplicationsPropertyGetstheRegisteredApplicationscollectionforthedocument.

SeeAlso|Example

Signature

object.RegisteredApplications

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

RegisteredApplicationsAcadRegisteredApplicationscollection;read-onlyTheRegisteredApplicationscollectionforthedocument.

Page 443: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RemoveablePropertySpecifieswhetheryoucanremovethelayerkeyfromthelayerkeystyle.

SeeAlso|Example

Signature

object.Removeable

objectAecLayerKeyTheobjectthispropertyappliesto.

RemoveableBoolean;read-onlyTRUE:Layerkeyisremovable.FALSE:Layerkeyisnotremovable.

Page 444: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RenderSmoothnessPropertySpecifiesthesmoothnessofshaded,rendered,andhiddenline-removedobjects.

SeeAlso|Example

Signature

object.RenderSmoothness

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

RenderSmoothnessDouble;read-writeThevalidrangeis0.01to10.0.

Systemvariables

ThevalueofthispropertyisstoredintheFACETRESsystemvariable.

Remarks

Theinitialvalueforthispropertyis0.5.Toimproveperformance,setthisvalueto1orlesswhendrawing.

Page 445: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ResizeOffsetPropertySpecifiestheoffsetoftheanchoredobjecttothecellboundarywhenthecellisresized.

SeeAlso|Example

Signature

object.ResizeOffset

objectAecAnchorEntToLayoutCell,AecAnchorEntToLayoutVolumeTheobjectthispropertyappliesto.

ResizeOffsetDouble;read-writeTheoffsetfromthecelltotheanchoredobject.

Remarks

TochangetheResizeOffsetvalue,youmustfirstsetApplyResizetoTrue.ModifyingResizeOffsetwhenApplyResizeisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Tospecifyadistancebetweentheanchoredobjectandthecell,specifyanegativevalueforResizeOffset.Toextendtheanchoredobjectbeyondthecelledges,specifyapositivevalue.

Page 446: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RightOffsetPropertySpecifiestherightoffsetfortheanchoredobject.

SeeAlso|Example

Signature

object.RightOffset

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

RightOffsetDouble;read-writeTherightoffsetfortheanchoredobject.

Remarks

TochangetheRightOffsetvalue,youmustfirstsetAdjustSizingtoTrue.ModifyingRightOffsetwhenAdjustSizingisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Page 447: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RingsPropertyReturnsthecollectionofringsthatmakeuptheprofile.

SeeAlso|Example

Signature

object.Rings

objectAecProfileTheobjectthispropertyappliesto.

RingsAecRings;read-onlyCollectionofringsthatmakeuptheprofile.

Page 448: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RisePropertySpecifiestheriseofgabledmasselements.

SeeAlso|Example

Signature

object.Rise

objectAecMassElementTheobjectthispropertyappliesto.

RiseDouble;read-writeTheriseofthegabledmasselement.

Page 449: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RotationPropertySpecifiestherotationreferenceanglefortheobject.

SeeAlso|Example

Signature

object.Rotation

objectAecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutToolAecMaskBlockRef,AecMassELement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

RotationACAD_ANGLE;read-writeRotationreferenceanglefortheobject.

Page 450: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScalePropertySpecifiesthescalefactorappliedtothehatchpattern.

SeeAlso|Example

Signature

object.Scale

objectAecDisplayComponentHatchTheobjectthispropertyappliesto.

ScaleDouble;read-write

Remarks

TheScalepropertydetermineshowthehatchpatternisrepeated.

Page 451: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleOnInsertPropertySpecifieswhetherobjectsareautomaticallyscaledwheninsertedintothedrawing.

SeeAlso|Example

Signature

object.ScaleOnInsert

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

ScaleOnInsertBoolean;read-writeTRUE:Newobjectsarescaledautomatically.FALSE:Newobjectsarenotscaledautomatically.

Page 452: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleXPropertySpecifiestheXdirectionscalefactoroftheinsertedblockorentity.

SeeAlso|Example

Signature

object.ScaleX

objectAecBlockRef,AecEntRef,AecMaskBlockRef,AecMVBlockRefTheobjectthispropertyappliesto.

ScaleXDouble;read-writeScaleoftheblockintheXdirection.

Page 453: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleYPropertySpecifiestheYdirectionscalefactoroftheinsertedblockorentity.

SeeAlso|Example

Signature

object.ScaleY

objectAecBlockRef,AecEntRef,AecMaskBlockRef,AecMVBlockRefTheobjectthispropertyappliesto.

ScaleYDouble;read-writeScaleoftheblockintheYdirection.

Page 454: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleZPropertySpecifiestheZdirectionscalefactoroftheinsertedblockorentity.

SeeAlso|Example

Signature

object.ScaleZ

objectAecBlockRef,AecEntRef,AecMaskBlockRef,AecMVBlockRefTheobjectthispropertyappliesto.

ScaleZDouble;read-writeScaleoftheblockintheZdirection.

Page 455: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SectionedBodyRenderingMaterialNamePropertyGetsorsetsthenameofthesectionedbodyrenderingmaterial.

SeeAlso|Example

Signature

object.SectionedBodyRenderingMaterialName

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

SectionedBodyRenderingMaterialNameString;read-write

Page 456: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SectionRenderingMaterialNamePropertyGetsorsetsthenameofthesectionrenderingmaterial.

SeeAlso|Example

Signature

object.SectionRenderingMaterialName

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

SectionRenderingMaterialNameString;read-write

Page 457: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SegmentPerPolylinePropertySpecifiesthenumberoflinesegmentstobegeneratedforeachpolylinecurve.

SeeAlso|Example

Signature

object.SegmentPerPolyline

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

SegmentPerPolylineInteger;read-writeThenumberoflinesegmentstobegeneratedforeachpolylinecurve.0<SegmentPerPolyline<=42950

Systemvariables

ThevalueofthispropertyisstoredintheSPLINESEGSsystemvariable.

Remarks

Theinitialvalueis8.Thehigherthenumberyouspecify,thegreatertheperformanceimpact.

Page 458: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SelfIntersectsPropertyDeterminesiftheprofileisself-intersecting.

SeeAlso|Example

Signature

object.SelfIntersects

objectAecProfileTheobjectthispropertyappliesto.

SelfIntersectsBoolean;read-onlyTRUE:Profileintersectsitself.FALSE:Profiledoesnotintersectitself.

Page 459: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ShapePropertySpecifiestheshapeofthelayoutgrid.

SeeAlso|Example

Signature

object.Shape

objectAecLayoutGrid2DTheobjectthispropertyappliesto.

ShapeAecLayoutShapeenum;read-write

Theshapeofthelayoutgrid.

Page 460: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Side1PropertySpecifiesthelengthofthecutplanealongthestartingedge.

SeeAlso|Example

Signature

object.Side1

objectAecClipVolTheobjectthispropertyappliesto.

Side1Double;read-writeThelengthofthecutplanealongthestartingedge.

Page 461: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Side2PropertySpecifiesthelengthofthecutplanealongtheendingedge.

SeeAlso|Example

Signature

object.Side2

objectAecClipVolTheobjectthispropertyappliesto.

Side2Double;read-writeLengthofcutplanealongtheendingedge.

Page 462: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SolidFillPropertySpecifiesifmultilines,traces,solids,allhatches(includingsolid-fill)andwidepolylinesarefilledin.

SeeAlso|Example

Signature

object.SolidFill

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

SolidFillBoolean;read-write

TRUE:Displayssolidfills.

FALSE:Doesnotdisplaysolidfills.

Systemvariables

ThevalueofthispropertyisstoredintheFILLMODEsystemvariable.

Remarks

TheinitialvalueofthispropertyisTRUE.

Page 463: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SpacingPropertySpecifiesthespacingbetweennodesorforanindividualnodeonalayouttool,orthespacingbetweenrepeatedhatchpatternsforadisplaycomponent.

SeeAlso|Example

Signature

object.Spacing

objectAecDisplayComponentHatch,AecLayoutCurve,AecLayoutCurveNode,AecLayoutGrid2DNode,AecLayoutGrid2DXNode,AecLayoutGrid2DYNode,AecLayoutGrid3DNode,AecLayoutGrid3DXNode,AecLayoutGrid3DYNode,AecLayoutGrid3DZNode,AecLayoutNodeTheobjectthispropertyappliesto.

SpacingDouble;read-writeThespacingbetweennodesorforanindividualnodeonalayouttool,orthespacingbetweenrepeatedhatchpatternsforadisplaycomponent.

Page 464: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StartOffsetPropertySpecifiestheoffsetdistancefromthestartpointofthecurve,whichmaybeusedtoreducetheeffectivelayoutcurvelength.

SeeAlso|Example

Signature

object.StartOffset

objectAecLayoutCurveTheobjectthispropertyappliesto.

StartOffsetDouble;read-writeTheoffsetdistancefromthestartpointofthecurve.

Page 465: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StylePropertySpecifiesthestyleoftheobject.

SeeAlso|Example

Signature

object.Style

objectAecMaskBlockRef,AecMassElement,AecMVBlockRef,AecPolygonTheobjectthispropertyappliesto.

StyleStyle;read-writeThestyleoftheobject.Thetypeofstyledependsonthetypeofobject,asfollows:

AecMaskBlockRef AecMaskBlockStyleAecMassElement AecMassElementStyleAecMVBlockRef AecMVBlockStyleAecPolygon AecPolygonStyle

Page 466: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StyleNamePropertySpecifiesthenameofthestylethatappliestotheobject.

SeeAlso|Example

Signature

object.StyleName

objectAecMaskBlockRef,AecMVBlockRef,AecPolygonTheobjectthispropertyappliesto.

StyleNameString;read-writeThestylename.

Page 467: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubTypePropertySpecifiesthemasselementshapesubtype.

SeeAlso|Example

Signature

object.SubType

objectAecMassElementTheobjectthispropertyappliesto.

SubTypeAecMassElementSubType;read-only

Page 468: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SupportsAnchoringPropertySpecifieswhetherthemassgroupsupportselementanchoring.

SeeAlso|Example

Signature

object.SupportsAnchoring

objectAecMassGroupTheobjectthispropertyappliesto.

SupportsAnchoringBoolean;read-write

Remarks

Thispropertyenablesenhancedmassgroupbehavior.

Page 469: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SurfaceHatchPlacementPropertySpecifieshowthesurfacehatchpatternisplacedontheobject.

SeeAlso|Example

Signature

object.SurfaceHatchPlacement

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

SurfaceHatchPlacementAecSurfaceHatchPlacement;read-write

Page 470: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SurfaceRenderingMaterialNamePropertyGetsorsetsthenameofthesurfacerenderingmaterial.

SeeAlso|Example

Signature

object.SurfaceRenderingMaterialName

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

SurfaceRenderingMaterialNameString;read-write

Page 471: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SurfaceRenderMaterialMappingPropertySpecifieshowthesurfacerendermaterialismappedtotheobject.

SeeAlso|Example

Signature

object.SurfaceRenderMaterialMapping

objectAecDisplayPropertiesMaterialTheobjectthispropertyappliesto.

SurfaceRenderMaterialMappingAecSurfaceMappingType;read-write

Page 472: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextFrameDisplayPropertyTogglesthedisplayofframesfortextobjectsinsteadofdisplayingthetextitself.

SeeAlso|Example

Signature

object.TextFrameDisplay

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

TextFrameDisplayBoolean;read-write

TRUE:Displaystheframearoundtheextentsofthetext,butdoesnotdisplaythetextitself.

FALSE:Displaysthefulltext.

Systemvariables

ThevalueofthispropertyisstoredintheQTEXTMODEsystemvariable.

Remarks

TheinitialvalueforthispropertyisFALSE.

Afteryouenableordisablethisoption,youmustusetheRegenmethodtoupdatethedisplay.

Page 473: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextHeightPropertySpecifiesthedefaultheightoftextinthedrawing.

SeeAlso|Example

Signature

object.TextHeight

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

TextHeightDouble;read-writeThetextheightininchesormillimeters.

Remarks

Thedefaultvalueis0.125inches,or3.175millimeters,dependingonthesettingoftheMeasurementUnitproperty.

Page 474: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextStylesPropertyGetstheTextStylescollectionforthedocument.

SeeAlso|Example

Signature

object.TextStyles

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

TextStylesAcadTextStylescollection;read-onlyTheTextStylescollectionforthedocument.

Page 475: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TopOffsetPropertySpecifythetopoffsetfortheanchoredobject.

SeeAlso|Example

Signature

object.TopOffset

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

TopOffsetDouble;read-writeThetopoffsetfortheanchoredobject.(SeeRemarks.)

Remarks

TochangetheTopOffsetvalue,youmustfirstsetAdjustSizingtoTrue.ModifyingTopOffsetwhenAdjustSizingisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Page 476: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TypePropertyForlayoutcurves,specifieshownodesarespecifiedalongthecurve;formasselements,specifiestheshapeofthemasselement.

SeeAlso|Example

Signature

object.Type

objectAecLayoutCurve,AecMassElementTheobjectthispropertyappliesto.

TypeAecLayoutCurve:AecLayoutTypeenum;read-writeTypeofnodespacingalongthecurve.

AecMassElement:AecMassElementTypeenum;read-writeTheMassElementshape.

Page 477: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseAngleOfObjectPropertySpecifiestheorientationofthehatchpattern.

SeeAlso|Example

Signature

object.UseAngleOfObject

objectAecDisplayComponentHatchTheobjectthispropertyappliesto.

UseAngleOfObjectBoolean;read-writeTRUE:Orientthehatchingtotheobject,regardlessoftheobjectrotation.FALSE:OrientthehatchingtotheWorldCoordinateSystem.

Page 478: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseFixedViewDirectionPropertySpecifiesiftheFixedViewDirectionisusedforthedisplayconfiguration.

SeeAlso|Example

Signature

object.UseFixedViewDirection

objectAecDisplayConfigurationTheobjectthispropertyappliesto.

UseFixedViewDirectionBoolean;read-write

Page 479: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseModelExtentsPropertyDeterminesiftheheightandlowerextensionaresetautomaticallyusingmodelextents.

SeeAlso|Example

Signature

object.UseModelExtents

objectAecClipVolTheobjectthispropertyappliesto.

UseModelExtentsBoolean;read-writeTRUE:HeightandLowerExtensionaresetautomaticallyFALSE:HeightandLowerExtensionarenotsetautomatically

Page 480: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseOffsetPropertySpecifiesiftheoffsetvalueisused.

SeeAlso|Example

Signature

object.UseOffset

objectAecEntRefTheobjectthispropertyappliesto.

UseOffsetBoolean;read-write

Page 481: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UserCoordinateSystemsPropertyGetstheUCSscollectionforthedocument.

SeeAlso|Example

Signature

object.UserCoordinateSystems

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

UserCoordinateSystemsAcadUCSscollection;read-onlyTheUCSscollectionforthedocument.

Page 482: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ValidPropertyTeststhevalidityoftheobject.

SeeAlso|Example

Signature

object.Valid

objectAecProfile,AecRingTheobjectthispropertyappliesto.

ValidBoolean;read-onlyTRUE:Objectisvalid.FALSE:Objectisnotvalid.

Remarks

Aringisvalidifthefollowingaretrue:

Thereismorethanonesegment.Thesegmentsarecontinuous.Thesegmentsareclosed.Nosegmentintersectsitself.

Aprofileisvalidifeachringisclosedanddoesnotself-intersect,andtheprofileisnotselfintersecting.

Page 483: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ValuePropertyForlayeroverrides,specifiesthevalueofthelayerkeystyleoverride;forlayoutcurves,specifieseitherthespacingbetweennodesorthenumberofnodesonthelayoutcurve.

SeeAlso|Example

Signature

object.Value

objectAecLayerOverrideSetting,AecLayoutCurveTheobjectthispropertyappliesto.

ValueAecLayerOverrideSetting:String;read-writeThestringthelayerkeyoverrideissetto.

AecLayoutCurve:Variant;read-writeBayspacingornumberofevendivisionsonalayoutcurve.

Remarks

AecLayoutCurve:

Ifthecurveusesmanualspacing,Valueiszero.

ChecktheTypepropertytodeterminewhatValuerepresents.

Page 484: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VerticalScalePropertySpecifiesthescaleatwhichtheverticalaxisofthedrawingisdisplayed(inLandDevelopmentDesktoponly).

SeeAlso|Example

Signature

object.VerticalScale

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

HeadHeightDouble;read-writeTheverticalscale.Forexample,fora1:200scale,enter200.

Remarks

ThisisonlyusedinAutodeskLandDevelopmentDesktop.

Page 485: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewBlockDefsPropertyReturnsthecollectionofviewblockdefinitionsforthemulti-viewblockdisplayrepresentationdefinition.

SeeAlso|Example

Signature

object.ViewBlockDefs

objectAecMVBlockDisplayRepDefTheobjectthispropertyappliesto.

ViewBlockDefsAecViewBlockDefs;read-write

Page 486: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewBlocksPropertyReturnsthecollectionofviewblocksusedfordisplayrepresentationsbythemulti-viewblockreference.

SeeAlso|Example

Signature

object.ViewBlocks

objectAecMVBlockRefTheobjectthispropertyappliesto.

ViewBlocksAecViewBlocks;read-onlyThecollectionofviewblockreferences,witheachmulti-viewblockdisplayrepresentationmappedtoanindividualAcadBlock.

Page 487: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewDirectionPropertySpecifiestheviewdirectionfortheviewblockdefinition.

SeeAlso|Example

Signature

object.ViewDirection

objectAecViewBlockDefTheobjectthispropertyappliesto.

ViewDirectionAecViewDirection;read-write

Page 488: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewportsPropertyGetstheViewportscollectionforthedocument.

SeeAlso|Example

Signature

object.Viewports

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

ViewportsAcadViewportscollection;read-onlyTheViewportscollectionforthedocument.

Page 489: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewsPropertyGetstheViewscollectionforthedocument.

SeeAlso|Example

Signature

object.Views

objectAecBaseDatabase,AecDatabaseTheobjectorobjectsthispropertyappliesto.

ViewsAcadViewscollection;read-onlyTheViewscollectionforthedocument.

Page 490: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VisiblePropertySpecifieswhethertheobjectorapplicationisvisible.

SeeAlso|Example

Signature

object.Visible

objectAecBaseApplication,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMVBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectthispropertyappliesto.

VisibleBoolean;read-onlyTRUE:Theobjectorapplicationisvisible.FALSE:Theobjectorapplicationisnotvisible.

Remarks

Otherfactorscanalsocauseanobjecttobeinvisible.Forexample,anobjectwillnotbedisplayedifitslayerisofforfrozen.

Page 491: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Specifyingtheapplicationtobeinvisibleallowsyoutoruntasksinthebackgroundwithouthavingtoseethecomponent.

Page 492: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VoidPropertySpecifiesifaringproducesavoidinaprofile.

SeeAlso|Example

Signature

object.Void

objectAecRingTheobjectthispropertyappliesto.

VoidBoolean;read-writeTRUE:Ringisvoid.FALSE:Ringisadditive.

Page 493: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumePropertyReturnsthevolumeofthemasselementormassgroup.

SeeAlso|Example

Signature

object.Volume

objectAecMassElement,AecMassGroupTheobjectthispropertyappliesto.

VolumeDouble;read-onlyThevolumeofthemasselementormassgroup.

Page 494: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeDisplayUnitPropertySpecifiestheunitsusedtodisplayvolumemeasurements.

SeeAlso|Example

Signature

object.VolumeDisplayUnit

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

VolumeDisplayUnitAecBuiltInUnitenum;read-writeTheunitsusedtodisplayvolumemeasurements.

Page 495: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumePrecisionPropertySpecifiesthenumberofdecimalplacesdisplayedforvolumemeasurements.

SeeAlso|Example

Signature

object.VolumePrecision

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

VolumePrecisionLong;read-writeThedisplayprecisionforvolumemesurements.

Remarks

Theprecisionsettingsareusedonlyforlabelingandlistingvalues,notactualcomputations.

Page 496: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeSuffixPropertyThesuffixstringaddedwhenvolumemeasurementsaredisplayedinthedrawing.

SeeAlso|Example

Signature

object.VolumeSuffix

objectAecBaseDatabasePreferencesTheobjectthispropertyappliesto.

VolumeSuffixString;read-writeThesuffixdisplayedafterthevolumemeasurement.

Remarks

Thedefaultvalueis"Cu.Ft."or"m3",dependingonthevalueoftheMeasurementUnitproperty.Thevaluecanbeupto255charactersinlength.

Page 497: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WidthPropertySpecifiesthewidthoftheobject.

SeeAlso|Example

Signature

object.Width

objectAecLayoutGrid2D,AecLayoutGrid3D,AecMassElementTheobjectthispropertyappliesto.

WidthDouble;read-writeThewidthoftheobject.

Page 498: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WindowStatePropertySpecifiesthestateoftheapplicationordocumentwindow.

SeeAlso|Example

Signature

object.WindowState

objectAecBaseDocumentTheobjectorobjectsthispropertyappliesto.

WindowStateacWindowStateenum;read-writeIndicatesiftheapplicationwindowisminimizedormaximized.

Page 499: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WindowTitlePropertyGetsthetitleofthedocumentwindow.

SeeAlso|Example

Signature

object.WindowTitle

objectAecBaseDocumentTheobjectorobjectsthispropertyappliesto.

WindowTitleString;read-onlyThewindowtitleofthedocument.

Page 500: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XCountPropertySpecifiesthenumberofnodesalongtheXdirection.

SeeAlso|Example

Signature

object.XCount

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

XCountLong;read-writeThenumberofnodesalongtheXdirection.

Page 501: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XDistancePropertySpecifiesthedistancealongthecurve'sXaxistotheanchoredobject.

SeeAlso|Example

Signature

object.XDistance

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

XDistanceDouble;read-writeDistancealongthecurve'sXaxistotheanchoredobject.

Page 502: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XOffsetPropertySpecifiestheoffsetintheXdirectionoftheviewblockwithinthemulti-viewblock,orthexoffsetforthehatchpatternofadisplaycomponent.

SeeAlso|Example

Signature

object.XOffset

objectAecDisplayComponentHatch,AecViewBlockTheobjectthispropertyappliesto.

XOffsetDouble;read-writeTheoffsetintheXdirection.

Page 503: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XPositionFromPropertySpecifiesthepositiononthecurvefromwhichtheXDistancetoananchoredobjectismeasured.

SeeAlso|Example

Signature

object.XPositionFrom

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

XPositionFromAecCurvePositionenum;read-writeThepositiononthecurvefromwhichXDistanceismeasured.

Page 504: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XPositionToPropertySpecifiesthepositionontheanchoredobjecttomeasureXDistanceto.

SeeAlso|Example

Signature

object.XPositionTo

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

XPositionToAecEdgePositionenum;read-writeThepositionthatXDistancemeasuresto.

Page 505: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRefEditPropertyDeterminesifthecurrentdrawingcanbeeditedinplacewhenbeingreferencedbyanotheruser.

SeeAlso|Example

Signature

object.XRefEdit

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

XRefEditBoolean;read-write

TRUE:Allowsin-placereferenceediting.

FALSE:Doesnotallowin-placereferenceediting.

Systemvariables

ThevalueofthispropertyisstoredintheXEDITsystemvariable.

Remarks

TheinitialvalueofthispropertyisTRUE.

Page 506: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRefLayerVisibilityPropertyDeterminesthevisibilityofxref-dependentlayersandspecifiesifnestedxrefpathchangesaresaved.

SeeAlso|Example

Signature

object.XRefLayerVisibility

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

XRefLayerVisibilityBoolean;read-write

TRUE:Xref-dependentlayerchangesmadeinthecurrentdrawingtakeprecedence.

FALSE:Thelayertable,asstoredinthereferencedrawing(xref)takesprecedence.

Systemvariables

ThevalueofthispropertyisstoredintheVISRETAINsystemvariable.

Remarks

TheinitialvalueofthispropertyisTRUE.

WhenthispropertyissettoTRUE,layersettingsaresavedwiththecurrentdrawing'slayertableandpersistfromsessiontosession.Nestedxrefpathchangesaresavedwiththecurrentdrawingandpersistfromsessiontosession.

WhenthispropertyissettoFALSE,changesmadetoxref-dependentlayersinthecurrentdrawingarevalidinthecurrentsessiononly,butare

Page 507: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

notsavedwiththedrawing.Whenthecurrentdrawingisreopened,thelayertableisreloadedfromthereferencedrawingandthecurrentdrawingreflectsthosesettings.Thelayersettingsaffectedare:On/Off,Freeze/Thaw,Color,andLinetype.Thissettingalsospecifiesthatchangesmadetothepathsofnestedxrefsareforthecurrentsessiononlyandarenotsavedwiththedrawing.

Page 508: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XrefOverlaysUseOwnDisplayConfigPropertyWhenusedasanXrefOverlay,usethisdrawing'sdefaultdisplayconfigurationinitially.

SeeAlso|Example

Signature

object.XrefOverlaysUseOwnDisplayConfig

objectAecBaseDatabasePreferencesTheobjectorobjectsthispropertyappliesto.

XrefOverlaysUseOwnDisplayConfigBoolean;read-writeWhenusedasanXrefOverlay,usethisdrawing'sdefaultdisplayconfigurationinitially.

Page 509: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRotationPropertySpecifiestherotationoftheanchoredobjectaroundtheXaxis.

SeeAlso|Example

Signature

object.XRotation

objectAecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorEntToCurve,AecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

XRotationDouble;read-writeRotationoftheanchoredobjectaroundtheXaxis.

Page 510: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XSpacingPropertySpecifiesthespacingbetweennodesalongtheXdirectionofthelayoutgrid.

SeeAlso|Example

Signature

object.XSpacing

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

XSpacingACAD_DISTANCE;read-writeThespacingbetweennodesalongtheXdirectionofthelayoutgrid.

Page 511: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YAlignmentPropertySpecifiesthealignmentoftheanchoredobjectinrelationtothebaselineoftheassembly.

SeeAlso|Example

Signature

object.YAlignment

objectAecAnchorEntToGridAssemblyTheobjectthispropertyappliesto.

YAlignmentAecInfillAlignmentenum;read-writeAlignmentoftheinfillanchoredtotheassembly.(SeeRemarks.)

Remarks

TochangetheYAlignmentvalue,youmustfirstsetAllowVariationtoTrue.ModifyingYAlignmentwhenAllowVariationisFalsedoesnotresultinanerrororwarning,butithasnoeffect.

Page 512: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YCountPropertySpecifiesthenumberofnodesalongtheYdirection.

SeeAlso|Example

Signature

object.YCount

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

YCountLong;read-writeThenumberofnodesalongtheYdirection.

Page 513: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YDistancePropertySpecifiesthedistancealongthecurve'sYaxistotheanchoredobject.

SeeAlso|Example

Signature

object.YDistance

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

YDistanceDouble;read-writeDistancealongthecurve'sYaxistotheanchoredobject.

Page 514: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YOffsetPropertySpecifiestheYoffsetoftheanchoredobject,ortheoffsetintheYdirectionoftheviewblockwithinthemulti-viewblock,ortheYoffsetforthehatchpatternofadisplaycomponent.

SeeAlso|Example

Signature

object.YOffset

objectAecAnchorEntToGridAssembly,AecDisplayComponentHatch,AecViewBlockTheobjectthispropertyappliesto.

YOffsetDouble;read-writeTheoffsetintheYdirection.

Page 515: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YPositionFromPropertySpecifiesthepositiononthecurvefromwhichtheYDistancetoananchoredobjectismeasured.

SeeAlso|Example

Signature

object.YPositionFrom

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

YPositionFromAecCurveWidthPositionenum;read-writeThepositiononthecurvefromwhichYDistanceismeasured.

Page 516: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YPositionToPropertySpecifiesthepositionontheanchoredobjecttomeasureYDistanceto.

SeeAlso|Example

Signature

object.YPositionTo

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

YPositionToAecPositionenum;read-writeThepositionthatYDistancemeasuresto.

Page 517: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YSpacingPropertySpecifiesthespacingbetweennodesalongtheYdirectionofthelayoutgrid.

SeeAlso|Example

Signature

object.YSpacing

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

YSpacingACAD_DISTANCE;read-writeThespacingbetweennodesalongtheYdirectionofthelayoutgrid.

Page 518: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZCountPropertySpecifiesthenumberofnodesalongtheZdirection.

SeeAlso|Example

Signature

object.ZCount

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

ZCountLong;read-writeThenumberofnodesalongtheZdirection.

Page 519: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZDistancePropertySpecifiesthedistanceabovethecurvetotheanchoredobject.

SeeAlso|Example

Signature

object.ZDistance

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

ZDistanceDouble;read-writeDistanceabovethecurvetotheanchoredobject.

Page 520: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZOffsetPropertySpecifiestheoffsetintheZdirectionoftheviewblockwithinthemulti-viewblock.

SeeAlso|Example

Signature

object.ZOffset

objectAecViewBlockTheobjectthispropertyappliesto.

ZOffsetDouble;read-writeTheoffsetintheZdirectionoftheviewblockwithinthemulti-viewblock.

Page 521: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZoomPropertySpecifiesthefocallengthofthecamera,inmillimeters.

SeeAlso|Example

Signature

object.Zoom

objectAecCameraTheobjectthispropertyappliesto.

ZoomDouble;read-writeLengthofthelensinmillimeters.

Remarks

The LENSLENGTHsystemvariablewillberesettotheZoomvaluewhenthecamerageneratesaview.

Page 522: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZPositionFromPropertySpecifiesthepositiononthecurvefromwhichtheZDistancetoananchoredobjectismeasured.

SeeAlso|Example

Signature

object.ZPositionFrom

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

ZPositionFromAecCurveHeightPositionenum;read-writeThepositiononthecurvefromwhichZDistanceismeasured.

Page 523: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZPositionToPropertySpecifiesthepositionontheanchoredobjecttomeasureZDistanceto.

SeeAlso|Example

Signature

object.ZPositionTo

objectAecAnchorEntToCurveTheobjectthispropertyappliesto.

ZPositionToAecHeightenum;read-writeThepositionthatZDistancemeasuresto.

Page 524: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZRotationPropertySpecifiestherotationoftheanchoredobjectaroundtheZaxis.

SeeAlso|Example

Signature

object.ZRotation

objectAecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorEntToCurve,AecAnchorLeadEntToNodeTheobjectthispropertyappliesto.

ZRotationDouble;read-writeRotationoftheanchoredobjectaroundtheZaxis.

Page 525: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZSpacingPropertySpecifiesthespacingbetweennodesalongtheZdirectionofthelayoutgrid.

SeeAlso|Example

Signature

object.ZSpacing

objectAecLayoutGrid2D,AecLayoutGrid3DTheobjectthispropertyappliesto.

ZSpacingACAD_DISTANCE;read-writeThespacingbetweennodesalongtheZdirectionofthelayoutgrid.

Page 526: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ModifiedEventTriggeredwhenanobjectorcollectioninthedrawinghasbeenmodified.

SeeAlso|Example

Signature

object.Modified(Entity)Aec2dSection,AecAnchor,AecAnchorEntToCurve,AecAnchorEntToGridAssembly,AecAnchorEntToLayoutCell,AecAnchorEntToLayoutNode,AecAnchorEntToLayoutVolume,AecAnchorLeadEntToNode,AecAnchorToRef,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDictionary,AecDictRecord,AecEditInPlaceProfile,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayerKeyStyle,AecLayerKeyStyles,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMaskBlockStyle,AecMaskBlockStyles,AecMassElement,AecMassElementStyle,AecMassElementStyles,AecMassGroup,AecMVBlockRef,AecMVBlockStyle,AecMVBlockStyles,AecObject,AecPolygon,AecPolygonStyle,AecPolygonStyles,AecProfileStyle,AecProfileStyles,AecSlice,AecVolumeLayoutToolAnobjectexpressionthatevaluatestoavalidcontainerobject.

Page 527: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EntityADrawingObjectTheobjectinthedrawingthatismodifiedcanbeanyoneofthedrawingobjects.

Remarks

Thiseventwillbetriggeredwhenevertheobjectismodified.Modificationincludeswheneverthevalueofapropertyisset,evenifthenewvalueisequaltothecurrentvalue.

WhencodinginVBA,youmustprovideaneventhandlerforallobjectsenabledfortheModifiedevent.Ifyoudonotprovideahandler,VBAmayterminateunexpectedly.

Noeventswillbefiredwhileamodaldialogisbeingdisplayed.

Page 528: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AutoCADobjectandlayercolors.

ACAD_COLOR

Name Value DescriptionacByBlock 0 Thecolordefinedfortheobject'sblock.

acRed 1 (red)

acYellow 2 (yellow)

acGreen 3 (green)

acCyan 4 (cyan)

acBlue 5 (blue)

acMagenta 6 (magenta)

acWhite 7 (white)

acByLayer(notvalidforLayerobject) 256 Thecolorofthelayertheobjectison.

ACAD_COLOR

Page 529: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AutoCADobjectandlayercolors.

Value Description0 Thecolordefinedfortheobject'sblock.

1 (red)

2 (yellow)

3 (green)

4 (cyan)

5 (blue)

6 (magenta)

7 (white)

acByLayer(notvalidforLayerobject) 256 Thecolorofthelayertheobjectison.

Page 530: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Lineweights.

AcLineWeight

Name ValueacLnWtByBlock -2

acLnWtByLayer -1

acLnWtByLwDefault -3

acLnWt000 0

acLnWt005 5

acLnWt009 9

acLnWt013 13

acLnWt015 15

acLnWt018 18

acLnWt020 20

acLnWt025 25

acLnWt030 30

acLnWt035 35

acLnWt040 40

acLnWt050 50

acLnWt053 53

acLnWt060 60

acLnWt070 70

acLnWt080 80

acLnWt090 90

acLnWt100 100

acLnWt106 106

AcLineWeight

Page 531: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

acLnWt120 120

acLnWt140 140

acLnWt158 158

acLnWt200 200

acLnWt211 211

Page 532: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Drawingunits.

AcMeasurementUnit

Name ValueacEnglish English(Imperial)units

acMetric Metricunits

AcMeasurementUnit

Page 533: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thestateoftheapplicationwindow.

AcWindowState

Name Value DescriptionacNorm 1 Normal(neitherminimizedormaximized)

acMin 2 Minimized

acMax 3 Maximized

AcWindowState

Page 534: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Unitofmeasurement.

AecBuiltInUnit

Name Value DescriptionaecUnitAcre 57 Acre

aecUnitAmpere 5 Ampere

aecUnitAngstrom 17 Angstrom

aecUnitAre 58 Are(100squaremeters)

aecUnitAstronomicalUnit 18 AstronomicalUnit

aecUnitBarn 59 Barn

aecUnitBarrel 98 Barrel

aecUnitBoardFoot 99 BoardFoot

aecUnitBolt 36 Bolt(40yards)

aecUnitBushel 100 Bushel

aecUnitCable 35 Cable(720feet)

aecUnitCaliber 32 Caliber(.01inches)

aecUnitCandela 7 Candela

aecUnitCentare 60 .01are(1squaremeter)

aecUnitCentiliter 101 Centiliter

aecUnitCentimeter 24 Centimeter

aecUnitCentury 175 Century

aecUnitChain 37 Chain

aecUnitChainEngineers 38 100feet(30.48meters)

aecUnitCord 102 Cord

aecUnitCubicAngstrom 122 CubicAngstrom

aecUnitCubicAstronomicalUnit 123 CubicAstronomicalUnit

AecBuiltInUnit

Page 535: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitCubicBolt 124 CubicBolt

aecUnitCubicCable 125 CubicCable

aecUnitCubicCaliber 126 CubicCaliber

aecUnitCubicCentimeter 103 CubicCentimeter

aecUnitCubicChain 127 CubicChain

aecUnitCubicCubit 128 CubicCubit

aecUnitCubicDecimeter 177 CubicDecimeter

aecUnitCubicFathom 129 CubicFathom

aecUnitCubicFoot 130 CubicFoot

aecUnitCubicFurlong 131 CubicFurlong

aecUnitCubicGigameter 132 CubicGigameter

aecUnitCubicHand 133 CubicHand

aecUnitCubicHectometer 134 CubicHectometer

aecUnitCubicInch 135 CubicInch

aecUnitCubicLeagueNautical 136 CubicLeagueNautical

aecUnitCubicLeagueStatute 137 CubicLeagueStatute

aecUnitCubicLightYear 138 CubicLightYear

aecUnitCubicLink 139 CubicLink

aecUnitCubicMeter 96 CubicMeter

aecUnitCubicMil 140 CubicMil

aecUnitCubicMileNautical 141 CubicMileNautical

aecUnitCubicMileStatute 142 CubicMileStatute

aecUnitCubicMillimeter 143 CubicMillimeter

aecUnitCubicMillimicron 144 CubicMillimicron

aecUnitCubicLeagueNautical 136 CubicNauticalLeague

aecUnitCubicMileNautical 141 CubicNauticalMile

aecUnitCubicPace 145 CubicPace

aecUnitCubicPalm 146 CubicPalm

aecUnitCubicParsec 147 CubicParsec

Page 536: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitCubicPerch 148 CubicPerch

aecUnitCubicRope 149 CubicRope

aecUnitCubicSkein 150 CubicSkein

aecUnitCubicSpan 151 CubicSpan

aecUnitCubicLeagueStatute 137 CubicStatuteLeague

aecUnitCubicMileStatute 142 CubicStatuteMile

aecUnitCubicSurveyFoot 152 CubicSurveyFoot

aecUnitCubicYard 153 CubicYard

aecUnitCubit 40 Cubit

aecUnitDalton 154 Dalton(atomicmassunit)

aecUnitDay 169 Day

aecUnitDecade 174 Decade

aecUnitDecimeter 23 Decimeter

aecUnitDecistere 104 Decistere

aecUnitDekaliter 105 Dekaliter

aecUnitDekameter 22 Dekameter

aecUnitDekastere 106 Dekastere

aecUnitDimensionless 0 Dimensionless

aecUnitDram 107 Dram

aecUnitDryPint 108 DryPint

aecUnitDryQuart 109 DryQuart

aecUnitFathoms 34 Fathom

aecUnitFirkin 110 Firkin

aecUnitFluidOunce 116 FluidOunce

aecUnitFluidPint 118 FluidPint

aecUnitFluidQuart 119 FluidQuart

aecUnitFoot 30 Foot

aecUnitFortnight 171 Fortnight

aecUnitFurlong 41 Furlong

Page 537: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitGallon 111 Gallon

aecUnitGigameter 19 Gigameter

aecUnitGill 112 Gill(.5cups)

aecUnitGrain 155 Grain

aecUnitGram 156 Gram

aecUnitHand 42 Hand(4inches)

aecUnitHectare 61 Hectare

aecUnitHectometer 21 Hectometer

aecUnitHogshead 113 Hogshead

aecUnitHour 168 Hour

aecUnitHundredweight 157 Hundredweight

aecUnitInch 31 Inch

aecUnitJoule 12 Joule

aecUnitKelvin 4 Kelvin

aecUnitKilogram 1 Kilogram

aecUnitKiloliter 114 Kiloliter

aecUnitKilometer 20 Kilometer

aecUnitLeagueNautical 45 LeagueNautical

aecUnitLeagueStatute 46 LeagueStatute

aecUnitLightYear 28 LightYear

aecUnitLink 39 Link(7.92inches)

aecUnitLiter 97 Liter

aecUnitLongTon 158 2240pounds(1.016metrictons)

aecUnitLumen 11 Lumen

aecUnitLux 16 Lux

aecUnitMeter 2 Meter

aecUnitMicron 26 Micron

aecUnitMil 47 Mil

Page 538: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitMile 44 Mile

aecUnitMileNautical 43 MileNautical

aecUnitMillenium 176 Millenium

aecUnitMillimeter 25 Millimeter

aecUnitMillimicron 27 Millimicron

aecUnitMinim 115 Minim

aecUnitMinute 167 Minute

aecUnitMole 6 Mole

aecUnitLeagueNautical 45 NauticalLeague

aecUnitTonne 166 MetricTon(tonne)

aecUnitMileNautical 43 NauticalMile

aecUnitNewton 10 Newton

aecUnitOunce 159 Ounce

aecUnitOunceTroy 160 OunceTroy

aecUnitPace 48 Pace

aecUnitPalm 49 Palm(3inches)

aecUnitParsec 29 Parsec

aecUnitPascals 13 Pascal

aecUnitPeck 117 Peck

aecUnitPennyweight 161 Pennyweight

aecUnitPound 162 Pound

aecUnitRadian 8 Radian

aecUnitRegisterTon 120 RegisterTon

aecUnitRod 50 Rod

aecUnitRope 51 rope

aecUnitSecond 3 Second

aecUnitSiderealYear 172 SiderealYear

aecUnitSkein 52 Skein

Page 539: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitSlug 163 Slug

aecUnitSpan 53 Span

aecUnitSquareAngstrom 62 SquareAngstrom

aecUnitSquareAstronomicalUnit 63 SquareAngstrom

aecUnitSquareBolt 64 SquareBolt

aecUnitSquareCable 65 SquareCable

aecUnitSquareCaliber 66 SquareCaliber

aecUnitSquareCentimeter 67 SquareCentimeter

aecUnitSquareChain 94 SquareChain

aecUnitSquareCubit 68 SquareCubit

aecUnitSquareDecimeter 69 SquareDecimeter

aecUnitSquareFathom 70 SquareFathom

aecUnitSquareFoot 56 SquareFoot

aecUnitSquareFurlong 71 SquareFurlong

aecUnitSquareGigameter 72 SquareGigameter

aecUnitSquareHand 73 SquareHand

aecUnitSquareInch 74 SquareInch

aecUnitSquareKilometer 75 SquareKilometer

aecUnitSquareLeagueNautical 76 SquareLeagueNautical

aecUnitSquareLeagueStatute 77 SquareLeagueStatute

aecUnitSquareLightYear 78 SquareLightYear

aecUnitSquareLink 79 SquareLink

aecUnitSquareMeters 55 SquareMeter

aecUnitSquareMicron 80 SquareMicron

aecUnitSquareMil 81 SquareMil

aecUnitSquareMileNautical 82 SquareMileNautical

aecUnitSquareMileStatute 83 SquareMileStatute

aecUnitSquareMillimicron 84 SquareMillimicron

Page 540: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

aecUnitSquareLeagueNautical 76 SquareNauticalLeague

aecUnitSquareMileNautical 82 SquareNauticalMile

aecUnitSquarePace 85 SquarePace

aecUnitSquarePalm 86 SquarePalm

aecUnitSquareParsec 87 SquareParsec

aecUnitSquarePerch 88 SquarePerch

aecUnitSquareRope 89 SquareRope

aecUnitSquareSkein 90 SquareSkein

aecUnitSquareSpan 91 SquareSpan

aecUnitSquareLeagueStatute 77 SquareStatuteLeague

aecUnitSquareMileStatute 83 SquareStatuteMile

aecUnitSquareSurveyFoot 92 SquareSurveyFoot

aecUnitSquareYard 93 SquareYard

aecUnitLeagueStatute 46 StatuteLeague

aecUnitSteradian 9 Steradian

aecUnitStone 164 Stone

aecUnitSurveyFoot 54 SurveyFoot

aecUnitTon 165 Ton

aecUnitTonne 166 Tonne(metricton)

aecUnitTownship 95 Township(36squaremiles)

aecUnitTropicalYear 173 365days,5hours,48minutes,45.51seconds(astronomicalyear)

aecUnitTun 121 Tun

aecUnitVolt 15 Volt

aecUnitWatt 14 Watt

aecUnitWeek 170 Week

aecUnitYards 33 Yard

Page 541: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positiononthecurve.

AecCurveHeightPosition

Name Value DescriptionaecCurveHeightPositionBottom 0 Bottom

aecCurveHeightPositionCenter 1 Center

aecCurveHeightPositionTop 2 Top

AecCurveHeightPosition

Page 542: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positiononthecurve.

AecCurvePosition

Name Value DescriptionaecCurvePositionStart 0 Start

aecCurvePositionMiddle 1 Middle

aecCurvePositionEnd 2 End

AecCurvePosition

Page 543: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positiononthecurve.

AecCurveWidthPosition

Name Value DescriptionaecCurveWidthPositionLeft 0 Left

aecCurveWidthPositionCenter 1 Center

aecCurveWidthPositionRight 2 Right

AecCurveWidthPosition

Page 544: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positionmeasuredto.

AecEdgePosition

Name Value DescriptionaecEdgePositionStart 0 Start

aecEdgePositionCenter 1 Center

aecEdgePositionEnd 2 End

AecEdgePosition

Page 545: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positionontheobject.

AecHeight

Name Value DescriptionaecHeightBottom 0 Bottom

aecHeightCenter 1 Center

aecHeightTop 2 Top

AecHeight

Page 546: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Alignmentinrelationtobaseline.

AecInfillAlignment

Name Value DescriptionaecInfillAlignCentered 0 Centered

aecInfillAlignFrontFlush 1 Infrontofthebaseline

aecInfillAlignBackFlush 2 Inbackofthebaseline

AecInfillAlignment

Page 547: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Theshapeofalayoutgrid.

AecLayoutShape

Name Value DescriptionaecLayoutShapeRectangular 0 Rectangularlayout

aecLayoutShapeRadial 1 Radiallayout

aecLayoutShapeCustom 2 Customlayout

AecLayoutShape

Page 548: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Typeofnodespacingalongthecurve.

AecLayoutType

Name Value DescriptionaecLayoutTypeManualSpacing 0 Manualspacing

aecLayoutTypeAutoSpacingEven 1 Spacedevenlyalongthecurve

aecLayoutTypeAutoSpacingBay 2 Automaticspacing,determinedbythespecifieddistancebetweennodes

AecLayoutType

Page 549: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Subtypeofthemasselement.

AecMassElementSubType

Name Value DescriptionaecMassElementSubTypeUnspecified -1 Unspecified

aecMassElementSubTypeProfileInternal 0 ProfileInternal

aecMassElementSubTypeProfileExternal 1 ProfileExternal

AecMassElementSubType

Page 550: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Shapeofthemasselement.

AecMassElementType

Name Value DescriptionaecMassElementTypeArch 1 Arch

aecMassElementTypeBarrelVault 2 Barrelvault

aecMassElementTypeBox 0 Box

aecMassElementTypeDoric 3 Simplecolumn

aecMassElementTypeCone 4 Cone

aecMassElementTypeCylinder 5 Cylinder

aecMassElementTypeDome 6 Dome

aecMassElementTypeExtrusion 12 Extrusionofaprofile

aecMassElementTypeFreeForm 14 Freeform

aecMassElementTypeGable 7 Gable

aecMassElementTypeIsoscelesTriangle 8 Isoscelestriangle

aecMassElementTypePyramid 10 Pyramid

aecMassElementTypeRevolution 13 Revolvedprofile

aecMassElementTypeRightTriangle 9 Righttriangle

aecMassElementTypeSphere 11 Sphere

AecMassElementType

Page 551: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Typeofoperationcombiningobjects.

AecMassOperation

Name Value DescriptionaecMassOperationAdd 0 Addition

aecMassOperationSubtract 1 Subtraction

aecMassOperationIntersect 2 Intersection

AecMassOperation

Page 552: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlacementofedgesonAECPolygonvertices.

AecPolygonStyleEdgeWidthJustification

Name Value DescriptionaecPolygonEdgeWidthJustificationIn 0 Insideedge

aecPolygonEdgeWidthJustificationCenter 1 Center

aecPolygonEdgeWidthJustificationOut 2 Outsideedge

AecPolygonStyleEdgeWidthJustification

Page 553: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Positionontheobject.

AecPosition

Name Value DescriptionaecPositionFront 0 Front

aecPositionCenter 1 Center

aecPositionBack 2 Back

AecPosition

Page 554: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AddExampleSubExample_Add_AecProfile()

'Thisexampledefinesacustomprofileconsistingof'oftwotriangles,onewithintheother.

DimdocAsAecBaseDocumentDimappAsNewAecBaseApplicationDimprofileStyleAsAecProfileStyleDimprofileAsNewAecProfileDimprofileNameAsStringapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getexistingoraddanewprofilestyle.OnErrorResumeNextprofileName="BOOBYPRIZE"SetprofileStyle=doc.ProfileStyles.Add(profileName)

'Iferroroccurred,theprofileprobablyalreadyexists.IfErr.Number0ThenErr.ClearOnErrorGoTo0SetprofileStyle=doc.ProfileStyles.Item(profileName)EndIf

'Definedefinitionpointsforrings.DimOuterPts(0To7)AsDoubleDimInnerPts(0To7)AsDouble

OuterPts(0)=0:OuterPts(1)=0OuterPts(2)=648:OuterPts(3)=0OuterPts(4)=324:OuterPts(5)=324OuterPts(6)=0:OuterPts(7)=0

InnerPts(0)=120:InnerPts(1)=60

Page 555: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InnerPts(2)=528:InnerPts(3)=60InnerPts(4)=324:InnerPts(5)=264InnerPts(6)=120:InnerPts(7)=60

'Createandsettheouterring.Dimring1AsAecRingSetring1=profile.Rings.Addring1.FromPoints(OuterPts)ring1.Void=False

'Createandsettheinnerring.Dimring2AsAecRingSetring2=profile.Rings.Addring2.FromPoints(InnerPts)ring2.Void=True

'Settheprofiledefinition.SetprofileStyle.profile=profileMsgBox("Profile"""&profileName&"""created.")

EndSub

Page 556: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AdjustSizingExampleSubExample_AdjustSizing()

'Thisexamplemodifiesthetopoffsetoftheselectedobject'inrelationtoitsanchorpointonthegridassembly.It'promptstheusertoselecttheobjecttobemodified,'andthenitpromptstheusertospecifythenumberofinches'toadjusttheoffsetby.TheAdjustSizingpropertyischecked,'andifitisnotcurrentlysettoTrue,itisresetandthe'theuserisadvisedofthechange.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimoffsetAsStringDimoffset_adjustAsDoubleOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"AdjustSizingExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0

Page 557: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfanchorIsNothingThenMsgBox"Selectedobjectisnotanchored.",vbExclamation,"AdjustSizingExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"AdjustSizingExample"Else'AdjustSizingmustbesettoTrueinorderforoffsetchangetotakeeffect.Ifanchor.AdjustSizing=FalseThenanchor.AdjustSizing=TrueMsgBox"AdjustSizingresetfromFalsetoTrue"EndIfMsgBox"Topoffsetofobjectwas:"&anchor.TopOffset,vbInformation,"TopOffsetExample"'Promptusertospecifyamounttoadjustoffsetby.offset_adjust=ThisDrawing.Utility.GetReal("Enterthenumberofinchestoadjusttopoffsetby:")'Changeoffsetbyspecifiedamount.anchor.TopOffset=anchor.TopOffset+offset_adjustThisDrawing.Regen(acActiveViewport)MsgBox"Newtopoffsetis:"&anchor.TopOffset,vbInformation,"TopOffsetExample"EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"AdjustSizingExample"EndIf

EndSub

Page 558: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AllowVariationExampleSubExample_AllowVariation()

'Thisexamplewilladdanchoranewmasselementtocellinagridassembly.DimgridAsAecGridAssemblyDimpolyAsAecPolygonDimptAsVariantDimobjAsAcadObjectThisDrawing.Utility.GetEntityobj,pt,"Selectgridtoattachto"IfTypeOfobjIsAecGridAssemblyThenSetgrid=objSetpoly=ThisDrawing.ModelSpace.AddCustomObject("AecPolygon")DimanchorAsNewAecAnchorEntToGridAssemblyanchor.Reference=grid'anchorthemasselementtothefirstcellinthegridanchor.Cell=2anchor.AllowVariation=Trueanchor.BottomOffset=6anchor.LeftOffset=6anchor.RightOffset=6anchor.TopOffset=6anchor.YAlignment=aecInfillAlignFrontFlushanchor.AdjustSizing=Truepoly.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"NodeExample"EndIf

EndSub

Page 559: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AlternateNameExampleSubExample_AlternateName_Add_Aec()

'Thisexamplelistthemulti-viewblockstylesinthecurrent'drawing,andallowstheusertoaddanalternatenametoeach'style(ifanalternatenamedoesnotalreadyexist).'Usethisexamplewithadrawingthatcontainsoneormore'multi-viewblockstyles.

DimappAsNewAecBaseApplicationDimdocAsAecBaseDocumentDimmvblockStylesAsAecMVBlockStylesDimmvblockStyleAsAecMVBlockStyleDimmsgAsStringDimaltnameAsStringDimreplyAsIntegerapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument

'Getthecollectionofmulti-viewblockstylesinthedrawing.SetmvblockStyles=doc.mvblockStyles'Iftherearenomulti-viewblockstylesdefinedinthe'drawing,alertuserandthenexit.IfmvblockStyles.count=0Thenmsg="Therearenomulti-viewblockstylesinthedrawing."MsgBoxmsg,vbExclamation,"AlternateNameExample"ExitSubEndIf

'Listthenameandalternatenameofeachmulti-viewblock'styleinthecurrentdrawing.IfAlternateNameisblank,'allowusertosetit.ForEachmvblockStyleInmvblockStyles

Page 560: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

msg="MVblockstylename:"&mvblockStyle.Name&vbCrLfaltname=mvblockStyle.AlternateNameIfaltname=""Thenmsg=msg&"Thereisnoalternatenamefor"&mvblockStyle.Name&vbCrLf&"AddoneatCommandprompt?"reply=MsgBox(msg,vbYesNo,"SetalternatenameatCommandprompt?")'Promptusertoenteranalternatename,iftheychose'todoso.Ifreply=vbYesThendoc.Utility.Promptlistaltname=doc.Utility.GetString(True,"Alternatename-->")mvblockStyle.AlternateName=altnameEndIfElsemsg=msg&"Alternatename:"&mvblockStyle.AlternateName&vbCrLfMsgBoxmsg,vbInformation,"AlternameNameExample"EndIfNext

EndSub

Page 561: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Angle1ExampleSubExample_Angle1()

'Thisexampleshowsthedeviationofcutplaneatstartingedgewherezerois'perpendiculartothebuildingelevationline

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"Angle1is:"&clip.Angle1,vbInformation,"Angle1Example"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"Angle1Example"EndIf

EndSub

Page 562: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Angle2ExampleSubExample_Angle2()

'Thisexampleshowsthedeviationofcutplaneatstartingedgewherezerois'perpendiculartothebuildingelevationline

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"Angle2is:"&clip.Angle2,vbInformation,"Angle2Example"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"Angle2Example"EndIf

EndSub

Page 563: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngleFromNodeExampleSubExample_AngleFromNode()

'Thisexamplewillfindtheanglefromthenodeforabubbleattachedtoa'columngridDimobjAsAcadObjectDimbubbleAsAecMVBlockRefDimanchorAsAecAnchorDimleaderAnchorAsAecAnchorLeadEntToNodeDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectbubble"IfTypeOfobjIsAecMVBlockRefThenSetbubble=objSetanchor=obj.GetAnchorIfTypeOfanchorIsAecAnchorLeadEntToNodeThenSetleaderAnchor=anchorMsgBox"Anglefromnode="&ThisDrawing.Utility.AngleToString(leaderAnchor.AngleFromNode,acDegrees,4),vbInformation,"ExampleAngleFromNode"ElseMsgBox"Notanchoredtocolumngrid",vbInformation,"ExampleAngleFromNode"EndIfElseMsgBox"Notabubble",vbInformation,"ExampleAngleFromNode"EndIf

EndSub

Page 564: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularAzimuthExampleSubExample_AngularAzimuth()

'ThisexamplereturnstheAngularAzimuthsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

'Converttheconstanttoastring.

DimStyleAsString

DimAngAzmAsLong

'DetermineAngularAzimuthsetting

AngAzm=dbPref.AngularAzimuth

SelectCaseAngAzm

Case0

Style="bearings."

Case1

Style="northazimuths."

Case2

Style="southazimuths."

Page 565: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSelect

MsgBox"ThecurrentvalueforAngularAzimuthis"&Style,vbInformation,"AngularAzimuthExample"

EndSub

Page 566: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularDisplayFormatExampleSubExample_AngularDisplayFormat()'ThisexamplereturnstheAngularDisplayFormatsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferencesSetdbPref=AecArchBaseApplication.ActiveDocument.Preferences'Converttheconstanttoastring.DimstrUnitsAsStringSelectCasedbPref.AngularDisplayFormatCase0strUnits="Degrees."Case1strUnits="Degrees/Minutes/Seconds"Case2strUnits="Grads."Case3strUnits="Radians"Case4strUnits="Surveyor"EndSelectMsgBox"ThecurrentvalueforAngularDisplayFormatis"&strUnits,_vbInformation,"AngularDisplayFormatExample"EndSub

Page 567: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AngularPrecisionExampleSubExample_AngularPrecision()

'ThisexamplereturnstheAngularPrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforAngularPrecisionis"&dbPref.AngularPrecision,_

vbInformation,"AngularPrecisionExample"

EndSub

Page 568: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ApplicationExampleSubExample_Application()'Thisexamplecreatesalineandthenusesthe'Applicationpropertyofthelinetoreturnthe'applicationname.DimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoubleDimmyAppAsAcadApplication'CreateanewlinereferencestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=2:endPoint(1)=2:endPoint(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)lineObj.Update

'ReturntheapplicationfortheobjectSetmyApp=lineObj.Application'DisplaythenameoftheapplicationMsgBox"Theapplicationnameis:"&myApp.name,vbInformation,"ApplicationExample"EndSub

Page 569: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ApplyResizeExampleSubExample_ApplyResize()

'Thisexamplewilltakeamasselementanchoredtoa2DLayoutGrid,and'applyaResizeOffsettoit.

DimobjAsAcadObjectDimanchorAsAecAnchorEntToLayoutCellDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectanchoredelement"IfTypeOfobjIsAecMassElementThenDimmassAsAecMassElementSetmass=objIfTypeOfmass.GetAnchorIsAecAnchorEntToLayoutCellThenSetanchor=mass.GetAnchoranchor.ResizeOffset=-22anchor.ApplyResize=FalseEndIfEndIf

EndSub

Page 570: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaExampleExamples:

lAecProfile

lAecSlice

SubExample_Area_AecProfile()

'ThisexampleshowstheareaoftheprofileofanAecPolygon

DimobjAsObjectDimptAsVariantDimpolyAsAecPolygonThisDrawing.Utility.GetEntityobj,pt,"SelectanAECPolygon"

IfTypeOfobjIsAecPolygonThenSetpoly=objMsgBox"ProfileArea:"&poly.Profile.Area,vbInformation,"AreaExample"ElseMsgBox"NotaPolygonornoProfileFound",vbInformation,"AreaExample"EndIf

EndSub

SubExample_Area_AecSlice()

'ThisexamplewilldisplaytheareaofonesliceinthecurrentdrawingDimsliceAsAecSliceDimobjAsObjectDimcounterAsInteger

Page 571: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

counter=0ForEachobjInThisDrawing.ModelSpaceIfTypeOfobjIsAecSliceAndcounter<1Thencounter=counter+1Setslice=objMsgBox"SliceArea:"&slice.Area,vbInformation,"AreaExample"EndIfNextIfcounter=0ThenMsgBox"NoSliceinDrawing",vbInformation,"AreaExample"EndIf

EndSub

Page 572: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaDisplayUnitExampleSubExample_AreaDisplayUnit()

'ThisexamplereturnstheAreaDisplayUnitsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Converttheareadisplayunittoastring.

DimunitAsString

SelectCasedbPref.AreaDisplayUnit

CaseaecUnitSquareInch

unit="squareinch."

CaseaecUnitSquareFoot

unit="squarefoot."

CaseaecUnitSquareYard

unit="squareyard."

CaseaecUnitSquareMil

unit="squaremillimeters."

CaseaecUnitSquareCentimeter

Page 573: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

unit="squarecentimeters."

CaseaecUnitSquareDecimeter

unit="squaredecimeters."

CaseaecUnitSquareMeters

unit="squaremeters."

EndSelect

MsgBox"ThecurrentvalueforAreaDisplayUnitis"&unit,_

vbInformation,"AreaDisplayUnitExample"

EndSub

Page 574: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaPrecisionExampleSubExample_AreaPrecision()

'ThisexampledisplaystheAreaPrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThecurrentvalueforAreaPrecisionis:"&dbPref.AreaPrecision,_

vbInformation,"AreaPrecisionExample"

EndSub

Page 575: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AreaSuffixExampleSubExample_AreaSuffix()

'ThisexampledisplaystheAreaSuffixsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThecurrentvalueforAreaSuffixis:"&dbPref.AreaSuffix,_

vbInformation,"AreaSuffixExample"

EndSub

Page 576: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayPolarExampleSubExample_ArrayPolar()'Thisexamplecreatesacircleandthenperformsapolararray'onthatcircle.'CreatethecircleDimcircleObjAsAcadCircleDimcenter(0To2)AsDoubleDimradiusAsDoublecenter(0)=2#:center(1)=2#:center(2)=0#radius=1SetcircleObj=ThisDrawing.ModelSpace.AddCircle(center,radius)ZoomAllMsgBox"Performthepolararrayonthecircle.",,"ArrayPolarExample"'DefinethepolararrayDimnoOfObjectsAsIntegerDimangleToFillAsDoubleDimbasePnt(0To2)AsDoublenoOfObjects=4angleToFill=3.14'180degreesbasePnt(0)=4#:basePnt(1)=4#:basePnt(2)=0#'Thefollowingexamplewillcreate4copiesofanobject'byrotatingandcopyingitaboutthepoint(3,3,0).DimretObjAsVariantretObj=circleObj.ArrayPolar(noOfObjects,angleToFill,basePnt)ZoomAllMsgBox"Polararraycompleted.",,"ArrayPolarExample"EndSub

Page 577: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ArrayRectangularExampleSubExample_ArrayRectangular()'Thisexamplecreatesacircleandthenperforms'arectangulararrayonthatcircle.'CreatethecircleDimcircleObjAsAcadCircleDimcenter(0To2)AsDoubleDimradiusAsDoublecenter(0)=2#:center(1)=2#:center(2)=0#radius=0.5SetcircleObj=ThisDrawing.ModelSpace.AddCircle(center,radius)ThisDrawing.Application.ZoomAllMsgBox"Performtherectangulararrayonthecircle.",,"ArrayRectangularExample"'DefinetherectangulararrayDimnumberOfRowsAsLongDimnumberOfColumnsAsLongDimnumberOfLevelsAsLongDimdistanceBwtnRowsAsDoubleDimdistanceBwtnColumnsAsDoubleDimdistanceBwtnLevelsAsDoublenumberOfRows=5numberOfColumns=5numberOfLevels=2distanceBwtnRows=1distanceBwtnColumns=1distanceBwtnLevels=1'CreatethearrayofobjectsDimretObjAsVariantretObj=circleObj.ArrayRectangular(numberOfRows,numberOfColumns,numberOfLevels,distanceBwtnRows,distanceBwtnColumns,distanceBwtnLevels)ZoomAllMsgBox"Rectangulararraycompleted.",,"ArrayRectangularExample"EndSub

Page 578: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachAnchorExampleSubExample_AttachAnchor()'Thisexamplewillmakeamasselementandandanchorittoaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortomass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 579: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AttachEntityExampleSubExample_AttachEntity()

'Thisexamplewillmakeamasselementandandanchorittoaline.DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.AttachEntitymass'attachthemasselementtotheanchor

EndSub

Page 580: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BasePointExampleSubExample_BasePoint()

'ThisexampledisplaystheBasePointsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

DimvarPointAsVariant

Dimpoint(0To2)AsDouble

DimbasePointAsString

'Getthebasepoint

varPoint=dbPref.BasePoint

point(0)=varPoint(0)

point(1)=varPoint(1)

point(2)=varPoint(2)

'Formatbasepointtoastring

basePoint=Format(point(0))+","+Format(point(1))+","+Format(point(2))

MsgBox"ThecurrentvalueforBasePointis:"&basePoint,vbInformation,"BasePointExample"

Page 581: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

Page 582: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BasePointNEExampleSubExample_BasePointNE()

'ThisexampledisplaystheBasePointNEsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

DimvarPointAsVariant

Dimpoint(0To2)AsDouble

DimbasePointNEAsString

'Getthebasepoint

varPoint=dbPref.basePointNE

point(0)=varpoint(0)

point(1)=varpoint(1)

point(2)=varpoint(2)

'Formatbasepointtoastring

basePointNE=Format(point(0))+","+Format(point(1))+","+Format(point(2))

Page 583: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBox"ThecurrentvalueforBasePointNEis:"&basePointNE,_

vbInformation,"BasePointNEExample"

EndSub

Page 584: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BlocksExampleSubExample_Blocks()'Thisexamplefirstfindstheblockscollection'usingtheBlocksproperty.Itthenaddsanew'blocktotheblockcollection.DimblkCollAsAcadBlocksDimnewBlockAsAcadBlockDiminsertionPnt(0To2)AsDouble'GettheBlockscollectionSetblkColl=ThisDrawing.Blocks'DefinetheinsertionpointforthenewblockinsertionPnt(0)=0#:insertionPnt(1)=0#:insertionPnt(2)=0#'AddthenewblockintotheblockscollectionSetnewBlock=blkColl.Add(insertionPnt,"TEST")MsgBox"Ablockcalled"&newBlock.name&"hasbeenaddedtotheblockscollection",vbInformation,"BlocksExample"EndSub

Page 585: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BottomOffsetExampleSubExample_BottomOffset()

'Thisexamplemodifiesthebottomoffsetoftheselectedobject'inrelationtoitsanchorpointonthegridassembly.It'promptstheusertoselecttheobjecttobemodified,'andthenitpromptstheusertospecifythenumberofinches'toadjusttheoffsetby.Thenumbercanbeeitherpositive'ornegative.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.

DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimoffsetAsStringDimoffset_adjustAsDoubleOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"BottomOffsetExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0IfanchorIsNothingThen

Page 586: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBox"Selectedobjectisnotanchored.",vbExclamation,"BottomOffsetExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"BottomOffsetExample"Else'AdjustSizingmustbesettoTrueinorderforoffsetchangetotakeeffect.anchor.AdjustSizing=TrueMsgBox"Bottomoffsetofobjectwas:"&anchor.BottomOffset,vbInformation,"BottomOffsetExample"'Promptusertospecifyamounttoadjustoffsetby.offset_adjust=ThisDrawing.Utility.GetReal("Enterthenumberofinchestoadjusttopoffsetby:")'Changeoffsetbyspecifiedamount.anchor.BottomOffset=anchor.BottomOffset+offset_adjustThisDrawing.Regen(acActiveViewport)MsgBox"Newbottomoffsetis:"&anchor.BottomOffset,vbInformation,"BottomOffsetExample"EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"BottomOffsetExample"EndIf

EndSub

Page 587: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

BoundsExampleSubExample_Bounds()

'Thisexamplewilldisplaytheboundsofthefirstprofileinthedrawing.

DimdocAsAecArchBaseDocumentDimcProfileStylesAsAecProfileStylesDimprofileStyleAsAecProfileStyleDimprofileAsAecProfile

Setdoc=AecArchBaseApplication.ActiveDocumentSetcProfileStyles=doc.ProfileStylesIfcProfileStyles.Count>0ThenSetprofileStyle=cProfileStyles.Item(0)Setprofile=profileStyle.profileMsgBox"ProfileBounds:"&vbCR&_

"TopLeft:"&Format(profile.bounds(0),"0.000")&","&Format(profile.bounds(1),"0.000")&vbCr&_ "BottomRight:"&Format(profile.bounds(2),"0.000")&","&Format(profile.bounds(3),"0.000"),_

vbInformation,"BoundsExample"ElseMsgBox"NoAECProfilesinthedrawing",vbInformation,"BoundsExample"EndIf

EndSub

Page 588: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CellExampleSubExample_Cell()

'Thisexamplewilladdanchoranewmasselementtocellina2Dlayoutgrid.DimgridAsAecGridAssemblyDimmassAsAecMassElementDimptAsVariantDimobjAsAcadObjectThisDrawing.Utility.GetEntityobj,pt,"Selectgridtoattachto"IfTypeOfobjIsAecGridAssemblyThenSetgrid=objSetmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")DimanchorAsNewAecAnchorEntToGridAssemblyanchor.Reference=grid'anchorthemasselementtothefirstcellinthegridanchor.Cell=1mass.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"NodeExample"EndIf

EndSub

Page 589: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CenterOnNodeExampleSubExample_CenterOnNode()

'ThisexampleattachesaMassElementtoa2DLayoutGrid,andcentersthemasson

'thenode.

DimobjAsAcadObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenDimgridAsAecLayoutGrid2DSetgrid=objDimmassAsAecMassElementSetmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")DimanchorAsNewAecAnchorEntToLayoutNodeanchor.Reference=gridanchor.Node=1anchor.CenterOnNode=Truemass.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"CenterOnNodeExample"EndIf

EndSub

Page 590: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CentroidExampleSubExample_Centroid()

'Thisexamplewilldisplaythecentroidofthefirstprofileinthedrawing.

DimdocAsAecArchBaseDocumentDimcProfileStylesAsAecProfileStylesDimprofileStyleAsAecProfileStyleDimprofileAsAecProfile

Setdoc=AecArchBaseApplication.ActiveDocumentSetcProfileStyles=doc.ProfileStylesIfcProfileStyles.Count>0ThenSetprofileStyle=cProfileStyles.Item(0)Setprofile=profileStyle.profileMsgBox"ProfileCentroid:"&profile.Centroid(0)&","&profile.Centroid(1),_vbInformation,"CentroidExample"ElseMsgBox"NoAECProfilesinthedrawing",vbInformation,"CentroidExample"EndIf

EndSub

Page 591: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ClearExampleSubExample_Clear_AecProfile()

'ThisexamplecopiesaprofileandusestheClearmethodto'removealltheringsfromthenewcopy.'Theexamplelooksforaprofilestylenamed'"Hinged-Double-FullLite."Ifyoudonothavethisstyle'inthecurrentdrawing,changethenameofthestyletoone'thatexistsinyourdrawing.

DimdocAsAecBaseDocumentDimappAsNewAecBaseApplicationDimprofileStyleAsAecProfileStyleDimprofileAsNewAecProfileDimcopied_profileAsNewAecProfileDimprofileNameAsStringDimmsgAsStringapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getthespecifiedprofilestyle.OnErrorResumeNextprofileName="Hinged-Double-FullLite"SetprofileStyle=doc.ProfileStyles.Item(profileName)'Ifanerroroccurred,theprofileprobablydoesn'texist.IfErr.Number0ThenMsgBox"Profile"&profileName&"doesnotexist.",vbExclamation,"ClearExample"ExitSubEndIf

'SetanAecProfileobjecttothestyleyouretrieved.Setprofile=profileStyle.profile

Page 592: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

'Copytheprofile.copied_profile.CopyFromprofilemsg="Copiedprofilehad"&copied_profile.Rings.count&"rings."&vbCrLf'RemovetheringsinthecopiedprofileusingtheClearmethod.copied_profile.Clearmsg=msg&"AfterClear,thecopiedprofilehas"&copied_profile.Rings.count&"rings."&vbCrLfMsgBoxmsg,vbInformation,"ClearExample"

EndSub

EndSub

Page 593: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ContainsExampleSubExample_Contains()

'ThisexamplewillcheckifanAecRingcontainsanotherAecRing.

OnErrorResumeNextDimpointList1(0To9)AsDoubleDimpointList2(0To9)AsDoublepointList1(0)=0:pointList1(1)=0pointList1(2)=1:pointList1(3)=0pointList1(4)=1:pointList1(5)=1pointList1(6)=0:pointList1(7)=1pointList1(8)=0:pointList1(9)=0

pointList1(0)=0.25:pointList1(1)=0.25pointList1(2)=0.75:pointList1(3)=0.25pointList1(4)=0.75:pointList1(5)=0.75pointList1(6)=0.25:pointList1(7)=0.75pointList1(8)=0.25:pointList1(9)=0.25

Dimring1AsAecRingDimring2AsAecRingDimprofile1AsNewAecProfileDimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyleDimprofileAsAecProfile

Setcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item("ContainsRing")IfprofileStyleIsNothingThenSetprofileStyle=cprofiles.Add("ContainsRing")EndIfSetring1=profile1.Rings.AddSetring2=profile1.Rings.Add

Page 594: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ring1.FromPoints(pointList1)ring2.FromPoints(pointList2)MsgBox"Ring1containsRing2is:"&ring1.Contains(ring2)

EndSub

Page 595: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ContourLinesPerSurfaceExampleSubExample_ContourLinesPerSurface()'Thisexamplereturnsthecurrentsettingof'ContourLinesPerSurface.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrContourLinesPerSurfaceAsIntegerDimnewContourLinesPerSurfaceAsInteger'RetrievethecurrentContourLinesPerSurfacevaluecurrContourLinesPerSurface=ThisDrawing.preferences.ContourLinesPerSurfaceMsgBox"ThecurrentvalueforContourLinesPerSurfaceis"&currContourLinesPerSurface,vbInformation,"ContourLinesPerSurfaceExample"'ChangethevalueforContourLinesPerSurfacenewContourLinesPerSurface=2001ThisDrawing.preferences.ContourLinesPerSurface=newContourLinesPerSurfaceMsgBox"ThenewvalueforContourLinesPerSurfaceis"&newContourLinesPerSurface,vbInformation,"ContourLinesPerSurfaceExample"'ResetContourLinesPerSurfacetoitsoriginalvalueThisDrawing.preferences.ContourLinesPerSurface=currContourLinesPerSurfaceMsgBox"TheContourLinesPerSurfacevalueisresetto"&currContourLinesPerSurface,vbInformation,"ContourLinesPerSurfaceExample"EndSub

Page 596: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ConvertToCurrentAreaDisplayExampleSubExample_ConvertToCurrentAreaDisplay()

'ThisexamplereturnsthevalueofConvertToCurrentAreaDisplay

'forthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Settheareadisplayunitstosquareyards

dbPref.AreaDisplayUnit=aecUnitSquareYard

DimSourceAreaAsDouble

DimTargetAreaAsDouble

SourceArea=36.0*36.0'Squareunits,assumesdrawingsettoinchunits

TargetArea=dbPref.ConvertToCurrentAreaDisplay(SourceArea)

MsgBox"Theareatoconvertis"&sourcearea&"squareinches."&vbCrLf&_

"TheAreaDisplayUnitissettosquareyard."&vbCrLf&_

"ThevalueforConvertToCurrentAreaDisplayis"&TargetArea&"squareyards.",_

Page 597: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

vbInformation,"ConvertToCurrentAreaDisplayExample"

EndSub

Page 598: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ConvertToCurrentVolumeDisplayExampleSubExample_ConvertToCurrentVolumeDisplay()

'ThisexamplereturnsthevalueofConvertToCurrentVolumeDisplay

'forthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Setthevolumedisplayunitstocubicyards

dbPref.VolumeDisplayUnit=aecUnitCubicYard

DimSourceAreaAsDouble

DimTargetAreaAsDouble

SourceArea=36#*36#*36#'Cubicinches

TargetArea=dbPref.ConvertToCurrentVolumeDisplay(SourceArea)

MsgBox"Theareatoconvertis"&SourceArea&"cubicinches."&vbCrLf&_

"TheVolumeDisplayUnitissettocubicyard."&vbCrLf&_

"ThevalueforConvertToCurrentVolumeDisplayis"&TargetArea&""&dbpref.VolumeSuffix,_

Page 599: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

vbInformation,"ConvertToCurrentVolumeDisplayExample"

EndSub

Page 600: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CoordinatePrecisionExampleSubExample_CoordinatePrecision()

'ThisexamplereturnstheCoordinatePrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforCoordinatePrecisionis:"&dbPref.CoordinatePrecision,_

vbInformation,"CoordinatePrecisionExample"

EndSub

Page 601: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyExampleSubExample_Copy()'Thisexamplecreatesacircleandthencopies'thatcircle.Thenewcircleisthenmoved'andcoloredred.'CreatethecircleDimcircleObjAsAcadCircleDimcenter(0To2)AsDoubleDimradiusAsDoublecenter(0)=2#:center(1)=2#:center(2)=0#radius=0.5SetcircleObj=ThisDrawing.ModelSpace.AddCircle(center,radius)ZoomAllMsgBox"Copythecircle.",,"CopyExample"'CopythecircleDimcopyCircleObjAsAcadCircleSetcopyCircleObj=circleObj.Copy()'DefinethepointsthatmakeupthemovevectorDimpoint1(0To2)AsDoubleDimpoint2(0To2)AsDoublepoint1(0)=0:point1(1)=0:point1(2)=0point2(0)=2:point2(1)=0:point2(2)=0MsgBox"Movethecopiedcircle2unitsintheXdirection.",,"CopyExample"'MovethecircleandcoloritcopyCircleObj.Movepoint1,point2copyCircleObj.Color=acRedZoomAllMsgBox"Movecompleted.",,"CopyExample"EndSub

Page 602: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyFromExampleSubExample_CopyFrom_AecProfile()

'ThisexamplecopiesanexistingprofileusingtheCopyFrommethod.'Theexamplelooksforaprofilestylenamed'"Hinged-Double-FullLite."Ifyoudonothavethisstyle'inthecurrentdrawing,changethenameofthestyletoone'thatexistsinyourdrawing.

DimdocAsAecBaseDocumentDimappAsNewAecBaseApplicationDimprofileStyleAsAecProfileStyleDimprofileAsNewAecProfileDimcopied_profileAsNewAecProfileDimprofileNameAsStringDimmsgAsStringapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getthespecifiedprofilestyle.OnErrorResumeNextprofileName="Hinged-Double-FullLite"SetprofileStyle=doc.ProfileStyles.Item(profileName)'Ifanerroroccurred,theprofileprobablydoesn'texist.IfErr.Number0ThenMsgBox"Profile"&profileName&"doesnotexist.",vbExclamation,"CopyFromExample"ExitSubEndIf

'SetanAecProfileobjecttothestyleyouretrieved.Setprofile=profileStyle.profile'Copytheprofile.

Page 603: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

copied_profile.CopyFromprofile

msg="Copiedprofilehad"&copied_profile.Rings.count&"rings."&vbCrLfMsgBoxmsg,vbInformation,"CopyFromExample"

EndSub

Page 604: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CopyObjectsExampleSubExample_CopyObjects()'ThisexamplecreatesaCircleobjectandusestheCopyObjects'methodtomakeacopyofthenewCircle.

DimDOC1AsAcadDocumentDimcircleObj1AsAcadCircle,circleObj2AsAcadCircleDimcircleObj1CopyAsAcadCircle,circleObj2CopyAsAcadCircleDimcenterPoint(0To2)AsDoubleDimradius1AsDouble,radius2AsDoubleDimradius1CopyAsDouble,radius2CopyAsDoubleDimobjCollection(0To1)AsObjectDimretObjectsAsVariant'DefinetheCircleobjectcenterPoint(0)=0:centerPoint(1)=0:centerPoint(2)=0radius1=5#:radius2=7#radius1Copy=1#:radius2Copy=2#'CreateanewdrawingSetDOC1=Documents.Add'AddtwocirclestothedrawingSetcircleObj1=DOC1.ModelSpace.AddCircle(centerPoint,radius1)SetcircleObj2=DOC1.ModelSpace.AddCircle(centerPoint,radius2)ThisDrawing.Application.ZoomAll'Copyobjects''FirstputtheobjectstobecopiedintoaformcompatiblewithCopyObjectsSetobjCollection(0)=circleObj1SetobjCollection(1)=circleObj2'Copyobjectandgetbackacollectionofthenewobjects(copies)retObjects=DOC1.CopyObjects(objCollection)'Getnewlycreatedobjectandapplynewpropertiestothecopies

Page 605: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetcircleObj1Copy=retObjects(0)SetcircleObj2Copy=retObjects(1)circleObj1Copy.radius=radius1CopycircleObj1Copy.Color=acRedcircleObj2Copy.radius=radius2CopycircleObj2Copy.Color=acRedThisDrawing.Application.ZoomAllMsgBox"Circlescopied."EndSub

Page 606: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CountExampleSubExample_Count()'ThisexamplewilldisplaythenumberofMultiViewBlockStylesinthecurrentdrawing.

DimdocAsAecArchBaseDocumentDimcMvBlockStylesAsAecMVBlockStylesSetdoc=AecArchBaseApplication.ActiveDocumentSetcMvBlockStyles=doc.MVBlockStylesMsgBox"NumberofMVBlockStylesinthisdrawingis:"&cMvBlockStyles.count,vbInformation,"CountExample"

EndSub

Page 607: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DatabaseExampleSubExample_Database()'ThisexamplereferencestheDatabaseobjectobtainedfromthemodelspace.'WethendisplayinformationfromtheDatabaseobject.DimDatabaseAsAcadDatabase'AttachtoDatabaseobjectSetDatabase=ThisDrawing.ModelSpace.DatabaseMsgBox"WenowhaveaccesstothepropertiesandmethodsoftheDatabaseobject!"'RetrievethenumberofBlocksinthisdatabaseMsgBox"ThenumberofBlocksinthisdatabaseis:"&Database.Blocks.count

'ReleaseobjectSetDatabase=NothingMsgBox"TheDatabaseobjecthasbeenreleased!"EndSub

Page 608: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DatabaseScaleExampleSubExample_DatabaseScale()

'ThisexamplereturnstheDatabaseScalesettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforDatabaseScaleis:"&dbPref.DatabaseScale,_

vbInformation,"DatabaseScaleExample"

EndSub

Page 609: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DeleteExampleSubExample_Delete()

'Thisexamplepromptsuserstoselectadrawingobject,then'deletesthatobject.ItthenissuestheUndocommandto'reversethedelete.

DimobjAsAcadObjectDimentAsAecEntityDimpickPtAsVariant

OnErrorResumeNextThisDrawing.Utility.GetEntityobj,pickPt,"PleaseselectanAECobject:"&vbCrLfOnErrorGoTo0'VerifythatanAECobjectwasselected.IfobjIsNothingThenMsgBox"Nothingselected.",vbExclamation,"DeleteExample"ExitSubElseIfNot(TypeOfobjIsAecEntity)ThenMsgBox"TheobjectyouselectedisnotanAECobject.",vbExclamation,"DeleteExample"ExitSubElseSetent=objSetobj=NothingEndIf

'Deletetheselectedobject.ent.DeleteThisDrawing.Regen(acActiveViewport)MsgBox"Theselectedobjectwastemporarilydeleted.",vbExclamation,"DeleteExample"

'Undothedelete.ThisDrawing.SendCommand"_undo"&vbCr&vbCr

EndSub

Page 610: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DepthExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

lAecMassElement

SubExample_Depth_AecLayoutGrid2D()'Thisexampledisplaysthedepthofa2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimmsgAsStringDimangAsStringAsString'Askusertoselectagrid.ThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetobj=Nothing'Ifthegridisradial,thenDepthisanangle,inradians.'Thereisnowaytocheckthegridtype,becausethereis'noShapepropertyexposed.Sothisexampledisplaysboth'therawvalue(tothreedecimalplaces)andthevaluein'degrees(convertedfromradians).msg=msg&"Depthis"&Format(grid.Depth,"0.000")'Converttheradianvaluetodegreeswithaprecisionof2.angAsString=ThisDrawing.Utility.AngleToString(grid.Depth,acDegrees,2)msg=msg&"(ifradial,thisis"&angAsString&"degrees)"&vbCrLf

Page 611: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBoxmsg,vbInformation,"DepthExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"DepthExample"EndIf

EndSub

SubExample_Depth_AecLayoutGrid3D()

'Thisexampledisplaysthedepthofa3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridDepthis:"&grid.Depth,vbInformation,"DepthExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"DepthExample"EndIf

EndSub

SubExample_Depth_AecMassElement()

'ThisexampleshowsthesizeofthemasselementinitsrelativeYdirection

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectMsgBox"MassElement"&count&"Depthis:"&mass.Depth,vbInformation,"DepthExample"EndIf

Page 612: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"DepthExample"EndIf

EndSub

Page 613: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DescriptionExampleSubExample_Description()

'ThisexamplewilldisplaythedescriptionofanAECEntity.

DimobjAsAcadObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectAECObject"IfTypeOfobjIsAecGeoThenDimAecGeoAsAecGeo'AecGeoisthebaseclassforallthedrawnAECEntitiesSetAecGeo=objMsgBox"AECDescription:"&AecGeo.Description,vbInformation,"DescriptionExample"ElseMsgBox"NoAECEntityselected",vbInformation,"DescriptionExample"EndIf

EndSub

Page 614: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DictionariesExampleSubExample_Dictionaries()'Thisexamplefindsthecurrentdictionarycollectionand'addsanewdictionarytothatcollection.DimdictAsAcadDictionarySetdict=ThisDrawing.Dictionaries.Add("TEST")MsgBox"Anewdictionarycalled"&dict.name&"hasbeenaddedtothedictionariescollection.",vbInformation,"DictionariesExample"EndSub

Page 615: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimStylesExampleSubExample_DimStyles()'Thisexampleaddsanewdimensionstyle.DimdimStyleAsAcadDimStyleSetdimStyle=ThisDrawing.DimStyles.Add("TEST")MsgBox"Anewdimensionstylecalled"&dimStyle.name&"hasbeenaddedtotheDimstylescollection.",vbInformation,"DimstylesExample"EndSub

Page 616: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DisplaySilhouetteExampleSubExample_DisplaySilhouette()'Thisexamplereturnsthecurrentsettingof'DisplaySilhouette.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrDisplaySilhouetteAsBoolean'RetrievethecurrentDisplaySilhouettevaluecurrDisplaySilhouette=ThisDrawing.preferences.DisplaySilhouetteMsgBox"ThecurrentvalueforDisplaySilhouetteis"&preferences.DisplaySilhouette,vbInformation,"DisplaySilhouetteExample"'ChangethevalueforDisplaySilhouetteThisDrawing.preferences.DisplaySilhouette=Not(currDisplaySilhouette)MsgBox"ThenewvalueforDisplaySilhouetteis"&preferences.DisplaySilhouette,vbInformation,"DisplaySilhouetteExample"'ResetDisplaySilhouettetoitsoriginalvalueThisDrawing.preferences.DisplaySilhouette=currDisplaySilhouetteMsgBox"TheDisplaySilhouettevalueisresetto"&preferences.DisplaySilhouette,vbInformation,"DisplaySilhouetteExample"EndSub

Page 617: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DocumentExampleSubExample_Document()'Thisexamplecreatesacircleinmodelspaceandthen'findsthenameofthedocumentthatthecircleresidesin.DimcircleObjAsAcadCircleDimcenterPoint(0To2)AsDoubleDimradiusAsDouble'DefinethecirclecenterPoint(0)=0#:centerPoint(1)=0#:centerPoint(2)=0#radius=5#'CreatetheCircleobjectinmodelspaceSetcircleObj=ThisDrawing.ModelSpace.AddCircle(centerPoint,radius)ZoomAll'FindthedocumentnameforthecircleDimcurrDocAsAcadDocumentSetcurrDoc=circleObj.DocumentMsgBox"Thecircleresidesin:"&currDoc.nameEndSub

Page 618: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EdgeWidthExampleSubExample_EdgeWidth()

'ThisexamplewilldisplaytheedgewidthoftheselectedAecPolygon

DimobjAsAcadObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectAecPolygon"IfTypeOfobjIsAecPolygonThenDimpolygonAsAecPolygonDimpolygonStyleAsAecPolygonStyleSetpolygon=objSetpolygonStyle=polygon.StyleMsgBox"PolygonEdgeWidth="&polygonStyle.EdgeWidth,vbInformation,"EdgeWidthExample"ElseMsgBox"NoAecPolygonSelected",vbInformation,"EdgeWidthExample"EndIf

EndSub

Page 619: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EdgeWidthJustifyExampleSubExample_EdgeWidthJustify()

'ThisexamplewilldisplaytheedgewidthjustificationoftheselectedAecPolygon

DimobjAsAcadObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectAecPolygon"IfTypeOfobjIsAecPolygonThenDimpolygonAsAecPolygonDimpolygonStyleAsAecPolygonStyleSetpolygon=objSetpolygonStyle=polygon.StyleSelectCasepolygonStyle.EdgeWidthJustifyCaseaecPolygonEdgeWidthJustificationCenterMsgBox"PolygonEdgeWidthJustifyCENTER",vbInformation,"EdgeWidthJustifyExample"CaseaecPolygonEdgeWidthJustificationInMsgBox"PolygonEdgeWidthJustifyisIN",vbInformation,"EdgeWidthJustifyExample"CaseaecPolygonEdgeWidthJustificationOutMsgBox"PolygonEdgeWidthJustifyisOUT",vbInformation,"EdgeWidthJustifyExample"EndSelectElseMsgBox"NoAecPolygonSelected",vbInformation,"EdgeWidthJustifyExample"EndIf

EndSub

Page 620: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationModelSpaceExampleSubExample_ElevationModelSpace()'Thisexamplechangesthemodelspaceelevationofthecurrentdrawing'andthenresetsittotheoriginalvalueagain.DimcurrElevationAsDoublecurrElevation=ThisDrawing.ElevationModelSpaceMsgBox"Thecurrentmodelspaceelevationis"&ThisDrawing.ElevationModelSpace,vbInformation,"ElevationModelSpaceExample"'ChangetheelevationThisDrawing.ElevationModelSpace=currElevation+2MsgBox"Thenewmodelspaceelevationis"&ThisDrawing.ElevationModelSpace,vbInformation,"ElevationModelSpaceExample"'ResettheelevationtoitsoriginalvalueThisDrawing.ElevationModelSpace=currElevationMsgBox"Themodelspaceelevationisresetto"&ThisDrawing.ElevationModelSpace,vbInformation,"ElevationModelSpaceExample"

EndSub

Page 621: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationPaperSpaceExampleSubExample_ElevationPaperSpace()'Thisexamplechangesthepaperspaceelevationofthecurrentdrawing'andthenresetsittotheoriginalvalueagain.DimcurrElevationAsDoublecurrElevation=ThisDrawing.ElevationPaperSpaceMsgBox"Thecurrentpaperspaceelevationis"&ThisDrawing.ElevationPaperSpace,vbInformation,"ElevationpaperSpaceExample"'ChangetheelevationThisDrawing.ElevationPaperSpace=currElevation+2MsgBox"Thenewpaperspaceelevationis"&ThisDrawing.ElevationPaperSpace,vbInformation,"ElevationpaperSpaceExample"'ResettheelevationtoitsoriginalvalueThisDrawing.ElevationPaperSpace=currElevationMsgBox"Thepaperspaceelevationisresetto"&ThisDrawing.ElevationPaperSpace,vbInformation,"ElevationPaperSpaceExample"

EndSub

Page 622: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ElevationPrecisionExampleSubExample_ElevationPrecision()

'ThisexamplereturnstheElevationPrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforElevationPrecisionis:"&dbPref.ElevationPrecision,_

vbInformation,"ElevationPrecisionExample"

EndSub

Page 623: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndOffsetExampleSubExample_EndOffset()

'ThisexampledisplaystheendoffsetofaselectedAECLayoutCurveObjectDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveThisDrawing.Utility.GetEntityobj,pt,"SelectaNodeonanAECLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objMsgBox"EndOffsetis:"&layoutCurve.EndOffset,vbInformation,"EndOffsetExample"ElseMsgBox"NotaAECLayoutCurve",vbExclamation,"EndOffsetExample"EndIf

EndSub

Page 624: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExpandKeyExampleSubExample_ExpandKey()

'Thisexampleshowshowtoexpandalayerkeyforthecurrentlayerstandard

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)

MsgBox"LayerKeyWALLexpandsto:"&layerKeyStyle.ExpandKey("WALL"),_vbInformation,"ExpandExample"

EndSub

Page 625: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ExportFreeFormExampleSubExample_ExportFreeForm()

'Thisexamplecreatesamasselement,afterpromptingusers'foritsinsertionpoint,andthenexportsthemasselement'boundariestoafile.'YoucanrunthiscodeinconjunctionwithExample_ImportFreeForm,'whichimportsthesavedboundaries.

DimmassElementAsAecMassElementDimobjAsAcadObjectDimcenter_at_originAsBooleanDimobject_selectedAsBooleanobject_selected=False'Createanewmasselementwithapyramidshape.SetmassElement=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")massElement.Type=aecMassElementTypePyramid'Specifyalocationforthemasselement.pt=ThisDrawing.Utility.GetPoint(,"Selecttheinsertionpoint:")IfErr.Number0ThenMsgBox("errorwhengettingapoint."&vbCrLf)ExitSubEndIfmassElement.Location=ptmassElement.Rotation=0'Setthepyramid'sdimensionsto12'by12'by12'massElement.Width=144massElement.Depth=144massElement.Height=144'Indicatethatoriginalcoordinatesoftheboundary'representationaretobesaved.

Page 626: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

center_at_origin=True'Exportthemasselementboundaries.massElement.ExportFreeForm"c:\temp\freeform-massElement",center_at_origin

EndSub

Page 627: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FacetDeviationExampleSubExample_FacetDeviation()

'ThisexampledisplaystheFacetDeviationsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThesettingforFacetDeviationis:"&dbPref.FacetDeviation,_

vbInformation,"FacetDeviationExample"

EndSub

Page 628: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipXExampleSubExample_FlipX()

'ThisexamplewillflipanobjectthatusesanAecAnchorEntToCurveaboutthecurve'sXaxis.

DimobjAsAcadObjectDimpntAsVariantThisDrawing.Utility.GetEntityobj,pnt,vbCrLf&"SelectaGeoanchoredtoaCurve"

IfTypeOfobjIsAecGeoThenDimgeoAsAecGeoSetgeo=objDimanchorAsAecAnchorSetanchor=geo.GetAnchorIfTypeOfanchorIsAecAnchorEntToCurveThenDimcurveAnchorAsAecAnchorEntToCurveSetcurveAnchor=anchorIfcurveAnchor.FlipXThenMsgBox"FlipXisTrue",vbInformation,"FlipXExample"ElseMsgBox"FlipXisFalse",vbInformation,"FlipXExample"EndIf'ThefollowinglinewillflipthecurrentanchorcurveAnchor.FlipX=NotcurveAnchor.FlipXElseMsgBox"AnchornotoftypeAecAnchorEntToCurve",vbExclamation,"FlipXExample"EndIfElseMsgBox"NotanAecGeoObject",vbExclamation,"FlipXExample"EndIf

EndSub

Page 629: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipYExampleSubExample_FlipY()

'ThisexamplewillflipanobjectthatusesanAecAnchorEntToCurveaboutthecurve'sYaxis.

DimobjAsAcadObjectDimpntAsVariantThisDrawing.Utility.GetEntityobj,pnt,vbCrLf&"SelectaGeoanchoredtoaCurve"

IfTypeOfobjIsAecGeoThenDimgeoAsAecGeoSetgeo=objDimanchorAsAecAnchorSetanchor=geo.GetAnchorIfTypeOfanchorIsAecAnchorEntToCurveThenDimcurveAnchorAsAecAnchorEntToCurveSetcurveAnchor=anchorIfcurveAnchor.FlipYThenMsgBox"FlipYisTrue",vbInformation,"FlipYExample"ElseMsgBox"FlipYisFalse",vbInformation,"FlipYExample"EndIf'ThefollowinglinewillflipthecurrentanchorcurveAnchor.FlipY=NotcurveAnchor.FlipYElseMsgBox"AnchornotoftypeAecAnchorEntToCurve",vbExclamation,"FlipYExample"EndIfElseMsgBox"NotanAecGeoObject",vbExclamation,"FlipYExample"EndIf

EndSub

Page 630: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FlipZExampleSubExample_FlipZ()

'ThisexamplewillflipanobjectthatusesanAecAnchorEntToCurveaboutthecurve'sZaxis.

DimobjAsAcadObjectDimpntAsVariantThisDrawing.Utility.GetEntityobj,pnt,vbCrLf&"SelectaGeoanchoredtoaCurve"

IfTypeOfobjIsAecGeoThenDimgeoAsAecGeoSetgeo=objDimanchorAsAecAnchorSetanchor=geo.GetAnchorIfTypeOfanchorIsAecAnchorEntToCurveThenDimcurveAnchorAsAecAnchorEntToCurveSetcurveAnchor=anchorIfcurveAnchor.FlipZThenMsgBox"FlipZisTrue",vbInformation,"FlipZExample"ElseMsgBox"FlipZisFalse",vbInformation,"FlipZExample"EndIf'ThefollowinglinewillflipthecurrentanchorcurveAnchor.FlipZ=NotcurveAnchor.FlipZElseMsgBox"AnchornotoftypeAecAnchorEntToCurve",vbExclamation,"FlipZExample"EndIfElseMsgBox"NotanAecGeoObject",vbExclamation,"FlipZExample"EndIf

EndSub

Page 631: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FromPointsExampleSubExample_FromPoints()

'Thisexamplewillmakeanewprofilefromasetofpoints.

OnErrorResumeNextDimpointList(0To7)AsDoublepointList(0)=0.5:pointList(1)=0.5pointList(2)=0.067:pointList(3)=-0.25pointList(4)=0.933:pointList(5)=-0.25pointList(6)=0.5:pointList(7)=0.5

DimringAsAecRingDimprofileAsNewAecProfile

DimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyleSetcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item("FromPoints")IfprofileStyleIsNothingThenSetprofileStyle=cprofiles.Add("FromPoints")EndIfSetring=profile.Rings.Add

ring.FromPointspointListSetprofileStyle.profile=profile

EndSub

Page 632: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

FromPolylineExampleSubExample_FromPolyline()

'ThisexamplecreatesAECProfilefroma2DPolyline.

DimplineObjAsAcadPolyline

Dimpoints(0To14)AsDouble

'Definethe2Dpolylinepoints

'The3rdelementisignored

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:

'Createa2DPolylineobjectinmodelspace

SetplineObj=ThisDrawing.ModelSpace.AddPolyline(points)

OnErrorResumeNext

DimringAsAecRingDimprofileAsNewAecProfile

DimdocAsAecArchBaseDocument

Page 633: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Setdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyle

Setcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item("FromPolyline")IfprofileStyleIsNothingThenSetprofileStyle=cprofiles.Add("FromPolyline")EndIfSetring=profile.Rings.Add

ring.FromPolylineplineObj

plineObj.deleteSetprofileStyle.profile=profile

EndSub

Page 634: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GenerateLayerExampleSubExample_GenerateLayer()'Thisexampleshowshowtogeneratealayerwiththecurrentlayerstandard

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)

DimlayerAsAcadLayerSetlayer=layerKeyStyle.GenerateLayer("WALL")MsgBox"LayerKeyWALLgeneratedlayer:"&layer.Name_vbInformation,"ExpandExample"

EndSub

Page 635: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetAnchorExampleSubExample_GetAnchor()

'ThisexamplewillgettheanchorattachedtoanAECEntity.DimentAsAcadEntityDimgeoAsAecGeoDimptAsVariantDimanchorAsAecAnchorThisDrawing.Utility.GetEntityent,pt,"Selectedanchoredobject"IfTypeOfentIsAecGeoThenSetgeo=entSetanchor=geo.GetAnchorIfanchorIsNothingThenMsgBox"AECEntityisnotanchored",vbInformation,"GetAnchorExample"ElseMsgBox"AECEntityisanchoredwithan"&anchor.ObjectName&"object",vbInformation,"GetAnchorExample"EndIfElseMsgBox"AECEntitynotselected",vbInformation,"GetAnchorExample"EndIf

EndSub

Page 636: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetBoundingBoxExampleSubExample_GetBoundingBox()'Thisexamplecreatesalineinmodelspace.Itthenfindsthe'boundingboxforthelineanddisplaysthecornersofthebox.DimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoubleDimlineObjAsAcadLine

'CreatetheLineobjectinmodelspacestartPoint(0)=2#:startPoint(1)=2#:startPoint(2)=0#endPoint(0)=4#:endPoint(1)=4#:endPoint(2)=0#SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)ZoomAllDimminExtAsVariantDimmaxExtAsVariant'Returntheboundingboxforthelineandreturntheminimum'andmaximumextentsoftheboxintheminExtandmaxExtvariables.lineObj.GetBoundingBoxminExt,maxExt'PrinttheminandmaxextentsMsgBox"Theextentsoftheboundingboxforthelineare:"&vbCrLf_&"MinExtent:"&minExt(0)&","&minExt(1)&","&minExt(2)_&vbCrLf&"MaxExtent:"&maxExt(0)&","&maxExt(1)&","&maxExt(2),vbInformation,"GetBoundingBoxExample"EndSub

Page 637: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetExtensionDictionaryExampleSubExample_GetExtensionDictionary()'ThisexamplecreatesaCircleobjectinmodelspaceand'addsanewExtensionDictionarytotheCircleobjectDimEDictionaryAsAcadDictionaryDimcircleObjAsAcadCircleDimcenterPoint(0To2)AsDoubleDimradiusAsDouble'DefinetheCircleobjectcenterPoint(0)=0:centerPoint(1)=0:centerPoint(2)=0radius=5#'CreatetheCircleobjectinmodelspaceSetcircleObj=ThisDrawing.ModelSpace.AddCircle(centerPoint,radius)

ThisDrawing.Application.ZoomAllMsgBox"CircleobjectExtensionDictionarystatebefore:"&circleObj.HasExtensionDictionary'CreateanExtensionDictionaryforthenewCircleSetEDictionary=circleObj.GetExtensionDictionaryMsgBox"CircleobjectExtensionDictionarystateafter:"&circleObj.HasExtensionDictionaryEndSub

Page 638: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GetXDataExampleSubExample_GetXData()'Thisexamplecreatesalineandattachesextendeddatatothatline.'CreatethelineDimlineObjAsAcadLineDimstartPt(0To2)AsDouble,endPt(0To2)AsDoublestartPt(0)=1#:startPt(1)=1#:startPt(2)=0#endPt(0)=5#:endPt(1)=5#:endPt(2)=0#SetlineObj=ThisDrawing.ModelSpace.AddLine(startPt,endPt)ZoomAll

'Initializeallthexdatavalues.Notethatfirstdatainthelistshouldbe'applicationnameandfirstdatatypecodeshouldbe1001DimDataType(0To9)AsIntegerDimData(0To9)AsVariantDimreals3(0To2)AsDoubleDimworldPos(0To2)AsDoubleDataType(0)=1001:Data(0)="Test_Application"DataType(1)=1000:Data(1)="Thisisatestforxdata"

DataType(2)=1003:Data(2)="0"'layerDataType(3)=1040:Data(3)=1.23479137438413E+40'realDataType(4)=1041:Data(4)=1237324938'distanceDataType(5)=1070:Data(5)=32767'16bitIntegerDataType(6)=1071:Data(6)=32767'32bitIntegerDataType(7)=1042:Data(7)=10'scaleFactor

reals3(0)=-2.95:reals3(1)=100:reals3(2)=-20DataType(8)=1010:Data(8)=reals3'realworldPos(0)=4:worldPos(1)=400.99999999:worldPos(2)=2.798989DataType(9)=1011:Data(9)=worldPos'worldspaceposition'AttachthexdatatothelinelineObj.SetXDataDataType,Data

Page 639: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

'ReturnthexdataforthelineDimxdataOutAsVariantDimxtypeOutAsVariantlineObj.GetXData"",xtypeOut,xdataOutEndSub

Page 640: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

GroupsExampleSubExample_Groups()'ThisexamplefindsthecurrentGroupscollectionand'addsanewgrouptothatcollection.DimgroupCollAsAcadGroupsSetgroupColl=ThisDrawing.Groups'Createadimensionstylenamed"TEST"incurrentdrawingDimtestGroupAsAcadGroupSettestGroup=groupColl.Add("TEST")MsgBox"Anewgroupcalled"&testGroup.name&"hasbeenaddedtotheGroupscollection.",vbInformation,"GroupsExample"EndSub

Page 641: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HandleExampleSubExample_Handle()'Thisexamplecreatesseveralobjectsinmodelspace.'Ittheniteratesthroughmodelspaceanddisplaysthe'Handleforeachobjectfound.'CreateaRayobjectinmodelspaceDimrayObjAsAcadRayDimbasePoint(0To2)AsDoubleDimSecondPoint(0To2)AsDoublebasePoint(0)=3#:basePoint(1)=3#:basePoint(2)=0#SecondPoint(0)=1#:SecondPoint(1)=3#:SecondPoint(2)=0#SetrayObj=ThisDrawing.ModelSpace.AddRay(basePoint,SecondPoint)'CreateapolylineobjectinmodelspaceDimplineObjAsAcadLWPolylineDimpoints(0To5)AsDoublepoints(0)=3:points(1)=7points(2)=9:points(3)=2points(4)=3:points(5)=5SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=True

'CreatealineobjectinmodelspaceDimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoublestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=2:endPoint(1)=2:endPoint(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)'CreateacircleobjectinmodelspaceDimcircObjAsAcadCircleDimcenterPt(0To2)AsDoubleDimradiusAsDoublecenterPt(0)=5:centerPt(1)=3:centerPt(2)=0radius=3

Page 642: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetcircObj=ThisDrawing.ModelSpace.AddCircle(centerPt,radius)

'CreateanellipseobjectinmodelspaceDimellObjAsAcadEllipseDimmajAxis(0To2)AsDoubleDimcenter(0To2)AsDoubleDimradRatioAsDoublecenter(0)=5#:center(1)=5#:center(2)=0#majAxis(0)=10:majAxis(1)=20#:majAxis(2)=0#radRatio=0.3SetellObj=ThisDrawing.ModelSpace.AddEllipse(center,majAxis,radRatio)

ZoomAll'Iteratethroughthemodelspacecollectionanddisplay'thehandleofeachentityfound.DimentHandleAsStringDimentryAsAcadEntityForEachentryInThisDrawing.ModelSpaceentHandle=entry.handleentry.Highlight(True)MsgBox"Thehandleofthisobjectis"&entHandle,vbInformation,"HandleExample"entry.Highlight(False)NextEndSub

Page 643: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HandleToObjectExampleSubExample_HandleToObject()'Thisexamplecreatesasplineinmodelspace.Itthenreturnsthe'handleforthespline.Thesplineisreturnedfromthehandle,and'thencolored.'CreatethesplineDimsplineObjAsAcadSplineDimstartTan(0To2)AsDoubleDimendTan(0To2)AsDoubleDimfitPoints(0To8)AsDoublestartTan(0)=0.5:startTan(1)=0.5:startTan(2)=0endTan(0)=0.5:endTan(1)=0.5:endTan(2)=0fitPoints(0)=1:fitPoints(1)=1:fitPoints(2)=0fitPoints(3)=5:fitPoints(4)=5:fitPoints(5)=0fitPoints(6)=10:fitPoints(7)=0:fitPoints(8)=0SetsplineObj=ThisDrawing.ModelSpace.AddSpline(fitPoints,startTan,endTan)ZoomAll'FindthehandleofthesplineDimhandleAsIntegerhandle=splineObj.handleMsgBox"ThehandleoftheSplineis:"&splineObj.handle,,"HandleToObjectExample"'FindanobjectfromagivenhandleDimtempObjAsAcadObjectSettempObj=ThisDrawing.HandleToObject(handle)

'NowusethenewlyinitializedobjectvariabletocolortheobjectredtempObj.Color=acRedThisDrawing.RegenTrueMsgBox"TheSplineisnowred.",,"HandleToObjectExample"EndSub

Page 644: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HasExampleSubExample_Has()

'Thisexamplewillcheckthewallstylescollectionforagivenwallstyle.DimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcWallStylesAsAecWallStylesSetcWallStyles=doc.WallStylesDimstyleNameAsStringstyleName="Brick"IfcWallStyles.Has(styleName)ThenMsgBox"Wallstyle:'"&styleName&"'indrawing",vbInformation,"HasExample"ElseMsgBox"Wallstyle:'"&styleName&"'notindrawing",vbInformation,"HasExample"EndIf

EndSub

Page 645: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HasExtensionDictionaryExampleSubExample_HasExtensionDictionary()'Thisexamplewilliteratethrougheachobjectinthecurrentdrawingand'determineifthatobjecthasanassociatedExtensionDictionaryDimDrawingObjectAsAcadObjectDimExtensionDictionaryResultsAsString'MakesurethisdrawingcontainsobjectsbeforewecontinueIfThisDrawing.ModelSpace.count=0ThenMsgBox"Therearenoobjectsinthecurrentdrawing."ExitSubEndIfForEachDrawingObjectInThisDrawing.ModelSpace'DetermineifobjectcontainsExtensionDictionarySelectCaseDrawingObject.HasExtensionDictionaryCaseTrueExtensionDictionaryResults=ExtensionDictionaryResults&DrawingObject.ObjectName&"hasanassociatedExtensionDictionary"&vbCrLfCaseFalseExtensionDictionaryResults=ExtensionDictionaryResults&DrawingObject.ObjectName&"doesnothaveanassociatedExtensionDictionary"&vbCrLfEndSelectNextMsgBoxExtensionDictionaryResultsEndSub

Page 646: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HeightExampleExamples:

lAecClipVol

lAecLayoutGrid3D

lAecMassElement

SubExample_Height_AecClipVol()

'Thisexampleshowstheheightoftheuppercutplaneabovethe'buildingelevationlineposition

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"Heightis:"&clip.Height,vbInformation,"HeightExample"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"HeightExample"EndIf

EndSub

Page 647: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubExample_Height_AecLayoutGrid3D()

DimobjectAsObjectDimgridAsAecLayoutGrid3DDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecLayoutGrid3DThencount=count+1Setgrid=objectMsgBox"3DGrid"&count&"Heightis:"&grid.Height,vbInformation,"HeightExample"EndIfNextIfcount=0ThenMsgBox"No3DLayoutGridsPresentinDrawing",vbInformation,"HeightExample"EndIf

EndSub

SubExample_Height_AecMassElement()

'ThisexampleshowsthesizeofthemasselementinitsrelativeZdirection

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectMsgBox"MassElement"&count&"Heightis:"&mass.Height,vbInformation,"HeightExample"EndIfNextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"HeightExample"EndIf

Page 648: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

Page 649: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HighlightExampleSubExample_Highlight()'Thisexamplecreatesseveralobjectsinmodelspace.'Ittheniteratesthroughmodelspaceandhighlightseach'objectanddisplaysit'sEntityName.'CreateaRayobjectinmodelspaceDimrayObjAsAcadRayDimbasePoint(0To2)AsDoubleDimSecondPoint(0To2)AsDoublebasePoint(0)=3#:basePoint(1)=3#:basePoint(2)=0#SecondPoint(0)=1#:SecondPoint(1)=3#:SecondPoint(2)=0#SetrayObj=ThisDrawing.ModelSpace.AddRay(basePoint,SecondPoint)'CreateapolylineobjectinmodelspaceDimplineObjAsAcadLWPolylineDimpoints(0To5)AsDoublepoints(0)=3:points(1)=7points(2)=9:points(3)=2points(4)=3:points(5)=5SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=True

'CreatealineobjectinmodelspaceDimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoublestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=2:endPoint(1)=2:endPoint(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)'CreateacircleobjectinmodelspaceDimcircObjAsAcadCircleDimcenterPt(0To2)AsDoubleDimradiusAsDoublecenterPt(0)=20:centerPt(1)=30:centerPt(2)=0radius=3

Page 650: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetcircObj=ThisDrawing.ModelSpace.AddCircle(centerPt,radius)

'CreateanellipseobjectinmodelspaceDimellObjAsAcadEllipseDimmajAxis(0To2)AsDoubleDimcenter(0To2)AsDoubleDimradRatioAsDoublecenter(0)=5#:center(1)=5#:center(2)=0#majAxis(0)=10:majAxis(1)=20#:majAxis(2)=0#radRatio=0.3SetellObj=ThisDrawing.ModelSpace.AddEllipse(center,majAxis,radRatio)

ZoomAll'Iteratethroughthemodelspacecollectionand'highlighteachentity.DimentNameAsStringDimentryAsAcadEntityForEachentryInThisDrawing.ModelSpaceentName=entry.ObjectNameentry.Highlight(True)MsgBox"Thenameofthisobjectis"&entName,vbInformation,"HighlightExample"entry.Highlight(False)NextEndSub

Page 651: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

HyperlinksExampleSubExample_HyperLinks()'ThisexamplecreatesaCircleobjectinmodelspaceand'addsanewHyperlinktoitsHyperlinkcollectionDimHyperlinksAsAcadHyperlinksDimHyperlinkAsAcadHyperlinkDimcircleObjAsAcadCircleDimcenterPoint(0To2)AsDoubleDimradiusAsDoubleDimHLListAsString'DefinetheCircleobjectcenterPoint(0)=0:centerPoint(1)=0:centerPoint(2)=0radius=5#'CreatetheCircleobjectinmodelspaceSetcircleObj=ThisDrawing.ModelSpace.AddCircle(centerPoint,radius)

ThisDrawing.Application.ZoomAll'GetreferencetotheCircle'sHyperlinkscollectionSetHyperlinks=circleObj.Hyperlinks'AddanewHyperlinkcompletewithallpropertiesSetHyperlink=Hyperlinks.Add("AutoDesk")Hyperlink.URL="www.autodesk.com"Hyperlink.URLDescription="AutodeskMainSite"Hyperlink.URLNamedLocation="MY_LOCATION"'ReadanddisplayalistofexistingHyperlinksand'theirpropertiesforthisobjectForEachHyperlinkInHyperlinksHLList=HLList&"____________________________________"&vbCrLf'SeparatorHLList=HLList&"URL:"&Hyperlink.URL&vbCrLfHLList=HLList&"URLDescription:"&Hyperlink.URLDescription&vbCrLfHLList=HLList&"URLNamedLocation:"&Hyperlink.URLNamedLocation&vbCrLf

Page 652: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NextMsgBox"Thecirclehas"&Hyperlinks.count&"Hyperlink:"&vbCrLf&HLListEndSub

Page 653: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ImportFreeFormExampleSubExample_ImportFreeForm()

'Thisexampleimportsapreviouslyexportedboundaryrepresentation'ofamasselementandappliesittoafree-formmasselement.'Itpromptsuserstospecifythelocationofthenewmasselement.'YoucanrunthiscodeinconjunctionwithExample_ExportFreeForm'(runExample_ExportFreeFormfirst).

DimmassElementAsAecMassElementDimptAsVariantDimcenter_at_originAsBoolean

'CreateanewmasselementSetmassElement=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'Setthemasselementtypeto"free-form"massElement.Type=aecMassElementTypeFreeForm'Selectalocationforthemasselementpt=ThisDrawing.Utility.GetPoint(,"Selecttheinsertionpoint:")IfErr.Number0ThenMsgBox("errorwhengettingapoint."&vbCrLf)ExitSubEndIfmassElement.Location=pt'UsemasselementLocationasinsertionpoint.center_at_origin=True'Importtheboundaryrepresentation.massElement.ImportFreeForm"c:\temp\freeform-massElement"

EndSub

Page 654: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IndexExampleExamples:

lAecLayerKey

lAecLayerOverrideSetting

lAecLayoutCurveNode

lAecLayoutGrid2DNode

lAecLayoutGrid2DXNode

lAecLayoutGrid2DYNode

lAecLayoutGrid3DNode

lAecLayoutGrid3DXNode

lAecLayoutGrid3DYNode

lAecLayoutGrid3DZNode

lAecRing

lAecViewBlock

SubExample_Index_AecLayerKey()

'Thisexampleshowstheindexofthelayergeneratedbythekey

DimdbAsNewAecBaseDatabaseDimlayerKeyAsAecLayerKeydb.InitThisDrawing.DatabaseSetlayerKey=db.LayerKeyStyles.Item(0).Keys.Item(0)MsgBox"LayerIndex:"&layerKey.Index,vbInformation,"IndexExample"

Page 655: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Index_AecLayerOverrideSetting()

'Thisexampleshowstheindexoftheoverridesetting

DimdbAsNewAecBaseDatabaseDimsettingAsAecLayerOverrideSettingdb.InitThisDrawing.DatabaseSetsetting=db.LayerKeyStyles.Item(0).overrideSettings.Item(0)MsgBox"SettingIndex:"&setting.Index,vbInformation,"IndexExample"

EndSub

SubExample_Index_AecLayoutCurveNode()

'ThisexampledisplaysthecolorofthenodesownerlayoutcurveDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveDimnodeAsAecLayoutCurveNodeThisDrawing.Utility.GetEntityobj,pt,"SelectaLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objSetnode=layoutCurve.nodes.Item(0)MsgBox"Coloris:"&node.layoutCurve.Color,vbInformation,"LayoutCurveExample"ElseMsgBox"NotaLayoutCurve",vbExclamation,"LayoutCurveExample"EndIf

Page 656: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Index_AecLayoutGrid2DNode()

'ThisexampledisplaystheindexofalayoutnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"NodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecLayoutGrid2DXNode()'ThisexampledisplaystheindexofalayoutXnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"

Page 657: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"XNodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecLayoutGrid2DYNode()'ThisexampledisplaystheindexofalayoutYnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.YNodes.Item(0)MsgBox"YNodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecLayoutGrid3DNode()'Thisexampledisplaystheindexofalayoutnode

Page 658: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"NodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecLayoutGrid3DXNode()'ThisexampledisplaystheindexofalayoutXnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"XNodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"IndexExample"EndIf

Page 659: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Index_AecLayoutGrid3DYNode()'ThisexampledisplaystheindexofalayoutYnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.YNodes.Item(0)MsgBox"YNodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecLayoutGrid3DZNode()'ThisexampledisplaystheindexofalayoutZnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=obj

Page 660: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Setnode=grid.ZNodes.Item(0)MsgBox"ZNodeIndexis:"&node.Index,vbInformation,"IndexExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"IndexExample"EndIf

EndSub

SubExample_Index_AecRing()'ThisexamplewilldisplaytheindexoftheringDimdbAsNewAecBaseDatabaseDimringAsAecRingdb.InitThisDrawing.DatabaseSetring=db.ProfileStyles.Item(0).Profile.rings.Item(0)MsgBox"RingIndex:"&ring.Index,vbInformation,"IndexExample"

EndSub

SubExample_Index_AecViewBlock()'Thisexampleshowstheindexofthefirstviewblockofamultiviewblock

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefDimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=obj

Page 661: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetviewBlocks=blockRef.viewBlocksMsgBox"IndexofViewBlock1:"&viewBlocks.Item(0).Index,vbInformation,"IndexExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"IndexExample"EndIf

EndSub

Page 662: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

InitExampleSubExample_Init()

'Thisexampleinitializestheapplicationobject,using'thecurrentdrawing,thenliststhenumberofobjectsin'thedrawing'smodelspace.

DimappAsNewAecBaseApplicationDimdocAsAecBaseDocumentDimnbr_of_objectsAsIntegerDimmsgAsString'Initializetheapplicationobject.app.InitThisDrawing.Application'Accessthecurrentdrawingdatabase.Setdoc=app.ActiveDocument'Getthenumberofobjectsinthedrawing'smodelspace.nbr_of_objects=doc.ModelSpace.Countmsg="Thereare"&nbr_of_objects&"objectsinthisdrawing'smodelspace."MsgBoxmsg,vbInformation,"InitExample"

EndSub

Page 663: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IntersectExampleSubExample_Intersect()

'Thisexamplewilladdmaketwoprofilesfromrings,andintersectthefirstwiththesecond

OnErrorResumeNextDimpointList1(0To9)AsDoubleDimpointList2(0To7)AsDoublepointList1(0)=0:pointList1(1)=0pointList1(2)=1:pointList1(3)=0pointList1(4)=1:pointList1(5)=1pointList1(6)=0:pointList1(7)=1pointList1(8)=0:pointList1(9)=0

pointList2(0)=0.5:pointList2(1)=0.5pointList2(2)=0.067:pointList2(3)=-0.25pointList2(4)=0.933:pointList2(5)=-0.25pointList2(6)=0.5:pointList2(7)=0.5

Dimring1AsAecRingDimring2AsAecRingDimprofile1AsNewAecProfileDimprofile2AsNewAecProfile

DimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyleSetcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item("IntersectRing")IfprofileStyleIsNothingThenSetprofileStyle=cprofiles.Add("IntersectRing")EndIfSetring1=profile1.Rings.AddSetring2=profile2.Rings.Add

Page 664: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ring1.FromPoints(pointList1)ring2.FromPoints(pointList2)

profile1.Intersectprofile2

SetprofileStyle.profile=profile1

EndSub

Page 665: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IntersectWithExampleSubExample_IntersectWith()'Thisexamplecreatesalineandcircleandfindsthepointsat'whichtheyintersect.'CreatethelineDimlineObjAsAcadLineDimstartPt(0To2)AsDoubleDimendPt(0To2)AsDoublestartPt(0)=1:startPt(1)=1:startPt(2)=0endPt(0)=5:endPt(1)=5:endPt(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPt,endPt)'CreatethecircleDimcircleObjAsAcadCircleDimcenterPt(0To2)AsDoubleDimradiusAsDoublecenterPt(0)=3:centerPt(1)=3:centerPt(2)=0radius=1SetcircleObj=ThisDrawing.ModelSpace.AddCircle(centerPt,radius)ZoomAll'FindtheintersectionpointsbetweenthelineandthecircleDimintPointsAsVariantintPoints=lineObj.IntersectWith(circleObj,acExtendNone)'PrintalltheintersectionpointsDimIAsInteger,jAsInteger,kAsIntegerDimstrAsStringIfVarType(intPoints)<>vbEmptyThenForI=LBound(intPoints)ToUBound(intPoints)str="IntersectionPoint["&k&"]is:"&intPoints(j)&","&intPoints(j+1)&","&intPoints(j+2)MsgBoxstr,,"IntersectWithExample"str=""I=I+2j=j+3k=k+1

Page 666: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NextEndIfEndSub

Page 667: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ItemExampleSubExample_Item()

'ThisexampleliststhenumberofkeysintheStandard'layerkeystylescollection,andthenliststhenameof'eachlayerkeystylescollectioninthedrawing.Theexample'usesboththestringandintegermethodsofspecifyingthe'indexofanItem.DimappAsNewAecBaseApplicationDimdocAsAecBaseDocumentDimlayerkeystylesAsAecLayerKeyStylesDimkeystyleAsAecLayerKeyStyleDimmsgAsStringapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getthedrawing'scollectionoflayerkeystyles.Setlayerkeystyles=doc.layerkeystylesmsg="NumberofLayerKeyStylesinthisdrawingis:"&layerkeystyles.Count&vbCrLf'Getthestandardlayerkeystyle,ifitexists(itshould!)OnErrorResumeNextSetkeystyle=layerkeystyles.Item("Standard")'ListthenumberofkeysintheStandardlayerkeystyle.IfErrThenmsg=msg&"Standardlayerkeystyledoesnotexistinthisdrawing"Err.ClearElsemsg="Standardlayerkeystylecontains"&keystyle.Keys.Count&"keys."&vbCrLfEndIfOnErrorGoTo0'Loopthroughthelayerkeystylescollection,listingthename'ofeachlayerkeystyleinthecollection.

Page 668: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

msg=msg&vbCrLf&"Thelayerkeystylesinthisdrawingare:"&vbCrLfFori=0To(layerkeystyles.Count-1)msg=msg&""&layerkeystyles.Item(i).Name&vbCrLfNextMsgBoxmsg,vbInformation,"ItemExample"

EndSub

Page 669: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

KeysExampleSubExample_Keys()

'Thisexampleshowsthehowtogetthelayerkeyfromthelayerkeystyle.

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

<PREclass=Code>

EndSub

Page 670: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerExampleSubExample_Layer()

'Thisexampleliststhelayerkeysinthelayerkeystyle'ofthedocument'sstandardlayer.

DimappAsNewAecBaseApplicationDimdocAsAecBaseDocumentDimdbPrefAsAecBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeyDimmsgAsString'Initializetheapplicationobjectandaccessthecurrentdrawing.app.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getthedrawing'scollectionoflayerkeystyles.SetcLayerKeyStyles=doc.layerkeystyles

'Getthepreferencesobject.SetdbPref=doc.Preferences'Identifythelayerstandard.msg="Layerstandardis"&dbPref.LayerStandard_&".Itcontainsthefollowinglayerkeys:"&vbCrLf'Setthelayerkeystyletothecurrentlayerstandard.SetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)'Getthecollectionoflayerkeysinthestyle.SetcLayerKeys=layerKeyStyle.Keys'Loopthroughthecollectionandlistsomepropertiesofeachkey.

Page 671: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ForEachlayerKeyIncLayerKeysmsg=msg&""&layerKey.Name&":"&vbCrLfmsg=msg&"Color-"&layerKey.Color&vbCrLfmsg=msg&"Layer-"&layerKey.Layer&vbCrLfmsg=msg&"LineType-"&layerKey.Linetype&vbCrLfmsg=msg&"Lineweight-"&layerKey.Lineweight&vbCrLfmsg=msg&"Plotstyle-"&layerKey.PlotStyleName&vbCrLfNext

MsgBoxmsg,vbInformation,"LayerExample"

EndSub

Page 672: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerFileExampleSubExample_LayerFile()

'ThisexampledisplaystheLayerFilesettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

DimlayerfileAsString

layerfile=dbPref.LayerFile

'Testiflayerfileisset

Iflayerfile=""Then

layerfile="notset"

EndIf

MsgBox"ThecurrentvalueforLayerFileis:"&layerfile,vbInformation,"LayerFileExample"

EndSub

Page 673: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStyleExampleExamples:

lAecLayerKey

lAecLayerKeys

lAecLayerOverrideSetting

lAecLayerOverrideSettings

SubExample_LayerKeyStyle_AecLayerKey()

'Thisexampleshowsthelayerstylegeneratedbythekey

DimdbAsNewAecBaseDatabaseDimlayerKeyAsAecLayerKeydb.InitThisDrawing.DatabaseSetlayerKey=db.LayerKeyStyles.Item(0).Keys.Item(0)MsgBox"LayerStyle:"&layerKey.layerKeyStyle.Name,vbInformation,"LayerKeyStyleExample"

EndSub

SubExample_LayerKeyStyle_AecLayerKeys()

'Thisexampleshowsthenameoftheownerlayerkeystyle

DimdbAsNewAecBaseDatabaseDimlayerKeysAsAecLayerKeysdb.InitThisDrawing.DatabaseSetlayerKeys=db.LayerKeyStyles.Item(0).Keys

Page 674: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBox"LayerKeysOwnerName:"&layerKeys.layerKeyStyle.Name,vbInformation,"LayerKeyStyleExample"

EndSub

SubExample_LayerKeyStyle_AecLayerOverrideSetting()

'Thisexampleshowsthenameoftheowneroftheoverridesetting

DimdbAsNewAecBaseDatabaseDimsettingAsAecLayerOverrideSettingdb.InitThisDrawing.DatabaseSetsetting=db.LayerKeyStyles.Item(0).overrideSettings.Item(0)MsgBox"SettingOwnersName:"&setting.layerKeyStyle.Name,vbInformation,"LayerKeyStyleExample"

EndSub

SubExample_LayerKeyStyle_AecLayerOverrideSettings()

DimdbAsNewAecBaseDatabaseDimoverrideSettingsAsAecLayerOverrideSettingsdb.InitThisDrawing.DatabaseSetoverrideSettings=db.LayerKeyStyles.Item(0).overrideSettingsMsgBox"LayerOverrideSettingsownername:"&overrideSettings.layerKeyStyle.Name,vbInformation,"LayerKeyStyleExample"

EndSub

Page 675: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerKeyStylesExampleSubExample_LayerKeyStyles()

'ThisexamplewilldisplaythenumberofLayerKeyStylesinthecurrentdrawing.

DimdocAsAecArchBaseDocumentDimcLayerKeyStylesAsAecLayerKeyStylesSetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesMsgBox"NumberofLayerKeyStylesinthisdrawingis:"&cLayerKeyStyles.Count,vbInformation,"LayerKeyStylesExample"

EndSub

Page 676: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayersExampleSubExample_Layers()'ThisexamplefindsthecurrentLayerscollectionand'addsanewlayertothatcollection.DimlayerCollAsAcadLayersSetlayerColl=ThisDrawing.Layers'Createadimensionstylenamed"TEST"incurrentdrawingDimtestlayerAsAcadLayerSettestlayer=layerColl.Add("TEST")MsgBox"Anewlayercalled"&testlayer.name&"hasbeenaddedtotheLayerscollection.",vbInformation,"LayersExample"EndSub

Page 677: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayerStandardExampleSubExample_LayerStandard()

'ThisexampledisplaystheLayerStandardsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

DimlaystandardAsString

laystandard=dbPref.layerstandard

'Testiflayerstandardisset

Iflaystandard=""Then

laystandard="notset"

EndIf

MsgBox"ThecurrentvalueforLayerStandardis:"&laystandard,_

vbInformation,"LayerStandardExample"

EndSub

Page 678: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutCurveExampleExamples:

lAecLayoutCurveNode

lAecLayoutCurveNodes

SubExample_LayoutCurve_AecLayoutCurveNode()

'ThisexampledisplaysthecolorofthenodesownerlayoutcurveDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveDimnodeAsAecLayoutCurveNodeThisDrawing.Utility.GetEntityobj,pt,"SelectaLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objSetnode=layoutCurve.nodes.Item(0)MsgBox"Coloris:"&node.layoutCurve.Color,vbInformation,"LayoutCurveExample"ElseMsgBox"NotaLayoutCurve",vbExclamation,"LayoutCurveExample"EndIf

EndSub

SubExample_LayoutCurve_AecLayoutCurveNodes()

'ThisexampledisplaysthecolorofthenodecollectionsownercurveDimobjAsObjectDimptAsVariant

Page 679: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimlayoutCurveAsAecLayoutCurveDimnodesAsAecLayoutCurveNodesThisDrawing.Utility.GetEntityobj,pt,"SelectaLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objSetnodes=layoutCurve.nodesMsgBox"Coloris:"&nodes.layoutCurve.Color,vbInformation,"LayoutCurveExample"ElseMsgBox"NotaLayoutCurve",vbExclamation,"LayoutCurveExample"EndIf

EndSub

Page 680: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid2DExampleExamples:

lAecLayoutGrid2DNode

lAecLayoutGrid2DNodes

lAecLayoutGrid2DXNode

lAecLayoutGrid2DXNodes

lAecLayoutGrid2DYNode

lAecLayoutGrid2DYNodes

SubExample_LayoutGrid2D_AecLayoutGrid2DNode()

'ThisexampledisplaystheindexofalayoutnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"NodeLayoutGrid'sDepthis:"&node.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

Page 681: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubExample_LayoutGrid2D_AecLayoutGrid2DNodes()

'ThisexampledisplaystheindexofalayoutnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodesAsAecLayoutGrid2DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnodes=grid.XNodesMsgBox"Nodecollectionownerdepthis:"&nodes.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

SubExample_LayoutGrid2D_AecLayoutGrid2DXNode()

'ThisexampledisplaysthedepthoftheownergridofalayoutxnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"OwnerGridDepthis:"&node.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"Else

Page 682: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

SubExample_LayoutGrid2D_AecLayoutGrid2DXNodes()

'ThisexampledisplaysthedepthoftheownergridofacollectionoflayoutXnodesDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodesAsAecLayoutGrid2DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnodes=grid.XNodesMsgBox"OwnerGridDepthis:"&nodes.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

SubExample_LayoutGrid2D_AecLayoutGrid2DYNode()

'ThisexampledisplaysthedepthoftheownergridofalayoutxnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodeAsAecLayoutGrid2DNode

Page 683: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnode=grid.YNodes.Item(0)MsgBox"OwnerGridDepthis:"&node.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

SubExample_LayoutGrid2D_AecLayoutGrid2DYNodes()

'ThisexampledisplaysthedepthoftheownergridofacollectionoflayoutYnodesDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DDimnodesAsAecLayoutGrid2DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetnodes=grid.YNodesMsgBox"OwnerGridDepthis:"&nodes.LayoutGrid2D.Depth,vbInformation,"LayoutGrid2DExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"LayoutGrid2DExample"EndIf

EndSub

Page 684: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutGrid3DExampleExamples:

lAecLayoutGrid3DNode

lAecLayoutGrid3DNodes

lAecLayoutGrid3DXNode

lAecLayoutGrid3DXNodes

lAecLayoutGrid3DYNode

lAecLayoutGrid3DYNodes

lAecLayoutGrid3DZNode

lAecLayoutGrid3DZNodes

SubExample_LayoutGrid3D_AecLayoutGrid3DNode()

'ThisexampledisplaystheindexofalayoutnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"NodeLayoutGrid'sDepthis:"&node.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

Page 685: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DNodes()

'ThisexampledisplaystheindexofalayoutnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodesAsAecLayoutGrid3DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnodes=grid.XNodesMsgBox"Nodecollectionownerdepthis:"&nodes.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DXNode()

'ThisexampledisplaysthedepthoftheownergridofalayoutxnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"

Page 686: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.XNodes.Item(0)MsgBox"OwnerGridDepthis:"&node.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

SubExample_LayoutGrid3D_AecLayoutGrid3DXNodes()

'ThisexampledisplaysthedepthoftheownergridofacollectionoflayoutXnodesDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodesAsAecLayoutGrid3DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnodes=grid.XNodesMsgBox"OwnerGridDepthis:"&nodes.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DYNode()

'ThisexampledisplaysthedepthoftheownergridofalayoutYnode

Page 687: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.YNodes.Item(0)MsgBox"OwnerGridDepthis:"&node.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DYNodes()

'ThisexampledisplaysthedepthoftheownergridofacollectionoflayoutYnodesDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodesAsAecLayoutGrid3DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnodes=grid.YNodesMsgBox"OwnerGridDepthis:"&nodes.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

Page 688: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DZNode()

'ThisexampledisplaysthedepthoftheownergridofalayoutZnodeDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodeAsAecLayoutGrid3DNodeThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSetnode=grid.ZNodes.Item(0)MsgBox"OwnerGridDepthis:"&node.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

EndSub

SubExample_LayoutGrid3D_AecLayoutGrid3DZNodes()

'ThisexampledisplaysthedepthoftheownergridofacollectionoflayoutZnodesDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DDimnodesAsAecLayoutGrid3DNodesThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=obj

Page 689: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Setnodes=grid.ZNodesMsgBox"OwnerGridDepthis:"&nodes.LayoutGrid3D.Depth,vbInformation,"LayoutGrid3DExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"LayoutGrid3DExample"EndIf

EndSub

Page 690: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LayoutsExampleSubExample_Layouts()'ThisexamplewillaccesstheLayoutscollectionforthecurrentdrawing'andlistbasicinformationabouttheLayoutsinthedrawing.

DimLayoutsAsAcadLayouts,LayoutAsACADLayoutDimmsgAsString'GetlayoutscollectionfromdocumentobjectSetLayouts=ThisDrawing.Layoutsmsg=vbCrLf&vbCrLf'Startwithaspace'GetthenamesofeverylayoutinthisdrawingForEachLayoutInLayoutsmsg=msg&Layout.name&vbCrLfNext'DisplayalistofavailablelayoutsMsgBox"Thereare"&Layouts.count&"layoutsin"&_ThisDrawing.WindowTitle&":"&msgEndSub

Page 691: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeaderExtension1ExampleSubExample_LeaderExtension1()

'Thisexamplewillfindthe1stLeaderExtensionforabubbleattachedtoa'columngridDimobjAsAcadObjectDimbubbleAsAecMVBlockRefDimanchorAsAecAnchorDimleaderAnchorAsAecAnchorLeadEntToNodeDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectbubble"IfTypeOfobjIsAecMVBlockRefThenSetbubble=objSetanchor=obj.GetAnchorIfTypeOfanchorIsAecAnchorLeadEntToNodeThenSetleaderAnchor=anchorMsgBox"LeaderExtension1="&leaderAnchor.LeaderExtension1ElseMsgBox"Notanchoredtocolumngrid",vbInformation,"ExampleLeaderExtension1"EndIfElseMsgBox"Notabubble",vbInformation,"ExampleLeaderExtension1"EndIf

EndSub

Page 692: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeaderExtension2ExampleSubExample_LeaderExtension2()

'Thisexamplewillfindthe2ndLeaderExtensionforabubbleattachedtoa'columngridDimobjAsAcadObjectDimbubbleAsAecMVBlockRefDimanchorAsAecAnchorDimleaderAnchorAsAecAnchorLeadEntToNodeDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectbubble"IfTypeOfobjIsAecMVBlockRefThenSetbubble=objSetanchor=obj.GetAnchorIfTypeOfanchorIsAecAnchorLeadEntToNodeThenSetleaderAnchor=anchorMsgBox"LeaderExtension2="&leaderAnchor.LeaderExtension2ElseMsgBox"Notanchoredtocolumngrid",vbInformation,"ExampleLeaderExtension2"EndIfElseMsgBox"Notabubble",vbInformation,"ExampleLeaderExtension2"EndIf

EndSub

Page 693: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LeftOffsetExampleSubExample_LeftOffset()

'Thisexamplereturnstheleftoffsetoftheselectedobject'tothegridassembly.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimoffsetAsStringOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"LeftOffsetExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0IfanchorIsNothingThenMsgBox"Selectedobjectisnotanchored.",vbExclamation,"LeftOffsetExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"LeftOffsetExample"ElseMsgBox"Leftoffsetofobject:"&anchor.LeftOffset,vbInformation,"LeftOffsetExample"

Page 694: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"LeftOffsetExample"EndIf

EndSub

Page 695: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LimitsExampleSubExample_Limits()'Thisexamplefindsthecurrentlimitsforthedrawing.'Itthenchangesthelimitsforthedrawing.Thegrid'isturnedontoshowthelimits.'TurnonthegridfortheactiveviewportThisDrawing.ActiveViewport.GridOn=TrueThisDrawing.ActiveViewport=ThisDrawing.ActiveViewport'FindthecurrentlimitsDimcurrLimitsAsVariantcurrLimits=ThisDrawing.LimitsMsgBox"Thecurrentdrawinglimitsare"&vbCrLf_&"Lower-leftcorner"&ThisDrawing.Limits(0)&","&ThisDrawing.Limits(1)&vbCrLf_&"Upper-rightcorner"&ThisDrawing.Limits(2)&","&ThisDrawing.Limits(3),,"LimitsExample"'ChangethelimitsDimnewLimits(0To3)AsDoublenewLimits(0)=2#:newLimits(1)=2#:newLimits(2)=4#:newLimits(3)=4#ThisDrawing.Limits=newLimitsThisDrawing.RegenacActiveViewportMsgBox"Thenewdrawinglimitsare"&vbCrLf_&"Lower-leftcorner"&ThisDrawing.Limits(0)&","&ThisDrawing.Limits(1)&vbCrLf_&"Upper-rightcorner"&ThisDrawing.Limits(2)&","&ThisDrawing.Limits(3),,"LimitsExample"'ResetthedrawinglimitsThisDrawing.Limits=currLimitsThisDrawing.RegenacActiveViewportMsgBox"Thedrawinglimitshavebeenresetto"&vbCrLf_&"Lower-leftcorner"&ThisDrawing.Limits(0)&","&ThisDrawing.Limits(1)&vbCrLf_&"Upper-rightcorner"&ThisDrawing.Limits(2)&","&ThisDrawing.Limits(3),,"LimitsExample"EndSub

Page 696: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearDisplayFormatExampleSubExample_LinearDisplayFormat()

'ThisexamplereturnstheLinearDispalyFormatsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Convertthelineardisplayformattoastring.

DimlinearformatAsString

SelectCasedbPref.LinearDisplayFormat

Case1

linearformat="Scientific"

Case2

linearformat="Decimal"

Case3

linearformat="Engineering"

Case4

linearformat="Architectural"

Case5

linearformat="Fractional"

Page 697: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSelect

MsgBox"ThecurrentvalueforLinearDisplayFormatis:"&linearformat,vbInformation,"LinearDisplayFormatExample"

EndSub

Page 698: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearPrecisionExampleSubExample_LinearPrecision()

'ThisexamplereturnstheLinearPrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforLinearPrecisionis:"&dbPref.LinearPrecision,_

vbInformation,"LinearPrecisionExample"

EndSub

Page 699: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinearUnitExampleSubExample_LinearUnit()

'ThisexamplereturnstheLinearUnitsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Convertthelineardisplayunittoastring.

DimunitAsString

SelectCasedbPref.LinearUnit

CaseaecUnitInch

unit="inch"

CaseaecUnitFoot

unit="foot"

CaseaecUnitYards

unit="yard"

CaseaecUnitMillimeter

unit="millimeters"

CaseaecUnitCentimeter

unit="centimeters"

Page 700: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CaseaecUnitDecimeter

unit="decimeters"

CaseaecUnitMeter

unit="meters"

EndSelect

MsgBox"ThecurrentvalueforLinearUnitis:"&unit,vbInformation,"LinearUnitExample"

EndSub

Page 701: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LineTypeExampleSubExample_LineType()

'Thisexampleshowsthelinetypeofthelayergeneratedbythekey

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

Page 702: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinetypesExampleSubExample_Linetypes()'Thisexamplefindsthelinetypescollectionand'listsalltheavailablelinetypesinthecollection.DimlinetypeCollAsAcadLineTypesDimentryAsAcadLineTypeDimmsgAsString'ReturnthelinetypecollectionobjectoftheactivedocumentSetlinetypeColl=ThisDrawing.Linetypes'ListallavailablelinetypesForEachentryInlinetypeCollmsg=msg&entry.name&vbCrLfNextMsgBox"Thelinetypesavailableinthisdrawingare:"&vbCrLf&msg,vbInformation,"LinetypesExample"EndSub

Page 703: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LinetypeScaleExampleSubExample_LinetypeScale()'Thisexamplecreatesalineandfindsthelinetypescale'fortheline.Itthenchangesthelinetypescale,andfinally'resetsthelinetypescalebacktotheoriginalvalue.DimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoubleDimlineObjAsAcadLineDimcurrLTScaleAsDouble

'CreateaLineobjectinmodelspacestartPoint(0)=2#:startPoint(1)=2#:startPoint(2)=0#endPoint(0)=4#:endPoint(1)=4#:endPoint(2)=0#SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)lineObj.UpdatecurrLTScale=lineObj.LinetypeScaleMsgBox"Thelinetypescaleforthelineis:"&lineObj.LinetypeScale,vbInformation,"LinetypesExample"

'SetthelinetypescaleofaLineto.5lineObj.LinetypeScale=0.5lineObj.UpdateMsgBox"Thenewlinetypescaleforthelineis:"&lineObj.LinetypeScale,vbInformation,"LinetypesExample"'ResetthelinetypescaleofaLinetowhatiswasbeforelineObj.LinetypeScale=currLTScalelineObj.UpdateMsgBox"Thelinetypescaleforthelineisresetto:"&lineObj.LinetypeScale,vbInformation,"LinetypesExample"EndSub

Page 704: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LineWeightExampleSubExample_LineWeight()

'Thisexampleshowsthelineweightofthelayergeneratedbythekey

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

Page 705: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LineweightDisplayExampleSubExample_LineweightDisplay()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'whethersymbolnamesmayincludeextendedcharactersets,ormore'than31characters.''Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.LineWeightDisplayMsgBox"TheLineweightDisplaypreferenceissetto:"&originalValue

'ModifytheLineweightDisplaypreferencebytogglingthevalueACADPref.LineWeightDisplay=Not(ACADPref.LineWeightDisplay)newValue=ACADPref.LineWeightDisplayMsgBox"TheLineweightDisplaypreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.LineWeightDisplay=originalValueMsgBox"TheLineweightDisplaypreferencewasresetbackto:"&originalValueEndSub

Page 706: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LocationExampleSubExample_Location()

'ThisexampledisplaysthelocationofanAECEntityDimobjAsObjectDimptAsVariantDimgeoAsAecGeoThisDrawing.Utility.GetEntityobj,pt,"SelectanAECEntity"IfTypeOfobjIsAecGeoThenSetgeo=objMsgBox"AECEntityLocation:"&geo.Location(0)&","&geo.Location(1)&","&geo.Location(2),vbInformation,"LocationExample"ElseMsgBox"NotanAECEntity",vbExclamation,"LocationExample"EndIf

EndSub

Page 707: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

LowerExtensionExampleSubExample_LowerExtension()

'Thisexampleshowsthedistanceofthelowercutplanebelow'buildingelevationlineposition

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"LowerExtensionis:"&clip.LowerExtension,vbInformation,"LowerExtensionExample"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"LowerExtenstionExample"EndIf

EndSub

Page 708: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaskBlockStylesExample

SubExample_MaskBlockStyles()

'ThisexamplewilldisplaythenumberofMaskBlockStylesinthecurrentdrawing.

DimdocAsAecBaseDocumentDimappAsNewAecBaseApplicationDimcMaskBlocksAsAecMaskBlockStylesapp.InitThisDrawing.ApplicationSetdoc=app.ActiveDocumentSetcMaskBlocks=doc.MaskBlockStylesMsgBox"NumberofMaskBlockStylesinthisdrawingis:"_&cMaskBlocks.Count,vbInformation,"MaskBlockStylesExample"

EndSub

Page 709: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupExampleExamples:

lAecMassElement

lAecMassGroup

SubExample_MassGroup_AecMassElement()

'Thisexampleshowsthenameofthemass'group,ifapplicable

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectMsgBox"MassElement"&count&"MassGroupNameis:"&mass.MassGroup.Name,vbInformation,"MassGroupExample"EndIfNextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"MassGroupExample"EndIf

EndSub

Page 710: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubExample_MassGroup_AecMassGroup()

'ThisexampleshowstheMassGrouptheMassElementisattachedto.DimentAsAcadEntityDimptAsVariantDimmassAsAecMassElementDimmassGroupAsAecMassGroup

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMassElement"IfTypeOfentIsAecMassElementThenSetmass=entSetmassGroup=mass.massGroupIfNotmassGroupIsNothingThenMsgBox"MassGroupis:"&massGroup.Name,vbInformation,"MassGroupExample"ElseMsgBox"MassElementisnotpartofaMassGroup",vbInformation,"MassGroupExample"EndIfElseMsgBox"NotanAecMassElement",vbExclamation,"MassGroupExample"EndIf

EndSub

Page 711: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MassGroupsExampleSubExample_MassGroups()

'ThisexamplewilldisplaythenumberofMassGroupsinthecurrentdrawing.

DimappAsNewAecBaseApplicationDimAecdocAsAecBaseDocumentDimmassgroupsAsAecMassGroupsapp.InitThisDrawing.ApplicationSetAecdoc=app.ActiveDocumentSetAecdoc=AecArchBaseApplication.ActiveDocumentSetmassgroups=Aecdoc.massgroupsMsgBox"Thereare"&massgroups.count&"massgroupsinthisdrawing"

EndSub

Page 712: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MaxActiveViewportsExampleSubExample_MaxActiveViewports()'Thisexamplereturnsthecurrentsettingof'MaxActiveViewports.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrMaxActiveViewportsAsIntegerDimnewMaxActiveViewportsAsInteger'RetrievethecurrentMaxActiveViewportsvaluecurrMaxActiveViewports=ThisDrawing.preferences.MaxActiveViewportsMsgBox"ThecurrentvalueforMaxActiveViewportsis"&currMaxActiveViewports,vbInformation,"MaxActiveViewportsExample"'ChangethevalueforMaxActiveViewportsnewMaxActiveViewports=20ThisDrawing.preferences.MaxActiveViewports=newMaxActiveViewportsMsgBox"ThenewvalueforMaxActiveViewportsis"&newMaxActiveViewports,vbInformation,"MaxActiveViewportsExample"'ResetMaxActiveViewportstoitsoriginalvalueThisDrawing.preferences.MaxActiveViewports=currMaxActiveViewportsMsgBox"TheMaxActiveViewportsvalueisresetto"&currMaxActiveViewports,vbInformation,"MaxActiveViewportsExample"EndSub

Page 713: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MeasurementUnitExampleSubExample_MeasurementUnit()

'ThisexamplereturnstheMeasurementUnitsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Convertthemeasurementunittoastring.

DimunitAsString

IfdbPref.MeasurementUnit=acEnglishThen

unit="English"

Else

unit="Metric"

EndIf

MsgBox"ThecurrentvalueforMeasurementUnitis"&unit,_

vbInformation,"MeasurementUnitExample"

EndSub

Page 714: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MirrorExampleSubExample_Mirror()'Thisexamplecreatesalightweightpolyline'andthenmirrorsthatpolyline.'CreatethepolylineDimplineObjAsAcadLWPolylineDimpoints(0To11)AsDoublepoints(0)=1:points(1)=1points(2)=1:points(3)=2points(4)=2:points(5)=2points(6)=3:points(7)=2points(8)=4:points(9)=4points(10)=4:points(11)=1SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=TrueZoomAll'DefinethemirroraxisDimpoint1(0To2)AsDoubleDimpoint2(0To2)AsDoublepoint1(0)=0:point1(1)=4.25:point1(2)=0point2(0)=4:point2(1)=4.25:point2(2)=0MsgBox"Mirrorthepolyline.",,"MirrorExample"'MirrorthepolylineDimmirrorObjAsAcadLWPolylineSetmirrorObj=plineObj.Mirror(point1,point2)mirrorObj.Color=acRedZoomAllMsgBox"Mirrorcompleted.",,"MirrorExample"EndSub

Page 715: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Mirror3DExampleSubExample_Mirror3D()'Thisexamplecreatesaboxinmodelspace.'Itthenmirrorstheboxaboutaplaneandcolors'thenewboxred.DimboxObjAsAcad3DSolidDimlengthAsDouble,widthAsDouble,heightAsDoubleDimcenter(0To2)AsDouble'Definetheboxcenter(0)=5#:center(1)=5#:center(2)=0length=5#:width=7:height=10#'Createthebox(3DSolid)objectinmodelspaceSetboxObj=ThisDrawing.ModelSpace.AddBox(center,length,width,height)'DefinethemirroringplanewiththreepointsDimmirrorPt1(0To2)AsDoubleDimmirrorPt2(0To2)AsDoubleDimmirrorPt3(0To2)AsDoublemirrorPt1(0)=1.25:mirrorPt1(1)=0:mirrorPt1(2)=0mirrorPt2(0)=1.25:mirrorPt2(1)=2:mirrorPt2(2)=0mirrorPt3(0)=1.25:mirrorPt3(1)=2:mirrorPt3(2)=2'MirrortheboxDimmirrorBoxObjAsAcad3DSolidSetmirrorBoxObj=boxObj.Mirror3D(mirrorPt1,mirrorPt2,mirrorPt3)mirrorBoxObj.Color=acRed'ChangetheviewingdirectionoftheviewportDimNewDirection(0To2)AsDoubleNewDirection(0)=-1:NewDirection(1)=-1:NewDirection(2)=1ThisDrawing.ActiveViewport.direction=NewDirectionThisDrawing.ActiveViewport=ThisDrawing.ActiveViewportZoomAll

Page 716: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

Page 717: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ModelSpaceExampleSubExample_ModelSpace()'Thisexampleaddsalineandacircletomodelspace.'Thelineisaddedusingauser-definedvariablerepresenting'themodelspace.Thecircleisaddedwithoutusingthe'user-definedvariable.EitheruseoftheModelSpace'propertyisvalid.'DefinethelineDimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoublestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=4:endPoint(1)=4:endPoint(2)=0'AddthelinetomodelspaceusingthemspacevariableDimmspaceAsAcadModelSpaceSetmspace=ThisDrawing.ModelSpaceSetlineObj=mspace.AddLine(startPoint,endPoint)'DefineacircleDimcircleObjAsAcadCircleDimcenter(0To2)AsDoubleDimradiusAsDoublecenter(0)=4:center(1)=4:center(2)=0radius=1'AddthecircletomodelspacewithoutusingthemspacevariableSetcircleObj=ThisDrawing.ModelSpace.AddCircle(center,radius)ZoomAllEndSub

Page 718: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ModifiedExample

'Thiscodeisplacedinamoduleandisruntoinitializedtheeventhandler.

PublicehAsNewEventHandler

SubNotify()DimobjAsAcadObjectForEachobjInThisDrawing.ModelSpaceIfTypeOfobjIsAecMassElementThen 'Thissetsaneventhandler(definedbelow)ontheMassElementSeteh.obj=objExitForEndIfNext

EndSub

'ThisistheEventHandlercode'Itisplacedina"ClassModule"

PublicWithEventsobjAsAcadObject

PrivateSubobj_Modified(ByValpObjectAsIAcadObject)DimentAsAecMassElementSetent=pObjectDimlocAsVariantloc=ent.LocationDimstrAsStringstr="AecMassElementat("&loc(0)&","&_loc(1)&","&_loc(2)&")"

Page 719: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBoxstr,,"ObjectEvent"EndSub

Page 720: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MoveExampleSubExample_Move()'Thisexamplecreatesacircleandthenperforms'amoveonthatcircle.'CreatethecircleDimcircleObjAsAcadCircleDimcenter(0To2)AsDoubleDimradiusAsDoublecenter(0)=2#:center(1)=2#:center(2)=0#radius=0.5SetcircleObj=ThisDrawing.ModelSpace.AddCircle(center,radius)ZoomAll'DefinethepointsthatmakeupthemovevectorDimpoint1(0To2)AsDoubleDimpoint2(0To2)AsDoublepoint1(0)=0:point1(1)=0:point1(2)=0point2(0)=2:point2(1)=0:point2(2)=0MsgBox"Movethecircle2unitsintheXdirection.",,"MoveExample"'MovethecirclecircleObj.Movepoint1,point2ZoomAllMsgBox"Movecompleted.",,"MoveExample"EndSub

Page 721: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MVBlockRefExampleExamples:

lAecViewBlock

lAecViewBlocks

SubExample_Name_AecViewBlock()

'ThisexampleshowstheMVBlockRef'snumberofcolors

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objMsgBox"ColorsofViewBlocksMVBlockRef:"&blockRef.viewBlocks.Item(0).MVBlockRef.Color,vbInformation,"MVBlockRefExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"MVBlockRefExample"EndIf

EndSub

SubExample_Name_AecViewBlocks()

'ThisexampleshowsthenumberofcolorsoftheowneroftheViewblockcollection

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRef

Page 722: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objSetviewBlocks=blockRef.viewBlocksMsgBox"ColorsofMVBlockRefOwner:"&viewBlocks.MVBlockRef.Color,vbInformation,"MVBlockRefExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"MVBlockRefExample"EndIf

EndSub

Page 723: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MVBlockStylesExampleSubExample_MVBlockStyles()'ThisexamplewilldisplaythenumberofMultiViewBlockStylesinthecurrentdrawing.

DimdocAsAecArchBaseDocumentDimcMvBlockStylesAsAecMVBlockStylesSetdoc=AecArchBaseApplication.ActiveDocumentSetcMvBlockStyles=doc.MVBlockStylesMsgBox"NumberofMVBlockStylesinthisdrawingis:"&cMvBlockStyles.Count,vbInformation,"MVBlockStylesExample"

EndSub

Page 724: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NameExampleExamples:

lAecMassGroup

lAecCamera

lAecLayerKey

lAecViewBlock

SubExample_Name_AecMassGroup()

'Thisexampleshowsthenameofthemassgroup

DimobjectAsObjectDimgroupAsAecMassGroupDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassGroupThencount=count+1Setgroup=objectMsgBox"MassGroup"&count&"Nameis:"&group.Name,vbInformation,"NameExample"EndIfNextIfcount=0ThenMsgBox"NoMassElementGroupsPresentinDrawing",vbInformation,"NameExample"EndIf

Page 725: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Name_AecCamera()

'ThisexampledisplaysthenameofaselectedcameraobjectDimobjAsObjectDimptAsVariantDimcameraAsAecCameraThisDrawing.Utility.GetEntityobj,pt,"SelectaCamera"IfTypeOfobjIsAecCameraThenSetcamera=objMsgBox"Nameis:"&camera.Name,vbInformation,"NameExample"ElseMsgBox"NotaCamera",vbExclamation,"NameExample"EndIf

EndSub

SubExample_Name_AecLayerKey()

'Thisexampleshowsthenameofthelayergeneratedbythekey

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'Setsthelayerkeystyletothecurrentlayerstandard

Page 726: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

SubExample_Name_AecViewBlock()

'Thisexampleshowsthenameofthefirstviewblockofamultiviewblock

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefDimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objSetviewBlocks=blockRef.viewBlocksMsgBox"NameofViewBlock1:"&viewBlocks.Item(0).Name,vbInformation,"NameExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"NameExample"EndIf

EndSub

Page 727: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NodeExampleSubExample_Node()

'Thisexamplewilladdanchoranewmasselementtoa2Dlayoutgridinthe'drawing.DimgridAsAecLayoutGrid2DDimmassAsAecMassElementDimptAsVariantDimobjAsAcadObjectThisDrawing.Utility.GetEntityobj,pt,"Selectgridtoattachto"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")DimanchorAsNewAecAnchorEntToLayoutNodeanchor.Reference=grid'anchorthemasselementtothelastnodeonthegridDimlastNodeAsLonglastNode=grid.XNodes.Count*grid.YNodes.Countanchor.Node=lastNodemass.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"NodeExample"EndIf

EndSub

Page 728: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NodesExampleSubExample_Nodes()

'ThisexampledisplaysthenumberofnodesonthelayoutcurveDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveThisDrawing.Utility.GetEntityobj,pt,"SelectaNodeonanAECLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objMsgBox"Numberofnodesis:"&layoutCurve.nodes.Count,vbInformation,"NodesExample"ElseMsgBox"NotaAECLayoutCurve",vbExclamation,"NodesExample"EndIf

EndSub

Page 729: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NormalExampleSubExample_Normal()

'ThisexampledisplaysthenormalvectorofanAECEntityDimobjAsObjectDimptAsVariantDimgeoAsAecGeoThisDrawing.Utility.GetEntityobj,pt,"SelectanAECEntity"IfTypeOfobjIsAecGeoThenSetgeo=objMsgBox"AECEntityNormal:"&geo.Normal(0)&","&geo.Normal(1)&","&geo.Normal(2),vbInformation,"NormalExample"ElseMsgBox"NotanAECEntity",vbExclamation,"NormalExample"EndIf

EndSub

Page 730: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

NorthRotationExampleSubExample_NorthRotation()

'ThisexamplereturnstheNorthRotationsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.Preferences

MsgBox"ThecurrentvalueforNorthRotationis:"&dbPref.NorthRotation,_

vbInformation,"NorthRotationExample"

EndSub

Page 731: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectIDExampleSubExample_ObjectID()'Thisexamplecreatesseveralobjectsinmodelspace.'Ittheniteratesthroughmodelspaceanddisplaysthe'ObjectIDforeachobjectfound.'CreateaRayobjectinmodelspaceDimrayObjAsAcadRayDimbasePoint(0To2)AsDoubleDimSecondPoint(0To2)AsDoublebasePoint(0)=3#:basePoint(1)=3#:basePoint(2)=0#SecondPoint(0)=1#:SecondPoint(1)=3#:SecondPoint(2)=0#SetrayObj=ThisDrawing.ModelSpace.AddRay(basePoint,SecondPoint)'CreateapolylineobjectinmodelspaceDimplineObjAsAcadLWPolylineDimpoints(0To5)AsDoublepoints(0)=3:points(1)=7points(2)=9:points(3)=2points(4)=3:points(5)=5SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=True

'CreatealineobjectinmodelspaceDimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoublestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=2:endPoint(1)=2:endPoint(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)'CreateacircleobjectinmodelspaceDimcircObjAsAcadCircleDimcenterPt(0To2)AsDoubleDimradiusAsDoublecenterPt(0)=5:centerPt(1)=3:centerPt(2)=0radius=3

Page 732: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetcircObj=ThisDrawing.ModelSpace.AddCircle(centerPt,radius)

'CreateanellipseobjectinmodelspaceDimellObjAsAcadEllipseDimmajAxis(0To2)AsDoubleDimcenter(0To2)AsDoubleDimradRatioAsDoublecenter(0)=5#:center(1)=5#:center(2)=0#majAxis(0)=10:majAxis(1)=20#:majAxis(2)=0#radRatio=0.3SetellObj=ThisDrawing.ModelSpace.AddEllipse(center,majAxis,radRatio)

ZoomAll'Iteratethroughthemodelspacecollectionanddisplay'theObjectIDofeachentityfound.DimentObjectIDAsLongDimentryAsAcadEntityForEachentryInThisDrawing.ModelSpaceentObjectID=entry.objectIDentry.Highlight(True)MsgBox"TheObjectIDofthisobjectis"&entObjectID,vbInformation,"ObjectIDExample"entry.Highlight(False)NextEndSub

Page 733: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectIDToObjectExampleSubExample_ObjectIDToObject()'Thisexamplecreatesasplineinmodelspace.Itthenreturnsthe'handleforthespline.Thesplineisreturnedfromthehandle,and'thencolored.'CreatethesplineDimsplineObjAsAcadSplineDimstartTan(0To2)AsDoubleDimendTan(0To2)AsDoubleDimfitPoints(0To8)AsDoublestartTan(0)=0.5:startTan(1)=0.5:startTan(2)=0endTan(0)=0.5:endTan(1)=0.5:endTan(2)=0fitPoints(0)=1:fitPoints(1)=1:fitPoints(2)=0fitPoints(3)=5:fitPoints(4)=5:fitPoints(5)=0fitPoints(6)=10:fitPoints(7)=0:fitPoints(8)=0SetsplineObj=ThisDrawing.ModelSpace.AddSpline(fitPoints,startTan,endTan)ZoomAll'FindtheobjectIDofthesplineDimobjectIDAsLongobjectID=splineObj.objectIDMsgBox"TheobjectIDoftheSplineis:"&splineObj.objectID,,"ObjectIDToObjectExample"'FindanobjectfromagivenobjectIDDimtempObjAsAcadObjectSettempObj=ThisDrawing.ObjectIdToObject(objectID)

'NowusethenewlyinitializedobjectvariabletocolortheobjectredtempObj.Color=acRedThisDrawing.RegenTrueMsgBox"TheSplineisnowred.",,"ObjectIDToObjectExample"EndSub

Page 734: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectNameExampleSubExample_ObjectName()'Thisexamplecreatesseveralobjectsinmodelspace.'Ittheniteratesthroughmodelspaceanddisplaysthe'ObjectNameforeachobjectfound.'CreateaRayobjectinmodelspaceDimrayObjAsAcadRayDimbasePoint(0To2)AsDoubleDimSecondPoint(0To2)AsDoublebasePoint(0)=3#:basePoint(1)=3#:basePoint(2)=0#SecondPoint(0)=1#:SecondPoint(1)=3#:SecondPoint(2)=0#SetrayObj=ThisDrawing.ModelSpace.AddRay(basePoint,SecondPoint)'CreateapolylineobjectinmodelspaceDimplineObjAsAcadLWPolylineDimpoints(0To5)AsDoublepoints(0)=3:points(1)=7points(2)=9:points(3)=2points(4)=3:points(5)=5SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=True

'CreatealineobjectinmodelspaceDimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDoublestartPoint(0)=0:startPoint(1)=0:startPoint(2)=0endPoint(0)=2:endPoint(1)=2:endPoint(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)'CreateacircleobjectinmodelspaceDimcircObjAsAcadCircleDimcenterPt(0To2)AsDoubleDimradiusAsDoublecenterPt(0)=20:centerPt(1)=30:centerPt(2)=0radius=3

Page 735: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetcircObj=ThisDrawing.ModelSpace.AddCircle(centerPt,radius)

'CreateanellipseobjectinmodelspaceDimellObjAsAcadEllipseDimmajAxis(0To2)AsDoubleDimcenter(0To2)AsDoubleDimradRatioAsDoublecenter(0)=5#:center(1)=5#:center(2)=0#majAxis(0)=10:majAxis(1)=20#:majAxis(2)=0#radRatio=0.3SetellObj=ThisDrawing.ModelSpace.AddEllipse(center,majAxis,radRatio)

ZoomAll'Iteratethroughthemodelspacecollectionanddisplay'theobjectnameofeachentityfound.DimobjNameAsStringDimentryAsAcadEntityForEachentryInThisDrawing.ModelSpaceobjName=entry.ObjectNameentry.Highlight(True)MsgBox"Thenameofthisobjectis"&objName,vbInformation,"ObjectNameExample"entry.Highlight(False)NextEndSub

Page 736: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByPlottingExampleSubExample_ObjectSortByPlotting()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyplottingorder.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortByPlottingMsgBox"TheObjectSortByPlottingpreferenceissetto:"&originalValue

'ModifytheObjectSortByPlottingpreferencebytogglingthevalueACADPref.ObjectSortByPlotting=Not(ACADPref.ObjectSortByPlotting)newValue=ACADPref.ObjectSortByPlottingMsgBox"TheObjectSortByPlottingpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortByPlotting=originalValueMsgBox"TheObjectSortByPlottingpreferencewasresetbackto:"&originalValueEndSub

Page 737: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByPSOutputExampleSubExample_ObjectSortByPSOutput()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyPostScriptoutputorder.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortByPSOutputMsgBox"TheObjectSortByPSOutputpreferenceissetto:"&originalValue

'ModifytheObjectSortByPSOutputpreferencebytogglingthevalueACADPref.ObjectSortByPSOutput=Not(ACADPref.ObjectSortByPSOutput)newValue=ACADPref.ObjectSortByPSOutputMsgBox"TheObjectSortByPSOutputpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortByPSOutput=originalValueMsgBox"TheObjectSortByPSOutputpreferencewasresetbackto:"&originalValueEndSub

Page 738: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByRedrawsExampleSubExample_ObjectSortByRedraws()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyredraworder.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortByRedrawsMsgBox"TheObjectSortByRedrawspreferenceissetto:"&originalValue

'ModifytheObjectSortByRedrawspreferencebytogglingthevalueACADPref.ObjectSortByRedraws=Not(ACADPref.ObjectSortByRedraws)newValue=ACADPref.ObjectSortByRedrawsMsgBox"TheObjectSortByRedrawspreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortByRedraws=originalValueMsgBox"TheObjectSortByRedrawspreferencewasresetbackto:"&originalValueEndSub

Page 739: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortByRegensExampleSubExample_ObjectSortByRegens()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyregenerationorder.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortByRegensMsgBox"TheObjectSortByRegenspreferenceissetto:"&originalValue

'ModifytheObjectSortByRegenspreferencebytogglingthevalueACADPref.ObjectSortByRegens=Not(ACADPref.ObjectSortByRegens)newValue=ACADPref.ObjectSortByRegensMsgBox"TheObjectSortByRegenspreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortByRegens=originalValueMsgBox"TheObjectSortByRegenspreferencewasresetbackto:"&originalValueEndSub

Page 740: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortBySelectionExampleSubExample_ObjectSortBySelection()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyobjectselection.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortBySelectionMsgBox"TheObjectSortBySelectionpreferenceissetto:"&originalValue

'ModifytheObjectSortBySelectionpreferencebytogglingthevalueACADPref.ObjectSortBySelection=Not(ACADPref.ObjectSortBySelection)newValue=ACADPref.ObjectSortBySelectionMsgBox"TheObjectSortBySelectionpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortBySelection=originalValueMsgBox"TheObjectSortBySelectionpreferencewasresetbackto:"&originalValueEndSub

Page 741: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ObjectSortBySnapExampleSubExample_ObjectSortBySnap()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thesortingofdrawingobjectsbyobjectsnap.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.ObjectSortBySnapMsgBox"TheObjectSortBySnappreferenceissetto:"&originalValue

'ModifytheObjectSortBySnappreferencebytogglingthevalueACADPref.ObjectSortBySnap=Not(ACADPref.ObjectSortBySnap)newValue=ACADPref.ObjectSortBySnapMsgBox"TheObjectSortBySnappreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.ObjectSortBySnap=originalValueMsgBox"TheObjectSortBySnappreferencewasresetbackto:"&originalValueEndSub

Page 742: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OffsetExampleSubExample_Offset()

'ThisexamplewillfindtheoffsetoftheMVBlocktagtotheendoftheleader.DimobjAsAcadObjectDimbubbleAsAecMVBlockRefDimanchorAsAecAnchorDimleaderAnchorAsAecAnchorLeadEntToNodeDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectbubble"IfTypeOfobjIsAecMVBlockRefThenSetbubble=objSetanchor=obj.GetAnchorIfTypeOfanchorIsAecAnchorLeadEntToNodeThenSetleaderAnchor=anchorDimoffsetAsVariantDimoffsetStringAsStringoffset=leaderAnchor.offsetoffsetString=offset(0)&","&offset(1)&","&offset(2)MsgBox"Offsetfromnode="&offsetString,vbInformation,"OffsetExample"ElseMsgBox"Notanchoredtocolumngrid",vbInformation,"OffsetExample"EndIfElseMsgBox"Notabubble",vbInformation,"OffsetExample"EndIf

EndSub

Page 743: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OLELaunchExampleSubExample_OLELaunch()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'whethertolaunchtheparentapplicationwhenplottingOLEobjects.'Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.OLELaunchMsgBox"TheOLELaunchpreferenceissetto:"&originalValue

'ModifytheOLELaunchpreferencebytogglingthevalueACADPref.OLELaunch=Not(ACADPref.OLELaunch)newValue=ACADPref.OLELaunchMsgBox"TheOLELaunchpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.OLELaunch=originalValueMsgBox"TheOLELaunchpreferencewasresetbackto:"&originalValueEndSub

Page 744: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OperationExampleExamples:

lAecMassElement

lAecMassGroup

SubExample_Operation_AecMassElement()

'Thisexampleshowstheoperationofamasselement?

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectSelectCasemass.OperationCaseaecMassOperationAddMsgBox"MassElement"&count&"Operation:Add",vbInformation,"OperationExample"CaseaecMassOperationIntersectMsgBox"MassElement"&count&"Operation:Intersect",vbInformation,"OperationExample"CaseaecMassOperationSubtractMsgBox"MassElement"&count&"Operation:Subtract",vbInformation,"OperationExample"EndSelectEndIfNext

Page 745: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Ifcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"OperationExample"EndIf

EndSub

SubExample_Operation_AecMassGroup()

'Thisexampleshowstheoperationofamassgroup?

DimobjectAsObjectDimgroupAsAecMassGroupDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassGroupThencount=count+1Setgroup=objectSelectCasegroup.OperationCaseaecMassOperationAddMsgBox"MassGroup"&count&"Operation:Add",vbInformation,"OperationExample"CaseaecMassOperationIntersectMsgBox"MassGroup"&count&"Operation:Intersect",vbInformation,"OperationExample"CaseaecMassOperationSubtractMsgBox"MassGroup"&count&"Operation:Subtract",vbInformation,"OperationExample"EndSelectEndIfNext

Page 746: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Ifcount=0ThenMsgBox"NoMassElementGroupsPresentinDrawing",vbInformation,"OperationExample"EndIf

EndSub

Page 747: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverridesEnabledExampleSubExample_OverridesEnabled()

DimdbAsNewAecBaseDatabaseDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsaeclayerkeystyleMsgBox"LayerOverridesEnabled:"&layerKeyStyle.OverridesEnabled,vbInformation,"OverridesEnabledExample"

EndSub

Page 748: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OverrideSettingsExampleSubExample_OverrideSettings()

DimdbAsNewAecBaseDatabaseDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsaeclayerkeystyleDimoverrideSettingsAsAecLayerOverrideSettingsdb.InitThisDrawing.DatabaseSetcLayerKeyStyles=db.LayerKeyStylesSetlayerKeyStyle=cLayerKeyStyles.Item(0)SetoverrideSettings=layerKeyStyle.overrideSettings

EndSub

Page 749: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

OwnerIDExampleSubExample_OwnerID()'ThisexamplecreatesanMTextobjectinmodelspace'andthenfindstheOwnerIDfortheobject.DimMTextObjAsAcadMTextDimcorner(0To2)AsDoubleDimwidthAsDoubleDimtextAsStringcorner(0)=0#:corner(1)=10#:corner(2)=0#width=10text="ThisisthetextStringforthemtextObject"

'CreatesthemtextObjectSetMTextObj=ThisDrawing.ModelSpace.AddMText(corner,width,text)ZoomAllMsgBox"TheOwnerIDfortheMTextobjectis:"&MTextObj.OwnerIDEndSub

Page 750: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PaperSpaceExampleSubExample_PaperSpace()'Thisexamplesetsthevariablepspacetothepaperspaceentitycollection.DimpspaceAsAcadPaperSpaceSetpspace=ThisDrawing.PaperSpaceEndSub

Page 751: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlotConfigurationsExampleSubExample_PlotConfigurations()'ThisexamplewillaccessthePlotConfigurationscollectionforthecurrentdrawing,'addaplotconfiguration,andlistbasicinformationaboutthe'plotconfigurationsinthedrawing.

DimPlotConfigurationsAsAcadPlotConfigurationsDimPlotConfigurationAsAcadPlotConfigurationDimmsgAsString'GetPlotConfigurationscollectionfromdocumentobjectSetPlotConfigurations=ThisDrawing.PlotConfigurations'Iftherearen'tanyplotconfigurations,thenwe'lladdoneIfPlotConfigurations.count=0Then'***Customizethenewconfigurationtoyoursatisfaction***PlotConfigurations.Add"NEW_CONFIGURATION"EndIfmsg=vbCrLf&vbCrLf'Startwithaspace'GetthenamesoftheplotconfigurationsinthisdrawingForEachPlotConfigurationInPlotConfigurationsmsg=msg&PlotConfiguration.name&vbCrLfNext'DisplayalistofavailableplotconfigurationsMsgBox"Thereare"&PlotConfigurations.count&"plotconfiguration(s)in"&_ThisDrawing.WindowTitle&":"&msgEndSub

Page 752: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlotStyleNameExampleSubExample_PlotStyleName()

'Thisexampleshowstheplotstylenameofthelayergeneratedbythekey

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

Page 753: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PlottableExampleSubExample_Plottable()

'Thisexampleshowswhetherthelayerisplottable

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

Page 754: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PolygonStylesExampleSubExample_PolygonStyles()

'ThisexamplewilldisplaythenumberofPolygonStylesinthecurrentdrawing.

DimdocAsAecArchBaseDocumentDimcPolygonStylesAsAecPolygonStylesSetdoc=AecArchBaseApplication.ActiveDocument

SetcPolygonStyles=doc.PolygonStyles

MsgBox"NumberofPolygonStylesinthisdrawingis:"&cPolygonStyles.Count,vbInformation,"PolygonStylesExample"

EndSub

Page 755: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

PreferencesExampleSubExample_Preferences()'ThisexamplereturnstheElevationPrecisionsettingforthecurrentdrawing.DimdbPrefAsAecDatabasePreferencesSetdbPref=AecArchBaseApplication.ActiveDocument.PreferencesMsgBox"ThecurrentvalueforElevationPrecisionis:"&dbPref.ElevationPrecision,_vbInformation,"ElevationPrecisionExample"

EndSub

Page 756: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileExampleExamples:

lAecProfileStyle

lAecRing

lAecRings

SubExample_Profile_AecProfileStyle()

'ThisexamplewilldisplaytheareaofthefirstprofilestyleinthecollectionDimdbAsNewAecBaseDatabaseDimpStyleAsAecProfileStyledb.InitThisDrawing.DatabaseSetpStyle=db.ProfileStyles.Item(0)MsgBox"ProfileArea:"&pStyle.Profile.Area,vbInformation,"ProfileExample"

EndSub

SubExample_Profile_AecRing()

'Thisexamplewilldisplaytheareaofthering'sownerprofileDimdbAsNewAecBaseDatabaseDimringAsAecRingdb.InitThisDrawing.DatabaseSetring=db.ProfileStyles.Item(0).Profile.rings.Item(0)MsgBox"RingProfileArea:"&ring.Profile.Area,vbInformation,"ProfileExample"

Page 757: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Profile_AecRings()

'ThisexamplewilldisplaytheareaoftheprofilethatownstheringcollectionDimdbAsNewAecBaseDatabaseDimpStyleAsAecProfileStyledb.InitThisDrawing.DatabaseSetpStyle=db.ProfileStyles.Item(0)MsgBox"RingsProfileArea:"&pStyle.Profile.rings.Profile.Area,vbInformation,"ProfileExample"

EndSub

Page 758: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyleExampleSubExample_ProfileStyle()

DimentAsObjectDimptAsVariantDimmassAsAecMassElement

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMassElement"IfTypeOfentIsAecMassElementThenSetmass=entMsgBox"ProfileStyleis:"&mass.ProfileStyle.Name,vbInformation,"ProfileStyleExample"ElseMsgBox"NotanAecMassElement",vbExclamation,"ProfileStyleExample"EndIf

EndSub

Page 759: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStyleNameExampleSubExample_ProfileStyleName()

'Thisexampleshowstheprofilestylenameforthemasselement

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectMsgBox"MassElement"&count&"Nameis:"&mass.ProfileStyleName,vbInformation,"ProfileStyleNameExample"EndIfNextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"ProfileStyleNameExample"EndIf

EndSub

Page 760: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProfileStylesExampleSubExample_ProfileStyles()

'ThisexamplewilldisplaythenumberofProfileStylesinthecurrentdrawing.

DimdocAsAecArchBaseDocumentDimcProfileStylesAsAecProfileStylesSetdoc=AecArchBaseApplication.ActiveDocumentSetcProfileStyles=doc.ProfileStylesMsgBox"NumberofProfileStylesinthisdrawingis:"&cProfileStyles.Count,vbInformation,"ProfileStylesExample"

EndSub

Page 761: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ProjectNameExampleSubExample_ProjectName()

'ThisexampledisplaystheProjectNamesettingforthecurrentdrawing

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThesettingforProjectNameis:"&dbPref.ProjectName,_

vbInformation,"ProjectNameExample"

EndSub

Page 762: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RadiusExampleSubExample_Radius()

'ThisexampleshowstheradiusofamasselementDimmassAsAecMassElementDimpt1(0To2)AsDoublept1(0)=100:pt1(1)=100:pt1(2)=0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")mass.Type=aecMassElementTypeConemass.Height=100mass.Radius=50mass.Location=pt1MsgBox"MassElementRadius="&mass.Radius,vbInformation,"RadiusExample"

EndSub

Page 763: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ReferenceExampleSubExample_Reference()'Thisexamplewillmakeamasselementandanchorittoaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortomass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 764: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RegisteredApplicationsExampleSubExample_RegisteredApplications()'ThisexamplefindsthecurrentRegisteredApplicationscollectionand'addsanewRegisteredApplicationtothatcollection.DimRegAppCollAsAcadRegisteredApplicationsSetRegAppColl=ThisDrawing.RegisteredApplications'CreateaRegisteredAppnamed"TEST"inthecurrentdrawingDimRegAppObjAsAcadRegisteredApplicationSetRegAppObj=RegAppColl.Add("TEST")MsgBox"Anewregisteredapplicationcalled"&RegAppObj.name&"hasbeenaddedtotheRegisteredApplicationscollection.",vbInformation,"RegisteredApplicationsExample"EndSub

Page 765: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ReleaseAnchorExampleSubExample_ReleaseAnchor()

'ThisexamplewillreleasetheanchorattachedtoanAECEntity.

DimentAsAcadEntityDimgeoAsAecGeoDimptAsVariantDimanchorAsAecAnchorThisDrawing.Utility.GetEntityent,pt,"Selectedanchoredobject"IfTypeOfentIsAecGeoThenSetgeo=entSetanchor=geo.GetAnchorIfanchorIsNothingThenMsgBox"AECEntitiyisnotanchored",vbInformation,"ReleaseAnchorExample"Elsegeo.ReleaseAnchor'releasestheanchorfromtheentityMsgBox"AECEntityisreleased",vbInformation,"ReleaseAnchorExample"EndIfElseMsgBox"AECEntitynotselected",vbInformation,"ReleaseAnchorExample"EndIf

EndSub

Page 766: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RemoveExampleSubExample_Remove_LayerKeyStyle()

'Thisexampleaddsanewlayerkeystyletothelayerkey'stylescollection,thenremovesthenewstyle.DimappAsNewAecBaseApplicationDimdocAsAecBaseDocumentDimlayerkeystylesAsAecLayerKeyStylesDimlayerkeystyleAsAecLayerKeyStyleDimmsgAsString'Initialize.app.InitThisDrawing.ApplicationSetdoc=app.ActiveDocument'Getthelayerkeystylescollectionandnotethenumber'ofobjectsinthecollection.Setlayerkeystyles=doc.layerkeystylesmsg="Therewere"&layerkeystyles.Count_&"layerkeystylesinthisdrawing."&vbCrLf

'Addanewlayerkeystyletothecollection.Setlayerkeystyle=layerkeystyles.Add("ExampleStyle")layerkeystyle.Description="Thisisatest"msg=msg&"Afteraddingalayerkeystyle,thereare"_&layerkeystyles.Count&"ofthem."MsgBoxmsg,vbInformation,"RemoveExample"

'Notethenumberofobjectsinthelayerkeystylescollectionnow.msg="Thenewlayerkeystylehad"&layerkeystyle.Keys.Count&"keys--"&vbCrLf

'Removethelayerkeystylethatwasjustadded.layerkeystyles.Remove("ExampleStyle")

Page 767: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

msg=msg&"butI'vesinceremovedthestyle..."MsgBoxmsg,vbInformation,"RemoveExample"

EndSub

Page 768: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RemoveableExampleSubExample_Removeable()

'Thisexampleshowswhetherthelayerisremoveable

DimdocAsAecArchBaseDocumentDimdbPrefAsAecArchBaseDatabasePreferencesDimcLayerKeyStylesAsAecLayerKeyStylesDimlayerKeyStyleAsAecLayerKeyStyleDimcLayerKeysAsAecLayerKeysDimlayerKeyAsAecLayerKeySetdoc=AecArchBaseApplication.ActiveDocumentSetcLayerKeyStyles=doc.LayerKeyStylesSetdbPref=doc.Preferences'SetsthelayerkeystyletothecurrentlayerstandardSetlayerKeyStyle=cLayerKeyStyles.Item(dbPref.LayerStandard)SetcLayerKeys=layerKeyStyle.KeysForEachlayerKeyIncLayerKeysDebug.PrintlayerKey.NameDebug.Print"Color-"&layerKey.ColorDebug.Print"Layer-"&layerKey.LayerDebug.Print"LineType-"&layerKey.LinetypeDebug.Print"Lineweight-"&layerKey.LineweightDebug.Print"Plotstyle-"&layerKey.PlotStyleNameDebug.Print"Plottable-"&layerKey.PlottableDebug.Print"Removable-"&layerKey.RemoveableNext

EndSub

Page 769: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RenderSmoothnessExampleSubExample_RenderSmoothness()'Thisexamplereturnsthecurrentsettingof'RenderSmoothness.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrRenderSmoothnessAsDoubleDimnewRenderSmoothnessAsDouble'RetrievethecurrentRenderSmoothnessvaluecurrRenderSmoothness=ThisDrawing.preferences.RenderSmoothnessMsgBox"ThecurrentvalueforRenderSmoothnessis"&currRenderSmoothness,vbInformation,"RenderSmoothnessExample"'ChangethevalueforRenderSmoothnessnewRenderSmoothness=2.5ThisDrawing.preferences.RenderSmoothness=newRenderSmoothnessMsgBox"ThenewvalueforRenderSmoothnessis"&newRenderSmoothness,vbInformation,"RenderSmoothnessExample"'ResetRenderSmoothnesstoitsoriginalvalueThisDrawing.preferences.RenderSmoothness=currRenderSmoothnessMsgBox"TheRenderSmoothnessvalueisresetto"&currRenderSmoothness,vbInformation,"RenderSmoothnessExample"EndSub

Page 770: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ResizeOffsetExampleSubExample_ResizeOffset()

'Thisexamplewilltakeamasselementanchoredtoa2DLayoutGrid,and'applyaResizeOffsettoit.

DimobjAsAcadObjectDimanchorAsAecAnchorEntToLayoutCellDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"Selectanchoredelement"IfTypeOfobjIsAecMassElementThenDimmassAsAecMassElementSetmass=objIfTypeOfmass.GetAnchorIsAecAnchorEntToLayoutCellThenSetanchor=mass.GetAnchoranchor.ResizeOffset=-22anchor.ApplyResize=FalseEndIfEndIf

EndSub

Page 771: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RightOffsetExampleSubExample_RightOffset()

'Thisexamplereturnstherightoffsetoftheselectedobject'tothegridassembly.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimoffsetAsStringOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"RightOffsetExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0IfanchorIsNothingThenMsgBox"Selectedobjectisnotanchored.",vbExclamation,"RightOffsetExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"RightOffsetExample"ElseMsgBox"Rightoffsetofobject:"&anchor.RightOffset,vbInformation,"RightOffsetExample"

Page 772: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"RightOffsetExample"EndIf

EndSub

Page 773: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RingsExampleSubExample_Rings()

'ThisexampleshowsthenumberofringsoftheprofileofanAecPolygon

DimobjAsObjectDimptAsVariantDimpolyAsAecPolygonThisDrawing.Utility.GetEntityobj,pt,"SelectanAECPolygon"IfTypeOfobjIsAecPolygonThenSetpoly=objMsgBox"ProfileRings:"&poly.Profile.rings.Count,vbInformation,"RingsExample"ElseMsgBox"NotaPolygonornoProfileFound",vbInformation,"RingsExample"EndIf

EndSub

Page 774: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RiseExampleSubExample_Rise()

'Thisexampleshowstheriseofthemasselementifgableshape

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectMsgBox"MassElement"&count&"Riseis:"&mass.Rise,vbInformation,"RiseExample"EndIfNextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"RiseExample"EndIf

EndSub

Page 775: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RotateExampleSubExample_Rotate()'Thisexamplecreatesalightweightpolyline'andthenrotatesthatpolyline.'CreatethepolylineDimplineObjAsAcadLWPolylineDimpoints(0To11)AsDoublepoints(0)=1:points(1)=2points(2)=1:points(3)=3points(4)=2:points(5)=3points(6)=3:points(7)=3points(8)=4:points(9)=4points(10)=4:points(11)=2SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=TrueZoomAllMsgBox"Rotatethepolylineby45degrees.",,"RotateExample"'DefinetherotationDimbasePoint(0To2)AsDoubleDimrotationAngleAsDoublebasePoint(0)=4:basePoint(1)=4.25:basePoint(2)=0rotationAngle=0.7853981'45degrees'RotatethepolylineplineObj.RotatebasePoint,rotationAngleZoomAllMsgBox"Rotationcompleted.",,"RotateExample"EndSub

Page 776: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Rotate3DExampleSubExample_Rotate3D()'Thisexamplecreatesaboxinmodelspace.'Itthenrotatestheboxaboutanaxis.DimboxObjAsAcad3DSolidDimlengthAsDouble,widthAsDouble,heightAsDoubleDimcenter(0To2)AsDouble'Definetheboxcenter(0)=5#:center(1)=5#:center(2)=0length=5#:width=7:height=10#'Createthebox(3DSolid)objectinmodelspaceSetboxObj=ThisDrawing.ModelSpace.AddBox(center,length,width,height)'ChangetheviewingdirectionoftheviewportDimNewDirection(0To2)AsDoubleNewDirection(0)=-1:NewDirection(1)=-1:NewDirection(2)=1ThisDrawing.ActiveViewport.direction=NewDirectionThisDrawing.ActiveViewport=ThisDrawing.ActiveViewportThisDrawing.RegenTrue'DefinetherotationaxiswithtwopointsDimrotatePt1(0To2)AsDoubleDimrotatePt2(0To2)AsDoubleDimrotateAngleAsDoublerotatePt1(0)=-3:rotatePt1(1)=4:rotatePt1(2)=0rotatePt2(0)=-3:rotatePt2(1)=-4:rotatePt2(2)=0rotateAngle=30rotateAngle=rotateAngle*3.141592/180#'Drawalinebetweenthetwoaxispointssothatitisvisible.'Thisisoptional.Itisnotrequiredfortherotation.DimaxisLineAsAcadLineSetaxisLine=ThisDrawing.ModelSpace.AddLine(rotatePt1,rotatePt2)

Page 777: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

axisLine.UpdateMsgBox"Rotatethebox30degreesabouttheaxisshown.",,"Rotate3DExample"

'RotatetheboxboxObj.Rotate3DrotatePt1,rotatePt2,rotateAngleThisDrawing.RegenTrueMsgBox"Theboxisrotated30degrees.",,"Rotate3DExample"EndSub

Page 778: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

RotationExampleSubExample_Rotation()

'ThisexampleshowstherotationreferanceangleforanAECEntity

DimobjectAsObjectDimptAsVariantDimgeoAsAecGeo

ThisDrawing.Utility.GetEntityobject,pt,"SelectAECEntity:"IfTypeOfobjectIsAecGeoThenSetgeo=objectDimrotStringAsStringrotString=ThisDrawing.Utility.AngleToString(geo.Rotation,acDegrees,4)MsgBox"AECEntityRotationis:"&rotString,vbInformation,"RotationExample"ElseMsgBox"NoAECEntityselected.",vbInformation,"RotationExample"EndIf

EndSub

Page 779: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SaveAsDefaultExampleSubExample_SaveAsDefault()

'ThisexamplesetstheTextHeightsettingto0.25

'andsavesitasthedefault.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

dbPref.TextHeight=0.25

dbPref.SaveAsDefault

MsgBox"ThenewdefaultvalueforTextHeightis:"&dbPref.TextHeight,_

vbInformation,"SaveAsDefaultExample"

EndSub

Page 780: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleEntityExampleSubExample_ScaleEntity()'Thisexamplecreatesalightweightpolyline'andthenscalesthatpolyline.'CreatethepolylineDimplineObjAsAcadLWPolylineDimpoints(0To11)AsDoublepoints(0)=1:points(1)=2points(2)=1:points(3)=3points(4)=2:points(5)=3points(6)=3:points(7)=3points(8)=4:points(9)=4points(10)=4:points(11)=2SetplineObj=ThisDrawing.ModelSpace.AddLightWeightPolyline(points)plineObj.Closed=TrueZoomAllMsgBox"Scalethepolylineby0.5",,"ScaleEntityExample"'DefinethescaleDimbasePoint(0To2)AsDoubleDimscalefactorAsDoublebasePoint(0)=4:basePoint(1)=4.25:basePoint(2)=0scalefactor=0.5'ScalethepolylineplineObj.ScaleEntitybasePoint,scalefactorZoomAllMsgBox"Scalecompleted.",,"ScaleEntityExample"EndSub

Page 781: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleOnInsertExampleSubExample_ScaleOnInsert()

'ThisexamplereturnstheScaleOnInsertsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Convertthescaleoninsertvaluetoastring.

DimscaleinsAsString

IfdbPref.ScaleOnInsert=TrueThen

scaleins="scaleoninsert."

Else

scaleins="donotscaleoninsert."

EndIf

MsgBox"ThecurrentvalueforScaleOnInsertis"&scaleins,_

vbInformation,"ScaleOnInsertExample"

EndSub

Page 782: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleXExampleExamples:

lAecMaskBlockRef

lAecMVBlockRef

SubExample_ScaleX_AecMaskBlockRef()

'ThisexampleshowstheXscaleofthemaskblockDimobjAsObjectDimptAsVariantDimmaskAsAecMaskBlockRef

ThisDrawing.Utility.GetEntityobj,pt,"SelectMaskBlock"IfTypeOfobjIsAecMaskBlockRefThenSetmask=objMsgBox"ScaleXis:"&mask.ScaleX,vbInformation,"ScaleXExample"ElseMsgBox"NotaMaskBlock",vbExclamation,"ScaleXExample"EndIf

EndSub

SubExample_ScaleX_AecMVBlockRef()

DimentAsAcadEntityDimptAsVariantDimmvBlockAsAecMVBlockRef

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMulti-ViewBlock"

Page 783: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfTypeOfentIsAecMVBlockRefThenSetmvBlock=entMsgBox"ScaleXis:"&mvBlock.ScaleX,vbInformation,"ScaleXExample"ElseMsgBox"NotanAecMVBlockRef",vbExclamation,"ScaleXExample"EndIf

EndSub

Page 784: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleXYExampleSubExample_ScaleXY()

DimringAsAecRingDimprofileAsAecProfile

DimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyleSetcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item(0)

SetprofileStyle.profile=profile.ScaleXY(2,1)

EndSub

Page 785: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleYExampleExamples:

lAecMaskBlockRef

lAecMVBlockRef

SubExample_ScaleY_AecMaskBlockRef()

'ThisexampleshowstheYscaleofthemaskblockDimobjAsObjectDimptAsVariantDimmaskAsAecMaskBlockRef

ThisDrawing.Utility.GetEntityobj,pt,"SelectMaskBlock"IfTypeOfobjIsAecMaskBlockRefThenSetmask=objMsgBox"ScaleYis:"&mask.ScaleY,vbInformation,"ScaleYExample"ElseMsgBox"NotaMaskBlock",vbExclamation,"ScaleYExample"EndIf

EndSub

SubExample_ScaleY_AecMVBlockRef()

DimentAsAcadEntityDimptAsVariantDimmvBlockAsAecMVBlockRef

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMulti-ViewBlock"

Page 786: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfTypeOfentIsAecMVBlockRefThenSetmvBlock=entMsgBox"ScaleYis:"&mvBlock.ScaleY,vbInformation,"ScaleYExample"ElseMsgBox"NotanAecMVBlockRef",vbExclamation,"ScaleYExample"EndIf

EndSub

Page 787: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ScaleZExampleExamples:

lAecMaskBlockRef

lAecMVBlockRef

SubExample_ScaleZ_AecMaskBlockRef()

'ThisexampleshowstheZscaleofthemaskblockDimobjAsObjectDimptAsVariantDimmaskAsAecMaskBlockRef

ThisDrawing.Utility.GetEntityobj,pt,"SelectMaskBlock"IfTypeOfobjIsAecMaskBlockRefThenSetmask=objMsgBox"ScaleZis:"&mask.ScaleZ,vbInformation,"ScaleZExample"ElseMsgBox"NotaMaskBlock",vbExclamation,"ScaleZExample"EndIf

EndSub

SubExample_ScaleZ_AecMVBlockRef()

DimentAsAcadEntityDimptAsVariantDimmvBlockAsAecMVBlockRef

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMulti-ViewBlock"

Page 788: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

IfTypeOfentIsAecMVBlockRefThenSetmvBlock=entMsgBox"ScaleZis:"&mvBlock.ScaleZ,vbInformation,"ScaleZExample"ElseMsgBox"NotanAecMVBlockRef",vbExclamation,"ScaleZExample"EndIf

EndSub

Page 789: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SegmentPerPolylineExampleSubExample_SegmentPerPolyline()'Thisexamplereturnsthecurrentsettingof'SegmentPerPolyline.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrSegmentPerPolylineAsIntegerDimnewSegmentPerPolylineAsInteger'RetrievethecurrentSegmentPerPolylinevaluecurrSegmentPerPolyline=ThisDrawing.preferences.SegmentPerPolylineMsgBox"ThecurrentvalueforSegmentPerPolylineis"&currSegmentPerPolyline,vbInformation,"SegmentPerPolylineExample"'ChangethevalueforSegmentPerPolylinenewSegmentPerPolyline=2001ThisDrawing.preferences.SegmentPerPolyline=newSegmentPerPolylineMsgBox"ThenewvalueforSegmentPerPolylineis"&newSegmentPerPolyline,vbInformation,"SegmentPerPolylineExample"'ResetSegmentPerPolylinetoitsoriginalvalueThisDrawing.preferences.SegmentPerPolyline=currSegmentPerPolylineMsgBox"TheSegmentPerPolylinevalueisresetto"&currSegmentPerPolyline,vbInformation,"SegmentPerPolylineExample"EndSub

Page 790: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SelfIntersectsExampleSubExample_SelfIntersects()

'ThisexampleshowsifanAecPolygonselfintersects

DimobjAsObjectDimptAsVariantDimpolyAsAecPolygonThisDrawing.Utility.GetEntityobj,pt,"SelectanAECPolygon"IfTypeOfobjIsAecPolygonThenSetpoly=objMsgBox"ProfileSelfIntersects?:"&poly.Profile.SelfIntersects,vbInformation,"SelfIntersectsExample"ElseMsgBox"NotaPolygonornoProfileFound",vbInformation,"SelfIntersectsExample"EndIf

EndSub

Page 791: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SetXDataExampleSubExample_SetXdata()'Thisexamplecreatesalineandattachesextendeddatatothatline.'CreatethelineDimlineObjAsAcadLineDimstartPt(0To2)AsDouble,endPt(0To2)AsDoublestartPt(0)=1#:startPt(1)=1#:startPt(2)=0#endPt(0)=5#:endPt(1)=5#:endPt(2)=0#SetlineObj=ThisDrawing.ModelSpace.AddLine(startPt,endPt)ZoomAll

'Initializeallthexdatavalues.Notethatfirstdatainthelistshouldbe'applicationnameandfirstdatatypecodeshouldbe1001DimDataType(0To9)AsIntegerDimData(0To9)AsVariantDimreals3(0To2)AsDoubleDimworldPos(0To2)AsDoubleDataType(0)=1001:Data(0)="Test_Application"DataType(1)=1000:Data(1)="Thisisatestforxdata"

DataType(2)=1003:Data(2)="0"'layerDataType(3)=1040:Data(3)=1.23479137438413E+40'realDataType(4)=1041:Data(4)=1237324938'distanceDataType(5)=1070:Data(5)=32767'16bitIntegerDataType(6)=1071:Data(6)=32767'32bitIntegerDataType(7)=1042:Data(7)=10'scaleFactor

reals3(0)=-2.95:reals3(1)=100:reals3(2)=-20DataType(8)=1010:Data(8)=reals3'realworldPos(0)=4:worldPos(1)=400.99999999:worldPos(2)=2.798989DataType(9)=1011:Data(9)=worldPos'worldspaceposition'AttachthexdatatothelinelineObj.SetXDataDataType,Data

Page 792: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

'ReturnthexdataforthelineDimxdataOutAsVariantDimxtypeOutAsVariantlineObj.GetXData"",xtypeOut,xdataOutEndSub

Page 793: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Side1ExampleSubExample_Side1()

'Thisexampleshowsthelengthofcutplanealongthestartingedge

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"Side1is:"&clip.Side1,vbInformation,"Side1Example"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"Side1Example"EndIf

EndSub

Page 794: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Side2ExampleSubExample_Side2()

'Thisexampleshowsthelengthofcutplanealongtheendingedge

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"Side2is:"&clip.Side2,vbInformation,"Side2Example"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"Side2Example"EndIf

EndSub

Page 795: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SolidFillExampleSubExample_SolidFill()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'whethermultilines,traces,solids,allhatches(includingsolid-fill)'andwidepolylinesarefilledin.''Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.SolidFillMsgBox"TheSolidFillpreferenceissetto:"&originalValue

'ModifytheSolidFillpreferencebytogglingthevalueACADPref.SolidFill=Not(ACADPref.SolidFill)newValue=ACADPref.SolidFillMsgBox"TheSolidFillpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.SolidFill=originalValueMsgBox"TheSolidFillpreferencewasresetbackto:"&originalValueEndSub

Page 796: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StartOffsetExampleSubExample_StartOffset()

'ThisexampledisplaysthestartoffsetofaselectedAECLayoutCurveobjectDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveThisDrawing.Utility.GetEntityobj,pt,"SelectaNodeonanAECLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objMsgBox"StartOffsetis:"&layoutCurve.StartOffset,vbInformation,"StartOffsetExample"ElseMsgBox"NotaAECLayoutCurve",vbExclamation,"StartOffsetExample"EndIf

EndSub

Page 797: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StyleExampleSubExample_Style()

'ThisexampleshowsthestyleofanAECEntity

DimobjAsObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectanAECObject"

IfTypeOfobjIsAecGeoThenOnErrorResumeNextDimnameAsStringname=obj.Style.name'Iftheentitydoesn'tuseastyle,thiswillfailIf(name"")ThenMsgBox"Styleis:"&name,vbInformation,"StyleExample"ElseMsgBox"AECEntitydoesnothaveastyle",vbInformation,"StyleExample"EndIfElseMsgBox"NotaAECEntity",vbExclamation,"StyleExample"EndIf

EndSub

Page 798: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

StyleNameExampleSubExample_StyleName()

'ThisexampleshowsthestylenameofanAECEntity

DimobjAsObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectanAECObject"IfTypeOfobjIsAecGeoThenOnErrorResumeNextDimnameAsStringname=obj.StyleName'Iftheentitydoesn'tuseastyle,thiswillfailIf(name"")ThenMsgBox"Styleis:"&name,vbInformation,"StyleExample"ElseMsgBox"AECEntitydoesnothaveastyle",vbInformation,"StyleExample"EndIfElseMsgBox"NotaAECEntity",vbExclamation,"StyleExample"EndIf

EndSub

Page 799: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubtractExampleSubExample_Subtract()

'Thisexampleaddstwoprofilesfromrings,andsubtractsthesecondfromthefirst

OnErrorResumeNextDimpointList1(0To9)AsDoubleDimpointList2(0To7)AsDoublepointList1(0)=0:pointList1(1)=0pointList1(2)=1:pointList1(3)=0pointList1(4)=1:pointList1(5)=1pointList1(6)=0:pointList1(7)=1pointList1(8)=0:pointList1(9)=0

pointList2(0)=0.5:pointList2(1)=0.5pointList2(2)=0.067:pointList2(3)=-0.25pointList2(4)=0.933:pointList2(5)=-0.25pointList2(6)=0.5:pointList2(7)=0.5

Dimring1AsAecRingDimring2AsAecRingDimprofile1AsNewAecProfileDimprofile2AsNewAecProfile

DimdocAsAecArchBaseDocumentSetdoc=AecArchBaseApplication.ActiveDocumentDimcprofilesAsAecProfileStylesDimprofileStyleAsAecProfileStyleSetcprofiles=doc.ProfileStylesSetprofileStyle=cprofiles.Item("SubtractRing")IfprofileStyleIsNothingThenSetprofileStyle=cprofiles.Add("SubtractRing")EndIfSetring1=profile1.Rings.AddSetring2=profile2.Rings.Add

Page 800: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ring1.FromPoints(pointList1)ring2.FromPoints(pointList2)

profile1.Subtractprofile2

SetprofileStyle.profile=profile1

EndSub

Page 801: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextFrameDisplayExampleSubExample_TextFrameDisplay()'Thisexamplereturnsthecurrentsettingof'TextFrameDisplay.Itthenchangesthevalue,andfinally'itresetsthevaluebacktotheoriginalsetting.DimcurrTextFrameDisplayAsBoolean'RetrievethecurrentTextFrameDisplayvaluecurrTextFrameDisplay=ThisDrawing.preferences.TextFrameDisplayMsgBox"ThecurrentvalueforTextFrameDisplayis"&preferences.TextFrameDisplay,vbInformation,"TextFrameDisplayExample"'ChangethevalueforTextFrameDisplayThisDrawing.preferences.TextFrameDisplay=Not(currTextFrameDisplay)MsgBox"ThenewvalueforTextFrameDisplayis"&preferences.TextFrameDisplay,vbInformation,"TextFrameDisplayExample"'ResetTextFrameDisplaytoitsoriginalvalueThisDrawing.preferences.TextFrameDisplay=currTextFrameDisplayMsgBox"TheTextFrameDisplayvalueisresetto"&preferences.TextFrameDisplay,vbInformation,"TextFrameDisplayExample"EndSub

Page 802: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextHeightExampleSubExample_TextHeight()

'ThisexampledisplaystheTextHeightsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThecurrentvalueforTextHeightis:"&dbPref.TextHeight,_

vbInformation,"TextHeightExample"

EndSub

Page 803: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TextStylesExampleSubExample_TextStyles()'ThisexamplefindsthecurrentTextstylescollectionand'addsanewTextstyletothatcollection.DimTextCollAsAcadTextStylesSetTextColl=ThisDrawing.TextStyles'CreateaTextstylenamed"TEST"inthecurrentdrawingDimtextStyleAsAcadTextStyleSettextStyle=TextColl.Add("TEST")MsgBox"AnewTextstylecalled"&textStyle.name&"hasbeenaddedtotheTextstylescollection.",vbInformation,"TextstylesExample"EndSub

Page 804: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TopOffsetExampleSubExample_TopOffset()

'Thisexamplemodifiesthetopoffsetoftheselectedobject'inrelationtoitsanchorpointonthegridassembly.It'promptstheusertoselecttheobjecttobemodified,'andthenitpromptstheusertospecifythenumberofinches'toadjusttheoffsetby.Thenumbercanbeeitherpositive'ornegative.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimoffsetAsStringDimoffset_adjustAsDoubleOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"TopOffsetExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0IfanchorIsNothingThen

Page 805: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

MsgBox"Selectedobjectisnotanchored.",vbExclamation,"TopOffsetExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"TopOffsetExample"Else'AdjustSizingmustbesettoTrueinorderforoffsetchangetotakeeffect.anchor.AdjustSizing=TrueMsgBox"Topoffsetofobjectwas:"&anchor.TopOffset,vbInformation,"TopOffsetExample"'Promptusertospecifyamounttoadjustoffsetby.offset_adjust=ThisDrawing.Utility.GetReal("Enterthenumberofinchestoadjusttopoffsetby:")'Changeoffsetbyspecifiedamount.anchor.TopOffset=anchor.TopOffset+offset_adjustThisDrawing.Regen(acActiveViewport)MsgBox"Newtopoffsetis:"&anchor.TopOffset,vbInformation,"TopOffsetExample"EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"TopOffsetExample"EndIf

EndSub

Page 806: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TransformByExampleSubExample_TransformBy()'Thisexamplecreatesalineandrotatesit90degrees'usingatransformationmatrix.'CreatealineDimlineObjAsAcadLineDimstartPt(0To2)AsDoubleDimendPt(0To2)AsDoublestartPt(0)=2:startPt(1)=1:startPt(2)=0endPt(0)=5:endPt(1)=1:endPt(2)=0SetlineObj=ThisDrawing.ModelSpace.AddLine(startPt,endPt)lineObj.Update'InitializethetransMatvariablewithatransformationmatrix'thatwillrotateanobjectby90degreesaboutthepoint(0,0,0)'(Moreexamplesoftransformationmatricesarelistedbelow)DimtransMat(0To3,0To3)AsDoubletransMat(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#'TransformthelineusingthedefinedtransformationmatrixMsgBox"Transformtheline.",,"TransformByExample"lineObj.TransformBy(transMat)ZoomAllMsgBox"Thelineistransformed.",,"TransformByExample"

'Moreexamplesoftransformationmatrices:

'RotationMatrix:90Degreesaboutpoint0,0,0'0.000000-1.0000000.0000000.000000'1.0000000.0000000.0000000.000000'0.0000000.0000001.0000000.000000

Page 807: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

'0.0000000.0000000.0000001.000000

'RotationMatrix:45Degreesaboutpoint5,5,0'0.707107-0.7071070.0000005.000000'0.7071070.7071070.000000-2.071068'0.0000000.0000001.0000000.000000'0.0000000.0000000.0000001.000000

'TranslationMatrix:moveanobjectby10,10,0'1.0000000.0000000.00000010.000000'0.0000001.0000000.00000010.000000'0.0000000.0000001.0000000.000000'0.0000000.0000000.0000001.000000

'ScalingMatrix:scaleby10,10atpoint0,0,0'10.0000000.0000000.0000000.000000'0.00000010.0000000.0000000.000000'0.0000000.00000010.0000000.000000'0.0000000.0000000.0000001.000000

'ScalingMatrix:scaleby10atpoint2,2'10.0000000.0000000.000000-18.000000'0.00000010.0000000.000000-18.000000'0.0000000.00000010.0000000.000000'0.0000000.0000000.0000001.000000EndSub

Page 808: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TypeExampleExamples:

lAecLayoutCurve

lAecMassElement

SubExample_Type_AecLayoutCurve()

'ThisexampledisplaysthespacingruleusedonaselectedaeclayoutcurveobjectDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveDimlayoutTypeAsAecLayoutTypeDimstrAsStringThisDrawing.Utility.GetEntityobj,pt,"SelectaNodeonanAECLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=objlayoutType=layoutCurve.TypeSelectCaselayoutTypeCaseaecLayoutTypeAutoSpacingBaystr="BaySpacing"CaseaecLayoutTypeAutoSpacingEvenstr="EvenSpacing"CaseaecLayoutTypeManualSpacingstr="ManualSpacing"EndSelectMsgBox"Layoutruleis:"&str,vbInformation,"TypeExample"ElseMsgBox"NotaAECLayoutCurve",vbExclamation,"TypeExample"EndIf

Page 809: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

EndSub

SubExample_Type_AecMassElement()

'Thisexampleshowsthetypeofmasselement

DimobjectAsObjectDimmassAsAecMassElementDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecMassElementThencount=count+1Setmass=objectSelectCasemass.TypeCaseaecMassElementTypeArchMsgBox"MassElement"&count&"Type:Arch",vbInformation,"TypeExample"CaseaecMassElementTypeBarrelVaultMsgBox"MassElement"&count&"Type:BarrelVault",vbInformation,"TypeExample"CaseaecMassElementTypeBoxMsgBox"MassElement"&count&"Type:Box",vbInformation,"TypeExample"CaseaecMassElementTypeConeMsgBox"MassElement"&count&"Type:Cone",vbInformation,"TypeExample"CaseaecMassElementTypeCylinderMsgBox"MassElement"&count&"Type:Cylinder",vbInformation,"TypeExample"CaseaecMassElementTypeDomeMsgBox"MassElement"&count&"Type:Dome",vbInformation,"TypeExample"CaseaecMassElementTypeDoricMsgBox"MassElement"&count&"Type:Doric",vbInformation,"TypeExample"CaseaecMassElementTypeExtrusionMsgBox"MassElement"&count&"Type:Extrusion",vbInformation,"TypeExample"CaseaecMassElementTypeGableMsgBox"MassElement"&count&"Type:Gable",vbInformation,"TypeExample"

Page 810: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CaseaecMassElementTypeIsoscelesTriangleMsgBox"MassElement"&count&"Type:IsoscelesTriangle",vbInformation,"TypeExample"CaseaecMassElementTypePyramidMsgBox"MassElement"&count&"Type:Pyramid",vbInformation,"TypeExample"CaseaecMassElementTypeRevolutionMsgBox"MassElement"&count&"Type:Revolution",vbInformation,"TypeExample"CaseaecMassElementTypeRightTriangleMsgBox"MassElement"&count&"Type:RightTriangle",vbInformation,"TypeExample"CaseaecMassElementTypeSphereMsgBox"MassElement"&count&"Type:Sphere",vbInformation,"TypeExample"EndSelectEndIfNextIfcount=0ThenMsgBox"NoMassElementsPresentinDrawing",vbInformation,"TypeExample"EndIf

EndSub

Page 811: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UserCoordinateSystemsExampleSubExample_UserCoordinateSystems()'ThisexamplefindsthecurrentUserCoordinateSystemscollectionand'addsanewUCStothatcollection.DimUCSCollAsAcadUCSsSetUCSColl=ThisDrawing.UserCoordinateSystems'CreateaUCSnamed"TEST"inthecurrentdrawingDimucsObjAsAcadUCSDimorigin(0To2)AsDoubleDimxAxisPnt(0To2)AsDoubleDimyAxisPnt(0To2)AsDouble'DefinetheUCSorigin(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#'AddtheUCStotheUserCoordinatesSystemscollectionSetucsObj=UCSColl.Add(origin,xAxisPnt,yAxisPnt,"TEST")MsgBox"AnewUCScalled"&ucsObj.name&"hasbeenaddedtotheUserCoordinateSystemscollection.",vbInformation,"UserCoordinateSystemsExample"EndSub

Page 812: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UpdateExampleSubExample_Update()'Thisexamplecreatesalineinmodelspace.Itdisplaysa'Msgboximmediatelybeforethecalltoupdatethelineand'againafterthecall.DimlineObjAsAcadLineDimstartPoint(0To2)AsDoubleDimendPoint(0To2)AsDouble

'CreateaLineobjectinmodelspacestartPoint(0)=2#:startPoint(1)=2#:startPoint(2)=0#endPoint(0)=4#:endPoint(1)=4#:endPoint(2)=0#SetlineObj=ThisDrawing.ModelSpace.AddLine(startPoint,endPoint)lineObj.Color=acRedMsgBox"Beforetheupdate.",,"UpdateExample"'ThefollowingcodedrawsanobjectinAutoCADwindowlineObj.UpdateMsgBox"Aftertheupdate.",,"UpdateExample"'ThefollowingcallupdatestheentiredrawingThisDrawing.Application.UpdateEndSub

Page 813: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseModelExtentsExampleSubExample_UseModelExtents()

'Thisexampledeterminesiftheheightandlower'extensionaresetautomaticallyusingmodelextents

DimobjectAsObjectDimclipAsAecClipVolDimcountAsInteger'initalizecount=0ForEachobjectInThisDrawing.ModelSpaceIfTypeOfobjectIsAecClipVolThencount=count+1Setclip=objectMsgBox"ClipVol"&count&"UseModelExtents?:"&clip.UseModelExtents,vbInformation,"UseModelExtentsExample"EndIfNextIfcount=0ThenMsgBox"NoClipVolPresentinDrawing",vbInformation,"UseModelExtentsExample"EndIf

EndSub

Page 814: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

UseNodeCSExampleSubExample_UseNodeCS()

'ThisexampleattachesaMassElementtoa2DLayoutGrid,andusestheNodes

'coordinatesystem.

DimobjAsAcadObjectDimptAsVariantThisDrawing.Utility.GetEntityobj,pt,"SelectLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenDimgridAsAecLayoutGrid2DSetgrid=objDimmassAsAecMassElementSetmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")DimanchorAsNewAecAnchorEntToLayoutNodeanchor.Reference=gridanchor.Node=1anchor.UseNodeCS=Truemass.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"UseNodeCSExample"EndIf

EndSub

Page 815: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ValidExampleExamples:

lAecProfile

lAecRing

SubExample_Valid_AecProfile()

'ThisexampleshowsifanAecPolygonisvalid

DimobjAsObjectDimptAsVariantDimpolyAsAecPolygonThisDrawing.Utility.GetEntityobj,pt,"SelectanAECPolygon"IfTypeOfobjIsAecPolygonThenSetpoly=objMsgBox"ProfileValid:"&poly.Profile.Valid,vbInformation,"ValidExample"ElseMsgBox"NotaPolygonornoProfileFound",vbInformation,"ValidExample"EndIf

EndSub

SubExample_Valid_AecRing()

'ThisexamplewilldisplaythevalidityoftheringDimdbAsNewAecBaseDatabaseDimringAsAecRingdb.InitThisDrawing.Database

Page 816: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Setring=db.ProfileStyles.Item(0).Profile.rings.Item(0)MsgBox"RingValid?:"&ring.Valid,vbInformation,"ValidExample"

EndSub

Page 817: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ValueExampleExamples:

lAecLayerOverrideSetting

lAecLayoutCurve

SubExample_Value_AecLayerOverrideSetting()

'Thisexampleshowsthenameoftheowneroftheoverridesetting

DimdbAsNewAecBaseDatabaseDimsettingAsAecLayerOverrideSettingdb.InitThisDrawing.DatabaseSetsetting=db.LayerKeyStyles.Item(0).overrideSettings.Item(0)MsgBox"SettingValue:"&setting.Value,vbInformation,"ValueExample"

EndSub

SubExample_Value_AecLayoutCurve()

'ThisexamplesshoweitherthebayspacingorthenumberofnodesonthelayoutcurveDimobjAsObjectDimptAsVariantDimlayoutCurveAsAecLayoutCurveDimstrAsStringThisDrawing.Utility.GetEntityobj,pt,"SelectaNodeonanAECLayoutCurve"IfTypeOfobjIsAecLayoutCurveThenSetlayoutCurve=obj

Page 818: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SelectCaselayoutCurve.TypeCaseaecLayoutTypeAutoSpacingBaystr="Bayspacing="&layoutCurve.ValueCaseaecLayoutTypeAutoSpacingEvenstr="Numberofevenspaces="&layoutCurve.ValueCaseaecLayoutTypeManualSpacingstr="ManualSpacing"EndSelect

MsgBoxstr,vbInformation,"ValueExample"ElseMsgBox"NotaAECLayoutCurve",vbExclamation,"ValueExample"EndIf

EndSub

Page 819: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VerticalScaleExampleSubExample_VerticalScale()

'Thisexamplewilldisplaytheverticalscaleofthedatabase.

DimdbAsNewAecArchBaseDatabaseDimprefAsAecArchBaseDatabasePreferencesdb.InitThisDrawing.DatabaseSetpref=db.PreferencesMsgBox"VerticalScaleofthedatabase:"&pref.VerticalScale,vbInformation,_

"VerticalScaleExample"

EndSub

Page 820: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewBlocksExampleSubExample_ViewBlocks()

DimentAsAcadEntityDimptAsVariantDimmvBlockAsAecMVBlockRefDimcViewBlocksAsAecViewBlocks

ThisDrawing.Utility.GetEntityent,pt,"SelectAECMulti-ViewBlock"IfTypeOfentIsAecMVBlockRefThenSetmvBlock=entSetcViewBlocks=mvBlock.viewBlocksMsgBox"NumberofViewblocksis:"&cViewBlocks.Count,vbInformation,"StyleNameExample"ElseMsgBox"NotanAecMVBlockRef",vbExclamation,"StyleNameExample"EndIf

EndSub

Page 821: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewportsExampleSubViewports()'ThisexamplefindsthecurrentViewportscollectionand'addsanewviewporttothatcollection.DimviewportCollAsAcadViewportsSetviewportColl=ThisDrawing.Viewports'Createaviewportnamed"TEST"inthecurrentdrawingDimviewportObjAsAcadViewportSetviewportObj=viewportColl.Add("TEST")MsgBox"Anewviewportcalled"&viewportObj.name&"hasbeenaddedtotheViewportscollection.",vbInformation,"ViewportsExample"EndSub

Page 822: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ViewsExampleSubExample_Views()'Thisexamplefindsthecurrentviewscollectionand'addsanewviewtothatcollection.DimviewCollAsAcadViewsSetviewColl=ThisDrawing.Views'Createaviewnamed"TEST"inthecurrentdrawingDimviewObjAsAcadViewSetviewObj=viewColl.Add("TEST")MsgBox"Anewviewcalled"&viewObj.name&"hasbeenaddedtotheviewscollection.",vbInformation,"ViewsExample"EndSub

Page 823: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VisibleExampleSubExample_Visible_AecBaseObject()

'ThisexampleaddsanAecPolygonobjecttothecurrentdrawing,'displaystheobject,thenturnstheobject'sVisibleproperty'toFalseandredisplaysthedrawing.

DimobjAsAcadObjectDimptAsVariantDimpolygonAsAecPolygon

'AddanAecPolygonobjecttothedrawing.Setpolygon=ThisDrawing.ModelSpace.AddCustomObject("AecPolygon")

'Selectalocationfortheobjectonscreen.pt=ThisDrawing.Utility.GetPoint(,"Selecttheinsertionpoint:")IfErr.Number0ThenMsgBox("errorwhengettingapoint."&vbCrLf)ExitSubEndIf

'Placetheobjectatthespecifiedpoint,thendisplay'amessagesothatuserscanseetheobject.polygon.Location=ptpolygon.UpdateMsgBox("AecPolygonaddedtodrawing.Nowyouseeit...")

'Maketheobjectinvisible,thendisplayamessagesothat'thedrawingisvisibleanduserscanseethatthe'objectisnolongervisible.polygon.Visible=Falsepolygon.UpdateMsgBox("...andnowyoudon't.")

'Maketheobjectvisibleagain,sothatuserscanmanipulate'itthroughtheuserinterface.polygon.Visible=True

Page 824: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

polygon.Update

EndSub

Page 825: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VoidExampleSubExample_Void()

'ThisexamplewilldisplaytheiftheringisvoidornotDimdbAsNewAecBaseDatabaseDimringAsAecRingdb.InitThisDrawing.DatabaseSetring=db.ProfileStyles.Item(0).Profile.rings.Item(0)MsgBox"RingVoid?:"&ring.Void,vbInformation,"VoidExample"

EndSub

Page 826: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeExampleSubExample_Volume()

'Thisexampleshowsthevolumeofamasselementormassgroup.

DimobjectAsObjectDimptAsVariantDimmassAsAecMassElementDimmassGroupAsAecMassGroupDimcountAsIntegerThisDrawing.Utility.GetEntityobject,pt,"SelectMassElementorMassGroup"IfTypeOfobjectIsAecMassGroupThenSetmassGroup=objectMsgBox"MassGroupvolume="&Format(massGroup.Volume,"###0.000"),vbInformation,"VolumeExample"ElseIfTypeOfobjectIsAecMassElementThenSetmass=objectMsgBox"MassElementvolume="&Format(mass.Volume,"###0.000"),vbInformation,"VolumeExample"ElseMsgBox"MassElementorGroupnotselected.",vbInformation,"VolumeExample"EndIfEndIf

EndSub

Page 827: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeDisplayExampleSubExample_VolumeDisplayUnit()

'ThisexamplereturnstheVolumeDisplayUnitsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

'Convertthevolumedisplayunittoastring.

DimunitAsString

SelectCasedbPref.VolumeDisplayUnit

CaseaecUnitCubicInch

unit="cubicinch"

CaseaecUnitCubicFoot

unit="cubicfoot"

CaseaecUnitCubicYard

unit="cubicyard"

CaseaecUnitCubicMil

unit="cubicmillimeters"

CaseaecUnitCubicCentimeter

unit="cubiccentimeters"

Page 828: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

CaseaecUnitCubicDecimeter

unit="cubicdecimeters"

CaseaecUnitCubicMeter

unit="cubicmeters"

EndSelect

MsgBox"ThecurrentvalueforVolumeDisplayUnitis"&unit,_

vbInformation,"VolumeDisplayUnitExample"

EndSub

Page 829: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumePrecisionExampleSubExample_VolumePrecision()

'ThisexampledisplaystheVolumePrecisionsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThecurrentvalueforVolumePrecisionis:"&dbPref.VolumePrecision,_

vbInformation,"VolumePrecisionExample"

EndSub

Page 830: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

VolumeSuffixExampleSubExample_VolumeSuffix()

'ThisexampledisplaystheVolumeSuffixsettingforthecurrentdrawing.

DimdbPrefAsAecArchBaseDatabasePreferences

SetdbPref=AecArchBaseApplication.ActiveDocument.preferences

MsgBox"ThecurrentvalueforVolumeSuffixis"&dbPref.VolumeSuffix,_

vbInformation,"VolumeSuffixExample"

EndSub

Page 831: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WidthExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

lAecMassElement

SubExample_Width_AecLayoutGrid2D()

'Thisexampledisplaysthewidthofa2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridWidthis:"&grid.Width,vbInformation,"WidthExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"WidthExample"EndIf

EndSub

SubExample_Width_AecLayoutGrid3D()

'Thisexampledisplaysthewidthofa3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 832: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridWidthis:"&grid.Width,vbInformation,"WidthExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"WidthExample"EndIf

EndSub

SubExample_Width_AecMassElement()

'ThisexampleshowsthesizeofthemasselementinitsrelativeXdirection

DimobjAsObjectDimptAsVariantDimmassAsAecMassElementThisDrawing.Utility.GetEntityobj,pt,"SelectMassElement"

IfTypeOfobjIsAecMassElementThen</font>Setmass=objMsgBox"MassElementWidthis:"&mass.Width,vbInformation,"WidthExample"ElseMsgBox"NoMassElementsselected.",vbInformation,"WidthExample"EndIf

EndSub

Page 833: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WindowStateExampleSubExample_WindowState()'ThisexamplereadsanddisplaysthecurrentwindowstateoftheAutoCADapplication.

DimCurrentStateAsString'Usethe"WindowState"variabletodeterminethewindowstateofAutoCADSelectCaseWindowStateCaseacMin:CurrentState="Minimized"CaseacMax:CurrentState="Maximized"CaseacNorm:CurrentState="NormalSize"EndSelect

'DisplaywindowstateMsgBox"Theapplicationwindowisnow:"&CurrentStateEndSub

Page 834: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

WindowTitleExampleSubExample_WindowTitle()

'Thisexamplecyclesthroughthedocumentscollection'andusestheWindowTitlepropertytocreatealistofallopendocuments.

DimDOCAsAecBaseDocumentDimaecAppAsNewAecBaseApplicationDimmsgAsString'InitializetheAecBaseapplicationobjectaecApp.InitThisDrawing.Application'Iftherearenoopendocuments,thenexitIfaecApp.Documents.count=0ThenMsgBox"Therearenoopendocuments!"ExitSubEndIfmsg=vbCrLf&vbCrLf'Startwithaspace'CyclethroughallopendrawingsandgetthewindowtitleofeachdrawingForEachDOCInaecApp.Documentsmsg=msg&DOC.WindowTitle&vbCrLfNext'DisplayalistofopendrawingsMsgBox"Theopendrawingtitlesare:"&msg

EndSub

Page 835: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XDistanceExampleSubExample_XDistance()

'Thisexamplewillmakeamasselementandandanchorit200units'fromthestartofaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.XDistance=200'settheXDistancefortheanchormass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 836: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XEndoffsetExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_XEndoffset_AecLayoutGrid2D()

'ThisexampledisplaystheXendoffsetfora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridXEndOffsetis:"&grid.XEndOffset,vbInformation,"XEndOffsetExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"XEndOffsetExample"EndIf

EndSub

SubExample_XEndoffset_AecLayoutGrid3D()

'ThisexampledisplaystheXendoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 837: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridXEndOffsetis:"&grid.XEndOffset,vbInformation,"XEndOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"XEndOffsetExample"EndIf

EndSub

Page 838: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XNodesExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_XNodes_AecLayoutGrid2D()

'ThisexampledisplaysthenumberofXnodesofa2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridXNodesis:"&grid.XNodes.Count,vbInformation,"XNodesExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"XNodesExample"EndIf

EndSub

SubExample_XNodes_AecLayoutGrid3D()

'ThisexampledisplaysthenumberofXnodesofa3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 839: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridXNodesis:"&grid.XNodes.Count,vbInformation,"XNodesExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"XNodesExample"EndIf

EndSub

Page 840: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XOffsetExampleSubExample_XOffset()

'ThisexampleshowstheXoffsetofthefirstviewblockofamultiviewblock

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefDimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objSetviewBlocks=blockRef.viewBlocksMsgBox"XOffsetofViewBlock1:"&viewBlocks.Item(0).XOffset,vbInformation,"XOffsetExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"XOffsetExample"EndIf

EndSub

Page 841: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XPositionFromExampleSubExample_XPositionFrom()

'Thisexamplewillmakeamasselementandanchorit200units'fromtheendofaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.XDistance=200'settheXDistancefortheanchoranchor.XPositionFrom=aecCurvePositionEnd'settheanchortomeasurefromtheendofthecurvemass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 842: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XPositionToExampleSubExample_XPositionTo()

'Thisexamplewillmakeamasselementandandanchorit'scenter200units'fromtheendofaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.XDistance=200'settheXDistancefortheanchoranchor.XPositionFrom=aecCurvePositionEnd'settheanchortomeasurefromtheendofthecurveanchor.XPositionTo=aecEdgePositionCenter'settheanchortomeasuretothecenteroftheentitymass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 843: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRefEditExampleSubExample_XRefEdit()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'whetherthecurrentdrawingcanbeeditedinplacewhenbeing'referencedbyanotheruser.''Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.XRefEditMsgBox"TheXRefEditpreferenceissetto:"&originalValue

'ModifytheXRefEditpreferencebytogglingthevalueACADPref.XRefEdit=Not(ACADPref.XRefEdit)newValue=ACADPref.XRefEditMsgBox"TheXRefEditpreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.XRefEdit=originalValueMsgBox"TheXRefEditpreferencewasresetbackto:"&originalValueEndSub

Page 844: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRefLayerVisibilityExampleSubExample_XRefLayerVisibility()'Thisexamplereadsandmodifiesthepreferencevaluewhichcontrols'thevisibilityofxref-dependentlayersandspecifiesifnestedxref'pathchangesaresaved.''Whenfinished,thisexampleresetsthepreferencevaluebackto'it'soriginalvalue.DimACADPrefAsAcadDatabasePreferencesDimoriginalValueAsVariant,newValueAsVariant'GettheuserpreferencesobjectSetACADPref=ThisDrawing.preferences'ReadanddisplaytheoriginalvalueoriginalValue=ACADPref.XRefLayerVisibilityMsgBox"TheXRefLayerVisibilitypreferenceissetto:"&originalValue

'ModifytheXRefLayerVisibilitypreferencebytogglingthevalueACADPref.XRefLayerVisibility=Not(ACADPref.XRefLayerVisibility)newValue=ACADPref.XRefLayerVisibilityMsgBox"TheXRefLayerVisibilitypreferencehasbeensetto:"&newValue

'Resetthepreferencebacktoit'soriginalvalue''*Note:Commentoutthislastsectiontoleavethechangeto'thispreferenceineffectACADPref.XRefLayerVisibility=originalValueMsgBox"TheXRefLayerVisibilitypreferencewasresetbackto:"&originalValueEndSub

Page 845: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XRotationExampleSubExample_XRotation()

'Thisexamplewillmakeamasselementandandanchorittoaline,'androtateitaroundtheXaxisoftheline45degreesDimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineeastheobject(curve)toanchortoanchor.XDistance=200'settheXDistancefortheanchoranchor.XRotation=Atn(1)'Rotateby45degrees(Atnof1is45degreesinradians)mass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 846: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XStartOffsetExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_XStartOffset_AecLayoutGrid2D()

'ThisexampledisplaystheXstartoffsetfora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridXStartOffsetis:"&grid.XStartOffset,vbInformation,"XStartOffsetExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"XStartOffsetExample"EndIf

EndSub

SubExample_XStartOffset_AecLayoutGrid3D()

'ThisexampledisplaystheXstartoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 847: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridXStartOffsetis:"&grid.XStartOffset,vbInformation,"XStartOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"XStartOffsetExample"EndIf

EndSub

Page 848: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XTypeExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_XType_AecLayoutGrid2D()

'ThisexampledisplaystheXtypefora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSelectCasegrid.XTypeCase0:MsgBox"GridXTypeis:ManualSpacing",vbInformation,"XTypeExample"Case1:MsgBox"GridXTypeis:AutoSpacingEven",vbInformation,"XTypeExample"Case2:MsgBox"GridXTypeis:AutoSpacingBay",vbInformation,"XTypeExample"EndSelectElseMsgBox"Nota2DLayoutGrid",vbExclamation,"XTypeExample"EndIf

EndSub

Page 849: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubExample_XType_AecLayoutGrid3D()

'ThisexampledisplaystheXtypefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSelectCasegrid.XTypeCase0:MsgBox"GridXTypeis:ManualSpacing",vbInformation,"XTypeExample"Case1:MsgBox"GridXTypeis:AutoSpacingEven",vbInformation,"XTypeExample"Case2:MsgBox"GridXTypeis:AutoSpacingBay",vbInformation,"XTypeExample"EndSelectElseMsgBox"Nota3DLayoutGrid",vbExclamation,"XTypeExample"EndIf

EndSub

Page 850: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

XValueExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_XValue_AecLayoutGrid2D()

'ThisexampledisplaystheXvaluefora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridXValueis:"&grid.XValue,vbInformation,"XValueExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"XValueExample"EndIf

EndSub

SubExample_XValue_AecLayoutGrid3D()

'ThisexampledisplaystheXvaluefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 851: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridXValueis:"&grid.XValue,vbInformation,"XValueExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"XValueExample"EndIf

EndSub

Page 852: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YAlignmentExampleSubExample_YAlignment()

'Thisexamplelooksatthewayaselectedobjectisanchored'inrelationtothebaselineofagridassembly.'Usethisexamplewithadrawingthatcontainsawindow'assemblyandoneormoreAECobjectsattachedtothe'assembly.DimentAsAcadEntityDimgeoAsAecGeoDimanchorAsAecAnchorDimalignmentAsStringOnErrorResumeNext'Handleerrorsincode.'Promptusertoselectanobject.ThisDrawing.Utility.GetEntityent,pt,"Selectobjectanchoredtowindowassembly:"'MakesureuserselectedanAECobject,andthattheobject'isanchoredtoagridassembly.IfentIsNothingThenMsgBox"Nothingwasselected.",vbExclamation,"YAlignmentExample"ElseIfTypeOfentIsAecGeoThenSetgeo=ent'Gettheanchortheobjectisattachedto.Setanchor=geo.GetAnchorOnErrorGoTo0IfanchorIsNothingThenMsgBox"Selectedobjectisnotanchored.",vbExclamation,"YAlignmentExample"ElseIfNotTypeOfanchorIsAecAnchorEntToGridAssemblyThenMsgBox"Objectisanchored,butnottoagridassembly.",vbExclamation,"YAlignmentExample"Else

Page 853: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SelectCaseanchor.YAlignmentCaseaecInfillAlignCenteredalignment="Centered."CaseaecInfillAlignFrontFlushalignment="Infrontofthebaseline."CaseaecInfillAlignBackFlushalignment="Inbackofthebaseline."CaseElsealignment="Unknown"EndSelectMsgBox"YAlignmentofobject:"&alignment,vbInformation,"YAlignmentExample"EndIfElseMsgBox"ObjectselectedisnotanAECentity.",vbInformation,"YAlignmentExample"EndIf

EndSub

Page 854: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YDistanceExampleSubExample_YDistance()

'Thisexamplewillmakeamasselementandandanchorit200units'totheleftofaline.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.YDistance=200'settheYDistancefortheanchormass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 855: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YEndOffsetExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_YEndOffset_AecLayoutGrid2D()

'ThisexampledisplaystheYendoffsetfora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridYEndOffsetis:"&grid.YEndOffset,vbInformation,"YEndOffsetExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"YEndOffsetExample"EndIf

EndSub

SubExample_YEndOffset_AecLayoutGrid3D()

'ThisexampledisplaystheYendoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 856: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridYEndOffsetis:"&grid.YEndOffset,vbInformation,"YEndOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"YEndOffsetExample"EndIf

EndSub

Page 857: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YNodesExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_YNodes_AecLayoutGrid2D()

'ThisexampledisplaysthenumberofYnodesfora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridYNodesis:"&grid.YNodes.Count,vbInformation,"YNodesExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"YNodesExample"EndIf

EndSub

SubExample_YNodes_AecLayoutGrid3D()

'ThisexampledisplaysthenumberofYnodesfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 858: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridYNodesis:"&grid.YNodes.Count,vbInformation,"YNodesExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"YNodesExample"EndIf

EndSub

Page 859: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YOffsetExampleSubExample_YOffset()

'ThisexampleshowstheYoffsetofthefirstviewblockofamultiviewblock

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefDimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objSetviewBlocks=blockRef.viewBlocksMsgBox"YOffsetofViewBlock1:"&viewBlocks.Item(0).YOffset,vbInformation,"YOffsetExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"YOffsetExample"EndIf

EndSub

Page 860: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YPositionFromExampleSubExample_YPositionFrom()

'Thisexamplewillmakeamasselementandandanchorit200units'fromtheleftofaline.DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.YDistance=200'settheYDistancefortheanchoranchor.YPositionFrom=aecCurvePositionEnd'settheanchortomeasurefromtheendofthecurvemass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 861: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YPositionToExampleSubExample_YPositionTo()

'Thisexamplewillmakeamasselementandandanchorit'scenter200units'fromtheleftofaline.DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.YDistance=200'settheYDistancefortheanchoranchor.YPositionTo=aecEdgePositionCenter'settheanchortomeasuretothecenteroftheentitymass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 862: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YRotationExampleSubExample_YRotation()

'Thisexamplewilladdanchoranewmasselementtoa2Dlayoutgridinthe'drawing.DimgridAsAecLayoutGrid2DDimmassAsAecMassElementDimptAsVariantDimobjAsAcadObjectThisDrawing.Utility.GetEntityobj,pt,"Selectgridtoattachto"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSetmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")DimanchorAsNewAecAnchorEntToLayoutNodeanchor.Reference=grid'anchorthemasselementtothefirstnodeonthegridanchor.Node=1anchor.YRotation=Atn(1)'45degreesmass.AttachAnchoranchorElseMsgBox"NoLayoutGridselected",vbInformation,"NodeExample"EndIf

EndSub

Page 863: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YStartOffsetExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_YStartOffset_AecLayoutGrid2D()

'ThisexampledisplaystheYstartoffsetfora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridYStartOffsetis:"&grid.YStartOffset,vbInformation,"YStartOffsetExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"YStartOffsetExample"EndIf

EndSub

SubExample_YStartOffset_AecLayoutGrid3D()

'ThisexampledisplaystheYstartoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 864: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridYStartOffsetis:"&grid.YStartOffset,vbInformation,"YStartOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"YStartOffsetExample"EndIf

EndSub

Page 865: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YTypeExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_YType_AecLayoutGrid2D()

'ThisexampledisplaystheYtypefora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objSelectCasegrid.YTypeCase0:MsgBox"GridYTypeis:ManualSpacing",vbInformation,"YTypeExample"Case1:MsgBox"GridYTypeis:AutoSpacingEven",vbInformation,"YTypeExample"Case2:MsgBox"GridYTypeis:AutoSpacingBay",vbInformation,"YTypeExample"EndSelectElseMsgBox"Nota2DLayoutGrid",vbExclamation,"YTypeExample"EndIf

EndSub

Page 866: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SubExample_YType_AecLayoutGrid3D()

'ThisexampledisplaystheYtypefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSelectCasegrid.YTypeCase0:MsgBox"GridYTypeis:ManualSpacing",vbInformation,"YTypeExample"Case1:MsgBox"GridYTypeis:AutoSpacingEven",vbInformation,"YTypeExample"Case2:MsgBox"GridYTypeis:AutoSpacingBay",vbInformation,"YTypeExample"EndSelectElseMsgBox"Nota3DLayoutGrid",vbExclamation,"YTypeExample"EndIf

EndSub

Page 867: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

YValueExampleExamples:

lAecLayoutGrid2D

lAecLayoutGrid3D

SubExample_YValue_AecLayoutGrid2D()

'ThisexampledisplaystheYvaluefora2DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid2DThisDrawing.Utility.GetEntityobj,pt,"Selecta2DLayoutGrid"IfTypeOfobjIsAecLayoutGrid2DThenSetgrid=objMsgBox"GridYValueis:"&grid.YValue,vbInformation,"YValueExample"ElseMsgBox"Nota2DLayoutGrid",vbExclamation,"YValueExample"EndIf

EndSub

SubExample_YValue_AecLayoutGrid3D()

'ThisexampledisplaystheYvaluefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3D

Page 868: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridYValueis:"&grid.YValue,vbInformation,"YValueExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"YValueExample"EndIf

EndSub

Page 869: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZDistanceExampleSubExample_ZDistance()

'Thisexamplewillmakeamasselementandandanchorit200units'abovealine.

DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.ZDistance=200'settheZDistancefortheanchormass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 870: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZEndOffsetExampleSubExample_ZEndOffset()

'ThisexampledisplaystheZendoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridZEndOffsetis:"&grid.ZEndOffset,vbInformation,"ZEndOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"ZEndOffsetExample"EndIf

EndSub

Page 871: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZNodesExampleSubExample_ZNodes()

'ThisexampledisplaysthenumberofZnodesfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridZNodesis:"&grid.ZNodes.Count,vbInformation,"ZNodesExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"ZNodesExample"EndIf

EndSub

Page 872: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZOffsetExampleSubExample_ZOffset()

'ThisexampleshowstheZoffsetofthefirstviewblockofamultiviewblock

DimobjAsObjectDimptAsVariantDimblockRefAsAecMVBlockRefDimviewBlocksAsAecViewBlocksThisDrawing.Utility.GetEntityobj,pt,"SelectaMultiviewBlock"IfTypeOfobjIsAecMVBlockRefThenSetblockRef=objSetviewBlocks=blockRef.viewBlocksMsgBox"ZoffsetofViewBlock1:"&viewBlocks.Item(0).ZOffset,vbInformation,"ZOffsetExample"ElseMsgBox"NotaMultiviewBlock",vbInformation,"ZOffsetExample"EndIf

EndSub

Page 873: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZoomExampleSubExample_Zoom()

'ThisexampledisplaysthezoomofaselectedAecCameraobjectDimobjAsObjectDimptAsVariantDimcameraAsAecCameraThisDrawing.Utility.GetEntityobj,pt,"SelectaCamera"IfTypeOfobjIsAecCameraThenSetcamera=objMsgBox"Zoomis:"&camera.Zoom,vbInformation,"ZoomExample"ElseMsgBox"NotaCamera",vbExclamation,"ZoomExample"EndIf

EndSub

Page 874: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZPositionFromExampleSubExample_ZPositionFrom()'Thisexamplewillmakeamasselementandandanchorit200units'abovealine.DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000

Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.ZDistance=-200'settheZDistancefortheanchoranchor.ZPositionFrom=aecCurvePositionEnd'settheanchortomeasurefromtheendofthecurvemass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 875: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZPositionToExampleSubExample_ZPositionTo()'Thisexamplewillmakeamasselementandandanchorit'scenter200units'abovealine.DimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineastheobject(curve)toanchortoanchor.ZDistance=-200'settheZDistancefortheanchoranchor.ZPositionFrom=aecCurvePositionEnd'settheanchortomeasurefromtheendofthecurveanchor.ZPositionTo=aecEdgePositionCenter'settheanchortomeasuretothecenteroftheentitymass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 876: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZRotationExampleSubExample_ZRotation()

'Thisexamplewillmakeamasselementandandanchorittoaline,'androtateitaroundtheZaxisoftheline45degreesDimmassAsAecMassElementDimlineAsAcadLineDimanchorAsNewAecAnchorEntToCurveDimpt1(0To2)AsDoubleDimpt2(0To2)AsDoublept2(0)=1000:pt2(1)=1000'thismakesanewmasselement120x120x120at0,0,0Setmass=ThisDrawing.ModelSpace.AddCustomObject("AecMassElement")'drawsalinefrom0,0to1000,1000Setline=ThisDrawing.ModelSpace.AddLine(pt1,pt2)anchor.Reference=line'setthelineeastheobject(curve)toanchortoanchor.ZDistance=200'settheZDistancefortheanchoranchor.ZRotation=Atn(1)'Rotateby45degrees(Atnof1is45degreesinradians)mass.AttachAnchoranchor'attachtheanchortothemasselement

EndSub

Page 877: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZStartOffsetExampleSubExample_ZStartOffset()

'ThisexampledisplaystheZstartoffsetfora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridZStartOffsetis:"&grid.ZStartOffset,vbInformation,"ZStartOffsetExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"ZStartOffsetExample"EndIf

EndSub

Page 878: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZTypeExampleSubExample_ZType()

'ThisexampledisplaystheZtypefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objSelectCasegrid.ZTypeCase0:MsgBox"GridZTypeis:ManualSpacing",vbInformation,"ZTypeExample"Case1:MsgBox"GridZTypeis:AutoSpacingEven",vbInformation,"ZTypeExample"Case2:MsgBox"GridZTypeis:AutoSpacingBay",vbInformation,"ZTypeExample"EndSelectElseMsgBox"Nota3DLayoutGrid",vbExclamation,"ZTypeExample"EndIf

EndSub

Page 879: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ZValueExampleSubExample_ZValue()

'ThisexampledisplaystheZvaluefora3DlayoutgridDimobjAsObjectDimptAsVariantDimgridAsAecLayoutGrid3DThisDrawing.Utility.GetEntityobj,pt,"Selecta3DLayoutGrid"IfTypeOfobjIsAecLayoutGrid3DThenSetgrid=objMsgBox"GridZValueis:"&grid.ZValue,vbInformation,"ZValueExample"ElseMsgBox"Nota3DLayoutGrid",vbExclamation,"ZValueExample"EndIf

EndSub

Page 880: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ForceHorizontalPropertySpecifieswhetherthetagisalignedwiththeobjectororientedhorizontally.

SeeAlso|Example

Signature

object.ForceHorizontal

objectAecAnchorExtendedTagToEntTheobjectthispropertyappliesto.

ForceHorizontalBoolean;read-writeTRUE:Orientthetaghorizontally.FALSE:Alignthetagwiththeobject.

Page 881: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

TrueColorPropertyReturnsthetruecoloroftheobject.

SeeAlso|Example

Signature

object.TrueColor

objectAec2DSection,AecBlockRef,AecCamera,AecCellLayoutTool,AecClipVol,AecClipVolRes,AecDisplayComponentEntity,AecEditInPlaceProfile,AecEntity,AecEntRef,AecGeo,AecGridAssembly,AecLayoutCurve,AecLayoutGrid2D,AecLayoutGrid3D,AecLayoutTool,AecMaskBlockRef,AecMassElement,AecMassGroup,AecMvBlockRef,AecPolygon,AecSlice,AecVolumeLayoutToolTheobjectorobjectsthispropertyappliesto.

TrueColorAcadAcCmColorobject;read-onlyAutoCADTrueColorobject.

Page 882: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ActiveConfigurationPropertyReturnstheactivedisplayconfigurationforthespecifiedviewport.

SeeAlso|Example

Signature

RetVal=object.ActiveConfiguration(ViewPort)

objectAecDisplayConfigurationsTheobjectthispropertyappliesto.

ViewPortAcadObject;input-onlyTheAcadViewportorAcadPViewportthatthedisplayconfigurationappliesto.

RetValAecDisplayConfigurationTheactivedisplayconfigurationforthespecifiedviewport.

Page 883: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AddOverrideMethodAddsanobjectorstyleoverrideonthedisplayrepresentation.

SeeAlso|Example

Signature

RetVal=object.AddOverride(AecObject)

ObjectAecDisplayRepresentationTheobjectorobjectsthismethodappliesto.

AecObjectAecObject;input-onlyAnobjectinstanceorstyleoverride.

RetValAecDisplayPropertiesTheoverridedisplaypropertiesforthedisplayrepresentation.

Remarks

Thismethodwillfailifanoverrideisalreadyattached.

Page 884: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DeleteOverrideMethodDeletesanexistingoverridefromthedisplayrepresentation.

SeeAlso|Example

Signature

object.DeleteOverrideAecObject

ObjectAecDisplayRepresentationTheobjectorobjectsthismethodappliesto.

AecObjectAecObject;input-onlyAnobjectinstanceorstyleoverride.

Remarks

Thismethodwillfailifthereisnoexistingoverridetoremove.

Page 885: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

DuplicateMethodCreatesaduplicatedisplayrepresentation.

SeeAlso|Example

Signature

RetVal=object.DuplicateUniqueName

ObjectAecDisplayRepresentationTheobjectorobjectsthismethodappliesto.

UniqueNameString;input-onlyTheuniquenameforthenewdisplayrepresentation.

RetValAecDisplayRepresentationTheduplicateddisplayrepresentation.

Remarks

Thismethodwillfailifthenameisnotunique.

Page 886: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SeeAlso

MethodsandProperties:

ImportFreeFormmethod

Page 887: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SeeAlso

MethodsandProperties:

ExportFreeFormmethod

Page 888: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Collections

AecLayerKeys

AecLayerKeyStyles

AecLayerOverrideSettings

AecLayoutCurveNodes

AecLayoutGrid2DNodes

AecLayoutGrid2DXNodes

AecLayoutGrid2DYNodes

AecLayoutGrid3DNodes

AecLayoutGrid3DXNodes

AecLayoutGrid3DYNodes

AecLayoutGrid3DZNodes

AecLayoutNodes

AecMaskBlockStyles

AecMassElementStyles

AecMassGroups

AecMVBlockStyles

Page 889: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

AecMVBlockStyles

AecPolygonStyles

AecProfileStyles

AecRings

AecViewBlocks

Page 890: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ACAD_ANGLEdatatypeACAD_ANGLEisaDOUBLEwhoseunitsarebasedontheAUNITSsystemvariable,andwhoseprecisionisbasedontheAUPRECsystemvariable.

Page 891: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SeeAlso:

MethodsandProperties:

AngleToStringmethod

AutoCADActiveXandVBADeveloper'sGuide:

CalculatingPointsandValues

Page 892: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SeeAlso:

MethodsandProperties:

AngleToStringmethod

AutoCADActiveXandVBADeveloper'sGuide:

CalculatingPointsandValues

Page 893: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

SeeAlso:

MethodsandProperties:

AngleToStringmethod

AutoCADActiveXandVBADeveloper'sGuide:

CalculatingPointsandValues

Page 894: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Theviewdirectionforagivendisplayset.

AecViewDirection

Name Value DescriptionaecViewDirectionTop 0 Top

aecViewDirectionBottom 1 Bottom

aecViewDirectionLeft 2 Left

aecViewDirectionRight 3 Right

aecViewDirectionFront 4 Front

aecViewDirectionBack 5 Back

aecViewDirectionModel 6 Model

AecViewDirection

Page 895: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thefixedviewdirectionusedbyadisplayconfiguration.

AecFixedViewDirection

Name Value DescriptionaecFixedViewDirectionTop 0 Top

aecFixedViewDirectionBottom 1 Bottom

aecFixedViewDirectionLeft 2 Left

aecFixedViewDirectionRight 3 Right

aecFixedViewDirectionFront 4 Front

aecFixedViewDirectionBack 5 Back

aecFixedViewDirectionViewport 6 Viewport

AecFixedViewDirection

Page 896: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thehatchtypeusedbyadisplaycomponent.

AecHatchType

Name Value DescriptionaecHatchTypeUserDefined 0 UserDefined

aecHatchTypePreDefined 1 PreDefined

aecHatchTypeCustomDefined 2 CustomDefined

aecHatchTypeSolidFill 3 SolidFill

AecHatchType

Page 897: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thesurfacehatchplacement.

AecSurfaceHatchPlacement

Name Value DescriptionaecSurfaceHatchPlacementTop 1 Top

aecSurfaceHatchPlacementBottom 2 Bottom

aecSurfaceHatchPlacementLeft 3 Left

aecSurfaceHatchPlacementRight 4 Right

aecSurfaceHatchPlacementFront 5 Front

aecSurfaceHatchPlacementBack 6 Back

AecSurfaceHatchPlacement

Page 898: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

Thesurfacemappingtype.

AecSurfaceMappingType

Name Value DescriptionaecSurfaceMappingTypeDefaultMapping 0 DefaultMapping

aecSurfaceMappingTypeFaceMapping 1 FaceMapping

aecSurfaceMappingTypeAsSurfaceHatch 2 AsSurfaceHatch

AecSurfaceMappingType

Page 899: Autodesk AEC Base ActiveX and VBA Reference Guide · object in the AutoCAD ActiveX and VBA Reference for information regarding the Methods, Properties and Events provided through

ACAD_DISTANCEdatatypeACAD_DISTANCEisaDOUBLEwhoseunitsarebasedontheLUNITSsystemvariable,andwhoseprecisionisbasedontheLUPRECsystemvariable.