×
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

VBA Objet to Read tor edit the Links in a CADProduct document

VBA Objet to Read tor edit the Links in a CADProduct document

VBA Objet to Read tor edit the Links in a CADProduct document

(OP)
Does any one know what object in Catia VBA Script can be used to Read and Write to the Linked Documents, in the Assembly or Drawing files of Catia.

Help would be Greatly apprecited. I want to programatically change the absolute path ( the front Part of the Path ) in each of the links, as the documents move from the users Local C Drive Work Space, back to the server, and then as the next user accessed it , modifiy the links via script so all the assembly files or drawing file automatically update all the links, for the next users local hard drive work space,

Thanks

Dana

RE: VBA Objet to Read tor edit the Links in a CADProduct document

Hi,

The bellow CATScript will give you the path but only for first level in the Product. You need to have the CATProduct in Design Mode. If you need more , you have to modify the code. Code is not mine, unfortunately I didn't notice from which forum I get it.

Language="VBSCRIPT"

Sub CATMain()

Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set products1 = product1.Products

For i = 1 To products1.Count

ElementName = products1.Item(i).ReferenceProduct.Parent.Name ' Extract reference name
ElementPath = products1.Item(i).ReferenceProduct.Parent.Path ' Extract reference path
FullPath = ElementPath & "\" & ElementName ' 1 + 1 = 2

If Right(ElementName,7) = "CATPart" Then
Msgbox products1.Item(i).Name & " -> Link (CATPart) -> " & FullPath ' Note products1.Item(i).Name is current instance name
Elseif Right(ElementName,7) = "Product" Then

If ElementName = productDocument1.Name Then
Msgbox products1.Item(i).Name & " -> Link (Component) -> " & FullPath
Else
Msgbox products1.Item(i).Name & " -> Link (CATProduct) -> " & FullPath

End If
End If
Next

End Sub

Regards
Fernando

https://picasaweb.google.com/102257836106335725208

RE: VBA Objet to Read tor edit the Links in a CADProduct document

(OP)
I have since learned that Catia uses links of many types
CCP cut Copy Paste
KWE Knowlede Expert, for Parameters
Instance - for Part to part like adaptivety in INventor or realations in Solid works
View Links for drawings and several others.

I am assuming there is a way to write a VBA to automatically write and read this links from part files, and by know where they are moving to or from, (server or Local), adjust the links in the child files, so that every file knows where to find what it needs.

The folder structure does not change except for the Prefix part of the path. For Example c:\myworkspace\Dan\Project...
may be
c:\myworkspace\Mark|Project on another machine
or
c:\catiafileserver\mainfiles\project on the server

We are NOT using Smart Team and have no plans to.

Any more ideas or examples from anyone would be appreciated to point me in the rightr direction.

Thanks is advance.

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