Write API for checkin new document into PDM Vault server

Discussion in 'SolidWorks' started by manishmgupta, Apr 17, 2006.

  1. manishmgupta

    manishmgupta Guest

    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
     
    manishmgupta, Apr 17, 2006
    #1
  2. manishmgupta

    Jeff Guest

    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
     
    Jeff, Apr 18, 2006
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.