求助 VBA中如何建一个内容与原块同但块名不同的新块
<p>如题</p><p>各位大大,不知道有什么办法使用VBA新建一个与原块内容相同,但块名不同的块</p><p>已使用的方法是新建空块定义,插入原块,原块打散(当然打散后删除),但是对于动态块不适用,因为动态块打散后动态定义不见了</p> Dim D1 As AcadDocument, D2 As AcadDocument, P(2) As Double, BF1(0) As AcadBlockReference, BF2 As VariantSet D1 = ActiveDocument
Set D2 = Documents.Add
Set BF1(0) = D1.ModelSpace.InsertBlock(P, 块名称, 1, 1, 1, 0)
BF2 = D1.CopyObjects(BF1, D2.ModelSpace)
BF1(0).Delete
D2.Blocks.Item(块名称).Name = 块的新名称
BF2 = D2.CopyObjects(BF2, D1.ModelSpace)
BF2(0).Delete
D2.Close
页:
[1]