PDMWorks 2006 API - add links between documents

9 views
Skip to first unread message

Chris

unread,
Feb 16, 2007, 3:43:32 PM2/16/07
to SolidWorks-API
We're using PDMWorks 2006 SP 5.0 to store our the CNC programs for our
waterjet. We model the parts in Solidworks, make a drawing, and
create the CNC program. We then add all these documents to PDMWorks,
creating a link between the SLDDRW file and CNC program. (The CNC
program is an attachment of the SLDDRW). The part and drawing files
go into PDMWorks easily enough, but the CNC programs are a little more
difficult. We have to drag them one at a time from an Explorer window
onto the appropriate SLDDRW file, tell PDMWorks that yes, I really
want to add this file as an attachment and go through the check-in
screen. Since some projects may have dozens or hundreds of CNC
programs, this results in mistakes or files that do not get vaulted.

Here's what I'd like to do. Since I know that every SLDDRW has an
identically named CNC program, I can go through all the files in a
directory, look for the CNC programs, strip off the extension,
location the SLDDRW with the same name in PDMWorks, and add the CNC
program to PDMWorks as an attachment to the SLDDRW. I can do most of
that, until the part where I need to add the link between documents.

Let's say I have a PDMWorks document. I can use this code to find all
the attachments:

dim oDoc as PDMWorks.PDMWDocument
dim oLink as PDMWorks.PDMWLink
dim oLinks as PDMWorks.PDMWLinks

oDoc = oConnection.GetSpecificDocument("foo.SLDDRW")

oLinks=oDoc.Attachments

for Each oLink in oLinks
Debug.print (oLink.Name)
next oLink

However, I can't seem to find anything that lets me add a link to the
oLinks collection. There's something in the PDMWConnection.CheckIn
method, but it seems to apply only to MS Excel and Word documents.

So, here's my question. How can I add the link between two documents
in PDMWorks 2006 SP5.0?

Thanks,
Chris

fcsuper

unread,
Feb 19, 2007, 2:47:18 PM2/19/07
to SolidWorks-API
I highly recommend you address this issue on Eng-Tips. There are some
really good API guys there. However, just a warning, there's not too
many people that like to touch PDMWorks API: http://www.eng-tips.com/threadminder.cfm?pid=559

Matt
http://sw.fcsuper.com

Reply all
Reply to author
Forward
0 new messages