DMU Navigator

Creating a Label on a Product


This macro shows you how to use marker3Ds to create a label containing information on a product. The macro assumes that a CATProduct has been loaded and that one component is selected.

This image shows the selection state before the use of the macro :

 

This image shows the result of the macro :

 

CAADmuLabel is launched in CATIA [1]. A previously opened document is needed.

CAADmuLabel.CATScript is located in the CAAScdDmuUseCases module. Execute macro (Windows only).

 

CAADmuLabel includes four steps:

  1. Retrieving the selected component
  2. Reading information on the component
  3. Retrieving of the marker3Ds collection
  4. Creation of the marker3D

Retrieving the selected component

The FindObject method is used on the Selection object with the string "CATIAProduct" to retrieve the selected oProduct (see Product ).

Reading information on the component

The Position and GetComponents methods are used to get the position of the oProduct component.

The PartNumber method allows to build the sTextString message of the label.

Retrieving of the marker3Ds collection

The cMarker3Ds collection (see Marker3Ds ) is the factory to create oMarker3D object (see Marker3D ) : this collection is retrieved using the GetTechnologicalObject method, with the string "Marker3Ds", on the root product of the active document.

Creation of the marker3D

The different positions for the label are computed

The Add3DText method is used to create the oMarker3D object with the positions, the sTextString message and the oProduct component.

TextSize method is used on the oMarker3D object to modify one of it's attribute.

Update method is used take into account all modifications on the oMarker3D object.

[Top]


In Short

This use case has shown how to use marker3Ds in order to label components. Specifically, it has illustrated how to :

[Top]


References

[1] Replaying a macro
[2] DMU Navigator automation objects

[Top]


DMU Navigator Home DMU Space Analysis Home DMU Kinematics Simulation Home

Copyright © 2001, Dassault Systèmes. All rights reserved.