API: How to get assembly components and sub-components in the order that they appear in the FeatureManager design tree

Document created by Michael Kozikowski Employee on Nov 16, 2010Last modified by Michael Kozikowski Employee on Nov 2, 2012
Version 6Show Document
  • View in full screen mode

The attached C# macro shows how to traverse an assembly and get the components in the order that they appear in the FeatureManager design tree.

 

This macro:

  • calls IModelDoc2::FirstFeature and IFeature::GetNextFeature to traverse the FeatureManager design tree.
  • calls IFeature::GetTypeName2 to find only components by Reference type.
  • recurses the traversal, locating all components and sub-components in the order that they appear in the FeatureManager design tree.

 

Note:
- Subscription Services required for full access.

- Looking for more API Examples?

 

 

Copyright © 2011 Dassault Systèmes SolidWorks Corp. All rights reserved.
Do not distribute or reproduce without the written consent of Dassault Systèmes SolidWorks Corp.

Attachments

Outcomes