前段时间有人问我这个,今天写个代码分享一下。
[AppleScript] 纯文本查看 复制代码 #coding=utf-8
#Author:月之眼 E-mail:[email]naruto@n-dda.cn[/email]
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino.Geometry as rg
#custom_filter
def select_CurveXSelf(rhino_objects, geometry, geometry_index):
list = rs.CurveCurveIntersection(geometry)
return (list!=None)and(list[0]==Overlap)
def commond():
geometrys = rs.GetObjects("Select self intersecting curves",rs.filter.curve,True,True,custom_filter = select_CurveXSelf)
color = rs.GetColor(0)
if geometrys and color:
[rs.ObjectColor(i,color) for i in geometrys]
if __name__=="__main__":
commond()
|