The Acad Object Object

This object represents methods and properties common to the following objects:

Acad3DFace

Acad3DPolyline

Acad3DSolid

AcadArc

AcadAttribute

AcadAttributeReference

AcadBlock

AcadBlockReference

AcadBlocks

AcadCircle

AcadDictionaries

AcadDictionary

AcadDim3PointAngular

AcadDimAligned

AcadDimAngular

AcadDimArcLength

AcadDimDiametric

AcadDimension

AcadDimOrdinate

AcadDimRadial

AcadDimRadialLarge

AcadPolyfaceMesh

AcadDimRotated

AcadPolygonMesh

AcadDimStyle

AcadPolyline

AcadDimStyles

AcadPViewport

AcadDynamicBlockReferenceProperty

AcadRasterImage

AcadEllipse

AcadRay

AcadEntity

AcadRegion

AcadExternalReference

AcadRegisteredApplication

AcadGroup

AcadRegisteredApplications

AcadGroups

AcadShape

AcadHatch

AcadSolid

AcadLayer

AcadSortentsTable

AcadLayers

AcadSpline

AcadLayout

AcadTable

AcadLayouts

AcadTableStyle

AcadLeader

AcadText

AcadLine

AcadTextStyle

AcadLineType

AcadTextStyles

AcadLineTypes

AcadTolerance

AcadLWPolyline

AcadTrace

AcadMInsertBlock

AcadUCS

AcadMLine

AcadUCSs

AcadModelSpace

AcadView

AcadMText

AcadViewport

AcadOle

AcadViewports

AcadPaperSpace

AcadViews

AcadPlotConfiguration

AcadXLine

AcadPlotConfigurations

AcadXRecord

AcadPoint

Common AcadObject Methods

The following table presents common AcadObject methods.

Name

Description

Delete

GetExtensionDictionary

GetXData

SetXData

Deletes a specified object. If an object in a collection is deleted, all the remaining items are reassigned a new index based on the current count. Note that you can't delete collections, so you can't use this method for collections without creating an error.

Returns AcadDictionary and gets the extension dictionary associated with an object. If an object doesn't have an extension dictionary, this method will create one for that object and return it.

Gets the extended data (XData), that is, instance-specific data, associated with an object. A NULL string value for the AppName parameter will return all the data attached to the object, regardless of the application that created it. Supplying an application name will return only the data that was created by the specified application. Parameters: AppName As String, XDataType As Variant (array of Integers), and XDataValue As Variant (array of Variants).

Sets the extended data (XData), that is, instance-specific data associated with an object. Parameters: XDataType As Variant (array of Integers) and XDataValue As Variant (array of Variants).

Common AcadObject Properties

The following table presents common AcadObject properties.

Name Returns Description

Application

Object

Gets the Application object. This property's value is read-only. The Application object represents the application's frame controls and path settings and provides the means to navigate down the object hierarchy.

Document

Object

Gets the document or drawing in which the object belongs. This property's value is read-only.

Handle

String

Gets the handle of an object. This property's value is read-only. An object ID and a handle are the two ways of referencing an object. A handle stays the same in a drawing for the lifetime of the object.

HasExtensionDictionary

Boolean

Determines whether the object has an extension dictionary associated with it. This property's value is read-only.

ObjectID

Integer

Gets the object ID of the object. This property's value is read-only. You can use an object ID or a handle to reference an object. It's better to use a handle unless you plan to work with certain ObjectARX functions that require an object ID.

ObjectName

String

Gets the AutoCAD class name of the object. This property's value is read-only.

OwnerID

Integer

Gets the object ID of the owner (i.e., the parent object). This property's value is read-only.

Common AcadObject Event

Apart from the AcadApplication and AcadDocument objects, which expose a variety of events, AutoCAD provides only one other event, the Modified event. This event is common to all the objects listed previously. When coding in VBA, you must provide an event handler for all objects enabled for the Modified event; otherwise, your application may crash. No events are fired while a modal dialog box is displayed.

Event_Description_

Modified Triggered whenever an object is modified. Note that setting the value of a property even if that value remains unchanged is considered to be a modification. Parameter: Entity As AcadEntity, the object in the drawing that is modified. The AcadEntity object is covered in the next section.

Was this article helpful?

0 0

Responses

Post a comment