# 關於 TextObject 參數自動設定的使用

**URL:** <https://cn.discourse.mcneel.com/t/topic/1607>\
**Category:** 腳本程式\
**Created:** [2020年一月31日 06:11 UTC](https://cn.discourse.mcneel.com/t/topic/1607 "2020-01-31T06:11:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angel](https://sea3.discourse-cdn.com/mcneel/user_avatar/cn.discourse.mcneel.com/angel/32/3310_2.png) [@angel](https://cn.discourse.mcneel.com/u/angel)\
**Post date:** [2020年一月31日 06:11 UTC](https://cn.discourse.mcneel.com/t/topic/1607/1 "2020-01-31T06:11:19Z")

</div>

! \_-TextObject aa\_8 0,0,0 \_Height=5.000 \_Rotation=0 \_Font=Arial \_Italic=No \_Bold=No \_HorizontalAlignment=Center \_VerticalAlignment=Top \_CreateGeometry=Curves \_GroupOutput=Yes \_AllowSingleStrokeFonts=No \_LowerCaseAsSmallCaps=No \_AddSpacking=No \_UserTextCenterToPosition=Yes

在 Rhino command 下使用上述語法，訊息如下

Command: \_-TextObject  
Text String \<aa\_8\> ( Height=1 Rotation=0 Font=Arial Italic=No Bold=No HorizontalAlignment=Left VerticalAlignment=Top CreateGeometry=Curves GroupOutput=No AllowSingleStrokeFonts=No LowerCaseAsSmallCaps=No AddSpacing=No UseTextCenterToPosition=No ): aa\_8  
Text string: aa\_8  
Pick point: 0,0,0  
**Command: \_Height=5.000**  
**Unknown command: \_Height=5.000**

\_Height 以後的參數全都看不懂，並且出來的結果字高不是5。

Rhino6 要如何修改才能用 TextObject 自動給字串、座標點與字高等參數。

---

<div class="post-metadata">

**Author:** ![KelvinC](https://sea3.discourse-cdn.com/mcneel/user_avatar/cn.discourse.mcneel.com/kelvinc/32/3391_2.png) [@KelvinC](https://cn.discourse.mcneel.com/u/KelvinC)\
**Post date:** [2020年二月2日 09:14 UTC](https://cn.discourse.mcneel.com/t/topic/1607/2 "2020-02-02T09:14:41Z")

</div>

請這樣改寫 Macro：

! \_-TextObject \_Height=5 \_Rotation=0 \_Font Arial \_Italic=No \_Bold=No \_HorizontalAlignment=Center \_VerticalAlignment=Top \_CreateGeometry=Curves \_GroupOutput=Yes \_AllowSingleStrokeFonts=No \_LowerCaseAsSmallCaps=No \_AddSpacing=No \_UseTextCenterToPosition=Yes aa\_8 0,0,0

我做的修改如下：

 ![image](https://global.discourse-cdn.com/mcneel/uploads/mcneel_cn/original/2X/3/3586bb062a649e0fd145e4797a2dd3449d2cd62f.png)

(1) 把 aa\_8 0,0,0 (輸入的文字和插入點) 移到最後面，不然指令遇到 aa\_8 0,0,0 就直接結束了。

(2) 把 \_Font=Arial 改成 \_Font Arial  
因為 [RH-56801](https://mcneel.myjetbrains.com/youtrack/issue/RH-56801) 這個 bug。

(3) (4) 錯字。

---

<div class="post-metadata">

**Author:** ![KelvinC](https://sea3.discourse-cdn.com/mcneel/user_avatar/cn.discourse.mcneel.com/kelvinc/32/3391_2.png) [@KelvinC](https://cn.discourse.mcneel.com/u/KelvinC)\
**Post date:** [2020年二月4日 15:38 UTC](https://cn.discourse.mcneel.com/t/topic/1607/3 "2020-02-04T15:38:41Z")

</div>

> [@KelvinC](#):
>
> (2) 把 \_Font=Arial 改成 \_Font Arial  
> 因為 [RH-56801](https://mcneel.myjetbrains.com/youtrack/issue/RH-56801) 這個 bug。

6.24 將會包含這個修正。
