ModelSpace Entity Extents

ModelSpace Entity Extents

Anonymous
Not applicable
228 Views
1 Reply
Message 1 of 2

ModelSpace Entity Extents

Anonymous
Not applicable
I am trying to determine the extents (in the x and y direction) of my entities in modelspace. I need this I can draw an object a certain distance from the centre of the entities.
0 Likes
229 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
TRy to use the .getboundingbox method... Look at
the help for Autocad-VBA as shown below

 

 

Sub Example_GetBoundingBox()
' This example creates a line in model space. It then finds the
' bounding box for the line and displays the corners of the box.

Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
Dim lineObj As AcadLine

' Create the Line object in model space
startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
ZoomAll

Dim minExt As Variant
Dim maxExt As Variant

' Return the bounding box for the line and return the minimum
' and maximum extents of the box in the minExt and maxExt variables.
lineObj.GetBoundingBox minExt, maxExt

' Print the min and max extents
MsgBox "The extents of the bounding box for the line are:" & vbCrLf _
& "Min Extent: " & minExt(0) & "," & minExt(1) & "," & minExt(2) _
& vbCrLf & "Max Extent: " & maxExt(0) & "," & maxExt(1) & "," & maxExt(2), vbInformation, "GetBoundingBox Example"

End Sub


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am trying to determine the extents (in the x and y direction) of my entities
in modelspace. I need this I can draw an object a certain distance from the
centre of the entities.
0 Likes