Does anyone know of an API method to get the maximum drill tool?
Meaning for CNC milling, what is the maximum diameter of the drill tool able to make the part in one shot, without replacing tools.
if you are just trying to use an End mill to do the whole machining process then your going to want to group the diameters based on the available tools.
using a 6mm end mill to cut a 40mm counterbore is not a good idea.
basically Use IBody2::GetFaces
Loop through them to build an array of diameters.
keep in mind that sometimes faces are not of type cylinder, however they are actually cylinders but spline driven probably due to importing.
if they are solidworks features then they should be evaluated as cylinders correctly
if using VB.net
DiameterCollection should be a system.collections.generic.list(of Double)
if using vba
DiameterCollection will be an array of type double
Dim DiameterCollection() as double
For each SwFace as face2 in SwBody.GetFaces
Dim Surf as surface = swface.getsurface
if surf.isCylinder then
Dim Diam as double
Dim CylParams as object
CylParams = surf.CylinderParams
Diam = CylParams(6)*2 'This is in meters
'If using .net
if DiameterCollection.contains(diam)=false then
'if using VBA
For n = 0 to ubound(diameterCollection)
If DiameterCollection(n) = diam then
elseif n = ubound(diameterCollection) then
Redim preserve DiameterCollection(ubound(diameterCollection)+1)
DiameterCollection(ubound(DiameterCollection)) = Diam
once this collection of diameters is built you can then compare it against available endmill tools to build the list of tools needed.
Sharp edges is the next step.
Do you need a macro? Check tool will tell you min rad Using the Check Tool for Minimum Radius of Curvature
I take it the tool needs to be changes manually on your intended milling machine. Using a tool determined by the min rad might be uneconomical time wise.
Actually this is pretty good!
I don't really intend to use this tool, this is more for evaluating measures.
Do you know of anyway to get the outer minimum curvature and the inner one?
Plus, the Check tool doesn't give an answer if there are sharp corners, any idea for that? just telling if there are corners, not the angle.
if i understand you correctly, i am assuming you want to tie actual machining tools into your design. meaning if you have a 6mm drill, how deep can it go without needing another drill to follow. basically a series of drills.
without having your tools in a database that can be queried then this isn't totally possible. if you do, then its simple.
a good rule of thumb is 5x and 8x diameter tools can drill to full depth in a single load. they may peck for chip break or evacuation.
sometimes 12x diameter is allowed, but most of the time it isn't.
greater than 12x will normally require the (5x or 8x),Tool Change, the 12x, Tool Change, and the 16x
any time these tool changes occur it significantly increases the cost. more than just the tool change.(spindle ramp up delays, Fluid On Delays,ect)
deeper than 16x like a 24 or 30 would probably be (5x or 8x), Tool Change, 12x,Tool change (24x or 30x)
of course 8x doesn't necessarily mean exactly 8x diameter
8x diameter 6mm drill would be 48mm max depth. however its probably more like 55mm
if this isn't what you meant then disregard.
Jacob you get a big like!
But I don't understand the cylinder explanation. "if surf.isCylinder then" when will this return false?
Surf.IsCylinder will only return true if it is actually a cylinder.
there are many shapes, Cylinders, Cones, Planar, torodials, Swept, ect.
If Surf.IsCylinder then
' this guarantees it is a cylinder.
I have started using Surf.Identity which returns an integer that is an enumeration SwSurfaceTypes_e
if Surf.Identity = SwSurfaceTypes_e.Cylinder_type then
I have attached an example part.
I did as you said, and the DiameterCollection contains 0.02, 0.01, 0.002, 0.0003 meters.
This is not exactly the expected results.
If you take a look of the part, you will see that it is possible to drill this part with a 1 mm tool.
The minimum diameter in the DiameterCollection is 0.3 mm as stated.
The code got the circular holes very good though, which is also good for me.
Is there anyway around this? Or is this the sharp edges you've said that is coming up next?
Thank you very much
when you say drill, i assume you mean End Mill.
the square slot that is filleted with 0.0002 radius is the one in question i believe.
i almost have the macro written that gets all sharp edges.
this macro will very simply analyze edges to determine if they are considered sharp.
the code in Function EdgeIsSharp
find 'Needs More Work Method
there is probably an easier way to compare the 2 faces adjacent to an edge to determine if they are sharp, but i don't have it at this point.
Hi Jacob I can't see the macro for some reason.
Can you reattach it please? It sounds like a good one
Can't you see the getsharpedges.swp.zip file?
Download it if you can
This function is insanely good
I have no words. Thank you!
Retrieving data ...