forked from mcneel/rhino-developer-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampleDupSeam.py
27 lines (25 loc) · 1.15 KB
/
SampleDupSeam.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
################################################################################
# SampleDupSeam.py
# Copyright (c) 2017 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
import scriptcontext
# Duplicates the seam of a closed Brep
def SampleDupSeam():
go = Rhino.Input.Custom.GetObject()
go.SetCommandPrompt("Select edges to duplicate")
go.GeometryFilter = Rhino.DocObjects.ObjectType.Curve
go.GeometryAttributeFilter = Rhino.Input.Custom.GeometryAttributeFilter.SeamEdge
go.GetMultiple(1,0)
if (go.CommandResult() == Rhino.Commands.Result.Success):
for i in range(0, go.ObjectCount):
ref = go.Object(i)
edge = ref.Edge()
crv = edge.DuplicateCurve()
scriptcontext.doc.Objects.AddCurve(crv)
# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if __name__ == "__main__":
SampleDupSeam() # Call the function defined above