CATIA V5 Drafting Workbench Tutorial. This tutorial shows how to create drawing using CATIA V5 drafting workbench. Topics covered in this tutorial are: - How to insert title block - How to insert desired views - How to create exploded view in assembly - How to create drawing for exploded view - How to insert balloons & bill of material.
![]() Modify Text in Title Blocks on every CatDrawing that is open.Modify Text in Title Blocks on every CatDrawing that is open.This is how the Title Blocks looks (every CatDrawing the same.) Now what i have to do is to modify Text1 , Text2 , Text3 ,Text4 and Text 5 on every page. I am new to catia , and VB too. I have tried to create a macro that asks me ..what new text should be and type them in the text boxes but i have failed. For example: New project: Text1 = a1 Text2 = b1 Text3 = c1 Text4 = d1 Text5 = e1 After few days update is needed and after some changes : Text1 must become = a2 Text2 must become = b2 and so on. Sometimes i have to do this for 2 or 3 sheets and i do it..manually on each page. But other times i have to do this for 100 or more.. The Title Blocks are allways in SheetBackground , and it's custom made (it't not one from Catia title blocks library) If needed , i can send you a CatDrawing sheet, just ask. Hope i will find here some help. Best regards , and thank you for your time.
CATIA gives its users the possibility to use a VBscript macro to generate Title Blocks automatically adjusted to any drawing format. A few macros are provided by default. Users can customize frames and title blocks by either modifying one the default macros or by creating their own macros.
The default macros are stored in the install_root/intel_a/VBScript/FrameTitleBlock directory and have a
.CATScript extension. We can specify another location in the Tools > Options > Mechanical Design > Drafting > Layout tab.
A macro is comprised of
Sub procedures and functions. When the Insert Frame and Title Block dialog box is displayed, it will show a set of actions predefined in the macro. Those actions are Sub procedures prefixed using CATDrw_ .
For instance, the Creation action looks like this:
Contents
CATInit()
When creating the Title Block, the first thing to do is activate the sheet and the view calling the
CATInit() function. This function will initialize the dialog and create main objects. A simplified version of this function can be a Sub procedure with just the following:
CATCreateReference()
The next step is to create the frame’s overall dimensions and reference point. The default offset value is of 10 mm, while for sheets bigger than a DIN A2, this values grows to 20 mm. The reference point will tell other title block macros that there’s already a title block created. The reference text will also be used to check if the macro can make some actions like delete, update or resize on the existing Title Block.
CATFrame()
The frame —which is composed of a border, some centring marks, letters and a ruler— will enclose the drafts that we create from our products and assemblies.
The
CATFrameStandard Sub procedure defines the length between two horizontal/vertical marks Cst_ , computes the number of centring marks Nb_CM_ , and computes the maximum Ruler lenght. The spacing values are divisors of the ISO A series paper size standard.
Once some basic lengths have been defined, the
CATFrameBorder Sub procedure draws the border while the CATCentringMark Sub procedure generates the centring marks and the CATFrameText Sub procedure writes the numbers and letters —starting from Chr(65), corresponding to capital letter A— in the frame.
The
CATFrameRuler Sub procedure creates a small ruler at the bottom of the document to use as a reference for sizes. The bigger marks in the ruler are spaced at intervals of 5 cm while the smaller marks are spaced at intervals of 1 cm.
CATCreateTitleBlockFrame()
This is one of the most interesting
Sub procedures in the Title Block’s creation process in terms of customization. In this procedure we create all the blocks that will contain our own information and information about the product such as title, scale, drawer, supervisor, weight, part number, etc.
![]()
The different blocks are 2D lines created using the
CreateLine function, which accepts a set of coordinates —line start and line end— and the name of the line.
![]()
The columns and rows have been defined assisted by constants
Col and Row taking the lower-right corner of the frame as the reference point:
CATTitleBlockText()
Now that we have the blocks, it’s time to fill them with content. The
CATTitleBlockText Sub procedure will do most of the job for us. This procedure we can use to define our own names to display, like the name of the company who owns the drawing. It’s also where we can change the displayed texts in case we want the title block in Spanish or German.
The texts are placed inside the blocks with the
CreateTextAF function which gets as arguments a string with the caption we want to write, the coordinates of the anchor position, and the font size.
Examples
I took the
Drawing_TitleBlock_Sample2.CATScript file and edited some lines in the CATTitleBlockText Sub procedure to display the name of this blog and my own name as the drawer of the draft.
Landscape A3, Spanish.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |