2011-09-19 104 views
0

我希望能夠使用PDMworks檢查繪圖,但無法弄清楚我的生活,我將發佈網站下面的內容。我想要做的就是檢查繪圖並更改其最終狀態。如果有人有這個計劃的經驗,我會很感激。我得到錯誤預期;或= @檢入(不能指定在聲明構造函數參數)(使用Enterprise PDM(PDMworks)登記文件Solidworks API C#

using PDMWorks.Interop.pdmworks;//PDM Reference 

public interface IPDMWConnection { } 
public interface IPDMWDocuments { } 
public interface IPDMWDocument { } 

private void button10_Click(object sender, EventArgs e) //Check Drawing Into PDM Change State "Roll to Standard" 
{ 
    var filename = textBox1.Text + ".slddrw"; 
    var project = "MLD028D"; 
    var number = "1"; 
    var description = "Configured Actuator Drawing"; 
    var note = "Configured by Actuator Generator"; 
    var revision = "--"; 
    var lifecycle = "Configured"; 
    bool retainOwnership = false; 
    object references = textBox1.Text + "sldasm"; 

    //CheckIn Drawing to PDM 
    PDMWDocument CheckIn( 
    filename, //filename- Name of the closed document to check in 
    project, //project- Name of the project to which the document belongs 
    number, //Number Document number 
    description, //Description Document description 
    note, //note Document notes 
    //PDMWRevisionOptionType i_revOption, //i_revOption - Revision option as defined in PDMWRevisionOptionType (see Remarks) 
    revision, //Revision - Document revision 
    lifecycle, //lifecycle - Document lifecycle status 
    retainOwnership, //RetainOwnership - (bool false)True to retain ownership of the document in the vault, false to not 
    references //References - Array of the full paths and filenames of any referenced documents to check in (see Remarks) 
    ); 
    MessageBox.Show(textBox1.Text + " Drawing and Assembly Checked-In"); 
} 
+0

這是鏈接到網站http://help.solidworks.com/2011/English/api/pdmworksapi/PDMWorks.Interop.pdmworks~PDMWorks.Interop.pdmworks.IPDMWConnection~CheckIn.html –

回答

1

我終於收到答覆從SolidWorks這裏是如何在圖形中檢查和更改圖紙的狀態。

using EdmLib; //Enterprise PDM Reference 

     private void button10_Click(object sender, EventArgs e) //Check Drawing Into PDM Change State "Roll to Standard" 
    { 
     //Create a file vault interface and log in to a vault. 
     EdmVault5 vault = default(EdmVault5); 
     vault = new EdmVault5(); 
     vault.LoginAuto("Engineering", 0); 

     //Get the vault's root folder interface. 
     IEdmFile5 file = default(IEdmFile5); 
     IEdmFile5 file2 = default(IEdmFile5); 
     IEdmFolder5 folder = default(IEdmFolder5); 
     folder = vault.RootFolder; 

     //Check In Assembly 
     file2 = vault.GetFileFromPath("file location", out folder); 
     file2.UnlockFile(0, "Checked In By Configurator", 0, null); 

     //Check In Drawing and Change State to "Roll to Standard" 
     file = vault.GetFileFromPath("file location", out folder); 
     file.UnlockFile(0, "Checked In By Configurator", 0, null); 
     file.ChangeState("Check ENG Design", folder.ID, "Created By Configurator", 0 , 0); 
     file.ChangeState("Final Review", folder.ID, "Created By Configurator", 0, 0); 
     file.ChangeState("Roll to Standard", folder.ID, "Created By Configurator", 0, 0); 

     MessageBox.Show(textBox1.Text + " Drawing and Assembly Checked-In"); 
    } 
相關問題