代码:
[mw_shl_code=applescript,true]#coding=utf-8
#作者:月之眼 联系:naruto@n-dda.cn
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino as r
#自定义选择类型
def select_line(rhino_objects,geo,geo_index):
cv = rs.coercecurve(geo)
return rs.IsLine(cv) and rs.CurveLength(cv)<40
def commond():
geos = rs.GetObjects("选择直线",rs.filter.curve,True,True,custom_filter = select_line)
color = rs.GetColor(0)
if geos and color:
[rs.ObjectColor(i,color) for i in geos]
if __name__=="__main__":
commond()
[/mw_shl_code] 效果展示: