Hii …I want to open the step file only once not in loop .And i want to update the activedoc and rhinoobject to the original state.How can i make the copy of original activedoc and rhinoobject without any modification.Here attaching the code to get the activedoc and rhinoobject by opening step file.
public void OpenSTPFile(out RhinoDoc activeDoc, out RhinoObject rhinoObject, string fileName)
{
bool t;
flag = true;
activeDoc = null;
rhinoObject = null;
try
{
// Open the Rhino file and set the active Doc in RhinoDoc
RhinoDoc.Open(fileName, out t);
activeDoc = RhinoDoc.ActiveDoc;
// Get a list of all Brep objects in the active document
IEnumerable<RhinoObject> brepObjects = activeDoc.Objects.GetObjectList(ObjectType.Brep);
// Get the first Brep object from the list
rhinoObject = brepObjects.FirstOrDefault();
}
catch (FileNotFoundException e)
{
Console.WriteLine("Error converting Rhino object to Brep: " + e.Message);
}
}