Submitted by benschmoo on Mon, 07/13/2020 - 05:08
Forums:
Hi!
I try to add a Polygonface to any surface at a userselected point. Now i got the error "Incorrect Object for this Operation - NXOpen.Builder.Commit() "
Maybe the following code will help to understand the Problem:
NXOpen.SketchPolygon nullNXOpen_SketchPolygon = null;
NXOpen.SketchPolygonBuilder sketchPolygonBuilder1;
sketchPolygonBuilder1 = workPart.Sketches.CreateSketchPolygonBuilder(nullNXOpen_SketchPolygon);
//here is some Polygon code (dimensions/placing ect.)
NXOpen.NXObject nXObject2;
nXObject2 = sketchPolygonBuilder1.Commit();
theSession.ActiveSketch.Update();
How i solved the problem for me
After a few days i finally solved the problem, with adding the size. I don't know why it wasn't added when i recorded the Journal...
sketchPolygonBuilder1.Size = NXOpen.SketchPolygonBuilder.SizeType.CircumscribedRadius;