Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Help with VBA Macro Script in CATIA: Displaying Dimension Value Annotations 3d

Status
Not open for further replies.

Med Che

New member
Oct 21, 2023
7
Hi everyone, I've created a small script in VBA for CATIA that selects a dimension in the 3D annotation. I want to display the value of this dimension using MsgBox, but I'm not sure which method to use to retrieve and display the value.
Can anyone help me with this?Thanks in advance!
 
Replies continue below

Recommended for you

share your code and what the problem is

Eric N.
indocti discant et ament meminisse periti
 
First of all, thank you for responding to my post. My goal is to display the value of "Dimension.10" using Msgbox. To this end, I have created this script:

Sub CATMain()
Dim productDocument1 As ProductDocument
Set productDocument1 = catia.ActiveDocument
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
selection1.Search "CATTPSSearch.TPSDimensionAnnot,all"
MsgBox selection1.Item(4).Value.Name ' Nom de Dimension => Dimension.10
MsgBox selection1.Item(4).Value.Value
End Sub
 
 https://files.engineering.com/getfile.aspx?folder=4b6725dd-f965-4820-a79b-28d34ad72cbf&file=Sans_titre.jpg
Status
Not open for further replies.

Part and Inventory Search

Sponsor