Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Set Font size and color in drawing table

Status
Not open for further replies.

sri91

Mechanical
Aug 29, 2019
43
Hi Everyone,
I am trying to set the parameters 'Font size' and 'color' in the texts of a drawing table.
I am using the below code.
What ever the text size I give, it is taking zero(0).

Can you please suggest me.


drwTbls(drwTblNum).SetCellString rowCount, 2, wrksht.Cells(j, 1)
drwTbls(drwTblNum).SetCellAlignment rowCount, 2, CatTableMiddleCenter
Set currText = drwTbls(drwTblNum).GetCellObject(rowCount, 2)
currText.SetParameterOnSubString catFontSize, 0, 0, 0.075
Dim txtProps1 As DrawingTextProperties
Set txtProps1 = currText.TextProperties
currText.SetFontSize 0, 0, 0.095
currText.TextProperties.Color = vbGreen


Thanks in advance
SURYASRI
 
Replies continue below

Recommended for you

Hi Little,
Even though I have given the update, it is not setting the font size.
Still it is changing to zero only.
Please help.

drwTbls(drwTblNum).SetCellString rowCount, 5, Right(wrksht.Cells(j, 2), 5)
drwTbls(drwTblNum).SetCellAlignment rowCount, 5, CatTableMiddleCenter
Set currText = drwTbls(drwTblNum).GetCellObject(rowCount, 3)
Dim ifs As Double
ifs = 0.075
currText.SetFontSize 0, 0, ifs
colo = currText.TextProperties.Color
currText.TextProperties.Update

Thanks
SURYASRI
 
Oh, as far as I remember you have to specify font not by size, but by it's index in dropdown menu as displayed in the UI: 1, 2, 3 etc.
 
Hi Little,
I am getting error for the below code.
 
Hi Little,
I am getting error for the below code.

currText.TextProperties.Font 0, 0, 0.095

In the UI in catia text properties are in inches like 0.095, 0.075, 1.2 inch etc...
Please check the attached picture for the UI.
Please do the needful help.

Thanks
SURYASRI
 
 https://files.engineering.com/getfile.aspx?folder=3661a123-461a-4422-99e4-499801cf70b4&file=Capture.JPG
Status
Not open for further replies.

Part and Inventory Search

Sponsor