DMU Space Analysis | 
    
      Computing the Maximum Separation | 
  
| 
       This macro shows you how to use distances to compute the maximum separation between selected components (i.e. the maximum of all the minimum distances between a couple of components). The macro assumes that a CATProduct has been loaded and that some components are selected. This image shows the selection state before the use of the macro : 
 
 This image shows the result of the macro : 
 
  | 
  |
| 
       CAASpaMaximumSeparation is launched in CATIA [1]. A previously opened document is needed. CAASpaMaximumSeparation.CATScript is located in the CAAScdDmuUseCases module. Execute macro (Windows only). 
  | 
  |
| 
       CAASpaMaximumSeparation includes seven steps: 
 Retrieving the selected componentsThe cGroups collection (see  
 The number of selected components, iNumber is retrieved using
      the  A warning is sent if, at least, two components are not selected. Retrieving the distances collectionThe cDistances collection (see  Loop on each couple of componentsThe basic idea of the algorithm is to create a oDistance object for each couple of components. Each couple is build using imbricated loops and one group iGroup2
      which content is changed using  Creation and computation of the distanceThe oDistance object is created using  Comparison with the maximum valueIf the result is consistent (  CleanThe environment is cleaned using  Display the resultsThe results are displayed in a Msgbox. 
  | 
  
![]()
[Top]
This use case has shown how to use distance in order to compute the maximum separation. Specifically, it has illustrated how to :
[Top]
| [1] | Replaying a Macro | 
| [2] | Space Analysis automation objects | 
[Top]
DMU Navigator Home DMU Space Analysis Home DMU Kinematics Simulation Home
Copyright © 2001, Dassault Systèmes. All rights reserved.