×
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

Placing a Logo image in a titleblock

Placing a Logo image in a titleblock

Placing a Logo image in a titleblock

(OP)
Hey All,

I've been editing the CATIA macro which controls the titleblock inside the drafting enviroment. Since macro recording is not working I'm trying to figure out how to add a logo into the titleblock.

What is use: Catia V6 2013x
Out of the box titleblock script (can be provided if needed)

I have tried following scripts:

CODE --> catia

Dim MySheet As DrawingSheet
 Set MySheet = CATIA.ActiveDocument.Sheets.ActiveSheet
 Dim MyView As DrawingView
 Set MyView = MySheet.Views.ActiveView
 Dim MyDrawingPicture1 As DrawingPicture
 Set MyDrawingPicture1 = MyView.Pictures.Add("C:\tmp\ball.bmp", 100., 50.) 

Gives object not found error for "CATIA.ActiveDocument.Sheets.ActiveSheet"


And this:

CODE --> Catia

'Insert company logo
  Set objPicture = Pictures.Add("c:\Drawing_Formats\logo.bmp", GetOH() + Col(3)+ 0.75, GetOV()+ Row(2) +.75 )
  objPicture.Width = objPicture.Width / 5.75
  objPicture.Height = objPicture.Height / 5.75
  objPicture.Name =   "TitleBlock_Text_Logo"
  Set objPicture = Nothing 

which already errors when 'How to init the dialog and create main objects
'-------------------------------------------------------------------------------
Set Selection1 = CATIA.ActiveDocument.Selection

Any Help would be greatly appreciated.

RE: Placing a Logo image in a titleblock

(OP)
Dear Jenial,

I have tried the script suggested in the thread you posted (see first section of my code) It however gives me an error of object not found on the CATIA.ActiveDocument.Sheets.ActiveSheet.

RE: Placing a Logo image in a titleblock

(OP)
Thanks Ferdo, I got it to work. Heres my code for others to use if they ever run into this issue:

CODE --> CatiaV6

'The following example inserts a drawing picture from a given picture file path The MyView is the active view in the active drawing sheet 
 Dim MySheet As DrawingSheet
 Set MySheet = CATIA.ActiveEditor.ActiveObject.Sheets.ActiveSheet
 Dim MyView As DrawingView
 Set MyView = MySheet.Views.ActiveView
 Dim MyDrawingPicture1 As DrawingPicture
 Set MyDrawingPicture1 = MyView.Pictures.Add("C:\logo.bmp", 220., 33.) 

These coordinates put the logo at the right spot for my titleblock

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