程序用Rhino支持的Eto模块定义窗口类,通过对话框输入轴线数据,对数据进行处理,实现一键绘制轴网功能。
注意,在Rhinopython编辑器中执行时,程序中不能有汉字,否则会报错;
如果注释需要汉字,在第一行加上:#-- coding:UTF-8 --,表示支持汉字编码;
#This is a Axis tool in rhino , made by zjq202209
from Eto import *
import rhinoscriptsyntax as rs
import Eto.Drawing as Drawing
import Eto.Forms as Forms
import Rhino.Geometry as Geometry
# Our custom form class
class ZxForm(Forms.Form):
# build all of the controls in the constructor
def __init__(self):
self.Topmost=True
self.Title="ZxForm_20220916"
#self.Width=500
#self.Height=300
self.ClientSize = Drawing.Size(600, 300)
self.Padding = Drawing.Padding(10)
self.Resizable = False
#define label and textbox
self.lab01=Forms.Label(Text = 'input X Distance:' )
self.lab02=Forms.Label(Text = 'input Y Distance:')
self.lab03=Forms.Label(Text = 'input x0y0:')
self.text01=Forms.TextBox(Text = '6000,6000,6000')
self.