MapUtil.NewExpression method

AutoCAD Map 3D ActiveX

MapUtil.NewExpression method

Creates an Expression object.

NewExpression(Expression As String) As Expression

Returns an Expression object.

Expression

The expression string.

You can use the Expression object to specify a property alteration or a query report, or use it to execute general-purpose expressions, such as an expression to get the area of all objects in a selection set. You can use the dot, colon, ampersand, SQL, and AutoLISP variables as expression strings. For more information on expressions, see AutoCAD Map UI Help, "Expressions".

The following example creates an Expression object that specifies the area of a drawing object.

Dim amap As AcadMap

Dim prj As Project

Dim exp As Expression

Dim i As Integer

Dim varVal As Variant

Dim obj As Object

Dim lngAry() As Long

ReDim lngAry(ThisDrawing.ModelSpace.Count)

Dim strVal As String

 

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

Set exp = prj.MapUtil.NewExpression(".AREA")