tai550115 发表于 2008-12-22 15:31:00

[求助]可以說明collection的應用,或推薦閱讀嗎?

本帖最后由 作者 于 2008-12-23 8:28:20 编辑 <br /><br /> <p>做了含attribute的Block但重覆引用時需把attribute.rotation,height</p><p>上回站上mccad大大教了GetSubEntity 直接由螢幕點選更改attribute,</p><p>但有些狀況必需在InsertBlock之前先改變已定義block的attribute.rotation</p><p>在 Joe Sutphin的Autocad 2006 VBA a programmer's Reference書上 </p><p></p><p>查到先選入collection中 </p><p>Function GetAttrib(oBlock As AcadBlock) As Collection</p><p>Dim objEnt&nbsp; As AcadEntity</p><p>Dim objAttribute As AcadAttribute</p><p>Dim coll As New Collection</p><p>&nbsp;For Each objEnt In oBlock</p><p>&nbsp;&nbsp; If objEnt.ObjectName = "AcDbAttributeDefinition" Then</p><p>&nbsp;&nbsp;&nbsp; Set objAttribute = objEnt</p><p>&nbsp;&nbsp;&nbsp; coll.Add objAttribute</p><p>&nbsp;&nbsp; End If</p><p>&nbsp;Next objEnt</p><p>Set GetAttrib = coll</p><p>End Function</p><p></p><p>再用 for each ObjAttribute in coll .......捉到attribute更改</p><p>請問</p><p>1.這是正確而有效率的方法嗎?</p><p>2.很少看書上寫collection用法,麻煩前輩指點一二,或推薦閱讀,</p><p>謝謝!!<br/></p>
页: [1]
查看完整版本: [求助]可以說明collection的應用,或推薦閱讀嗎?