For features I can loop through them all and based off whatthe user selected I can select it as below:
feat.Select2(true, 0);
Once everything is selected I can then delete it all using the codebelow:
openDoc.Extension.DeleteSelection2((Int32)swDeleteSelectionOptions_e.swDelete_Absorbed+ (Int32)swDeleteSelectionOptions_e.swDelete_Children);
That all works well for parts and assemblies but how about sheetsand views? I have tried looping through all the sheets and doingthis:
openDoc.Extension.SelectByID2(shtNames[s],swSelectType_e.swSelSHEETS.ToString(), 0, 0, 0, true, 1, null,(Int32)swSelectOption_e.swSelectOptionExtensive);
And for each view as below:
openDoc.Extension.SelectByID2(swView.Name,swSelectType_e.swSelDRAWINGVIEWS.ToString(), 0, 0, 0, true, 0,null, (Int32)swSelectOption_e.swSelectOptionDefault);
but nothing gets selected. What am I missing here? Is there abetter way that to accomplish this? Thanks for the help!SolidworksApi macros
feat.Select2(true, 0);
Once everything is selected I can then delete it all using the codebelow:
openDoc.Extension.DeleteSelection2((Int32)swDeleteSelectionOptions_e.swDelete_Absorbed+ (Int32)swDeleteSelectionOptions_e.swDelete_Children);
That all works well for parts and assemblies but how about sheetsand views? I have tried looping through all the sheets and doingthis:
openDoc.Extension.SelectByID2(shtNames[s],swSelectType_e.swSelSHEETS.ToString(), 0, 0, 0, true, 1, null,(Int32)swSelectOption_e.swSelectOptionExtensive);
And for each view as below:
openDoc.Extension.SelectByID2(swView.Name,swSelectType_e.swSelDRAWINGVIEWS.ToString(), 0, 0, 0, true, 0,null, (Int32)swSelectOption_e.swSelectOptionDefault);
but nothing gets selected. What am I missing here? Is there abetter way that to accomplish this? Thanks for the help!SolidworksApi macros