AnsweredAssumed Answered

How can I check if a sketch exists with a certain name then delete it if it does?

Question asked by Joe L on Dec 1, 2015
Latest reply on Dec 1, 2015 by Joe L

I'm fairly new to this programming. 

I currently have a program i wrote that creates a new sketch with a spline from excel then names that sketch.

 

I've been attempting for a while to have a sub that searches the features/sketches already in the part for the name that will be used for the new sketch and if it exists, delete it.  I have been unsuccessful in either searching or deleting the feature.

 

I do not have any current lines to show as they never seem to do what I'm looking for.

 

I've checked the delete feature example

2012 SOLIDWORKS API Help - Delete Selected Feature Example (VBA)

but the program does not seem to work

 

I've also tried

2012 SOLIDWORKS API Help - Delete a Smart Feature Example (VBA)

but also no luck

 

If anyone has any suggestions, the help would be appreciated.

 

My major hurdles are searching/selecting a feature by name and also what to call to delete that feature.

Outcomes