Hi ,Team I am working with Rhino Plugin ,
I have a one file which Has 1300 around Block Instance
I have created a Plugin which Exports a step file for each Block.
But when only 200 to 300 file Exported .Then Rhino Common Throws AccessVoilation Exception
One More observation is If we try this again on same files with some of previously Exported Files it works.
Is there any specific mistake am ,I doing here
[System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions]
public ElementGeometry CreateBRepElement(string stepFolderPath, RhinoObject subObject, Transform xform)
{
Metrics.StartTracking("CreateBRepElement:CreateBRepGeometry");
ElementGeometry bRepGeomet = null;
RhinoDoc doc;
GeometryBase geometry;
CreateStepFileFromRhinoObject.TransformGeometry(subObject, xform, out doc, out geometry);
if (geometry.IsValid)
{
doc.Objects.Add(geometry, subObject.Attributes);
string stepFilePath = System.IO.Path.Combine(stepFolderPath, subObject.Id + ".stp");
try
{
**FileStp.Write(stepFilePath, doc, new FileStpWriteOptions());**
bRepGeomet = CreateBRepGeometry(stepFilePath, subObject);
}
catch (AccessViolationException ave)
{
StartUploadingExchange.CounterForInvalidObjects++;
ReadWriteExchangeData.GetInstance().GlobalStopWatchTimeStamp.CreateTimeStamp("[EXCE]: (Write)From CreateBRepElement Function: AccessViolationException - " + ave.Message, TimeSpan.Zero, false);
}
catch (Exception e)
{
StartUploadingExchange.CounterForInvalidObjects++;
ReadWriteExchangeData.GetInstance().GlobalStopWatchTimeStamp.CreateTimeStamp("[EXCE]: (Write)From CreateBRepElement Function: " + e.Message, TimeSpan.Zero, false);
}
}
File.Write operation Throws Exception