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:
Gives object not found error for "CATIA.ActiveDocument.Sheets.ActiveSheet"
And this:
which already errors when 'How to init the dialog and create main objects
'-------------------------------------------------------------------------------
Set Selection1 = CATIA.ActiveDocument.Selection
Any Help would be greatly appreciated.
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
http://www.eng-tips.com/viewthread.cfm?qid=399139
RE: Placing a Logo image in a titleblock
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
Programming in v6 is different then in v5....you need to read the documentation...
For example in v5 you have CATIA.ActiveDocument , in v6 you have CATIA.ActiveEditor ....
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Placing a Logo image in a titleblock
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