Hello
I am trying to better understand the proper usage of the Document Manager API vs. the Solidworks API
In direct regards to this example: 2014 SOLIDWORKS API Help - Traverse Assembly at Component and Feature Levels Using Recursion Example (VB.NET)
In the above example, this work is done inside Solidworks where the macro already knows what document its working with via:
My question would be this:
1) Is it possible to leverage the Document Manager API to feed the Solidworks API information regarding which document I'm working on? Examples of properties used by the Solidworks API that I'd like:
.GetFirstSubFeature
.NextSubFeature
.GetChildren
etc..
(Looking to build a BOM when one doesn't exist in Solidworks by looking at FeatureManager tree via Top Assembly > Sub Assemblies > Children of those Sub Assemblies)
2) Are all the properties above ONLY accessible via a Macro inside Solidworks?
I need to work outside of Solidworks and it seems that I'm really strapped to what the DM API can return for me.
Any insight appreciated, this forum has been a big help in even getting this far..
You can't use SolidWorks API unless SolidWorks is open. Using SolidWorks API is just telling SolidWorks what to do. No SolidWorks, no SolidWorks API. Document Manager API is definitely limited. As its name suggests, its purpose is to manage files. It can read a limited set of the data that is stored in SolidWorks files, but it can't do things like change dimensions, rebuild, examine feature tree, etc. All those functions require SolidWorks.