Hide Table of Contents

Get DimXpert Features and Annotations in a Model Example (C#)

This application shows you how to get all of the DimXpert feature and annotation objects in a model.  

This application is more advanced than other examples, because it involves multiple class modules.

//--------------------------------------------------------------------------

// Preconditions:

// 1. Create a new C# macro using SolidWorks VSTA.

// 2. Name the project DimXpert_text_v2_cs.

// 3. Save the project.

// 4. Copy and paste the Main module into the code window.  

// 5. Right-click on the project in Project Explorer and click Add > Class.

// 6. Select the Class template and type DimXpertFeatureData.cs

//    in the Name field.

// 7. Click Add.

// 8. Copy and paste the DimXpertFeatureData class module into the code window.  

// 9. Right-click on the project in Project Explorer and click Add > Class.

// 10. Select the Class template and type DimXpertAnnotationData.cs

//     in the Name field.

// 11. Click Add.

// 12. Copy and paste the DimXpertAnnotationData class module

//     into the code window.  

// 13. Ensure that the latest SolidWorks.Interop.swdimxpert.dll interop assembly

//     is loaded (right-click on the project in Project Explorer,

//     click Add Reference, choose the DimXpert assembly on the .NET tab).

// 14. Ensure that the Microsoft Scripting Runtime library is loaded

//     (right-click on the project in Project Explorer, click Add Reference,

//      choose the library on the COM tab).

// 15. Open a part that contains DimXpert features and/or annotations.

//     (You may want to go through the online DimXpert Tutorial

//      to learn how to create DimXpert features and annotations.

//      From the ? help menu, click SolidWorks Tutorials > All SolidWorks

//      Tutorials (Set 1) > DimXpert Tutorials)

// 16. Open an Immediate Window in the IDE.

// 17. Run this macro (F5).

//

// Postconditions:

// 1. The output of this macro is logged in c:\temp\dimXpertInfo.txt.

// 2. Inspect the Immediate Window.

//--------------------------------------------------



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:   Get DimXpert Features and Annotations in a Model Example (C#)
*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.