mayuezxl 发表于 2006-8-21 21:15:00

[求助][VBA]如何创建块

请指点,如何把选择集里的对象转换为块?

alin 发表于 2006-8-23 10:13:00

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

ZJW80 发表于 2007-9-25 08:12:00

<p>请问如何用 VBA编程创建 块对象哪?</p>

alin 发表于 2007-9-25 09:06:00

上面的程序就是

Clark_James 发表于 2016-9-19 23:27:04

alin 发表于 2007-9-25 09:06
上面的程序就是

NUBILITY

Clark_James 发表于 2016-9-19 23:28:59

alin 发表于 2007-9-25 09:06
上面的程序就是

NUBILITY
页: [1]
查看完整版本: [求助][VBA]如何创建块