×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Print Annotations macro

Print Annotations macro

Print Annotations macro

(OP)
Hello. I created a macro that exports all 3d annotation data to a Power Point. This macro only runs when working from a single CATPart. I am trying to modify my code to allow the user to have a CATProduct open, select the part to get the data, then it will run as usual and export the annotation data for that selected part.


Sub CATMain()
Dim productDocument1 As Document
Dim product1 As Product
Dim products1 As Products

Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set products1 = product1.Products

Dim sStatus As String

Set Selection = productDocument1.Selection

ReDim sFilter(0)

Msgbox "Please select a part."

sFilter(0) = "Part"
sStatus = Selection.SelectElement2(sFilter, "Select a part", False)


Dim partDoc1 As PartDocument
Set partDoc1=selection.Item(1).value

namebody=partDoc1.name

Dim part1 as Part
set part1 = partDoc1

Dim myProduct As Product
Set myProduct = productDocument1.GetItem(part1.Name)

Dim partName, RealPartNumber,Defy As String

partName=myProduct.name

'====================================
Dim oAnnotationSets As AnnotationSets
Set oAnnotationSets= partDocument1.Product.GetTechnologicalObject("CATAnnotationSets")

The program stops working at this last line. Any ideas why?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources