Drafting

Creating a Detail Sheet


This macro shows you how to create a sheet in a drawing.

This macro opens the CAADriSheet.CATDrawing document that contains a sheet only. 
It creates DrawingSheet object from the DrawingSheets collection with the AddDetail method and a activate it.

CAADriSheet is launched in CATIA [1]. No open document is needed.

CAADriDetailSheet.CATScript is located in the CAAScdPriUseCases module. Execute macro (Windows only).

 

CAAPriPad includes the following steps:

  1. Prolog
  2. Creating the Detail Sheet
  3. Activating the Detail Sheet

Prolog

The macro first loads CAADriDetailSheet.CATDrawing that contains a sheet: Sheet.1 

...
' ------------
' Get the sheets collection of the drawing
' ------------
Dim oDrawingSheets As DrawingSheets
Set oDrawingSheets = oDoc.Sheets
...

Once the drawing document has been loaded, the odrawingSheets is declared to receive the instance of the sheets.

Creating the Detail Sheet

...
' ------------
' Add the detail sheet with a default name to the sheets collection of the drawing
' ------------
MsgBox "Click OK to create the new sheet."
Dim oDrawingSheet As DrawingSheet
Set oDrawingSheet = oDrawingSheets.AddDetail("New Detail Sheet") 
...

The oDrawingSheet object is added to the oDrawingSheets collection with the AddDetail method and a default name: New Detail Sheet. 

The oDrawingSheet is then displayed with the following result but not activated.

Activating the Detail Sheet

...
' ------------
' Activate the detail sheet
' ------------
MsgBox "Click OK to activate the new detail sheet."
oDrawingSheet.Activate 
...

The Activate property of the DrawingSheet object is used to activate it.

[Top]


In Short

This use case has shown how to create and activate a sheet using macros.

[Top]


References

[1] Replaying a Macro
[Top]

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