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!

Bounding Box macro

mdraikar

Mechanical
Dec 3, 2024
1
Hello ,

I copied the bounding box macro and did some changes but it fails in bbox line ,
Please help me in correcting this, ( Example in part if the value comes as Bbox_dx.1 or .2 or .3 or .4 it should automatically find and give results)
'____________________________________________________
Dim catDoc As PartDocument
Dim catPart As Part

Set catDoc=CATIA.ActiveDocument
Set catPart=catDoc.Part

Dim Bbox_dx As String
Bbox_dx=catPart.Parameters.Item("Bbox_dx.2").ValueAsString

Dim Bbox_dy As String
Bbox_dy=catPart.Parameters.Item("Bbox_dy.2").ValueAsString

Dim Bbox_dz As String
Bbox_dz=catPart.Parameters.Item("Bbox_dz.2").ValueAsString

MsgBox "Overall Dimensions of part :" & _
vbCrLf & "Length =" & Bbox_dx & _
vbCrLf & "Width =" & Bbox_dy & _
vbCrLf & "Height =" & Bbox_dz


End Sub
 

Part and Inventory Search

Sponsor