Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

InternalValidationError : err == AcGe::kXXOk

eightdeltacharlie
Participant

InternalValidationError : err == AcGe::kXXOk

eightdeltacharlie
Participant
Participant

This call to a Plane object's IntersectWithCurve function (red line in the code) fails with error message: InternalValidationError : err == AcGe::kXXOk 

 

This failure seems similar to what was described in this post and apparently fixed in a January 2016 release.  I'm running the 2.0.2016 build. Any suggestions on whether this is an issue in IntersectWithCurve's implementation, or whether i'm messing up the call somehow?  Thanks.

 

 

	Ptr<Product> product = app->activeProduct();
	Ptr<Design> design = product;
	Ptr<Component> rootComponent = design->rootComponent();

	Ptr<Selections> activeSelection = ui->activeSelections();
	Ptr<Base> selection = activeSelection->item(0)->entity();

	if (Ptr<ConstructionPlane>(selection))
	{
		Ptr<ConstructionPlane> plane = selection;

		Ptr<Sketches> sketches = rootComponent->sketches();
		if (!sketches)
			return false;

		Ptr<Sketch> sketch = sketches->item(0);
		if (!sketch)
			return false;

		Ptr<SketchCurves> sketchCurves = sketch->sketchCurves();
		if (!sketchCurves)
			return false;

		Ptr<SketchFittedSpline> spline = sketchCurves->sketchFittedSplines()->item(0);
		if (!spline)
			return false;

		Ptr<ObjectCollection> points = plane->geometry()->intersectWithCurve(spline->geometry());
		if (!points)
			return false;
	}

 

 

0 Likes
Reply
891 Views
4 Replies
Replies (4)

liujac
Alumni
Alumni

Hi,

 

It is an issue in IntersectWithCurve. I logged a defect on this in our internal system (UP-28514). Thanks for reporting this issue.

 

Jack

0 Likes

eightdeltacharlie
Participant
Participant

Thanks Jack.  Is there any workaround you could suggest in the meantime?  My process likely could draw a bunch of sketch lines over the spline (in place of ConstructionPlanes), and then use SketchFittedSpline.intersections to infer the information I need.  Unfortunately I was hoping to use the intersection data as input to create 2-point circles, so I'd need to create and maintain the relationships to planes anyways to create the follow on circle sketches.

 

Any idea which release the fix may fall into once root-caused? 🙂

 

Thanks.

0 Likes

eightdeltacharlie
Participant
Participant

It looks like the sketchline based intersect workaround I mentioned earlier also doesn't work.  The following call to a Sketchline's Intersections method (red text in code) fails with an InternalValidationError : refplane message.  I've attached a screenshot of the input sketch, but it summary - its one sketch with two intersecting SketchLines, and two fitted splines that intersect one of those lines.  Whether I pass in NULL for the first parameter (to consider the entire sketch) or pass in an ObjectCollection of specific curves, the results are the same.

 

Ptr<Selections> activeSelection = ui->activeSelections();
Ptr<Base> selection = activeSelection->item(0)->entity();

if (Ptr<SketchLine>(selection))
{
	Ptr<SketchLine> sketch = selection;
	Ptr<ObjectCollection> intersectingCurves;
	Ptr<ObjectCollection> intersectionPoints;
	sketch->intersections(NULL, intersectingCurves, intersectionPoints);
}

 

0 Likes

liujac
Alumni
Alumni

Hi,

 

There is an issue inside SketchCurve.intersections. I logged a defect for this (UP-28551). We will try the best to fix the issues ASAP maybe early in June.

 

You may use the workaround for now as below.

 

	Ptr<Selections> activeSelection = ui->activeSelections();
	Ptr<Base> selection = activeSelection->item(0)->entity();
	Ptr<SketchLine> sketchLine = selection;
	if (sketchLine)
	{
		Ptr<Line3D> line = sketchLine->geometry();
		Ptr<Sketch> sketch = sketchLine->parentSketch();
		Ptr<SketchCurves> skCurves = sketch->sketchCurves();
		for (auto skCurve : skCurves)
		{
			if(skCurve == sketchLine)
				continue;

			Ptr<Curve3D> curve = nullptr;
			if (Ptr<SketchArc> arc = skCurve)
				curve = arc->geometry();
			else if(Ptr<SketchLine> line = skCurve)
				curve = line->geometry();
			else if (Ptr<SketchCircle> circle = skCurve)
				curve = circle->geometry();
			else if (Ptr<SketchEllipse> ellipse = skCurve)
				curve = ellipse->geometry();
			else if (Ptr<SketchEllipticalArc> ellipticalArc = skCurve)
				curve = ellipticalArc->geometry();
			else if (Ptr<SketchFittedSpline> fittedSpline = skCurve)
				curve = fittedSpline->geometry();
			else if (Ptr<SketchFixedSpline> fixedSpline = skCurve)
				curve = fixedSpline->geometry();
			else if (Ptr<SketchConicCurve> conicCurve = skCurve)
				curve = conicCurve->geometry();

			if(!curve)
				continue;

			Ptr<ObjectCollection> intersections = line->intersectWithCurve(curve);
		}
	}
1 Like