Write API for checkin new document into PDM Vault server

Apr 17, 2006 1 Replies

Hi all Request you to provide me solution on checkin new document into PDM Vault server.



While chackin a document using PDMWorks API. I found one function like "PDMWConnection.checkin"



If i try this checkin function for a document which is there in vault server then this function is working. My coding is:


Dim adocDocs As PDMWDocuments Dim adocDoc As PDMWDocument set adocDocs = Connection.Documents For Each adocDoc In adocDocs If UCase(adocDoc.Name) = UCase(filename) Then adocDoc.ReleaseOwnership adocDoc.TakeOwnership filename = "D:\GaymarSource\Crib Assembly - XPRT\" & filename Connection.CheckIn filename, project, "", "", "", ReadFromFile, "A-07", status, True, ""


** Problem **

-------------------- Now my problem is if i select a new document which is not there in vault server. Then what shold i do. How can i set the "adocDoc" object. (Type: PDMWDocument) if i write last two lines of above code then it shows an error like "Document write permission was denied". So i think i have to set the adocdoc object to take the ownership.



How can i set that object.? Let me know any issues. Please help me.



It would great if one can illustrate me API for checkin a new document in PDM vault server.



Appreciating your early response.



Thanks & Regards,



Manish



You are overthinking the programming. Start off with the basics, then get advanced.

'''This example shows how to log in to a PDMWorks vault, and checkin a new document.

Sub main() Dim connection As PDMWConnection Dim Refs As Variant

Set connection = CreateObject("PDMWorks.PDMWConnection")

connection.Login "pdmwadmin", "pdmwadmin", "localhost"

connection.CheckIn "FILE PATH & NAME HERE", "PROJECT NAME HERE", "PART NUMBER HERE", _ "DESCRIPTION HERE", "NOTES HERE", Default, "REVISION HERE", _ "LIFECYCLE HERE", True, Refs

connection.Logout End Sub

How much programming experience do you have?

You may want to also post these types of questions in the SolidWorks-API group.

Jeff

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required