×
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

Line Up Dimensions

Line Up Dimensions

Line Up Dimensions

(OP)
I have two dimensions in drafting, and want to Line up one of them to other, I used Line-Up option, but it only aligned the dimension line and not the dimension value. I want to overlap both dimensions exactly to the Dimension value position. I tried to create a macro, but I am not able to get x and y values of drawing dimension text, unlike Drawing Text.

RE: Line Up Dimensions

You either need a macro or overlay the dimension values manually.

But why? Are the two values different?

RE: Line Up Dimensions

(OP)
We are updating drawing views with similar parts, where we end up in getting lot of pink dimensions. Re-routing will not work for some dimensions, and we need to create new ones. To avoid writing ECN and also to ease the comparison of old and new drawings, we exactly overlap the dimension values. I was looking for an option built-in in Catia itself, but could not find one. Finally I was able to write the following macro: We need to use this macro along with Line-Up option to get the desired result.

Sub CATMain()

Dim DrwDoc As DrawingDocument
Set DrwDoc = CATIA.ActiveDocument
Dim dd As DrawingDimension
Dim xy(7) As Variant
Dim dd1 As Object
Dim m1, c1, m2, c2, x_intersection, y_intersection As Double

Dim oSel1 As Selection
Set oSel1 = CATIA.ActiveDocument.Selection

ReDim strArray1(1)
Dim sStatus1 As String

strArray1(0) = "DrawingDimension"

sStatus1 = oSel1.SelectElement3(strArray1, "Select Dimensions to Align", False, CATMultiSelTriggWhenUserValidatesSelection, False)

Set dd = oSel1.Item(1).Value
Set dd1 = oSel1.Item(2).Value
oSel1.Clear

dd1.GetBoundaryBox xy

m1 = (xy(7) - xy(1)) / (xy(6) - xy(0))
c1 = xy(1) - m1 * xy(0)

m2 = (xy(5) - xy(3)) / (xy(4) - xy(2))
c2 = xy(5) - m2 * xy(4)

If m1 - m2 <> 0 Then

int_x = (c2 - c1) / (m1 - m2)
int_y = m1 * int_x + c1

dd.MoveValue int_x, int_y, 1, 1

End If

End Sub

RE: Line Up Dimensions

I had the feeling that the scale of the view will come into the equation, as the distance from the value to the dimline, which is defined by the drawing standard.

Eric N.
indocti discant et ament meminisse periti

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