Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

InternalValidationError : err == AcGe::kXXOk

4 REPLIES 4
Reply
Message 1 of 5
eightdeltacharlie
774 Views, 4 Replies

InternalValidationError : err == AcGe::kXXOk

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;
	}

 

 

4 REPLIES 4
Message 2 of 5
liujac
in reply to: eightdeltacharlie

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

Message 3 of 5
eightdeltacharlie
in reply to: liujac

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.

Message 4 of 5

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);
}

 

Message 5 of 5
liujac
in reply to: eightdeltacharlie

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);
		}
	}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report