21 | 08 | 2017

Get Block Insert Point

The following sample shows how to return the insert point of a block


Sub Getblockinsertpnt()

'*** Code from VisibleVisual.com ********

Dim Block As AcadBlockReference
Dim ReturnObj As AcadObject
Dim ReturnPnt As Variant

GetEnt: 'Start loop point

ThisDrawing.Utility.GetEntity ReturnObj, ReturnPnt, "Select a block: "

If ReturnObj.ObjectName <> "AcDbBlockReference" Then

MsgBox "The selected object wasn't a block!", vbExclamation

GoTo GetEnt 'Goto loop point

End If

Set Block = ReturnObj

'Return the blocks insertion point

MsgBox "X: " & Block.insertionpoint(0) & " ; Y:" & Block.insertionpoint(1) & " ; Z:" & Block.insertionpoint(2)

End Sub



Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles