StartMe 发表于 2009-7-4 21:34:00

如何读取当前图形中的所有图片?

如何读取当前图形中的所有图片的信息?我要把他列表显示。

StartMe 发表于 2009-7-5 20:31:00

就像图片管理器那样,把所有的图片名称显示出来即可。

mccad 发表于 2009-7-5 21:32:00

它是Raster对象,可以用name属性来读取文件名,如果要取得带路径的文件名,则使用ImageFile属性。

StartMe 发表于 2009-7-6 20:47:00

<p>谢谢郑总。</p><p>这个属性我是知道的,但是我不知怎么能读取所有的图片,是遍历所有图中对象,然后判断哪个是图片?我的一张图里对象太多了,好几万,图片几十张,不知怎么能快速读出所有图片?</p><p>方便的话能否给写几行例子?谢谢了。</p>

mccad 发表于 2009-7-6 20:58:00

按道理过滤器你应该会用。

StartMe 发表于 2009-7-6 22:47:00

<p>O(∩_∩)O哈哈~,我够笨,谢谢郑总。</p>

StartMe 发表于 2009-7-10 21:50:00

<p>这两天有时间试了一下,但是不知为何选择集对象数为0,图里可是有70多张图片呢。帮忙看看哪地方不对,谢谢。</p><p>&nbsp;&nbsp;&nbsp; On Error Resume Next<br/>&nbsp;&nbsp;&nbsp; Dim ss As AcadSelectionSet<br/>&nbsp;&nbsp;&nbsp; If Not IsNull(ThisDrawing.SelectionSets.Item("ss")) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set ss = ThisDrawing.SelectionSets.Item("ss")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.Delete<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; Set ss = ThisDrawing.SelectionSets.Add("ss")</p><p>&nbsp;&nbsp;&nbsp; Dim filterType(0) As Integer<br/>&nbsp;&nbsp;&nbsp; Dim filterData(0) As Variant<br/>&nbsp;&nbsp;&nbsp; filterType(0) = 0<br/>&nbsp;&nbsp;&nbsp; filterData(0) = "RASTER"<br/>&nbsp;&nbsp;&nbsp; ss.Select acSelectionSetAll, , , filterType, filterData<br/>&nbsp;&nbsp;&nbsp; MsgBox ss.Count, vbInformation</p><p>不知是不是过滤条件不对,所以 filterData(0) = "RASTERIMAGE" 我也试了,同样为0。<br/></p><p></p>

mccad 发表于 2009-7-10 23:08:00

<p>IMAGE</p><p><a href="http://www.mjtd.com/Manual/ArticleShow.asp?ArticleID=495">http://www.mjtd.com/Manual/ArticleShow.asp?ArticleID=495</a></p>

StartMe 发表于 2009-7-11 20:10:00

行了,谢谢郑总。
页: [1]
查看完整版本: 如何读取当前图形中的所有图片?