Create Correct Variable


#1

Hello
I created a variable that is getting out of context in CurveGeometry item

var obj = doc.Objects.Find(idMyObj);
doc.Objects.Replace(obj.Id, obj.CurveGeometry.Extend(CurveEnd.End, 10, CurveExtensionStyle.Line));

How should I create my variable to solve this?
I apologize if my question is very basic, since I’m starting in RhinoCommon

Thanks


#2

Hi feibih,
Use “Geometry” instead of “CurveGeometry”.


#3

Thank you for your help
Below solution:

var obj = doc.Objects.Find(idMyObj) as Rhino.DocObjects.CurveObject;
doc.Objects.Replace(obj.Id, obj.CurveGeometry.Extend(CurveEnd.End, 10, CurveExtensionStyle.Line));