Change macro to link the title block on name of material
Change macro to link the title block on name of material
(OP)
Hi all,
I try to change the default macro of Catia to link the test on title block with the property of catpart.
I can not link the name of the material of catpart with a text.
I copy a part of code:
*********************
If ProductDrawn <> Nothing Then
Texts.GetItem("TitleBlock_Text_EnoviaV5_Effectivity").Text = ProductDrawn.PartNumber
Texts.GetItem("TitleBlock_Text_Title_1").Text = ProductDrawn.Definition
Texts.GetItem("TitleBlock_Text_Title_2").Text = ProductDrawn.Nomenclature
Dim ProductAnalysis As Analyze
Set ProductAnalysis = ProductDrawn.Analyze
Texts.GetItem("TitleBlock_Text_Weight_1").Text = FormatNumber(ProductAnalysis.Mass,2)
End If
***********************
Can you help me to insert on "TitleBlock_Text_Title_2" the name of material? please
Tahnks in advance
I try to change the default macro of Catia to link the test on title block with the property of catpart.
I can not link the name of the material of catpart with a text.
I copy a part of code:
*********************
If ProductDrawn <> Nothing Then
Texts.GetItem("TitleBlock_Text_EnoviaV5_Effectivity").Text = ProductDrawn.PartNumber
Texts.GetItem("TitleBlock_Text_Title_1").Text = ProductDrawn.Definition
Texts.GetItem("TitleBlock_Text_Title_2").Text = ProductDrawn.Nomenclature
Dim ProductAnalysis As Analyze
Set ProductAnalysis = ProductDrawn.Analyze
Texts.GetItem("TitleBlock_Text_Weight_1").Text = FormatNumber(ProductAnalysis.Mass,2)
End If
***********************
Can you help me to insert on "TitleBlock_Text_Title_2" the name of material? please
Tahnks in advance





RE: Change macro to link the title block on name of material
Try to use Insert variable option of text as below...
Set oPartNumber = Part.Paramters.GetItem( "Part Number" ) ' Root Part Name
Set oTextToLinkPartNumber = Texts.GetItem("TitleBlock_Text_EnoviaV5_Effectivity")
oTextToLinkPartNumber.InsertVariable 1, Len(oTextToLinkPartNumber.Text), oPartNumber
Regards,
Maddy
The willingness to share knowledge does not make one charitable; it makes one self-reliant to know more.
Modified - Courtesy of Robert Brault
RE: Change macro to link the title block on name of material
now I've solved the problem.
Bye