idoo 发表于 2008-6-23 23:46:00

VBA插入块后,如何炸开??

<p>我的代码如下:</p><p>Public Sub test()</p><p>PT1(0) = TX+ 15540 * Scal: PT1(1) = TY + 990 * Scal: PT1(2) = 0</p><p>Set InsBLK = ThisDrawing.ModelSpace.InsertBlock(PT1, "C:\Program Files\ys.dwg", Scal, Scal, Scal, 3.14159 * 0)</p><p>InsBLK.Layer = "TXT"</p><p>InsBLK.Explode</p><p>End Sub</p><p>可是输出的结果为一个为炸开的块上有一个已经炸开了的块,感觉是将同一块插入了两次(在同一个位置),并把其中一个炸开了。如果把倒数第二句去掉,则只插入了一个没有炸开的块。</p>

byghbcx 发表于 2008-6-24 10:19:00

<p>看看这样行不行,</p><p>Public Sub test()</p><p>PT1(0) = TX+ 15540 * Scal: PT1(1) = TY + 990 * Scal: PT1(2) = 0</p><p>Set InsBLK = ThisDrawing.ModelSpace.InsertBlock(PT1, "*C:\Program Files\ys.dwg", Scal, Scal, Scal, 3.14159 * 0)</p><p>InsBLK.Layer = "TXT"</p><p>End Sub</p>

wylong 发表于 2008-6-24 12:52:00

<p>Public Sub test()</p><p>PT1(0) = TX+ 15540 * Scal: PT1(1) = TY + 990 * Scal: PT1(2) = 0</p><p>Set InsBLK = ThisDrawing.ModelSpace.InsertBlock(PT1, "C:\Program Files\ys.dwg", Scal, Scal, Scal, 3.14159 * 0)</p><p>InsBLK.Layer = "TXT"</p><p>InsBLK.Explode</p><p>InsBLK.delete</p><p>End Sub</p>

idoo 发表于 2008-6-25 20:22:00

<p>谢谢两位,加用*后,无法插入块了,使用delete是可以的,不过这样的原因怎么讲呢??</p>

rongyifei 发表于 2008-7-5 17:05:00

学习了!

wylong 发表于 2008-7-5 17:52:00

<p>Public Sub test()</p><p>PT1(0) = TX+ 15540 * Scal: PT1(1) = TY + 990 * Scal: PT1(2) = 0</p><p>Set InsBLK = ThisDrawing.ModelSpace.InsertBlock(PT1, "C:\Program Files\ys.dwg", Scal, Scal, Scal, 3.14159)</p><p>InsBLK.Layer = "TXT"</p><p>InsBLK.Explode</p><p>InsBLK.delete</p><p>End Sub</p>
页: [1]
查看完整版本: VBA插入块后,如何炸开??