Blocks Insertion Point

Blocks Insertion Point

Anonymous
Not applicable
4,439 Views
4 Replies
Message 1 of 5

Blocks Insertion Point

Anonymous
Not applicable
Please help me;
I would like to know how to get the insertion Point and Rotation angle of a block inserted using VBA

Thanks a lot
0 Likes
4,440 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Check out this two properties of an AcadBlockReference object, which is the
one you inserted or you get from drawing:

AcadBlockReference.InsertionPoint
AcadBlockReference.Roration

wrote in message news:[email protected]...
Please help me;
I would like to know how to get the insertion Point and Rotation angle of a
block inserted using VBA

Thanks a lot
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thank you for your help; But I need more help, what is the code in VBA to get the Insertion Point. I am new in this business.

Thank You Very Much
0 Likes
Message 4 of 5

Anonymous
Not applicable
This should do the trick ...

Joe
--

Public Sub GetInsertionAndRotation()
Dim Point As Variant
Dim oEntity As AcadEntity
Dim oBlockRef As AcadBlockReference

On Error Resume Next

ThisDrawing.Utility.GetEntity oEntity, Point, "Select a block ..."

If Err Then Exit Sub

If TypeOf oEntity Is AcadBlockReference Then
Set oBlockRef = oEntity
With oBlockRef
MsgBox "Insertion point is " & .InsertionPoint(0) & ", " &
.InsertionPoint(1) & ", " & .InsertionPoint(2) & vbCrLf & _
"Rotation is " & ThisDrawing.Utility.AngleToString(.Rotation,
acDegrees, 0)
End With
End If
End Sub


wrote in message news:[email protected]...
Thank you for your help; But I need more help, what is the code in VBA to
get the Insertion Point. I am new in this business.

Thank You Very Much
0 Likes
Message 5 of 5

Anonymous
Not applicable
To Joe Sutphin

I would like to thank you very much for your code, it did the trick.
Thanks and have a nice day.
0 Likes