Message 1 of 4
View label and text box

Not applicable
05-28-2010
09:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to create a view label and a text box using the same string.
The sheet contains a number of parts, the view label is correct but the text box always uses the properties of the first base view on the sheet, is it possable to get the text box to use the same view properties as the view label?
Here is the sample code:
sTextPartNumber = " "
sTextDescription = " "
sTextQty = " Qty " & GlobalQuantity
sTextMaterial = " "
sTextThick = FindTheThickness(Global_Thick)
Dim osketch As DrawingSketch
sText = "" & sTextPartNumber & "," & sTextQty & ",
" & sTextDescription & ",
" & sTextMaterial & ", Thick " & sTextThick & "," & " "
Set osketch = oDrawDoc.ActiveSheet.Sketches.Add
osketch.Edit
Dim oTextBox As TextBox
Set oTextBox = osketch.TextBoxes.AddFitted(oTransGeom.CreatePoint2d(oDrawView.Center.X, oDrawView.Center.Y - (ViewHeight / 2) - 1), sText)
oDrawView.Label.Position = oTransGeom.CreatePoint2d(oDrawView.Center.X, oDrawView.Center.Y - (ViewHeight / 2) - 1)
oDrawView.ShowLabel = True
oDrawView.Label.FormattedText = sText
The sheet contains a number of parts, the view label is correct but the text box always uses the properties of the first base view on the sheet, is it possable to get the text box to use the same view properties as the view label?
Here is the sample code:
sTextPartNumber = "
sTextDescription = "
sTextQty = " Qty " & GlobalQuantity
sTextMaterial = "
sTextThick = FindTheThickness(Global_Thick)
Dim osketch As DrawingSketch
sText = "
" & sTextDescription & ",
" & sTextMaterial & ", Thick " & sTextThick & "," & "
Set osketch = oDrawDoc.ActiveSheet.Sketches.Add
osketch.Edit
Dim oTextBox As TextBox
Set oTextBox = osketch.TextBoxes.AddFitted(oTransGeom.CreatePoint2d(oDrawView.Center.X, oDrawView.Center.Y - (ViewHeight / 2) - 1), sText)
oDrawView.Label.Position = oTransGeom.CreatePoint2d(oDrawView.Center.X, oDrawView.Center.Y - (ViewHeight / 2) - 1)
oDrawView.ShowLabel = True
oDrawView.Label.FormattedText = sText