Grasshopper

algorithmic modeling for Rhino

Hello


I am learning VB, and I have a small problem In the "primer" manual page 111 :

new_line.rotate(angle, OnUtil.On_zaxis,Line_From)

the rotate function is called, but I have an error that this function does not exist

And I have an error also for "OnUtil.On_zaxis" :

'rotate' is not a member of 'rhino.geometry.line'

'Onutil is not declared'

Do you know where the problem comes from?

Views: 1180

Replies to This Discussion

GetLength

Thank you !


It's not easy to get started ...

No problem,

one thing useful is to put the RhinoCommon on the PC so no need to have internet. I put the rhinocommon.chm on my desktop/bureau of Windows. => upload next file

http://developer.rhino3d.com/api/RhinoCommonWin/RhinoCommon.chm

https://discourse.mcneel.com/t/rhino-common-pdf-documentation/36940

http://developer.rhino3d.com


Thank you, it will help me !!

And do you know if there is the same thing for the general functions (except rhino) like list functions etc.

Hello,
How can I declare a global variable in the "runscript" that I can have in the functions without having to set them in parameter?

public double startX(Curve c, int tol)
{

return Math.Round(c.PointAtStart.X, tol);

}

and I would like :

public double startX(Curve c)
{

return Math.Round(c.PointAtStart.X, tol);

}



You can do that

private void RunScript(double x, object y, ref object A)
{
A = function(x);
}

// <Custom additional code>

double tol= 0.2;

public double function(double x)
{
return tol* x;
}


// </Custom additional code>
}

It works because it is inside a class, here  Script_Instance : GH_ScriptInstance

For the tolerance you can use

double tol = RhinoDoc.ActiveDoc.ModelAbsoluteTolerance

RhinoDoc.ActiveDoc.ModelAngleToleranceRadians ...

thank you

I managed otherwise by writing: (in Custom additional code). 
I could not find the syntax

private int tolerance;
private List <Curve> ATemp;


Do you know how to explode a curve or a polyline (for the c#)? (As the component explode of grasshopper )

I have been searching and I can't find

Use the seach in the chm file, or use CTRL+F in methods of Curve class and seek for explode

It must work for a type of curve,

  1. polycurve => explode and 
  2. Curve =>duplicatesegments (that means it is a polyline)

PolyCurve. Explode Method

Rhino 5 for Windows

Explodes this PolyCurve into a list of Curve segments. This will not explode nested polycurves. Call RemoveNesting() first if you need all individual segments.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.30000.17 (5.13.60913.21340)

Syntax
Copy
public Curve[] Explode()
Public Function Explode As Curve()

Return Value

Type:  Curve[]
An array of polycurve segments.
See Also

Reference

***************************************************
Curve. DuplicateSegments Method
Rhino 5 for Windows
Polylines will be exploded into line segments. ExplodeCurves will return the curves in topological order.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.30000.17 (5.13.60913.21340)
Syntax
Copy
public Curve[] DuplicateSegments()
Public Function DuplicateSegments As Curve()

Return Value

Type:  Curve[]
An array of all the segments that make up this curve.
See Also

Thank you !!

I had seen this function but how to convert curves into polycurve? I did not get there

You don't really convert, you have to test the type of the curve 

see that :

http://www.grasshopper3d.com/forum/topics/explode-closed-planar-cur...

It works !!
I now understand better !
Thank you !!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service