Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia V5 Title Block Macro

Status
Not open for further replies.

Csaba Solyom

Mechanical
Sep 22, 2016
14
Hello,

I started working on creating a custom Title Block for our company (so far have been using a background template, manually filling out the fields).
An example drawing of ours can be found in the attachement.
There are a couple of things I don't know how to accomplish:

1. Inserting the roughness symbol, and value with the macro.
2. Inserting the corner transition symbols, according to ISO 13715:2000 (~DIN 6784). Alternatively, inserting a picture with that.
3. Drawing cirlces, for the ISO First Angle Projection symbol, or again, inserting a picture instead.
4. There is a boxed Technical Conditions list just left of the title block. How do I create boxed/framed text?

Thank you very much for any help you can offer.
 
 http://files.engineering.com/getfile.aspx?folder=c45a216f-82e7-4376-88ce-b8b2a14f8ec6&file=1731-01.1_000-R00_(1_of_8).pdf
Replies continue below

Recommended for you

Hi,

1. Not possible in macro, as far as I know there is no API. Instead you can draw that symbol or use a 2DComponent (and insert with a macro).
2. I didn't check but I expect to be same situation like position 1.
3. Can be done in macro, almost everyone is doing this.
4. You can insert a text and then put a frame on it.

Please check the forum, there are few examples, even in the latest threads. I saw the drawing, if you need more help you can find me on LinkedIn, nickname is there [smile] (or you can post here your code and we will try to help you more).

Regards
Fernando

- Romania
- EU
 
I attached the current version, with functional code for most of the stuff I want in it - except for the revision algorithm, which is not quite complete.

About the tips you gave me:

1&2. I'm not sure what a 2DComponent is in this context. I could just draw both things with Line2D and text (lineweight question at 3. would apply here as well, to make the look proper).
3. I drew the geometry of the symbol, what remains is to draw the center lines.
- I checked in the V5Automation document, and learned about the SetRealWeight and SetRealLineType methods. What I don't know is how to reference a specific line I have drawn. You can find the relevant code starting from Line583​
4. Putting a frame, as in drawing lines, around the text is not what I'm looking for, as that text changes frequently, and the frame needs to autoresize according to the text (in the original I used the "frame" command from the Text Properties toolbar. Can that same thing be applies via macro (in a way that doesn't require me actually coding the algorithm to resize the frame)? If not, the engineer making the drw has to check and update that textfield anyway, applying the frame manually is an acceptable trade-off to having an automated title block.

Thank you.
 
 http://files.engineering.com/getfile.aspx?folder=3d2b97f7-e497-4a5e-874e-a6e3ea84ef49&file=AC_Title_Block_R00.CATScript
1. You can draw roughness symbol at desired location. Pretty simple.
2. the same as 1.
3. As Ferdo said. Example:
Code:
Set CircleOD = Fact.CreateClosedCircle(183.35, 11.325, 1.715)
    CircleOD.Name = "ProjCirc1"
    MyCATIA.ActiveDocument.Selection.Add CircleOD
    Set visProperties1 = MyCATIA.ActiveDocument.Selection.VisProperties
    visProperties1.SetRealWidth 2, 0.25
4. As ferdo said or create a text add then craete a frame by drawing lines.
If you don't change text all the time then you can use frame created from lines, but if it's different all the time then put a frame over text using text properties.
 
1&2. I would draw them as both of you suggested.
Just in case, check this link .
3. I'm also doing what JeniaL suggested.
4. I was referring about what JeniaL explained much better then in me in the last part of the point 4 (also you can find in forum examples about frame over text, most of them about circle or locked circle).

Regards
Fernando

- Romania
- EU
 
I managed to get most of what I wanted done in a neat way... so far, so good. Also found the relevant methods for setting a rectangle frame on a text element.

Now that the titleblock itself is pretty much as I would like it, I have another element that I want to automate, and would appreciate the help:
Automatically renaming the sheets in the .catdrawing file, based on the same information that goes into the title block. We make one .catdrawing file for each subassembly (assembly drawing + technical drawing of components, each on a separate sheet) of the project. The naming convention of the sheets is as follows:
Properties\Nomenclature - Properties\Revision - Properties\DescriptionRef, resulting in something like 042-R01 Base Plate for instance.

Filling this info out manually leads to infrequent but annoying discrepancies, and all the fun and confusion that brings with it. Can this renaming also be automated via macros?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor