Hello together,
i have problems to create a working planar surface in C#. My first try with random coordinates was this where mSWmodeler is the modeler.
double[] surfaceRoot = new double[3] {0, 0, 0};
double[] surfaceNormal = new double[3] {1, 0, 0 };
double[] surfaceCoordinateSystem = new double[3] { 1, 0, 0 };
Surface intersectionPlane = (Surface)mSWModeler.CreatePlanarSurface2(surfaceRoot, surfaceNormal, surfaceCoordinateSystem);
bool test = intersectionPlane.IsPlane();
But every time i use the surface in a method, e.g. the IsPlane here or Surface::IntersectCurve(), solidworks crashes with the error: exception of HRRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Another idea was this:
mSWBody.CreatePlanarSurface(surfaceRoot, surfaceNormal);
This doesn't return the surface and the the surface does't show up in the featuretree or the 3dmodel. I hope someone could help me.
SolidworksApi macros