程序的目的是希望分解每个图元后,将其再重新还原到原层 问题一:我想调用最下边这个explodere是否正确 问题二;和昨天问的一样,怎么解决图元分解为题(不是块)element.explode不行用什么其他的方法正确 刚开始学vb,用vba做东ix,这个是我写的程序,有很多问题,希望高手解决下,不甚感激 Private Sub explode() On Error Resume Next Dim sset As AcadSelectionSet If Not IsNull(ThisDrawing.SelectionSets.Item("all")) Then Set sset = ThisDrawing.SelectionSets.Item("all") sset.Delete End If Set sset = ThisDrawing.SelectionSets.Add("all") Dim filtertype(0 To 8) As Integer Dim filterdata(0 To 8) As Variant filtertype(0) = 8: filterdata(0) = "AERTAL" filtertype(1) = 8: filterdata(1) = "BURIED" filtertype(2) = 8: filterdata(2) = "HICAP" filtertype(3) = 8: filterdata(3) = "KANDBASE" filtertype(4) = 8: filterdata(4) = "NOTE" filtertype(5) = 8: filterdata(5) = "SYSTEM" filtertype(6) = 8: filterdata(6) = "TELCO_BOUNDARY" filtertype(7) = 8: filterdata(7) = "TERMINAL" filtertype(8) = 8: filterdata(8) = "BORDERSTAMP" sset.Select acSelectionSetAll, , , filtertype, filterdata Dim element As AcadEntity Dim layername As Variant For Each element In sset layername = element.Layer Select Case layername Case "AERTAL" Call explodere(element) Case "BURIED" Call explodere(element) Case "HICAP" Call explodere(element) Case "KANDBASE" Call explodere(element) Case "NOTE" Call explodere(element) Case "SYSTEM" Call explodere(element) Case "TELCO_BOUNDARY" Call explodere(element) Case "TERMINAL" Call explodere(element) Case "BORDERSTAMP" Call explodere(element) End Select Next sset.Delete End Sub
//希望分步执行的时候调用他 Private Sub explodere(element) '分解该元素 element.explode '将层反回 element.Layer = layername End Sub
程序的目的是希望分解每个图元后,将其再重新还原到原层 问题一:我想调用最下边这个explodere是否正确 问题二;和昨天问的一样,怎么解决图元分解为题(不是块)element.explode不行用什么其他的方法正确 |