Hide Table of Contents
Getting Started

You can use the ISldWorks::GetAddInObject to get a Dispatch pointer to the IApplication object and connect to the SolidWorks Toolbox Browser API.

For example, in COM:

LPDISPATCH pDisp = NULL;
HRESULT hres = pSldWorks->GetAddInObject("{ED783340-D5DB-11d4-BD5A-00C04F019809}" , &pDisp);

PDM applications can use the steps outlined in these sections to integrate with SolidWorks and the SolidWorks Toolbox Browser:

Drag and Drop Standard SolidWorks Toolbox Parts

After the user releases the mouse button to drop a SolidWorks Toolbox Browser part onto the assembly, it fires the FileDropPreNotify event and passes the filename of the dropped file.

  1. In the FileDropPreNotify event handler, the PDM application must call IAssemblyDoc::SetDroppedFileName and pass the filename of the PDM-managed version of the document (if it can be made writable), or a copy of the managed document that can be written to by SolidWorks Toolbox (if it cannot be made writable).

  2. If SolidWorks Toolbox determines that the dropped file needs to be written to, it fires the BeforeWritingToDocument event and passes the filename of the PDM-managed version of the dropped file.

  3. In the BeforeWritingToDocument event handler, the PDM application must ensure that the file that was previously passed to IAssemblyDoc::SetDroppedFileName is writable and call IPDMDocManager::SetDocumentStatus passing swPDMStatusKnownAndAvailable. SolidWorks Toolbox generates an error and stops the file drop if the application passes any other status value.

  4. After the application updates the document, SolidWorks Toolbox fires the AfterWritingToDocument event and passes in the filename of the document that was written to.

  5. In the AfterWritingToDocument event handler, the PDM application must copy the changed document to the SolidWorks Toolbox Standard Vault, or change the status of the managed version to read only.

    SolidWorks continues the file drop as usual.

Back to top

Insert SmartFastener

After the user inserts a SmartFastener, SolidWorks Toolbox fires the PreInsertDocument event and passes the file name of the document.

  1. In the PreInsertDocument event handler, the PDM application must call IPDMDocManager::SetManagedDocument and pass the filename of the PDM-managed version of the document (if it can be made writable), or a copy of the managed document that can be written to by SolidWorks Toolbox (if it cannot be made writable).

  2. If it determines that the file needs to be written to, SolidWorks Toolbox fires the BeforeWritingToDocument event and passes the filename of the PDM-managed version of the file.

  3. In the BeforeWritingToDocument event handler, the PDM application must ensure that the file that was previously passed to IAssemblyDoc::SetDroppedFileName is writable and call IPDMDocManager::SetDocumentStatus passing swPDMStatusKnownAndAvailable. SolidWorks Toolbox generates an error and stops the file drop if the application passes any other status value.

  4. After the document is updated, SolidWorks Toolbox fires the AfterWritingToDocument event and passes the file name of the PDM-managed version of the file.

  5. In the AfterWritingToDocument event handler, the PDM application must copy the changed document to the SolidWorks Toolbox Standard Vault, or change the status of the managed version to read only.

    SolidWorks continues the insert as usual.

    Back to top

Drag and Drop Copied SolidWorks Toolbox Parts

After the user releases the mouse button to drop a copy of a SolidWorks Toolbox Browser part onto the assembly, it fires the PreInsertDocument event and passes in the filename of the copied toolbox file.

  1. In the PreInsertDocument event handler, the PDM application must call IPDMDocManager::SetManagedDocument and pass the filename of the PDM-managed version of the document for SolidWorks Toolbox to insert into the assembly. If a managed document was not returned, SolidWorks Toolbox creates a new part.

  2. If a new copied part is created, SolidWorks Toolbox fires the NewDocumentAdded event and passes the filename of the new part and sets AddedToBrowser to FALSE.

  3. In the NewDocumentAdded event handler, the PDM application must copy the changed document to the SolidWorks Toolbox Standard Vault. The PDM application must call IPDMDocManager::SetManagedDocument and pass the file name of the PDM-managed version of the document for SolidWorks Toolbox to insert into the assembly. If a managed document is not returned, SolidWorks Toolbox uses the new document filename.

    Back to top

Add New Part Wizard

After the user clicks the Finish button, SolidWorks Toolbox fires the NewDocumentAdded event and sets AddedToBrowser to TRUE.

In the event handler, the PDM application must make arrangements for the newly added file or a copy of it that the PDM application places in its vault. The PDM application must always call IPDMDocManager::SetManagedDocument and pass the file name of the PDM-managed version of the document. This file is added to the SolidWorks Toolbox Browser database.

Back to top



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Getting Started - SolidWorks.Interop.ToolboxBrowser
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2010 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.