
- Solidworks feature tree dissolve unfolder how to#
- Solidworks feature tree dissolve unfolder series#
I have not found the rationale behind these two different object types (and why some have one, the other or both), so you better read the documentation. You cannot cast these objects back to a feature.GetTypeName2 to find out the type, then cast it to the correct type. GetDefinition to get the definition object, like RefPlaneFeatureData.
Other objects have a GetFeature method for this.
You can cast some of these specific features back to a feature. Check the docs to find out if your feature type returns something or null. GetSpecificFeature2 to get the specific feature object, like RefPlane. SOLIDWORKS stores feature data in two groups of objects: I just hope they will be phasing out the methods that return plain objects as well. Often there is only one version (always without the I) and sometimes it returns a generic object and sometimes it returns the specific type.Īccording to Joyce at the documentation team, SOLIDWORKS is phasing out the methods that start with I. The method with I returns the specific object, so you don’t have to cast it.Ĭonfusingly, there are not always two copies of the same method available. You then have to cast that object to a Feature. Apparently, when two otherwise identical methods are available, the method without I returns a generic object. What is the difference between GetNextFeature and IGetNextFeature? To traverse the tree exactly how you see it in the user interface, use GetFeatureTreeRootItem2 and the ITreeControlItem interface.Ģ.1. It does return the features in a random order, so there’s that. After four-plus years of SOLIDWORKS API programming, I learned that the method GetFeatures also exists. There are two other ways to get all features: You do this by getting the first feature from the model, then the next feature from the previous feature. You may often have to traverse these features from top to bottom to find the feature(s) you are looking for.
Drawings have sheets, views and tables.Assemblies have components, component patterns and assembly-level cuts.Parts have features like extrudes, fillets and revolves.The most important properties are the type name, the name (that can be changed by users), the definition and the relation with its parent(s) and child / children.Įvery model has its unique feature types: Each featureįeatures are represented by IFeature in the API.
They are organized in the feature tree (the official name is FeatureManager Design Tree) on the left of the SOLIDWORKS window.
Disable the feature tree to make your macro or add-in fasterįeatures are the basic building blocks within SOLIDWORKS models. Solidworks feature tree dissolve unfolder how to#
How to change the selected faces and edges in a feature. No more endless parameters: create new features from a FeatureData object. The FeatureManager object / IFeatureManager interface. What is the difference between GetNextFeature and IGetNextFeature?. You can find links to the other parts at the end of the post. Solidworks feature tree dissolve unfolder series#
This post is part of a series on the SOLIDWORKS API. If you create macros or add-ins for SOLIDWORKS, you will have to deal with features and the feature tree.īut traversing the tree can be a pain.