Continue to Site

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!

Catia macro | Take dimensions from a drawing

Status
Not open for further replies.

Tbertin

Mechanical
Jun 27, 2012
6
Hi everybody,

I'm quite new in Catia with macro and I have one (maybe stupid) question.

From drawings, I try to take automatically the biggest dimensions for metal sheet in order to generate "length x width x thickness" note.
The problem in my macro is to check if a dimension is horizontal or vertical.

To get the dimension, I use :
Code:
Set drawingDimension = drawingDimensions1.Item(i)
DimensionSheet = drawingDimension.GetValue.Value ==> gives the value

And after I've seen on documentation this :

DimLineOrientation( ) As CatDimOrientation
Returns or orientation of dimension line.

with

enum CatDimOrientation {
catHorizontal,
catVertical,
catParallel,
catPerpandicular,
catAngle
}

But I can't manage to use it, if I check with a MsgBox the value of this, I get a number which is the same for vertical and horizontal dimension...

How can I use this or is there another way to do it ?

Thank you for your help,

Thomas
 
Replies continue below

Recommended for you

Update :
For example, I have one simple square metal sheet with 2 dimensions : Length and Width.
For both I tested this :
Code:
If drawingDimension.GetDimLine.DimLineOrientation = catHorizontal Then
    MsgBox "Horizontal"
ElseIf drawingDimension.GetDimLine.DimLineOrientation = catVertical Then
    MsgBox "Vertical"
ElseIf drawingDimension.GetDimLine.DimLineOrientation = catParallel Then
    MsgBox "Parallel"
ElseIf drawingDimension.GetDimLine.DimLineOrientation = catPerpandicular Then
    MsgBox "Perpandicular"
End If

But I got Horizontal for both...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor