Looks like you are making cavity form tools there.
To delete the feature. Check if combobox is yes then
Programmatically select the feature and call
We are a carbide company that processes carbide from powder and machine these parts in a state like chalk then they are sintered in a furnace. We make any style cutter you could imagine.
I don't understand how to get it to look at the combobox to run the code or not to run the code.
I love carbide manufacturing. So cool. Especially the through coolant holes in drills. Spirals.. magic. We use form tools for hydraulic manifolds.
Features cannot look at controls. You must execute the code behind the control. So when creation of your part is executed you must look at the combobox to determine if you delete the feature or not.
Think if your code as a person. The feature cannot read your mind. It must be commanded to do something.
This is a model creator. I have it built with the worse case scenario part with spiral flutes, coolant and also Straight flutes and Coolant. Basically this macro is a form that I am building that dumbs down my part template. Someone that isn't a solidworks junky like myself can get in here and create basic cutting tools with just a form. In any case in that macro, the features are already built and named something it can look for. My thought is It kind of needs to do an If-Then statement code were if the box is checked, do this. If not do this. I'll keep researching it. I know it can be done. In the API world (which i'm just learning) I would think this would be an easier function to execute. Maybe not?
What company you work for Jacob? Good chance we make the carbide your form cutters are made from.
JEM Technical in Minnesota
here is your check
If UCase(CmbBoxSHANK.value) = "YES" Then
If Val(shankdiametertxtbox.Text) <> 0 Then
boolstatus = swModel.Extension.SelectByID2("Shank Ø@Shank Sketch", "DIMENSION", -0.155119488290314, 8.15696945460451E-03, 4.48889141565494E-02, False, 0, Nothing, 0)
Set myDimension = swModel.Parameter("Shank Ø@Shank Sketch")
myDimension.SystemValue = (shankdiametertxtbox.Text) * 0.0254
If Val(shanklengthtxtbox.Text) <> 0 Then
boolstatus = swModel.Extension.SelectByID2("Shank Length@Shank Sketch", "DIMENSION", -0.155119488290314, 8.15696945460451E-03, 4.48889141565494E-02, False, 0, Nothing, 0)
Set myDimension = swModel.Parameter("Shank Length@Shank Sketch")
myDimension.SystemValue = (shanklengthtxtbox.Text) * 0.0254
Dim ShankFeat As Feature
Set ShankFeat = swpart.FeatureByName("SHANK")
If Not ShankFeat Is Nothing Then
ShankFeat.Select2 True, -1
Dim ShankSketch As Feature
Set ShankSketch = swpart.FeatureByName("SHANK SKETCH")
ShankSketch.Select2 True, -1
also in straightFlute you never instantiated ISwapp
Set swApp = Application.SldWorks
your loop is wrong for deleting the steps
Dim intX As Double
intX = cmbboxSTEPS.value
Dim i As Integer
For i = intX To 8
swModel.Extension.SelectByID2 CStr(i) + " step", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0
I didn't like the box popping up so I turned it into a comment and it still worked. I have been messing around with this and don't really know what I'm doing. I took an API class through solidworks but it was just the beginning to my understanding of this. I purchased a book but i'm only on chapter two. lol. I do appreciate all the support I have been getting on this forum. I will copy some of this in there and see if I can get it working. My next class I Driveworks so I will probably be doing this all over again. The key is the solid model being built with independent features. I think I have it pretty sound.
what you really need is macrofeatures
above is my software addin. it is all SQL database driven.
so when you change the database, the geometry changes to match.
fully defined tool bodies directly from part number in whatever erp system you have.
helical flute is also easy to create.
but you would want to hire this type of work out.
i was just trying to show you that there is a better alternative to driveworks.
I'll certainly look into this. Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
We use a system called Syteline. It has a configurator built into it but we don't know how it works and it is pretty costly I guess to get it working. We have been talking about online part building for our customers for standard endmills, hobs, form cutters and such. I will certainly look into what your talking about. I never heard of it and its another avenue maybe for me to complete this project. Thanks so much!!