'Re: Creating a Block from a Selection set ' 'P.Murali
Sub newblk() Dim obj() As Object Dim ss As AcadSelectionSet Dim blk As AcadBlock
Set ss = ThisDrawing.SelectionSets.Add("ss_SET") ss.SelectOnScreen pt = ThisDrawing.Utility.GetPoint(, "Pick an insertion point: ")
ReDim obj(0 To ss.Count - 1) As Object For i = 0 To ss.Count - 1 Set obj(i) = ss.Item(i) Next i
Set blk = ThisDrawing.Blocks.Add(pt, "MYBLOCK") ThisDrawing.CopyObjects obj, blk 'you can delete the original items after this ss.Delete End Sub
|