Executes the expression.
Execute( _
AcDbID as Long, _
ResultValue As Variant _
) As Boolean
Returns True on success.
AcDbID
ResultValue
The following example.creates and executes an expression that finds the area of all objects in model space.
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")
For Each obj In ThisDrawing.ModelSpace
lngAry(i) = obj.ObjectID
exp.Execute lngAry(i), varVal
i = i + 1
strVal = strVal & varVal & Chr(13)
Next
MsgBox strVal