Hi All,
I am currently trying to create annotations in CATIA V5 via a script - I have managed to do normal annotations see script below however I am trying to get the annotation which is created to be parallel to screen?
There is a button in the FTA toolbar which does this - however I need it in script.
Anyone got any ideas?
(I've tried to record a macro however it doesn't pick up annotation settings/properties)
Thanks
Script so far:
set opart=GetPartFromObject(oParam1)
Set part1 = opart
Set annotationSets1 = part1.AnnotationSets
Set annotationSet1 = annotationSets1.Add("ISO_3D")
Set userSurfaces1 = part1.UserSurfaces
Set userSurface1 = userSurfaces1.Generate(oPoint)
'Above is the point
Set viewFactory1 = annotationSet1.TPSViewFactory
Set view1 =viewFactory1.CreateView(oPlane,1)
Set annotationFactory1 = annotationSet1.AnnotationFactory
Set annotation1 = annotationFactory1.CreateEvoluateText(userSurface1,50, 50, 50, True)
annotation1.text.Get2dAnnot.ActivateFrame catRectangle
annotation1.text.Get2dAnnot.FrameType = catRectangle
annotation1.Text.Get2dAnnot.SetFontName 0, 0, "Arial (TrueType)"
annotation1.Text.Get2dAnnot.SetFontSize 0, 0, CDbl("5.0")
annotation1.TransfertToView view1
oList.valuelist.Add annotation1.Text
Dim LResult1 As Long
LResult1 = Len (oParam1.Name) +4
annotation1.Text.Text = oParam1.Name & " = "
annotation1.Text.Get2dAnnot.InsertVariable LResult1 , 0, oParam1
annotation1.ModifyVisu
annotation1.Name = oParam1.Name
Set annotationSet1 = annotationSets1.Item("Annotation Set.1")
Part1.Update
End Sub
I am currently trying to create annotations in CATIA V5 via a script - I have managed to do normal annotations see script below however I am trying to get the annotation which is created to be parallel to screen?
There is a button in the FTA toolbar which does this - however I need it in script.
Anyone got any ideas?
(I've tried to record a macro however it doesn't pick up annotation settings/properties)
Thanks
Script so far:
set opart=GetPartFromObject(oParam1)
Set part1 = opart
Set annotationSets1 = part1.AnnotationSets
Set annotationSet1 = annotationSets1.Add("ISO_3D")
Set userSurfaces1 = part1.UserSurfaces
Set userSurface1 = userSurfaces1.Generate(oPoint)
'Above is the point
Set viewFactory1 = annotationSet1.TPSViewFactory
Set view1 =viewFactory1.CreateView(oPlane,1)
Set annotationFactory1 = annotationSet1.AnnotationFactory
Set annotation1 = annotationFactory1.CreateEvoluateText(userSurface1,50, 50, 50, True)
annotation1.text.Get2dAnnot.ActivateFrame catRectangle
annotation1.text.Get2dAnnot.FrameType = catRectangle
annotation1.Text.Get2dAnnot.SetFontName 0, 0, "Arial (TrueType)"
annotation1.Text.Get2dAnnot.SetFontSize 0, 0, CDbl("5.0")
annotation1.TransfertToView view1
oList.valuelist.Add annotation1.Text
Dim LResult1 As Long
LResult1 = Len (oParam1.Name) +4
annotation1.Text.Text = oParam1.Name & " = "
annotation1.Text.Get2dAnnot.InsertVariable LResult1 , 0, oParam1
annotation1.ModifyVisu
annotation1.Name = oParam1.Name
Set annotationSet1 = annotationSets1.Item("Annotation Set.1")
Part1.Update
End Sub