I have small problem, does anyone know how to change position of existing dimensions and Notes in Part/Product using short macro.
I will shortly describe what I want to do and what kind of problem I have.
- I have simple model (let say rectangle)
- Inside this model I have dimensions and annotations created in FTA.
- Next step is to drastically change position of this model (base model in point 0,0,0 and I want tochange it position to 150,10000,80 + rotation)
- during this change some dimensions and annotations (Theirs position in 3D) are not fully following after geometry.
Because of that I would like to have simple macro to create new position of my dimensions and annotations after part update.
I have performed some simple tests code bellow
What I have noticed, when I set new position of the text:
- Theoretically text change position but in 3D it stays in old position.
When edit my text by double click on it and then click OK my text translates to new position which was set in macro earlier. The same situation is when I would like to change frame of the text or content (I had AAA and I would like to have BBB), it's changes only when I open Text editor.
Set part1 = CATIA.ActiveDocument Set Selection = part1.Selection Set VisPropertySet = Selection.VisProperties Selection.Search ("name='Text.1',all") ' get selected annotation here Dim anAnnotation As Annotation Set anAnnotation = CATIA.ActiveDocument.Selection.Item(1).Value ' get annotation on the DrawingText interface Dim txtAnnotation As DrawingText Set txtAnnotation = anAnnotation.Text.Get2dAnnot() ' get TPS view that contains annotation on the DrawingView interface Dim vwTPSView As DrawingView Set vwTPSView = txtAnnotation.Parent.Parent ' get coordinates on a view Dim dX ' as Double txtAnnotation.X = 0 txtAnnotation.Y = 30 txtAnnotation.FrameType = catEllipse part1.Update End Sub