Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Placing a Logo image in a titleblock

Status
Not open for further replies.

Lars26B

Aerospace
Aug 5, 2015
8
NL
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:
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:
  '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.
 
Replies continue below

Recommended for you

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.
 
Thanks Ferdo, I got it to work. Heres my code for others to use if they ever run into this issue:

Code:
 '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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top