VB 中如何炸开图纸里所有块
VB 中如何炸开图纸里所有块 <p>弄个块选择集,执行炸开命令</p> 有代码么?希望大侠们提供一下 <p>Public Sub ExplodeINSERT()<br/> On Error Resume Next<br/> Dim ssetObj As AcadSelectionSet<br/> If ThisDrawing.SelectionSets.Count = 0 Then<br/> Set ssetObj = ThisDrawing.SelectionSets.Add("ssetObj")<br/> Else<br/> Set ssetObj = ThisDrawing.SelectionSets(0)<br/> ssetObj.Clear<br/> End If<br/> <br/> Dim gpcode(0) As Integer<br/> Dim datavalue(0) As Variant<br/> gpcode(0) = 0<br/> datavalue(0) = "INSERT"<br/> <br/> Dim groupcode As Variant, datacode As Variant<br/> groupcode = gpcode<br/> datacode = datavalue<br/> ssetObj.Select acSelectionSetAll, , , groupcode, datacode<br/> <br/> Dim i As Integer<br/> Dim ENT As AcadEntity<br/> Dim Qty As Integer<br/> Qty = 0<br/> For i = 0 To ssetObj.Count - 1<br/> Set ENT = ssetObj(i)<br/> ENT.Explode<br/> Qty = Qty + 1<br/> Next i<br/> MsgBox "炸开" & Str(Qty) & "个块!"<br/>End Sub</p><p><br/>试试看!</p> VB中如何使用? <p>请抽出点时间阅读CAD帮助文件,你的问题都可以解决。</p> 大侠们帮帮忙 <p>VBA代码转VB在网上找找吧!有很简单的方式的</p> 本帖最后由 liuzpzp007 于 2012-7-12 16:08 编辑为什么块复制在别的地方炸开啊
(defun c:lsp()
(setq ss (ssget "x" '((0 . "insert"))))
(setq i 0)
(repeat (sslength ss)
(setq en (ssname ss i))
(command "explode" en)
(setq i (+ i 1))
)
)
页:
[1]
2