Table Of Content

The CATIA - Generative Drafting Journaling Guide has been designed to show you how to create drawing .... 1, the Legal format (8.5 x 14"). = 2, the A0 ISO ...
544KB taille 163 téléchargements 310 vues
Generative Drafting Journaling Preface Basic Tasks Glossary Index

© Dassault Systèmes 1994-2000. All rights reserved.

Preface The CATIA - Generative Drafting Journaling Guide has been designed to show you how to create drawing views starting from a CATIA script document. This book aims at illustrating the several stages of creation you may encounter. The information contained in this guide is specific to Version 5 Release 5 of the CATIA Generative Drafting workbench, which operates in a WINDOWS or UNIX workstation environment under the AIX, IRIX, SUN OS and HP-UX operating system.

Basic Tasks

CATDrawing Document Drawing Sheet Drawing View Drawing Basics

CATDrawing Document New CATDrawing Open CATDrawing

Create a CATDrawing Document Definition Creates a new drawing.

Methods Documents.Add Creates a document object and adds it to the documents collection. This document becomes the active one, and a window is created to accomodate it which becomes the active window. Syntax Documents.Add ( iDocType ) as Document iDocType as String The type of the document to be created, here a CATDrawing. = "Drawing" Example CATIA.Documents.Add ( "Drawing" )

Running The Macro 1. Open CATIA. 2. Load the CreateCATDrawing1.CATScript macro. 3. Run the macro.

Open a CATDrawing Document Definition Open an existing drawing.

Methods Documents.Open Opens and reads a document stored in a file, displays it in a new window, adds the document to the documents collection and the window to the windows collection, and makes both the document and the window the active ones. Syntax Documents.Add ( iFileName ) as Document iFileName as String The string containing the document name and path to be opened. Example CATIA.Documents.Open ( "C:\DrawingDirectory\UserDrawing.CATDrawing" )

Running The Macro 1. Open CATIA. 2. Check in OpenCATDrawing1.CATScript the path to the Generative Drafting Journaling Guide directory sample. 3. Load the OpenCATDrawing1.CATScript macro. 4. Run the macro.

Drawing Sheet Sheet Detail Sheet

Sheet Definition The drawing sheet contains drawing views.

Methods Activate Activates the drawing sheet. Syntax Activate Example UserSheet.Activate

Add Creates a new drawing sheet and adds it to the DrawingSheets collection. Syntax Add ( iSheetName ) as DrawingSheet iSheetName as String The sheet name. Example UserSheets.Add ( SheetName )

ForceUpdate Updates the drawing sheet even is not necessary. Syntax ForceUpdate Example UserSheet.ForceUpdate

GenerateDimensions Generates dimensions in all the drawing views of the drawing sheet from distance, length, angle, radius, and diameter 3D constraints. Only one dimension is generated for an existing constraint. Syntax GenerateDimensions Example UserSheet.GenerateDimensions

Item Gets a drawing sheet or detail sheet using its index or its name from the DrawingSheets collection. Syntax Item ( iIndex ) as DrawingSheet iIndex as Variant The sheet index (Long) or sheet name (String). Example Set UserSheet = UserSheets.Item ( SheetIndex )

PrintOut Prints the sheet according to thedrawing sheet page setup on the default printer. See PageSetup.ChooseBestOrientation, PageSetup.FitToPrinterFormat, PageSetup.FitToSheetFormat. Syntax PrintOut Example UserSheet.PrintOut

PrintToFile Prints the drawing sheet according to the drawing sheet page setup in a file. See PageSetup.ChooseBestOrientation, PageSetup.FitToPrinterFormat, PageSetup.FitToSheetFormat.. Syntax PrintToFile ( iFileName ) iFileName as String The full file name, Example UserSheet.PrintToFile ( SheetFileName )

Remove Removes a drawing sheet or detail sheet using its index or its name from the DrawingSheets collection. Syntax Remove ( iIndex ) iIndex as Variant The sheet index (Long) or sheet name (String). Example UserSheets.Remove ( SheetIndex )

Update Updates the drawing sheet.

Syntax Update Example UserSheet.Update

Properties ActiveSheet Gets the active drawing sheet of the drawing document. Syntax ActiveSheet as DrawingSheet Example UserActiveSheet = UserDrawingDocument.ActiveSheet

DrawingSheet Dimensions an object as drawing sheet. Example Dim UserSheet as DrawingSheet

DrawingSheets Dimensions an object as drawing sheets. Example Dim UserSheets as DrawingSheets

Scale Gets or sets the drawing sheet scale. Syntax Scale as Double Example SheetScale = UserSheet.Scale UserSheet.Scale = 3.500000

Orientation Gets or sets the drawing sheet orientation. Syntax Orientation as Long = 0, the portrait orientation. = 1, the landscape orientation. = 2, the best orientation according to the print format.

Example SheetOrientation = UserSheet.Orientation UserSheet.Orientation = 0

PageSetup.Banner Gets or sets the drawing sheet printing banner. Syntax PageSetup.Banner as String Available variables are: $USER, the user name. $HOST, the workstation name. $SCALE, the print scale. $TIME, the print time. $DATE, the print date. $DAY, the print day. $MONTH, the print month. $YEAR, the print year. Example SheetPageSetupBanner = UserSheet.PageSetup.Banner UserSheet.PageSetup.Banner = "Printed by $USER at scale $SCALE on $MONTH/$DAY/$YEAR"

PageSetup.BannerPosition Gets or sets the drawing sheet printing banner position. Syntax PageSetup.BannerPosition as Long = 0, the print has no banner. = 1, the banner is located along the bottom side of the print. = 2, the banner is located along the top side of the print. = 3, the banner is located along the left side of the print. = 4, the banner is located along the right side of the print. Example SheetPageSetupBannerPosition = UserSheet.PageSetup.BannerPosition UserSheet.PageSetup.BannerPosition = 2

PageSetup.ChooseBestOrientation Gets or sets the drawing sheet printing best orientation. See PageSetup.Orientation. Syntax PageSetup.ChooseBestOrientation as Boolean = True, the drawing sheet is oriented if needed according to the print format. = False, the drawing sheet keeps its current orientation. Example SheetPageSetupBestOrientation = UserSheet.PageSetup.ChooseBestOrientation UserSheet.PageSetup.ChooseBestOrientation = True

PageSetup.Bottom Gets or sets the drawing sheet printing lower left corner location with respect to the bottom of the sheet of paper. This is the distance of the document or the image to print lower left corner to the inner side of the bottom margin. Syntax PageSetup.Bottom as Float Example SheetPageSetupBottom = UserSheet.PageSetup.Bottom UserSheet.PageSetup.Bottom = 40.0

PageSetup.BottomMargin Gets or sets the drawing sheet printing bottom margin. The bottom margin is a strip in which nothing is printed, located at the bottom of the page. Syntax PageSetup.BottomMargin as Float Example SheetPageSetupBottomMargin = UserSheet.PageSetup.BottomMargin UserSheet.PageSetup.BottomMargin = 10.0

PageSetup.FitToPrinterFormat Gets or sets the drawing sheet printing "fit to printer format". Syntax PageSetup.FitToPrinterFormat as Boolean = True, the drawing sheet is fitted to the printer format. = False, the drawing sheet is not fitted to the printer format. Example SheetPageSetupFitToPrinterFormat = UserSheet.PageSetup.FitToPrinterFormat UserSheet.PageSetup.FitToPrinterFormat = True

PageSetup.FitToSheetFormat Gets or sets the drawing sheet printing "fit to sheet format". Syntax PageSetup.FitToSheetFormat as Boolean = True, the drawing sheet is fitted to the sheet format. = False, the drawing sheet is not fitted to the sheet format. Example SheetPageSetupFitToSheetFormat = UserSheet.PageSetup.FitToSheetFormat UserSheet.PageSetup.FitToSheetFormat = True

PageSetup.Left Gets or sets the drawing sheet printing lower left corner location with respect to the left of the sheet of paper. This is the distance of the document or the image to print lower left corner to the inner side of the left margin. Syntax PageSetup.Left as Float Example SheetPageSetupLeft= UserSheet.PageSetup.Left UserSheet.PageSetup.Left = 40.0

PageSetup.LeftMargin Gets or sets the drawing sheet printing left margin. The left margin is a strip in which nothing is printed, located at the left of the page. Syntax PageSetup.LeftMargin as Float Example SheetPageSetupLeftMargin = UserSheet.PageSetup.LeftMargin UserSheet.PageSetup.LeftMargin = 10

PageSetup.Logo Gets or sets the drawing sheet printing logo file. Syntax PageSetup.Logo as String Example SheetPageSetupLogo = UserSheet.PageSetup.Logo UserSheet.PageSetup.Logo = LogoFilePath

PageSetup.MaximumSize Gets or sets the drawing sheet printing maximum size with respect to the page size and margins. If true, this overrides the location properties, that is PageSetup.Left and PageSetup.Bottom, and the PageSetup.Zoom property values. Syntax PageSetup.MaximumSize as Boolean = True, the drawing sheet is printed with the maximum size. = False, the drawing sheet is not printed with the maximum size. Example SheetPageSetupMaximumSize = UserSheet.PageSetup.MaximumSize UserSheet.PageSetup.MaximumSize = True

PageSetup.Orientation Gets or sets the drawing sheet printing orientation. Syntax PageSetup.Orientation as Long = 0, the portrait orientation. = 1, the landscape orientation. = 2, the best orientation according to the print format. Example SheetPageSetupOrientation = UserSheet.PageSetup.Orientation UserSheet.PageSetup.Orientation = 0

PageSetup.PaperHeight Gets or sets the drawing sheet printing paper height. Syntax PageSetup.PaperHeight as Float Example SheetPageSetupPaperHeight = UserSheet.PageSetup.PaperHeight UserSheet.PageSetup.PaperHeight = 297

PageSetup.PaperSize Gets or sets the drawing sheet printing paper size. Syntax PageSetup.PaperSize as Long = 0, the US Letter format (8.5 x 11"). = 1, the Legal format (8.5 x 14"). = 2, the A0 ISO format (841 x 1189 mm). = 3, the A1 ISO format (594 x 841 mm). = 4, the A2 ISO format (420 x 594 mm). = 5, the A3 ISO format (297 x 420 mm. = 6, the A4 ISO format (210 x 297 mm). = 7, the A ANSI format (8.5 x 11"). = 8, the B ANSI format (11 x 17"). = 9, the C ANSI format (17 x 22"). = 10, the D ANSI format (22 x 34") = 11, the E ANSI format (34 x 44") = 12, the F ANSI format (28 x 40"). = 13, the customized format. Example SheetPageSetupPaperSize = UserSheet.PageSetup.PaperSize UserSheet.PageSetup.PaperSize = 2

PageSetup.PaperWidth Gets or sets the drawing sheet printing paper width.

Syntax PageSetup.PaperWidth as Float Example SheetPageSetupPaperWidth = UserSheet.PageSetup.PaperWidth UserSheet.PageSetup.PaperWidth = 210

PageSetup.Quality Gets or sets the drawing sheet printing quality Syntax PageSetup.Quality as Long = 0, the print quality is acceptable for drafts. = 1, the print quality is low. = 2, the print quality is medium. = 3, the print quality is high. Example SheetPageSetupQuality = UserSheet.PageSetup.Quality UserSheet.PageSetup.Quality = 3

PageSetup.RightMargin Gets or sets the drawing sheet printing right margin. The right margin is a strip in which nothing is printed, located at the right of the page. Syntax PageSetup.RightMargin as Float Example SheetPageSetupRightMargin = UserSheet.PageSetup.RightMargin UserSheet.PageSetup.RightMargin = 10

PageSetup.Rotation Gets or sets the drawing sheet printing rotation. The right margin is a strip in which nothing is printed, located at the right of the page. Syntax PageSetup.Rotation as Long = 0, the image is not rotated. = 1, the image is rotated of 90 degrees clockwise. = 2, the image is rotated of 180 degrees clockwise. = 3, the image is rotated of 270 degrees clockwise. Example SheetPageSetupRotation = UserSheet.PageSetup.Rotation UserSheet.PageSetup.Rotation = 0

PageSetup.TopMargin Gets or sets the drawing sheet printing top margin.

The top margin is a strip in which nothing is printed, located at the top of the page. Syntax PageSetup.TopMargin as Float Example SheetPageSetupTopMargin = UserSheet.PageSetup.TopMargin UserSheet.PageSetup.TopMargin = 10

PageSetup.Zoom Gets or sets the drawing sheet printing zoom. Syntax PageSetup.Zoom as Float Example SheetPageSetupZoom = UserSheet.PageSetup.Zoom UserSheet.PageSetup.Zoom = 3.0

PaperSize Gets or sets the drawing sheet paper size. Syntax PaperSize as Long = 0, the US Letter format (8.5 x 11"). = 1, the Legal format (8.5 x 14"). = 2, the A0 ISO format (841 x 1189 mm). = 3, the A1 ISO format (594 x 841 mm). = 4, the A2 ISO format (420 x 594 mm). = 5, the A3 ISO format (297 x 420 mm. = 6, the A4 ISO format (210 x 297 mm). = 7, the A ANSI format (8.5 x 11"). = 8, the B ANSI format (11 x 17"). = 9, the C ANSI format (17 x 22"). = 10, the D ANSI format (22 x 34") = 11, the E ANSI format (34 x 44") = 12, the F ANSI format (28 x 40"). = 13, the customized format. Example SheetPaperSize = UserSheet.PaperSize UserSheet.PaperSize = 2

ProjectionMethod Gets or sets the drawing sheet projection method. Syntax ProjectionMethod as Long = 0, the views are created using first angle standard. = 1, the views are created using third angle standard.

Example SheetProjectionMethod = UserSheet.ProjectionMethod UserSheet.ProjectionMethod = 0

Sheets Gets the collection of drawing sheets in the drawing document. Syntax Sheets as DrawingSheets Example Set UserDrawingSheets = UserDrawingDocument .Sheets

Running The Macro 1. Open the Sheet1.CATDrawing document.

2. Load the Sheet1.CATScript macro. 3. Run the macro.

Detail Sheet Definition The drawing detail sheet contains drawing views used as detail in another sheet. The drawing detail sheet line reuses Sheet methods and properties.

Methods AddDetail Creates a new drawing detail sheet and adds it to the DrawingSheets collection. Syntax AddDetail ( iDetailSheetName ) as DrawingSheet iDetailSheetName as String The detail sheet name. Example UserSheets.AddDetail ( UserDetailSheetName )

IsDetail Gets if the sheet is a detail sheet. Syntax IsDetail as Boolean = True, the sheet is a detail sheet. = False, the sheet is not a detail sheet. Example SheetType = UserSheet.IsDetail

SetAsDetail Sets a sheet as detail sheet. Syntax SetAsDetail Example UserSheet.SetAsDetail

Running The Macro 1. Open the DetailSheet1.CATDrawing document.

2. Load the DetailSheet1.CATScript macro. 3. Run the macro.

Drawing View View

View Definition The drawing view.

Methods Activate Activates the drawing view. Syntax Activate Example UserView.Activate

Add Creates a new drawing view and adds it to the DrawingViews collection. Syntax Add ( iViewName ) as DrawingView iViewName as String The view name. Example UserViews.Add ( ViewName )

AlignedWithReferenceView Aligns the drawing view with the drawing reference view. See ReferenceView. Syntax AlignedWithReferenceView Example UserView.AlignedWithReferenceView

ForceUpdate Updates the view even is not necessary. Syntax ForceUpdate Example

UserView.ForceUpdate

IsGenerative Gets whether the drawing view has a generative behavior. Syntax IsGenerative as Boolean = True, the drawing view has a generative behavior. = False, the drawing view has not a generative behavior. Example ViewGenerative = UserView.IsGenerative

Item Gets a drawing view using its index or its name from the DrawingViews collection. Syntax Item ( iIndex ) as DrawingView iIndex as Variant The view index (Long) or view name (String). Example Set UserView = UserViews.Item ( ViewIndex )

Remove Removes a drawing view using its index or its name from the DrawingViews collection. Syntax Remove ( iIndex ) iIndex as Variant The view index (Long) or view name (String). Example UserViews.Remove ( ViewIndex )

UnAlignedWithReferenceView Unaligns the drawing view with the drawing reference view. See ReferenceView. Syntax UnAlignedWithReferenceView Example UserView.UnAlignedWithReferenceView

Update Updates the view.

Syntax Update Example UserView.Update

Properties ActiveView Gets the active drawing view of the drawing sheet. Syntax ActiveView as DrawingView Example UserActiveView = UserSheet.ActiveView

Angle Gets or sets the drawing view angle. Syntax Angle as Double Example ViewAngle = UserView.Angle UserView.Angle = 30.000000

DrawingView Dimensions an object as drawing view . Example Dim UserView as DrawingView

DrawingViews Dimensions an object as drawing views. Example Dim UserViews as DrawingViews

Factory2D Gets or sets the drawing view 2D factory. Syntax

Factory2D as Factory2D Example Set UserFactory2D = UserView.Factory2D

FrameVisualization Gets or sets the drawing view frame visualization display. Syntax FrameVisualization as Boolean = True, the drawing view frame visualization is displayed. = False, the drawing view frame visualization is not displayed. Example ViewFrameVisualizationDisplay = UserView.FrameVisualization UserView.FrameVisualization = True

GenerativeBehavior Gets the drawing view generative behavior. Syntax GenerativeBehavior as DrawingViewGenerativeBehavior Example Set ViewGenerativeBehavior = UserView.GenerativeBehavior

GenerativeLinks Gets the drawing view generative links. Syntax GenerativeLinks as DrawingViewGenerativeLinks Example Set ViewGenerativelinks = UserView.GenerativeLinks

GeometricElements Gets the drawing view geometric elements. Syntax GeometricElements as GeometricElements Example Set ViewGeometricElements = UserView.GeometricElements

ReferenceView Gets or sets the drawing reference view. Syntax

ReferenceView as Double Example UserReferenceView = UserView.ReferenceView UserView.ReferenceView = UserFrontView

Scale Gets or sets the drawing view scale. Syntax Scale as Double Example ViewScale = UserView.Scale UserView.Scale = 3.500000

Views Gets the collection of drawing views in the drawing sheet. Syntax Views as DrawingViews Example UserDrawingViews = UserSheet.Views

x Gets or sets the drawing view X coordinate. Syntax x as Double Example ViewXCoordinate = UserView.x UserView.x = 100.000000

y Gets or sets the drawing view Y coordinate. Syntax y as Double Example ViewYCoordinate = UserView.y UserView.y = 100.000000

Running The Macro 1. Open the View1.CATDrawing document.

2. Load the View1.CATScript macro. 3. Run the macro.

Drawing Basics Properties Update

Properties Definition Drawing properties.

Methods Properties DrawingDocument Dimensions an object as drawing document. Example Dim UserDrawingDocument as DrawingDocument

Standard Gets or sets the drawing document standard. Syntax Standard as Long = 0, ANSI standard. = 1, ISO standard. = 2, JIS standard. Example UserDrawingSheets = UserDrawingDocument .Sheets

Update Definition Updates a drawing elements.

Methods Update Updates the drawing document. Syntax Update Example UserDrawingDocument .Update

Glossary A absolute position active view

aligned section view associative detail view associativity attribute auxiliary view

A sheet coordinates. A view from which you create any element: another view or 2D dress-up. The view from which section views, section cuts and detail views will be created. This view generally corresponds to either the front view or the isometric view. A section view created from a cutting profile defined from non parallel planes. A detail view associated with a 3D element. In the Drafting workbench, the ability of child view(s) to follow the behavior of the parent view: moving, scaling. In the Drafting workbench, the graphical and/or geometrical properties inherited from 3D element. A view in a direction not necessarily vertical or horizontal.

B background sheet background view back-clipping

bill of material breakout

A sheet dedicated to frames and title blocks. A sheet dedicated to frames and title blocks. A back-clipping removes all the elements behind a pre-defined plane. It can only be applied on an extracted view. Aback-clipping plane is a plane used for generating a back-clipping. A piece of information inserted into the active view of a CATDrawing document. For this, you can be either in the working view or in the background view. A breakout is a partially removed section which allows visualizing a particular element in the view.

C callout child view clipped view clipping profile cross hatching cut area cutting profile

A graphical representation of a cutting profile. A view generated from a parent view. A view modified via a clipping profile. A zone to be kept and visualized in a view. A symbolic representation in the form of a pattern used to display a cut area. The cut surfaces on a section view or section cut. A set of planes used to define a section view or section cut.

D datum feature datum target design tree detail view drawing dress-up

An element defining a contacting surface on a part. An element defining a contacting surface on a part and represented by spherical or pointed locating pins. Area of the document window reserved for viewing the design specifications of a drawing, presented in the form of a tree structure. A view corresponding to a zoomed particular area to be visualized. This area to be visualized is defined by a circle or a given polygon. The root feature. Sheets are aggregated in the drawing. Views are aggregated in the sheets. A graphical attribute of a 2D element.

F filter front view

A restriction on elements to be cut in a section view or section cut, or elements to be seen in a projection view. A view created from a projection plane. This view is generally used as reference to create a projection view.

I isometric view

A 3D view that represents a part according to a given projection plane. This view allows a perspective visualization.

L lock

A locked view is a view in which any graphical modification of the generated 2D elements is forbidden.

M main view

The view which supports the geometry directly created in the sheet.

O object

In the Drafting workbench, there are two kinds of object: activated and selected. The view frame of an activated object is displayed in red. offset section view /cut A section view created from a cutting profile defined with several parallel planes. overlay In a multi-model context, all passive elements are called overlayed elements.

P parent view

part

A reference view from which another view is generated (for example a front view from which a section view will be created). The view frame of the parent view is displayed in red. Typically the front view is a parent view. See also child view. A 3D entity obtained by combining different features in the Part Design workbench.

projection view

A view created from an other view.

S section cut section profile section view

simple breakout

sheet standard

A view representing the intersection between the 3D geometry and the cutting profile. See cutting profile. In the Drafting workbench, a view representing the intersection between the 3D geometry and the cutting profile, and all the 3D geometry located behind the cutting profile. A simple breakout removes locally a sectioned part perpendicularly to the current view plane. You will then be able to visualize the remaining visible inside part. A set of views. Several sheets may be created in the Drafting workbench. The international conventions that are supported in the Drafting workbench: ANSI, ISO and JIS.

T template title block

In the Drafting workbench, an object that is included in the document (for example, the title block). A frame which contains the title block.

U unspec breakout

An unspec breakout operation removes locally a 3D part. It allows visualizing the inside of a 3D part. It can only be applied to an extracted view.

V view frame

A square or rectangular frame that contains the geometry and dimensions of the view.

Index A Activate

,

ActiveSheet ActiveView Add

,

AddDetail AlignedWithReferenceView Angle

D Documents.Add Documents.Open DrawingDocument DrawingSheet DrawingSheets DrawingView DrawingViews

F Factory2D ForceUpdate

,

FrameVisualization

G GenerateDimensions GenerativeBehavior GenerativeLinks GeometricElements

I IsDetail IsGenerative Item

,

O Orientation

P PageSetup.Banner PageSetup.BannerPosition PageSetup.Bottom PageSetup.BottomMargin PageSetup.ChooseBestOrientation PageSetup.FitToPrinterFormat PageSetup.FitToSheetFormat PageSetup.Left PageSetup.LeftMargin PageSetup.Logo PageSetup.MaximumSize PageSetup.Orientation PageSetup.PaperHeight PageSetup.PaperSize PageSetup.PaperWidth PageSetup.Quality PageSetup.RightMargin PageSetup.Rotation PageSetup.TopMargin PageSetup.Zoom PaperSize PrintOut PrintToFile ProjectionMethod

R ReferenceView Remove

,

S Scale

,

SetAsDetail Sheets Standard

U UnAlignedWithReferenceView Update

V Views

X x

Y y

,

,