Hi Everyone!
This is my first post here, so nice to meet you finally
In my company, we have standard for creating 3D annotations. One of rules for this standard states, that if someone clicks on annotation (for ex. text with leader), it should mark whole body to which the annotation applies.
So we should get something like this:

The problem is, that if we go to Geometry Connection Management, and try to add whole surface (Volume Extrude.1) instead of a face of this surface, Catia will automatically select random surface instead:

And we end up with single face marked in 3D viewer instead of whole body.
Maybe workaround would be to add all faces to the User Surface, but this is time consuming especially when surface is complex.
So the workaround for this situation is to replace face of this element with geometrical set:

I tried to recreate this using VBA:
But I get an error:

Do you have an idea how to make UserSurface out of HybridBody? Or is such operation not possible with Automation API, but only with CAA?
This is my first post here, so nice to meet you finally

In my company, we have standard for creating 3D annotations. One of rules for this standard states, that if someone clicks on annotation (for ex. text with leader), it should mark whole body to which the annotation applies.
So we should get something like this:

The problem is, that if we go to Geometry Connection Management, and try to add whole surface (Volume Extrude.1) instead of a face of this surface, Catia will automatically select random surface instead:

And we end up with single face marked in 3D viewer instead of whole body.
Maybe workaround would be to add all faces to the User Surface, but this is time consuming especially when surface is complex.
So the workaround for this situation is to replace face of this element with geometrical set:

I tried to recreate this using VBA:
Rich (BB code):
Sub CATMain()
Dim editor1 As Editor
Set editor1 = CATIA.ActiveEditor
Dim part1 As part
Set part1 = editor1.ActiveObject
Dim annSet As AnnotationSet
Set annSet = part1.AnnotationSets.GetItem("Annotation Set.1")
Dim geoset As hybridBody
Set geoset = part1.HybridBodies.Item(1)
Dim geosetRef As Reference
Set geosetRef = part1.CreateReferenceFromObject(geoset)
Dim uSurfs As UserSurfaces
Set uSurfs = part1.UserSurfaces
Dim uSurf As UserSurface
Set uSurf = uSurfs.Generate(part1.CreateReferenceFromObject(geoset))
Debug.Print ""
End Sub
But I get an error:

Do you have an idea how to make UserSurface out of HybridBody? Or is such operation not possible with Automation API, but only with CAA?