I am able to create FT&A 3D Annotations in a macro, but how do I do things like change font size, add frames, change text type, etc?
3D annotations are basically 2D texts based on 3D plane or surface. To retrieve underlying text interface you call:
Dim drwText as DrawingText
Set drwText = oAnnotation.Text().Get2dAnnot()
Interesting...would I then use SetFontSize like Ferdo used in this post? http://www.coe.org/p/fo/st/thread=28300
Any idea on how to set the rectangular frame?
You can call ActivateFrame or SetFontName right on retrieved drwText and observe propetries to change as expected.
BUT! In order to visualize changes you must somehow make annotation graphics to update. I struggled a lot with this in the past and come with solution based on reactivating annotation set that contains annotation being modified:
' turn off
CATIA.StartCommand "CATTPSSetVisuHdr" ' "Annotation set switch on/switch off" command
' turn on
Thank you very much for your help, this works very well! I used a trick to resize the active window to force the refresh. Here is a generic example of how I applied this.
Dim oAnnotation As Annotation
Dim oText As DrawingText
oAnnotation.Text.Text = sPartName & vbCrLf & sPartNumber
& vbCrLf & sRevision
oAnnotation.Name = "Part_Info"
k = Len(sSectionName) + Len(sSectionPartName) + Len(sLocation) + 2 'add 2 for 2 vbCrLf
Set oText = oAnnotation.Text.Get2dAnnot
oText.SetFontSize 1, k, 10 'First character to apply size, last character to apply size, size
'Resize window to force refresh
iWidth = CATIA.ActiveWindow.Width
CATIA.ActiveWindow.Width = iWidth - 2
CATIA.ActiveWindow.Width = iWidth