Hmm, I’m not 100% sure about this - closest thing I can find is Loft surfaces, which I believe is what the Rhino command is doing under the hood… that is a 2-step process, first extracting the number of isocurves you specify in the U/V direction, then lofting them together with the loft type options.
is giving an error “Message: expected IEnumerable[Curve], got tuple”.
What is the right way to implement methods of Rhino.Geometry in Rhinopython especially I do not want to activate some arguments? I know this is more of a python question than a Rhino question but any help would be great!
As with other programming languages, by default values are passed in order into a method/function.
Arguments that have an ‘=’ such as start=None are optional, if values are not passed to those they will take on the default value (what comes after the ‘=’). All required arguments have to be listed first.
which means you pass a list of curves (required) and you accept all the other default values except for rebuildpointcount, which you set to 5 instead of the default 0.
The RhinoCommon API docs for the method specify what it expects for each argument as well as what it returns.
This probably means you didn’t pass a list of curves as the first argument, you passed a tuple (of something) which it wasn’t able to interpret.
Most of the syntax stuff can be picked up from a basic python book or online learning resource (highly recommended); for RhinoCommon specific stuff, there are the guides and samples on the API doc/guide pages…
Thank you very much for the detailed explanation and pointing me to the relevant resources.
I will refer online the docs that you have provided.
Also on further search, it seems like a similar error was discussed here although I that doesn’t seem to solve my problem.
I just gave my curve list as:
curves = (Line1,Line2,Line3,Line4)
obj=Rhino.Geometry.Brep.CreateFromLoftRebuild(curves,start=None, end=None, loftType = 1, closed=True, rebuildPointCount = 1)
Here as you had mentioned, I tried avoiding the default value case and I got the error as this command takes exactly 6 inputs.
Also I tried entering in the .NET format based on one of the inputs in the discussion although I am not sure if I entered it correctly.
geomBaseList = ListLine1,Line2,Line3,Line4
obj=Rhino.Geometry.Brep.CreateFromLoftRebuild(geomBaseList,start=None, end=None, loftType = 1, closed=True, rebuildPointCount = 1)
and I still got an error which said: “expected Type, got Guid”
Does this mean that the points and lines created should be only using Rhino.Geometry Methods?
Just checking as when I tried using the curves created using Rhinoscriptsyntax, I got the error “expected Curve, got Guid”
crvs = System.ArrayRhino.Geometry.Curve
unset = Rhino.Geometry.Point3d.Unset
ltype = Rhino.Geometry.LoftType.Loose
breps = Rhino.Geometry.Brep.CreateFromLoftRebuild(crvs, unset, unset, ltype, False, 8)
for b in breps: