DEFINITION
"Self-contained Scripting" or "Autonomous Scripting"
Creating a script which,apart from the initial input, can run to completion
and produce and/or modify an object in a pre-determined manner without additional user input.
(An example of the application of such a script would be to produce a representation of a steel beam.)
PROBLEM:
When trying to use CreateRailRevolvedSurface in the Autonomous Script listed below I get following error message:
"expected Curve, got Guid"
The first two are curves, the third is a line and the fourth boolean?
Parameters required by CreateRailRevolvedSurface
profile: Profile curve for revolution.
| rail: Rail curve for revolution.
| axis: Axis of revolution.
| scaleHeight: If true, surface will be locally scaled.
| Returns: A NurbsSurface or null on failure.
When using AddSweep1 get error message “iteration over non-sequence of type Guid”
Question 1: How do I get Rhino.Geometry.NurbsSurface.CreateRailRevolvedSurface
to function in an Autonomous Script?
Question 2: How do I get rs.AddSweep1 to function in an Autonomous Script?
import rhinoscriptsyntax as rs
import math
import Rhino.Geometry.NurbsSurface as rgns
import System
Length = 20.0
Radius = 3.0
Pitch = 2.0
Turns = 10.0
StartPt = rs.AddPoint(0,0,0)
EndPt = rs.AddPoint(Length,0,0)
RadiusPt= rs.AddPoint(0,Radius,0)
SweepAxis = (StartPt,EndPt)
FullHelixLn=rs.AddLine((0,0,0), EndPt)
plane = (0,3,0)
Outline = rs.AddCircle(plane,0.25)
plane = rs.WorldXYPlane()
plane = (0,0,0)
rs.CurrentLayer( “Layer 04”)
Helix_Path = rs.AddSpiral(StartPt,EndPt,Pitch,Turns,Radius,Radius)
rs.CurrentLayer( “Layer 01”)
Surface1 = rgns.CreateRailRevolvedSurface(Outline,Helix_Path,FullHelixLn,scaleHeight=False)
Surface2 = rs.AddSweep1(Helix_Path,Outline,closed=True)