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!

Creat new parametre for CATIA Drafting TitleBlo macro to link the title block such: name of material 1

Status
Not open for further replies.

3DPLM

Industrial
Nov 13, 2015
8
thread560-347233
Hi
I read post old.
edite surce code :

Set oMaterial = Part.Paramters.GetItem( "Material" ) ' Root Material
Set oTextToLinkMaterial = Texts.GetItem("TitleBlock_Text_Material_1")
oTextToLinkMaterial.InsertVariable 1, Len(oTextToLinkMaterial.Text), oMaterial

But dont work!
Please helpe me for edite
 
Replies continue below

Recommended for you

do you set material using apply material or thru additional part properties?
 
Yes
Where is copy it code?

Sub CATTitleBlockText()
...
Sub CATLinks()
...

and where is need edite "Drawing_Titleblock_Sample2.CATScript"?
very thanks
 
this is how to read part properties

Code:
If ProductDrawn <> Nothing Then
    Texts.GetItem("TitleBlock_Text_EnoviaV5_Effectivity").Text = ProductDrawn.PartNumber
    Texts.GetItem("TitleBlock_Text_Title_1").Text  = ProductDrawn.Revision
    Texts.GetItem("TitleBlock_Text_Title_2").Text  = ProductDrawn.DescriptionRef
    Texts.GetItem("TitleBlock_Text_Title_3").Text  = ProductDrawn.Definition
    'Texts.GetItem("TitleBlock_Text_Title_4").Text  = ProductDrawn.Nomenclature
    Texts.GetItem("TitleBlock_Text_Title_5").Text  = ProductDrawn.TITLE.ValueAsString
    Texts.GetItem("TitleBlock_Text_Title_FILE_FOR_MANUFACTURING").Text = ProductDrawn.ReferenceProduct.UserRefProperties.Item("FILE FOR MANUFACTURING").ValueAsString
    Texts.GetItem("TitleBlock_Text_Title_7").Text  = ProductDrawn.Parent.Name
    Texts.GetItem("TitleBlock_Text_Title_8").Text = ProductDrawn.ReferenceProduct.UserRefProperties.Item("DRAWING No.").ValueAsString
    MTRL =ProductDrawn.ReferenceProduct.UserRefProperties.Item("MATERIAL").ValueAsString
    Texts.GetItem("TitleBlock_Text_Title_9").Text = ProductDrawn.ReferenceProduct.UserRefProperties.Item("MATERIAL").ValueAsString
    DrwSheets.Item(i).Views.Item(2).Texts.GetItem("TitleBlock_Text_Sheet_1_all").Text = CStr(nbSheet)
    Dim ProductAnalysis As Analyze
    Set ProductAnalysis = ProductDrawn.Analyze
    Texts.GetItem("TitleBlock_Text_Weight_1").Text = FormatNumber(ProductAnalysis.Mass,2)
  End If
 
Hi
Very thanks
But no runing!!!!
My file is attach.
Please help me for
1- insert material properties in TB
2- insert company logo in TB

I edit "Drawing_Titleblock_Sample2.CATScript" for material & Logo picture.but don't work.
 
 http://files.engineering.com/getfile.aspx?folder=7553a3f8-f23d-42e4-83ab-a14e1316921e&file=Drawing_Titleblock_Sample2_V5R18_V1.rar
above i posted the example how to get added properties. we set material in additional part properties

a picture you can add like this
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.ActiveDocument.Sheets.ActiveSheet
 Dim MyView As DrawingView
 Set MyView = MySheet.Views.ActiveView
 Dim MyDrawingPicture1 As DrawingPicture
 Set MyDrawingPicture1 = MyView.Pictures.Add("C:\Program Files\Dassault Systemes\B24\win_b64\VBScript\FrameTitleBlock\TitleBlock_Picture_LOGOKanfit.bmp", 275., 29.)
 
Hi
Thank you very much
Your code for Picture are very good and used.
I set material using apply material.
But your code for parameter that created in Part or Product properties.
I want insert name of material that material apply in part or product.
Pls help me



 
Hi JeniaL
I apply material for patr.
Please help me for insert Material name in TitleBlock .
Best Regards
 
Hello
: Part
Best Regards
I need inset material name in titleblock that Apply to Part.
such as Part name &...
above code for insert parameter name "MATERIAL" that created new parameter and type by user.
Best Regards
 
let's make it clear.
firs of all it's not such as part name/part number. part name/part number is a part property and not a parameter.
as i understand you want to assign material to part and then titleblock macro will get this parameter.
i don't really remember how to get parameters. i'll ask some people at work.
maybe guys on this board will help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor