The following is a CATIA drawing view macro to help you learn how to program for the drafting workbench since macros cannot be recorded in it. To create 2D CATIA drawing views from 3D models with a CATVBA macro  follow these steps:

Use the DrawingViews collection to create an empty DrawingView:

1
2
3
Dim oView As DrawingView
 
Set oView = oSheet.Views.Add()

Next, retrieve the GeneravtiveBehavior object:

4
5
6
Dim oGenB As DrawingViewGenerativeBehavior
 
Set oGenB = oView.GenerativeBehavior

Now, establish the link with the 3D CATIA model, like so:

7
8
9
10
11
Dim oParentDoc As PartDocument
 
Set oParentDoc = CATIA.Documents.Item("MyPart.CATPart")
 
oGenB.Document = oParentDoc.Product

Finally, set the View attributes, such as the hidden line mode:

12
oGenB.HiddenLineMode = catHlrModeOn

The DrawingView object contains the DrawingViewGenerativeBehavior object, which owns the methods for creating 2D views from 3D models.

Thanks for reading about my CATIA drawing view macro. Read more CATIA tutorials.