- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Change size of Clearance Hole with iLogic
Hi,
i'm trying to set a clearance hole with ilogic, but I can't find the option to set the bolt size (say M10).
However, when right click on the feature in the model tree and get it's information the M10 value is not there (it only shows the parameter for the size of the hole)
Can anyone help?
thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @johnster100. Changing hole feature specs by iLogic can be a pain, because they have become so dynamic, and a lot of the specs shown/available in them is being sourced from spreadsheet files. In some situations, if you attempt to change a spec to something that's not available within the spreadsheet, it may give an error too. There are some tricky properties value types involved in some of these scenarios that you may have to deal with. In the case of a clearance hole, the HoleFeature has a property called ClearanceInfo that returns a HoleClearanceInfo object we will need to deal with. It is simpler to deal with than some of the other object types. Once you're at this point, you can either use the SetClearanceInfo method, or just directly specify a new value for the FastenerSize property. However, as mentioned before, the value you specify must be one that is available in the spreadsheet, while the other settings are the way they are. The spreadsheet file is called "clearance.xls", and it is one of the standard files installed with Inventor, under the '\Design Data\XLS\en-us\ directory.
for example:
C:\Users\Public\Documents\Autodesk\Inventor 2022\Design Data\XLS\en-US\clearance.xls
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you want and have time, I would appreciate your Vote(s) for My IDEAS
or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here is a very simplistic example of an iLogic rule to change an existing hole feature's clearance hole size, by changing its fastener size.
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oHole As HoleFeature = oPDef.Features.HoleFeatures.Item(1)
If oHole.IsClearanceHole Then
'oHole.ClearanceInfo.SetClearanceInfo("ISO","Hex Head Cap Screw ISO 24017", "M10", FastenerFitType.kNormalFitType)
oHole.ClearanceInfo.FastenerSize = "M10"
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you want and have time, I would appreciate your Vote(s) for My IDEAS
or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Just another example showing another possible process for doing something like this by iLogic.
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oHFeats As HoleFeatures = oPDef.Features.HoleFeatures
Dim oHole As HoleFeature = oHFeats.Item(1)
If oHole.IsClearanceHole Then
Dim oStd As String = "ISO"
Dim oType As String = "Hex Head Cap Screw ISO 24017"
Dim oSize As String = "M10"
Dim oFit As FastenerFitType = FastenerFitType.kNormalFitType
Dim oNewClearanceInfo As HoleClearanceInfo = oHFeats.CreateClearanceInfo(oStd, oType, oSize, oFit)
oHole.ClearanceInfo = oNewClearanceInfo
End If
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, one thing we did for "custom holes" that we wanted to control, was a new style to the Excel Spread sheet that IV reads the hole data from.
In this case, we wanted to make standard dowel pin holes based on the metric size. So, I added these rows to the sheet and filled in the Size, Shaft Diameter, and Head dimentions appropriatatley...
so, when I fire the hole command in IV, they show up like this now.
Where it automatically assigns the diameter based on the metric size and fit.
Using this method, you can just insert more rows to the desired new styles you are looking for. Really, as many rows as you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So what you see there, are two styles of dowel pin holes..one for thru holes (or blind) and one for holes with breathers. Say for example I put a Ø10mm dowel pin that is a press fit into a 50 mm thick piece of metal...I don't want to bore a 10mm hole all the way thru, so using the C'Bore feature, I can set my C'bore to the dowel pin hole size, then set a depth, and then the breather hole is just a smaller thru hole. My hole note can then tolerance the breather hole to say, ±.010" while the dowl pin hole is held to within 0.001".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
If we would like to change the thread size from assembly, what will be the code like? The part that we are changing is model states. For example,
Change Text Parameter named Bolt Size - M10 in assembly.
Part1 Model State1 , Hole1 feature M10 changed.