Help for move to c#

Hello to all
help for move to c#?
Hi Move or Copy in C # How are you? None of these methods below


dynamic L = c.Transform.Translation((new Vector3d.XAxis) * gap);


{ var L = Rhino.Geometry.Transform.Translation((new Vector3d.XAxis) * gap);}
    var L2 = Rhino.DocObjects.RhinoTransformObjectsEventArgs(L);


{ var L = Rhino.Geometry.Transform.Translation((new Vector3d.XAxis) * gap);}
    var L2 = c.Transform(L); (7.6 KB)

Replace “dymanic L” with “A”. A is named by default , means your output.


C is uppercase.
The return value of the Translate method is a Bool.
XAxis is a static property, so there is no need for new.

In fact, my question is RefrenceType that after the Trancform (Move, Rotate…),What to do the primary clean object of ValueType
(Copy in C #) (in Python this problem is resolved with DeepCopy, but in the # c how?
move &(copy) (14.6 KB)
must A!=B BUT A=B :point_down:

   var y = new List<Curve>();
    y = c;
    B = new List<Curve>(y);;
    var x = Rhino.Geometry.Transform.Translation(gap);
    A = c;


Every GeometryBase has a generic Duplicate() method and a type based duplicated method, for curve type:

var first = c[0].DuplicateCurve();
var xf = Rhino.Geometry.Transform.Translation(gap);
A = c;
B = first;
1 Like

THNKS :pray: excellent

Another question that( what? API Extrude (Surfce) command in C #?)

private void RunScript(Surface surface, Vector3d direction, ref object A)
  var brep = surface.ToBrep();
  var line = new Line(Point3d.Origin, direction);
  A = brep.Faces[0].CreateExtrusion(line.ToNurbsCurve(), true);
private void RunScript(Brep brep, Vector3d direction, ref object A)
  A = ExtrudeBrep(brep, direction);
// <Custom additional code> 
public static Brep ExtrudeBrep(Brep brep, Vector3d direction)
  if(direction.IsZero) return brep;
  var breps = new List<Brep>{brep};
  foreach(BrepEdge edge in brep.Edges)
    if(edge.TrimCount == 0) continue;
    var crv = edge.DuplicateCurve();
    var extrusion = Surface.CreateExtrusion(crv, direction);
    if(extrusion == null) continue;
    var b = extrusion.ToBrep();
  if(breps.Count == 1) return brep;
  var cap = brep.DuplicateBrep();
  var result = Brep.JoinBreps(breps, 0.001);
  return result == null ? brep : result[0];
// <Custom additional code> (13.6 KB)

1 Like