What's new

IADSketch.Analyze() "Heal" argument

alexfranke

Senior Member
IADSketch.Analyze() "Heal" argument

(This is from memory, so this heal argument might actually be in a slightly different place.)

I noticed an Analyze method of (I believe IADSketch), which was not in the help files. It takes a set of bools -- one for each of the analyze options in the GUI, plus a couple others. One of the others is "heal" which I would assume to "heal" the sketch, however, passing in true does not seem to do this.

In my Text Import Wizard, splines and polylines are added unconnected. The "heal" function in the GUI connects them. Is the "heal" argument of the Analyze method supposed to do the same thing?

Thanks,
Alex
 

shubhab

Member


Hi Alex,

Sorry about the IADAnalyze.Sketch method not existing in the Help. But as mentioned already, we are still updating the file for its contents and will include this topic soon.

In short, Analyze Sketch will detect Open loops, disjoint ends, overlaps, self-intersections and Degenerate Figures. If you choose to heal the sketch by passing True as your argument, you will also need to provide a valid tolerance value, which will automatically heal the sketch as much as possible for the deformities within the provided tolerance limit.
Things which are not healable will not be attempted.

I suppose you have provided a valid tolerance value for your sketch.

If so, I suspect there might have been some units issues with the sketch(File) you chose to heal:

The tolerance value you provided might be out of range. One thing that you may want to check is that the file you open may have Display units as inches. But our API will convert that into Model units and all dimensions and values in the part will be handled in cms (which is our Model Units).

For example, I have attached a file with a very simple sketch. If I set the tolerance value to 0.22 when the Display units are in inches and run the AnalyzeSketch method, the sketch doesn't heal. However, if I input a tolerance value of 0.4 (which is roughly the lower limit of the tolerance if the file units is in cms), then the open loop gets healed.

Is this the problem you are facing?

Thanks,
Shubha
Alibre, Inc.
 

Attachments

  • Sketch Heal.zip
    6.5 KB · Views: 3

alexfranke

Senior Member


Hello again,

I'm afraid I can't open the file -- looks like you're using 9.0.2.9301 and I'm on version 9.0.0.9242. (I have the 9.0 version of Xpress.)

Let me play around with this a bit more, though -- that may indeed have been the problem.

Cheers,
Alex Franke
 

alexfranke

Senior Member


Hi again,

I tried this again and I'm still not able to get the expected results. It's as if the heal agrument is ignored. Here's essentially what I'm doing:

Code:
IADSketch sketch = [some valid sketch];

sketch.BeginChange();

// Add some curves and polylines (in attached example, the letter \"e\")

// Try to heal (also tried 10, 1.0, 0.01, 0.001 for tolerance)
IAnalyzedSketchData data = sketch.Analyze(true, false, false, false, false, true, 0.1); 

sketch.EndChange();

The endpoints of the disjointed figures are at the same points (curve 1 ends exactly where curve 2 begins). If I fire up the Alibre Design GUI and choose "heal" on the sketch it works fine (though I don't see any options for tolerance as suggested in the help file [not the API help file]). I just can't get the same results through the API.

I wonder if maybe this feature is limited in the Xpress version...

Thanks for your help! By the way, I'm passing centimeter measurements to the API.

Cheers,
Alex Franke
 

Attachments

  • HealExample.zip
    9 KB · Views: 3

shubhab

Member


Hi Alex,

I can see your problem. It seems like there is no problem in healing open loops (the example I had), but there is a problem with Disjoint ends.

This is not due to the XPress Version. All our API is also exposed in the XPress Version.
This is a defect in our API and I'll let our Development team know about this.

Also, sorry about having uploaded an incorrect version of the file. Do you want me to upload the right file that I mentioned in my previous post?

Thanks,
Shubha
Alibre, Inc.
 

alexfranke

Senior Member


Thanks again, Shubha. No, there's no need to upload another file.

I really appreciate the quick responses and the genuine efforts you are providing! Please let me know if there's any way I can return the favor -- for example I'd be happy to help test other areas of the API, or additional API functionality or documentation as it becomes available!

Cheers,
Alex
 
Top