Table Of Content

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, ...
542KB taille 97 téléchargements 298 vues
Interactive Drafting Journaling Preface Basic Tasks Glossary Index

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

Preface The CATIA - Interactive 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 Interactive 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

CATPart 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 Interactive 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

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

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 angle dimension area fill

A sheet coordinates. A view in which all the modifications will be performed. For instance, all the 2D geometry and dressup elements that will be added to the draft views to be created. A dimension applied to one or two linear elements or to circular elements. A closed area on which you will then apply graphical dressup element called hatching pattern.

B background sheet A sheet dedicated to frames and titlteblocks. A blank added between the dimensioned element on the view and one blanking extremity on the extension line.

C chained dimension A dimension presentation mode made of a system. A bevelled corner between any types of curves: lines, splines, arcs and so chamfer forth. chamfer dimension A dimension applied to a chamfer. An arc tangent between lines, arcs, circles and any types of curves corner (consecutive or that intersect).

D datum feature

An element defining a contacting surface on a part. An element defining a contacting surface on a part and represented by datum target spherical or pointed locating pins. detail sheet A sheet that is used as an intermediate catalog for positioning 2D geometry elements that will be instantiated afterwards. diameter dimension A dimension representing either a radius or a diameter. distance dimension A dimension representing the dimension between two elements be they linear or circular type. ditto An instanciation of a 2D element that is stored on a detail sheet. document A common unit of data (typically a file) used in user tasks and exchanged between users. When saved on disk, a document is given a unique filename by which it can be retrieved. The root feature. Sheets are aggregated in the drawing. Views are drawing aggregated in the sheets. drawing repository A drawing document containing 2D re-usable components. dress-up A graphical attribute of a 2D element.

F funnel

A representation of the dimensions which allows inserting the dimension value between the dimension symbols.

O object overrun

In the Drafting workbench, there are two kinds of object: activated and selected. The view frame of an activated object is displayed in red. A part of a dimension corresponding to the extended extension line.

P part

A 3D entity obtained by combining different features in the Part Design workbench.

R radius dimension A dimension applied to a circle, semi-circle or arc of a circle. roughness symbol A symbol that is used for defining a surface.

S sheet standard

A set of views. Several sheets may be created in the Drafting workbench. An international convention that is supported in the Drafting workbench: ANSI, ISO and JIS.

T template third angle title block

In the Drafting workbench, an object that is included in the document (for example, the title block). A projection method that allows projecting views from a part according to ISO/ANSI international standards. A frame which contains the title block.

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 GeometricElements

I IsDetail 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

,

,