goodmorning everybody
i want to get the plane coordinates of a TPSView in CATIA vba so i can compere those coordinates with the annotations in the product, here is the code
Dim vwTPSView As DrawingView
Dim dX As Double
Dim dY As Double
Dim dViewPlaneX1 As Double
Dim dViewPlaneY1 As Double
Dim dViewPlaneZ1 As Double
Dim dViewPlaneX2 As Double
Dim dViewPlaneY2 As Double
Dim dViewPlaneZ2 As Double
Dim anAnnotation As Annotation
Dim annotationSet1 As AnnotationSet
Sub CATMain()
Set partDocument1 = CATIA.ActiveDocument
Set selection1 = partDocument1.Selection
Set product1 = partDocument1.Product
Set products1 = product1.Products
Set productDocument1 = CATIA.ActiveDocument
Set anAnnotation = selection1.Item(1).Value
Set AnnotationSets = productDocument1.Product.GetTechnologicalObject("CATAnnotationSets")
nanot = AnnotationSets.Count
For i = 1 To nanot
Set annotationSet1 = AnnotationSets.Item(i)
Set TPSView1 = annotationSet1.TPSViews.Item(1)
anAnnotation.TransfertToView (TPSView1)
Set txtAnnotation = anAnnotation.Text.Get2dAnnot()
Set drwleaders = anAnnotation.Text.Get2dAnnot.Leaders
Set vwTPSView = txtAnnotation.Parent.Parent
vwTPSView.GenerativeBehavior.GetProjectionPlane dViewPlaneX1, dViewPlaneY1, dViewPlaneZ1, dViewPlaneX2, dViewPlaneY2, dViewPlaneZ2 'COORDENADAS DEL PLANO DE TRABAJO DE LA NOTA
texto = anAnnotation.Text.Text 'TEXTO DE LA NOTA
Set txtAnnotation = anAnnotation.Text.Get2dAnnot()
drwleaders.Item(1).GetPoint 1, ox, oy
Next
i have the proyection plane for the annotations but i donknow how to get those coordinates for the TPSView.
i hope you can help me out with this
thank you
i want to get the plane coordinates of a TPSView in CATIA vba so i can compere those coordinates with the annotations in the product, here is the code
Dim vwTPSView As DrawingView
Dim dX As Double
Dim dY As Double
Dim dViewPlaneX1 As Double
Dim dViewPlaneY1 As Double
Dim dViewPlaneZ1 As Double
Dim dViewPlaneX2 As Double
Dim dViewPlaneY2 As Double
Dim dViewPlaneZ2 As Double
Dim anAnnotation As Annotation
Dim annotationSet1 As AnnotationSet
Sub CATMain()
Set partDocument1 = CATIA.ActiveDocument
Set selection1 = partDocument1.Selection
Set product1 = partDocument1.Product
Set products1 = product1.Products
Set productDocument1 = CATIA.ActiveDocument
Set anAnnotation = selection1.Item(1).Value
Set AnnotationSets = productDocument1.Product.GetTechnologicalObject("CATAnnotationSets")
nanot = AnnotationSets.Count
For i = 1 To nanot
Set annotationSet1 = AnnotationSets.Item(i)
Set TPSView1 = annotationSet1.TPSViews.Item(1)
anAnnotation.TransfertToView (TPSView1)
Set txtAnnotation = anAnnotation.Text.Get2dAnnot()
Set drwleaders = anAnnotation.Text.Get2dAnnot.Leaders
Set vwTPSView = txtAnnotation.Parent.Parent
vwTPSView.GenerativeBehavior.GetProjectionPlane dViewPlaneX1, dViewPlaneY1, dViewPlaneZ1, dViewPlaneX2, dViewPlaneY2, dViewPlaneZ2 'COORDENADAS DEL PLANO DE TRABAJO DE LA NOTA
texto = anAnnotation.Text.Text 'TEXTO DE LA NOTA
Set txtAnnotation = anAnnotation.Text.Get2dAnnot()
drwleaders.Item(1).GetPoint 1, ox, oy
Next
i have the proyection plane for the annotations but i donknow how to get those coordinates for the TPSView.
i hope you can help me out with this
thank you