Conditional Tolerances/user symbols with iLogic or Macro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys!
I am hoping you all could point me in the right direction.
Here is the situation- some of our drawings require tolerancing that changes based on feature size. For example, features from 1" to 5" are +/-.03"; fromt 5" to 20" are +/- .1" and so on. currently I do this manually. Then we add a user symbol to the dimension (using shift and left click). I suppose this could be done using 2 seperate rules..
What i want to accomplish-
I want to be able to run a rule or macro that will go through all of my dimensions and set the tolerance for each one based on the tier-style tolerances as shown above. Then, i want a rule/macro to add a user symbol that is attached to the dimension.
The problem for me is that I dont know where in the object model all the dimensions are stored. I want the rule to go through all of the dimensions, not just certain feature types or per view. I've found this online
Dim oDef As PartComponentDefinition oDef = oDoc.ComponentDefinition Dim oHole(i) As HoleFeature oHole(i) = oDef.Features.HoleFeatures.Item(i) Dim oDiamParam(i) As Parameter oDiamParam(i) = oHole(i).HoleDiameter Dim oTol(i) As Tolerance oTol(i) = oDiamParam(i).Tolerance If oTol(i).ToleranceType() = 31233 Then ' If the hole currently has a default tolerance oTol(i).SetToFits(31244,("H6"),("")) ' Modify the hole tolerance HoleModCount = HoleModCount + 1 ' Bump the counter InventorVb.DocumentUpdate() ' Update Doc
but this is only for holes. How does one expand this to all features? Do I have to loop through all objects in the features collection object?
Thanks for your time,
D.M.