mikewolf2k
发表于 2005-3-25 19:04:00
你想怎么统计?
cqy
发表于 2005-4-1 14:09:00
比如:100-DN50,50-DN50.....等分布在图面上,统计100+50+...
mikewolf2k
发表于 2005-4-1 19:32:00
你这个要专门编程的话可以实现。建议你看看这个:<A href="http://www.mjtd.com/mcdown/list.asp?id=511" target="_blank" >http://www.mjtd.com/mcdown/list.asp?id=511</A>
lzws03
发表于 2005-4-20 18:26:00
版主,现在好多工具箱里都集成了这个功能了,但都是对于单行文字有效,对于多行文字无效,不知道您这个程序怎么样,下载下来回去试试再说吧。
xuelinhe
发表于 2005-9-4 15:04:00
如何加载啊?请教!!!
wusulizhi
发表于 2005-9-20 20:33:00
<P>谢谢了,</P>
dianbotang
发表于 2009-4-5 03:20:00
cqy发表于2005-4-1 14:09:00static/image/common/back.gif比如:100-DN50,50-DN50.....等分布在图面上,统计100+50+...
<p>实现这个很简单,把楼主的程序稍作修改就可以了。</p><p>可用于单行文字和多行文字。</p><p>根据需要自行修改过滤条件。</p><p>'数字求和<br/>Sub totalnumber()<br/> Dim total As Double<br/> total = 0<br/> Dim ssetObj As AcadSelectionSet<br/> Set ssetObj = CreateSelectionSet("numberobj")<br/> Dim fType, fData<br/> BuildFilter fType, fData, 0, "*text", 1, "*DN50"<br/> ssetObj.SelectOnScreen fType, fData<br/> For i = 0 To ssetObj.Count - 1<br/> total = total + Val(ssetObj(i).TextString)<br/> Next<br/> <br/> ssetObj.Delete<br/> ActiveDocument.Utility.Prompt "总和=" & total<br/>End Sub</p><p>Public Function CreateSelectionSet(Optional ssName As String = "ss") As AcadSelectionSet<br/> '返回一个空白选择集<br/> <br/> Dim ss As AcadSelectionSet<br/> <br/> On Error Resume Next<br/> Set ss = ThisDrawing.SelectionSets(ssName)<br/> If Err Then Set ss = ThisDrawing.SelectionSets.Add(ssName)<br/> ss.Clear<br/> Set CreateSelectionSet = ss<br/>End Function<br/>Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes())<br/> '用数组方式填充一对变量以用作为选择集过滤器使用<br/> Dim fType() As Integer, fData()<br/> Dim Index As Long, i As Long<br/> <br/> Index = LBound(gCodes) - 1<br/> <br/> For i = LBound(gCodes) To UBound(gCodes) Step 2<br/> Index = Index + 1<br/> ReDim Preserve fType(0 To Index)<br/> ReDim Preserve fData(0 To Index)<br/> fType(Index) = CInt(gCodes(i))<br/> fData(Index) = gCodes(i + 1)<br/> Next<br/> typeArray = fType: dataArray = fData<br/>End Sub</p><p></p>
chamous
发表于 2009-11-14 08:40:00
返回值是零.
scf0413
发表于 2011-1-16 21:41:01
大哥们能否提供个C#求和的代码啊?供小弟学习学习
mp3_2004
发表于 2012-11-30 00:35:42
文字求和,留着备用