The Acad Entity Object

The AcadEntity object represents a generic object that exposes all the methods and properties common to a set of AutoCAD objects known as the Drawing Objects. These objects, which define all the drawing capabilities (including drawing planar and solid objects, inserting text and hyperlinks, and linking external documents) are as follows:

Acad3DFace

Acad3DPolyline

Acad3DSolid

AcadArc

AcadAttribute

AcadAttributeReference

AcadBlockReference

AcadCircle

AcadDim3PointAngular

AcadDimAligned

AcadDimAngular

AcadDimArcLength

AcadDimDiametric

AcadDimRotated

AcadEllipse

AcadEntity

AcadExternalReference

AcadHatch

AcadLeader

AcadLine

AcadLWPolyline

AcadMInsertBlock

AcadMLine

AcadMText

AcadOle

AcadPoint

AcadDimension AcadDimOrdinate AcadDimRadial AcadDimRadialLarge

AcadPolyfaceMesh AcadPolygonMesh AcadPolyline AcadPViewport

AcadRasterImage

AcadRay

AcadRegion

AcadShape

AcadSolid

AcadSpline

AcadTable

AcadText

AcadTolerance

AcadTrace

AcadXline

Common AcadEntity Methods

In addition to the methods inherited from the AcadObject object, the AcadEntity object supports the following methods.

Name_Returns_Description_

ArrayPolar Variant Creates an array of selected objects in a polar pattern. The distance is deter mined from the array's center point to a reference point on the last object selected, which in turn depends on the type of object previously selected. AutoCAD uses the center point of a circle or arc, the insertion point of a block or shape, the start point of text, and one end point of a line or trace. Note that you can't use this method for the AcadAttributeReference object. Note also that you can't use this method while iterating through a collection. Parameters: NumberOfObjects As Integer, AngleToFill As Double, and CenterPoint As Variant.

The NumberOfObjects parameter specifies the number of objects to be created in the polar array. This must be a positive integer greater than 1. The AngleToFill parameter specifies the angle to fill in radians. A positive value indicates counterclockwise rotation. This parameter can't be equal to 0.

The CenterPoint parameter specifies the 3-D WCS coordinates indicating the center point for the polar array.

ArrayRectangular Variant Creates an array of selected objects in a rectangular pattern. AutoCAD

builds the rectangular array along a baseline defined by the current snap rotation angle, which is 0 by default. Note that you can't use this method for the AcadAttributeReference object. Note also that you can't use this method while iterating through a collection. Parameters: NumberOfRows As Integer,NumberOfColumns As Integer, NumberOfLevels As Integer,DistBetweenRows As Double, DistBetweenCols As Double, and DistBetweenLevels As Double. The NumberOfRows parameter specifies the number of rows in the rectangular array. This must be a positive number. If NumberOfColumns is 1, then NumberOfRows must be greater than 1.

The NumberOfColumns parameter specifies the number of columns in the rectangular array. This must be a positive number. If NumberOfRows is 1, then NumberOfColumns must be greater than 1.

The NumberOfLevels parameter specifies the number of levels in a 3-D array.

The DistBetweenRows parameter specifies the distance between the rows. If positive, rows are added upward from the base entity; otherwise, they're added downward.

The DistBetweenCols parameter specifies the distance between the columns. If positive, columns are added to the right of the base entity; otherwise, they're added to the left.

The DistBetweenLevels parameter specifies the distance between the

Name

Returns

Description

CopyObject Duplicates the given object to the same location. Note that you can't use this method for the AcadAttributeReference object. Note also that you can't use this method while iterating through a collection.

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

MinPoint As Variant and MaxPoint As Variant (both of these are three-element arrays of Doubles).

Highlight Sets the highlight status for the given object or for all objects in a given selection set. Note that you'll see the changes only once the drawing is updated. Parameter: HighlightFlag As Boolean.

IntersectWith Variant Returns the points at which one object intersects another object in the drawing as an array of Doubles. The object supplied as the parameter can be any drawing object. However, this method isn't supported by the AcadPolygonMesh and AcadPViewport objects. Parameters: IntersectObject As Object and option As AcExtendOption. For a list of the values of the AcExtendOption enumerated type, see Appendix B.

MirrorObject Creates a mirror image copy of a planar object around an axis, defined by two points. This method places the reflected image into the drawing and retains the original object. To remove the original object, use the Delete method. To manage the reflection properties of text objects, use the MIRRTEXT system variable. Note that you can't use this method for the AcadAttributeReference object. Note also that you can't use this method while iterating through a collection. Parameters: Point1 As Variant and Point2 As Variant.

Mirror3D Object Creates a mirror image copy of a planar object reflected in a plane, defined by three points. AutoCAD checks to see whether the object to be copied owns any other object. If it does, it performs a copy on those objects as well. The process continues until all owned objects have been copied. Note that you can't use this method for the AcadAttributeReference object. Note also that you can't use this method while iterating through a collection. Parameters: Point1 As Variant, Point2 As Variant, and Point3 As Variant.

Move Moves an object along a vector, defined by two points. Parameters:

FromPoint As Variant and ToPoint As Variant.

Rotate Rotates an object around a base point. Parameters: BasePoint As

Variant and RotationAngle As Double. The RotationAngle parameter should be specified in radians.

Rotate3D Rotates an object around an axis in 3-D space, defined by two points, which become the axis of rotation. Parameters: Point1 As Variant, Point2 As Variant, and RotationAngle As Double. The RotationAngle parameter should be in radians.

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

BasePoint As Variant and ScaleFactor As Double. The BasePoint parameter is a set of 3-D WCS coordinates and is the only common point in the original and scaled system. The ScaleFactor parameter determines the level of scaling. A value greater than 1 enlarges the object. A value between 0 and 1 shrinks the object. The scale factor must be greater than 0.

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

See the AutoCAD documentation for more information. Parameter: TransformationMatrix As Variant (a 4x4 array of Doubles).

Update

Updates the object to the drawing screen.

Common AcadEntity Properties

In addition to the properties inherited from the AcadObject, the AcadEntity object supports the following properties.

Name

Returns

Description

Color

AcColor

Gets or sets the color of an entity. For a list of possible values for the AcColor enumerated type, see Appendix B.

EntityName

String

Gets the class name of the object. Retained for backward compatibility only. Use the VBA TypeName function instead. This property's value is read-only.

EntityType

AcEntityName

Gets the entity type of the object. Retained for backward compatibility only. Use the vBa TypeOf keyword instead. This property's value is read-only. For a list of the values for the AcEntityName enumerated type, see Appendix B.

Hyperlinks

AcadHyperlinks

Gets the AcadHyperlinks collection for an entity. This property's value is read-only.

Layer

String

Gets or sets the layer for an entity.

Linetype

String

Gets or sets the linetype of an entity.

LinetypeScale

Double

Gets or sets the linetype scale of an entity. The default value is 1.0.

Lineweight

AcLineWeight

Gets or sets the lineweight of an individual entity or the default lineweight for the drawing. For a list of possible values for the AcLineWeight enumerated type, see Appendix B.

PlotStyleName

String

Gets or sets the object's plot-style name.

TrueColor

AcCmColor

Gets or sets the RGB color index, color name, or Pantone color book settings.

Visible

Boolean

Specifies whether the object (or application) is visible.

Note Because this object inherits from AcadObject, it supports the Modified event.

Was this article helpful?

+1 -2

Responses

  • topi
    How do i iterate through a acadpolyfacemesh?
    7 years ago

Post a comment