明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 732|回复: 3

[VBA群] 2013-06-11 明经AutoCAD.VBA编程(45054712) 群聊记录:我有一个数组,string,想按照顺序分别写入word的第一行,第二行,。。

 关闭 [复制链接]
发表于 2013-6-11 08:29 | 显示全部楼层 |阅读模式
在路上26 08:29:17
我有一个数组,string,想按照顺序分别写入word的第一行,第二行,。。。。。,哪位大师提供点指导啊
小学生 08:37:33
用循环呗
在路上26 08:41:33
是用循环,但对word vba,不了解,所以希望哪位大侠给个例子
 楼主| 发表于 2013-6-11 09:38 | 显示全部楼层
??超人不会飞 09:38:12
Select 的 acSelectionSetAll 项所选择的是所有图形中的对象,不管对象是在哪个空间或布局中。
 如果需要过滤出某个布局中的对象请问该怎么弄啊?
一缕阳光 09:39:05
用组码
??超人不会飞 09:39:30
能发个链接来看看学习下马
一缕阳光 09:39:53
组码过滤
你可以查查选择集资料
??超人不会飞 09:41:51
ts(SSetName).Delete

       Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName)

End Function

Sub SelectAllLayoutText()

       Dim ss As AcadSelectionSet

       Set ss = CreateSelectionSet

       Dim typeArray As Variant

       Dim dataArray As Variant

       BuildFilter typeArray, dataArray, 0, "TEXT"

       ss.Select acSelectionSetAll, , , typeArray, dataArray

       Debug.Print ss.Count

End Sub
Public Sub BuildFilter(typeArray, dataArray, aramArray gCodes())

       Dim fType() As Integer, fData()

       Dim index As Long, i As Long

       

       index = LBound(gCodes) - 1

               

       For i = LBound(gCodes) To UBound(gCodes) Step 2

               index = index + 1

               ReDim reserve fType(0 To index)

               ReDim reserve fData(0 To index)

               fType(index) = CInt(gCodes(i))

               fData(index) = gCodes(i + 1)

       Next

       typeArray = fType: dataArray = fData

End Sub

Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet

       On Error Resume Next

       ThisDrawing.SelectionSe
谁帮我解释下BuildFilter过程的意思啊 看不懂
??超人不会飞 09:44:00
我只知道用选择集过滤  模型空间对象和布局空间对象 就是用67的 0 和1 但是不同的布局空间里面的对象怎么过滤出来啊
一缕阳光 09:44:11
都一些基本 数据赋值语句
 楼主| 发表于 2013-6-11 22:56 | 显示全部楼层
十字路口 22:56:04
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-17 19:07 , Processed in 0.414946 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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