Specific feature selection type for context commands #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow-up to the context menu items/icons PR and should be merged after it.
SpecificFeatureSelectionTypeand wires it into the context item/icon registration flow).CommandContextItemCreateduses SolidWorksAddMenuPopupItem4instead ofAddMenuPopupItem3(feature type names fromIFeature.GetTypeName2instead of general selection type enums).CommandContext*and selection infrastructure as the base PRNotes
SolidDna/CADBooster.SolidDna/SolidWorks/SelectionManager/SpecificFeatureSelectionType.csWhy
SpecificFeatureSelectionTypeis separate fromSelectionTypeSpecificFeatureSelectionTypeis just a helper catalog class to create/accessSelectionTypeinstances for specific SolidWorks feature type names (for UI context menu filtering).SelectionTyperepresents the generic SolidWorks selection context (swSelectType_e+ related string values) and is used broadly across the library. “Specific feature types” are a different dimension: they are identified by the feature type name strings returned byIFeature.GetTypeName/GetTypeName2(large, version-dependent list).SpecificFeatureSelectionTypeis intentionally focused on UI context menu selection/registration (filtering context menu items by feature type name). Keeping it separate avoids bloatingSelectionType, avoids implying it’s supported everywhere, and keeps the API clearer: generic selection context vs feature-type-name based UI filtering.Why this is separate from
ModelFeatureType/ModelFeatureTypeMappingModelFeatureType/ModelFeatureTypeMappingexist to classify aModelFeatureinto a higher-level enum (often mapping many rawGetTypeName2strings to a single enum value, and sometimes branching by SolidWorks version). Context menu registration for “specific feature selection” needs the raw feature type name string (the UI/API filter value), not a computed/normalized enum classification. The mapping is not a stable source for that filter value because it is many-to-one (you can’t reliably reverse-map enum → one raw type name), it can be version-dependent (VersionYearbranches), and it operates on aModelFeatureinstance (FeatureTypeName) rather than providing a canonical list of raw feature type strings for UI filtering.Suggested library improvements (related to this PR)
ModelFeature.GetFeatureTypeName()Handle the Instant3D
"ICE"case by falling back toIFeature.GetTypeName()whenGetTypeName2()returns the generic"ICE".SelectedObject.IsFeatureSimplify feature detection by checking whether the selected
BaseObjectis anFeature. Current implementation not covers all cases.