×
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

wrong placement of dimension in drawing after update links of part

wrong placement of dimension in drawing after update links of part

wrong placement of dimension in drawing after update links of part

(OP)
hi,
I am trying to make a macro to update links between CATDrawing and CATPart. After execution of the macro, there are losses colored red annotations.
Here is my code:
Sub CATMain()

partFile = CATIA.ActiveDocument.FullName

Set partDoc = CATIA.Documents.Read(partFile)

Set myPart = partDoc.Part

drwFile = Replace(partFile, "Part", "Drawing")

Set drwDoc = CATIA.Documents.Open(drwFile)

Set mySheet = CATIA.ActiveDocument.Sheets.Item("Sheet.1")

For i = 1 To mySheet.Views.Count
Set myView = mySheet.Views.Item(i)
Set vLinks = myView.GenerativeLinks
vLinks.RemoveAllLinks

If InStr(myView.Name, "Main") < 1 Then
If InStr(myView.Name, "Background" ) < 1 Then
vLinks.AddLink myPart
End If
End If


Next

mySheet.ForceUpdate

'CATIA.ActiveDocument.Save

End Sub

RE: wrong placement of dimension in drawing after update links of part

I know that catia will keep dimensions linked when you use the proper way... I am not sure it will keep links when replaced with a script.

Eric N.
indocti discant et ament meminisse periti

RE: wrong placement of dimension in drawing after update links of part

(OP)
here is my drawing before running the code

this is how it looks as a result

RE: wrong placement of dimension in drawing after update links of part

When creating dimensions to holes, do not select the center line. Tag the hole itself when dimensioning.
If you have not already done this, try it. Then run the code and see if they fail.

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