Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SWITCH CATPART 3D ANNOTATION ON AND OFF

Status
Not open for further replies.

Thosnow

Aerospace
Feb 23, 2017
68
CA
Hello Ferdo and Others,

Do you know how (or at least which CATIA function) to

1) Turn/Switch CATPART 3D ANNOTATION on and off with a VBA macro?
2) Search, obtain and display Captures' value (ex: in the attached image, first capture value is "All")

Thank you All in advance

Quin
 
 http://files.engineering.com/getfile.aspx?folder=986db0aa-3f74-4d83-a83d-30d0f5172591&file=CATPART_3D_ANNOTATION.JPG
Replies continue below

Recommended for you

please use the proper function to upload Images it will make it easier for everyone.

Eric N.
indocti discant et ament meminisse periti
 
why don't you use the upload image function (near the smiley face) instead of the attachment?


Eric N.
indocti discant et ament meminisse periti
 
CATPART_3D_ANNOTATION_uq5mkx.jpg


Sorry...never known and used.....now the image is here.

Can you help about my questions above?

1) Turn/Switch CATPART 3D ANNOTATION on and off with a VBA macro?
2) Search, obtain and display Captures' value (ex: in the attached image, first capture value is "All")

Thank you All in advance

Quin
 
I created this last year, it turns on all FT&A features in a Catia product.
It should work for an individual part.
Code:
Sub CATMain()

Set  ProductDocument1 = CATIA.ActiveDocument
Set Product1 = ProductDocument1. Product

Dim ProductDoc1_As_Document
Set ProductDoc1 = Catia.ActiveDocument

Dim Selection1_As_Selection
Set Selection1 = ProductDoc1.Selection

selection1.Search "CATTPSSearch.CATFTAElement,all"
Set visPropertySet1 = Selection1.visProperties
VisPropertySet1.SetShow 0
Selection1.Clear

Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow

Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer

Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D

viewer3D1.Reframe 

Set viewpoint3D1 = viewer3D1.Viewpoint3D



End Sub
 
Hi Zecha,

Thank you for your post.

I am testing your code with CATIA 2015 with full licenses but

1) It does not work in both part document and product doc. See attached image for error.
2) Can it be run with VBA 7 in Catia 2016? If not, could you please show me how to?

Thank you in advance

Quin
Capture_jdvbdr.jpg
 
Right off the bat, I notice you are using the wrong type of file, catvbs instead of CATSript.

Copy my code and paste it into Wordpad and save it as a .CATSript file type and see how that works out.

As for the second part, I have no idea
I'm not good with coding outside of basic CATScripts.
 
Hi Zecha,

I did exactly what you said above, run the code in CATScript but nothing (really nothing) happens.

Do you have any suggestions?

Quin
 
Hi ALl,

I just tested the code in VBA with CATIA but the 3D annotation set does not switch on or off at all. I did reload the part document, run the code in VBA (as seen below) and I only see the part reframed (as there is viewer3D1.Reframe in the code).

I changed from ProductDocument to part document and I pasted my code below for your review.

========= SWITCH 3D ANNOTATION SET ON AND OFF ======

Sub CATMain()

Dim partDoc1, myPart1
Set partDoc1 = CATIA.ActiveDocument
Set myPart1 = partDoc1.Part

Dim CurPart As Document
Set CurPart = CATIA.ActiveDocument

Dim Selection1 As Selection
Set Selection1 = CurPart.Selection

Dim VisPropertySet1
Selection1.Search "CATTPSSearch.CATFTAElement,all"
Set VisPropertySet1 = Selection1.VisProperties
VisPropertySet1.SetShow 0
Selection1.Clear

Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow

Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer

Dim viewpoint3D1 As Viewpoint3D
Set viewpoint3D1 = viewer3D1.Viewpoint3D

viewer3D1.Reframe

Set viewpoint3D1 = viewer3D1.Viewpoint3D

End Sub
==============================

Please help me out

Thank you All

Quin
 
Hi Ferdo,

Thank you for sharing your tool bar.

I downloaded, run TST - CATIA V5 Time Saving Toolbar.exe but the annotation still does not show up.

1) What is FTA (workbend) in genenral? I have never known, seen and used it. Please elaborate
2) How could I make your tool bar worked?
3) Could you please share your code of switch annotation on/off with me? I want to incorporate it with my code.

I am using CATIA V5 2015 on Windows 10, 64 bit.

Your prompt reply is much appreciated.

Thank you

Quin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top