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 :
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
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
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 IfBut I got Horizontal for both...
RE: Catia macro | Take dimensions from a drawing
I would do this in 3D with BoundingBox.CATScript in the unfolded SM part (I believe you can find it on net).
Regards
Fernando
https://picasaweb.google.com/102257836106335725208