本帖最后由 筑梦NARUTO 于 2015-5-2 19:59 编辑
我上传了一个我很久以前做的选择曲面边缘的一个练习,你可以看看,还有可以自己定义filter来选择的类型,
我上传一个在一堆曲线里选择圆的例子。你可以看看:
[mw_shl_code=applescript,true]#coding=utf-8
import rhinoscriptsyntax as rs
from scriptcontext import *
import Rhino
def circleGeometryFilter (rhObject, geometry, componentIndex):
curve = rs.coercecurve(geometry)
return rs.IsCircle(curve)
def RunCommand():
objects = rs.GetObjects("选择圆", rs.filter.curve, False, False,custom_filter = circleGeometryFilter)
for curve in objects:
point = rs.CircleCenterPoint(curve)
rs.AddPoint(point)
print len(objects)
if __name__=="__main__":
RunCommand()[/mw_shl_code]
[/hide] |