明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1276|回复: 0

帮解决下问题,不甚感激

[复制链接]
发表于 2007-2-2 08:56:00 | 显示全部楼层 |阅读模式

程序的目的是希望分解每个图元后,将其再重新还原到原层

问题一:我想调用最下边这个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不行用什么其他的方法正确

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 18:34 , Processed in 0.161743 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表