tai550115 发表于 2008-11-12 18:42:00

[求助]在vba中直接寫類似eattedit修改attribute?

<p>acadBlock中可以用getAttributes把 attribute.textString抓出或修改,</p><p>怎麼改修attribute.Height?</p><p>同樣acadBlock建二個acadBlockReference,(a)&nbsp; (B)</p><p>(a)&nbsp; (B)各有不同attribute.textString顯示,</p><p>若想要改(a)attribute.height=8而(B)attribute.height=6</p><p>請問前輩大致步驟,</p><p>圖面操作以eattedit指令,選第二頁Text Options&nbsp; -&gt;height可以分別設定</p><p></p>

mccad 发表于 2008-11-12 19:11:00

<p>以下是个简单的测试程序:</p><p>Sub at()<br/>&nbsp;&nbsp;&nbsp; Dim ent As AcadEntity<br/>&nbsp;&nbsp;&nbsp; Dim pnt As Variant<br/>&nbsp;&nbsp;&nbsp; Dim tm As Variant<br/>&nbsp;&nbsp;&nbsp; Dim con As Variant<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ThisDrawing.Utility.GetSubEntity ent, pnt, tm, con, "请选择对象"<br/>&nbsp;&nbsp;&nbsp; If ent.ObjectName = "AcDbAttribute" Then ent.Height = 8<br/>End Sub</p>

robbin840311 发表于 2008-11-12 20:42:00

同意明总

tai550115 发表于 2008-11-13 08:32:00

又學了一招,謝謝大大

<p>天天都向大家問出一招,</p><p>有一天我會很强,天都睛了前途豁然開朗,</p><p>謝謝大大</p><p></p>

tai550115 发表于 2008-11-13 11:39:00

很難想到用GetSubEntity,再次感謝

<p>&nbsp;本來只會GetEntity,怎麼都抓到AcDbBlockReference快瘋掉,</p><p>網上範例很少寫到GetSubEntity,</p><p>autodesk的"ActiveX and&nbsp; VBA reference"寫的我看不懂 </p><p>如果不是大大慷慨賜教,還在裡頭打轉,</p><p>再次感謝</p>
页: [1]
查看完整版本: [求助]在vba中直接寫類似eattedit修改attribute?