Message 1 of 4
Setting block entities?

Not applicable
06-18-2002
05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to run a sub using 2 options; 1. by selecting the object or 2. by
looping through the drawing blocks.
I can't figure out the correct syntax for this in order to get both options
to work. The Getentity utility doesn't work if I try to use an AcadBlock
instead of an AcadEntity. Also If I don't set oBlk as a block then I can't
loop through the drawing blocks.
Private Sub Panel()
InsertPanel
End Sub
Private Sub Panels()
Dim oBlk As AcadBlock
For Each oBlk In ThisDrawing.Blocks
InsertPanel oBlk
Next oBlk
End Sub
Private Sub InsertPanel(Optional oBlk As AcadBlock)
Dim oEnt As AcadEntity
Dim Pnt As Variant
On Error Resume Next
If oBlk Is Nothing Then
ThisDrawing.Utility.GetEntity oEnt, Pnt, "Select Panel to update: "
'I can't seem to set the oEnt variable
Else: Set oEnt = oBlk
End If
Debug.Print oEnt.Name
End Sub
looping through the drawing blocks.
I can't figure out the correct syntax for this in order to get both options
to work. The Getentity utility doesn't work if I try to use an AcadBlock
instead of an AcadEntity. Also If I don't set oBlk as a block then I can't
loop through the drawing blocks.
Private Sub Panel()
InsertPanel
End Sub
Private Sub Panels()
Dim oBlk As AcadBlock
For Each oBlk In ThisDrawing.Blocks
InsertPanel oBlk
Next oBlk
End Sub
Private Sub InsertPanel(Optional oBlk As AcadBlock)
Dim oEnt As AcadEntity
Dim Pnt As Variant
On Error Resume Next
If oBlk Is Nothing Then
ThisDrawing.Utility.GetEntity oEnt, Pnt, "Select Panel to update: "
'I can't seem to set the oEnt variable
Else: Set oEnt = oBlk
End If
Debug.Print oEnt.Name
End Sub