×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Drafting; inserting "PAGE # OF #" and date printed in a footer
2

Drafting; inserting "PAGE # OF #" and date printed in a footer

Drafting; inserting "PAGE # OF #" and date printed in a footer

(OP)
Hello. I am a new user to CATIA V5 R20. I have a lot of experience with NX6 and Autodesk Inventor. CATIA has proven to be the most backwards, difficult software I have ever experienced.
That said, I have to plough on. I would like to know how I would insert "PAGE # OF #" and the print date at the bottom of a drawing. I would like it to be part of the background, somehow using parameters if possible. This will be a template for future use.

Please be clear and descriptive. I am familiar with VB, but not extensively. "Read the online help" won't help too much. I have tried and tried and can find nothing on this subject. (Online help often comes up fruitless)

Thank you,

Nick

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

Hey,

so first thing you need to make sure you are in the CATIA drafting window, make sure you all ready have your title block selected.
go in to the drop down window Edit,
select Sheet Background,
then dubble click on the area you want to edit if there is text all ready there, or add text by clicking on the text tool.
then once compleat exit the sheet background by going back to Edit and clicking on sheet view

that should do it
Ethan

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

(OP)
Ok, That will allow me to add text to a background- on a case by case basis. I wasn't clear enough (sorry).
What I am looking for is some sort variable or something that will print out the page number and the total number of pages in the document.

eg:
If I have a drawing that has one sheet, the text at the bottom will automatically show "page 1 of 1"

If I add two more sheets to said document, the text will say "page 1 of 3" on sheet one, "page 2 of 3" on page two and so on.

Any other software is capable of this. There has to be a way. It's got to be automatic. I am trying to eliminate redundant behaviour and quicken my workflow.

Nick

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

Hi,


[code CATScript]
' ==============================================================
' Purpose: CATScript will count sheets in an active CATDrawing and write names to them as "counter index/total number"
' Usage: 1 - A CATDrawing must be active
' 2 - Run macro
' Author: ferdo (Disclaimer: You use this code at your own risk)
' ===============================================================
Language="VBSCRIPT"
Sub CATMain()

'get the current date
Set objFSO = CreateObject("Scripting.FileSystemObject")
strNewName = objFSO.GetBaseName(objFile) & _
Year(Now) & "-" & _
Right("0" & Month(Now), 2) & "-" & _
Right("0" & Day(Now), 2) '& _

Set drawingDocument1 = CATIA.ActiveDocument
j=drawingDocument1.Sheets.count 'counting sheets numbers for total number

Dim oDoc As DrawingDocument
Dim oBackGround As DrawingView
Dim oFrontView As DrawingView
Dim oText As DrawingText

Set oDoc = CATIA.ActiveDocument
Set drawingSheets1 = drawingDocument1.Sheets

For i = 1 To drawingDocument1.Sheets.Count 'creating sheets index
Set oSheet = drawingDocument1.Sheets.Item(i)
oSheet.Activate 'activate corresponding index sheet to write on it

Set oBackGround = oDoc.Sheets.ActiveSheet.Views.Item("Background View") 'select Background View
Set oText = oBackGround.Texts.Add("Sheet" & i & " / " & "Sheet" & j, 0, 0) 'write Sheet index / Total number at position x=0 , y = 0

Next

End Sub
[/code]

Regards
Fernando

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

I hate when I cannot edit my own post...I forgot to add the date.....

[code CATScript]
' ==============================================================
' Purpose: CATScript will count sheets in an active CATDrawing and writee names to them as "counter index/total number"
' Usage: 1 - A CATDrawing must be active
' 2 - Run macro
' Author: ferdo (Disclaimer: You use this code at your own risk)
' ===============================================================
Language="VBSCRIPT"
Sub CATMain()

'get the current date
Set objFSO = CreateObject("Scripting.FileSystemObject")
strNewName = objFSO.GetBaseName(objFile) & _
Year(Now) & "-" & _
Right("0" & Month(Now), 2) & "-" & _
Right("0" & Day(Now), 2) '& _

Set drawingDocument1 = CATIA.ActiveDocument
j=drawingDocument1.Sheets.count ''counting sheets numbers for total number

Dim oDoc As DrawingDocument
Dim oBackGround As DrawingView
Dim oFrontView As DrawingView
Dim oText As DrawingText

Set oDoc = CATIA.ActiveDocument
Set drawingSheets1 = drawingDocument1.Sheets

For i = 1 To drawingDocument1.Sheets.Count 'creating sheets index
Set oSheet = drawingDocument1.Sheets.Item(i)
oSheet.Activate 'activate corresponding index sheet to write on it

Set oBackGround = oDoc.Sheets.ActiveSheet.Views.Item("Background View") 'select Background View
Set oText = oBackGround.Texts.Add("Sheet" & i & " / " & "Sheet" & j & " - " & strNewName, 0, 0) 'write Sheet index / Total number at position x=0 , y = 0

Next

End Sub
[/code]

Regards
Fernando

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

(OP)
Thank you thank you thank you!

That codes works perfectly. I tweaked it a bit for taste.
Fernando, would you be able to help me out with setting the font type and size as well as the text objects' anchor point (via code)?


I might wanna build other macros for other stuff- I'm re-learning the syntax after years of being away.

Cheers,

Nick

Light structural commercial aircraft parts
APM Consortium Inc.
Cambridge Ontario, Canada

RE: Drafting; inserting "PAGE # OF #" and date printed in a footer

Some details for what you want? Meaning font type, size (or if you want to input them from an input box)...

Anchor point...hmmm...I never thought of that, should be possible...or you want to change the text position maybe (not x = o , y = 0) ?

If you want to find more about CATIA programming check FAQ of this forum.

Regards
Fernando

https://picasaweb.google.com/102257836106335725208

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources