×
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

Catia macro | Take dimensions from a drawing

Catia macro | Take dimensions from a drawing

Catia macro | Take dimensions from a drawing

(OP)
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 --> VBA

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

RE: Catia macro | Take dimensions from a drawing

(OP)
Update :
For example, I have one simple square metal sheet with 2 dimensions : Length and Width.
For both I tested this :

CODE --> VBA

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...

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