Hello,
When i create a PMP with a PropertyManagerPageSelectionbox, the default selection functionality in Solidworks appears to not beworking. I want to be able to allow the user to select a plane and then for the Macro create a sketch on to the selectedplane. Without the PropertyManagerPageSelectionbox everything appears to work but with the selectionbox, even with the Plane selected, Edit Sketch prompts for a plane to be selected.
Without the SelectionBox, everything appears to work correctly as before. I can work around this by just using my own .Net controls to mirror the functionality but that would be a poor workaround. Am i missing something there? I'm doing this in the UI not even with scripts as a sanity test.
Also I'm not sure how it is best to get the selected object from the PropertyManagerPageSelectionbox, I couldn't find a nice sample anywhere. The way below is what I came up with pm_Selection is the PropertyManagerPageSelectionbox entity and I'm just trying to get selected RefPlane objects. Is this the correct way to go about it or is there a way to get the features directly from the SelectionBox entity.
--
if (mUserPage.pm_Selection.GetSelectedItemsCount() > 0)
{
SelectionMgr swSelMgr = (SelectionMgr)pDoc.SelectionManager;
int currentSelection = mUserPage.pm_Selection.SelectionIndex[mUserPage.pm_Selection.CurrentSelection];
Feature swFeature = (Feature)swSelMgr.GetSelectedObject6(currentSelection, mUserPage.pm_Selection.Mark);
RefPlane plane = swFeature.GetSpecificFeature2();
}
YC
SolidworksApi macros