[AppleScript] 纯文本查看 复制代码
#coding=utf-8
#作者:月之眼
import rhinoscriptsyntax as rs
def CreateText(text_string,pt,ht,font):
#创建单线text
opts='_GroupOutput=_Yes _FontName="{}" _Italic=_No _Bold=_No '.format(font)
opts+='_Height={} _Output=_Curves _AllowOpenCurves=_Yes '.format(ht)
opts+='_LowerCaseAsSmallCaps=_No _AddSpacing=_No '
rs.Command("_-TextObject "+opts+'"'+text_string+'"'+" " + str(pt),False)
if rs.LastCommandResult()==0: return rs.LastCreatedObjects()
def Main():
font_style="Arial"
#字体
text_String = "月之眼"
#需要写的文字
txt_ht=10
#字体大小
txt_objs=[]
pts = rs.GetPoints(message1 = "创建字体的位置")
if(pts==None):return
rs.EnableRedraw(False)
for pt in pts:
txt_obj=CreateText(text_String,pt,txt_ht,font_style)
if __name__=="__main__":
Main()