Cancel
Showing results for 
Search instead for 
Did you mean: 

NX Clearance Analysis Report- Coordinate Extraction

Experimenter
Experimenter

I performed clearance analysis to check the interferences in different parts of an assembly. The attached file shows the report in which we have the part number, type and the coordinates of the clash. Is there anyway to also extract the "coordinates of the two parts involved in the collision" along with the coordinates of the clash?

 

Thank you. 

1 REPLY

Re: NX Clearance Analysis Report- Coordinate Extraction

Creator
Creator

Hi,

 

I'm also working with the assembly clearance function.

Have you been able to extract the coordinates, part types and collision overlap (distance) through function in NXOpen?

I have been trying to get those informations through the following function but I'm not able to get anything more than the number of collision.

 

Thank you

 

public void CheckForCollision(ref bool contactCollisionDetected, ref ArrayList listOfContacts, ref float toleranceCurrent, float toleranceMax, bool bToleranceIncreased)
        {
            NXOpen.Assemblies.ClearanceSet nullNXOpen_Assemblies_ClearanceSet = null;
            NXOpen.Assemblies.ClearanceAnalysisBuilder clearanceAnalysisBuilder1;
            NXOpen.Part workPart = theSession.Parts.Work;
            clearanceAnalysisBuilder1 = workPart.AssemblyManager.CreateClearanceAnalysisBuilder(nullNXOpen_Assemblies_ClearanceSet);

            NXOpen.Expression expression1;
            expression1 = clearanceAnalysisBuilder1.CreateClearanceZoneExpression("0.0");
            
            NXOpen.Unit unit1 = (NXOpen.Unit)workPart.UnitCollection.FindObject("MilliMeter");
            expression1.Units = unit1;

            clearanceAnalysisBuilder1.SetDefaultClearanceZone(expression1);

            clearanceAnalysisBuilder1.CalculationMethod = NXOpen.Assemblies.ClearanceAnalysisBuilder.CalculationMethodType.ExactifLoaded;

            clearanceAnalysisBuilder1.ClearanceSetName = "SET1";

            clearanceAnalysisBuilder1.ClearanceBetween = NXOpen.Assemblies.ClearanceAnalysisBuilder.ClearanceBetweenEntity.Bodies;
            NXOpen.NXObject nXObject1;
            nXObject1 = clearanceAnalysisBuilder1.Commit();
 
            NXOpen.Assemblies.ClearanceSet clearanceSet1 = (NXOpen.Assemblies.ClearanceSet)nXObject1;
            clearanceSet1.PerformAnalysis(NXOpen.Assemblies.ClearanceSet.ReanalyzeOutOfDateExcludedPairs.True);
            NXOpen.Assemblies.ClearanceSet.Summary results = clearanceSet1.GetResults();

            NXOpen.SelectObject[] gh1 = clearanceAnalysisBuilder1.CollectionOneObjects.GetSelectObjectArray();
            NXOpen.DisplayableObject[] gh2 = clearanceAnalysisBuilder1.CollectionTwoObjects.GetArray();

            if (results.NumHard > 0)
            {
                toleranceCurrent += (float)1;
                contactCollisionDetected = true;
            }
            else
            {
                contactCollisionDetected = false;
            }

            int k = results.NumCollections;
            int m = results.NumCollection1;
            int l = results.NumAllInterf;

            Component test = clearanceSet1.OwningComponent;
            int f=clearanceSet1.GetNumberOfInterferences();
}