DMU Navigator

Creating an Approbation Stamp


This macro shows you how to use annotated views and marker2Ds, to approve a given state of a product. This approbation is officialized by a stamp in a corner of the viewer. The macro assumes that a CATProduct has been loaded.

This approbation stamp "ACME, Approved by John Smith, 1/31/01 2:32:04 PM" can be seen in the bottom-right of the image :

 

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

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

 

CAADmuApproval includes six steps:

  1. Prolog
  2. Acquisition of the responsible's name
  3. Creation of the annotated view
  4. Creation of the text
  5. Creation of the frame
  6. Application of the view

Prolog

Some constants are initialized : they describes the relative positioning of the different markers.

Acquisition of the responsible's name

A variable is defined for the responsible name.  The InputBox function asks the user to enter it's name string whose default value will be "John Smith". 

Creation of the annotated view

The cAnnotatedViews collection (see AnnotatedViews ) is the factory to create oAnnotatedView object (see AnnotatedView ) : this collection is retrieved using the GetTechnologicalObject method, with the string "AnnotatedViews", on the root product of the active document.

Add method is used on the cAnnotatedViews collection to create the oAnnotatedView object.

Creation of the text

The oAnnotatedView object enables the creation of markers thru cMarker2Ds collection (see Marker2Ds ): this collection is retrieved using the Marker2Ds method on the oAnnotatedView object.

The string of the approval text,"ACME, Approved by John Smith, 1/31/01 2:32:04 PM", is built using standard script features and the responsible name.

Its position is computed to fit with the bottom-right position specification.

The text, a oMarker2DText object (see Marker2D ), is created using the Add2DText method on the cMarker2Ds collection giving the position and the string.

Creation of the frame

The position of the frame is computed to order to fit with the text.

The frame, a oMarker2DRectangle object (see Marker2D ), is created using the Add2DRectangle method on the cMarker2Ds collection giving the position.

Application of the view

The annotated view is updated, in order to keep all modifications, using the Update method of the oAnnotatedView object.

The View command is used to apply the oAnnotatedView object to the current viewer : it enables the display of the view and it's markers. This command is available on the NavigatorWorkbench object(see NavigatorWorkbench ) which can be retrieved using the GetWorkbench method with the string "NavigatorWorkbench", on the active document.

[Top]


In Short

This use case has shown how to use annotated views and markers in order to build an approbation stamp. 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.