Hole Toletance

Hole Toletance

Anonymous
Not applicable
547 Views
11 Replies
Message 1 of 12

Hole Toletance

Anonymous
Not applicable
How to give tolerance to Hole hole diameter using VB / VBA.
I tried some thing with HoleSample but I didn't succeed

Need help please !!!
0 Likes
548 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
You don't actually assign a tolerance to the hole but set the tolerance on
the parameter that controls the diameter of the hole. The code below
illustrates adding a limits tolerance to the first hole in a part.

Public Sub AddToleranceToHole()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

' Get the first hole in the part.
Dim oHole As HoleFeature
Set oHole = oPartDoc.ComponentDefinition.Features.HoleFeatures.Item(1)

' Get the parameter controlling the diameter of the hole.
Dim oDiamParam As Parameter
Set oDiamParam = oHole.HoleDiameter

' Set a tolerance for the parameter.
Call oDiamParam.Tolerance.SetToDeviation(".002", "-.004")
End Sub

--
Brian Ekins
Autodesk Inventor API

wrote in message news:5313548@discussion.autodesk.com...
How to give tolerance to Hole hole diameter using VB / VBA.
I tried some thing with HoleSample but I didn't succeed

Need help please !!!
0 Likes
Message 3 of 12

Anonymous
Not applicable
Thanks Brian
0 Likes
Message 4 of 12

Anonymous
Not applicable
Thanks Brian,

I have tried the code and worked good for SetToDeviation but when I try to modify as below it gives error Invalied Procedure Call or argument. what could be wrong in this?

Dim oDiamPara As Parameter
Set oDiamPara = oHole.HoleDiameter

Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7", "N/A")
0 Likes
Message 5 of 12

Anonymous
Not applicable
This appears to be a bug with the SetToFits method. This should work:

Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7", "")

I've logged this as an issue so it can be addressed.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5315577@discussion.autodesk.com...
Thanks Brian,

I have tried the code and worked good for SetToDeviation but when I try to
modify as below it gives error Invalied Procedure Call or argument. what
could be wrong in this?

Dim oDiamPara As Parameter
Set oDiamPara = oHole.HoleDiameter

Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7",
"N/A")
0 Likes
Message 6 of 12

Anonymous
Not applicable
Thanks Brian Thanks a lot
0 Likes
Message 7 of 12

Anonymous
Not applicable
Today I installed SP2 for IV-11 , ReadMe for SP2-under API, Fixed the Following issues : it is given that
The Tolerance.SetToFits method does not use the shaft tolerance if the hole tolerance is set to "N/A".

After installing I tried the code
Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7", "") and
Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7",
"N/A")

but both did not worked. is this issue really fixed or to be fixed.?
0 Likes
Message 8 of 12

Anonymous
Not applicable
It's to be fixed. I also tested it in Inventor 11 SP2. I don't know when
it will be fixed but I did file the report so it can be priortized with the
other issues.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5316466@discussion.autodesk.com...
Today I installed SP2 for IV-11 , ReadMe for SP2-under API, Fixed the
Following issues : it is given that
The Tolerance.SetToFits method does not use the shaft tolerance if the hole
tolerance is set to "N/A".

After installing I tried the code
Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7", "") and
Call oDiamPara.Tolerance.SetToFits(kLimitsFitsShowTolerance, "H7",
"N/A")

but both did not worked. is this issue really fixed or to be fixed.?
0 Likes
Message 9 of 12

Anonymous
Not applicable
Thanks Brian
0 Likes
Message 10 of 12

Anonymous
Not applicable
Hi Brian,

Has this bug been solved yet??

if it's fixed... Which Hotfix is the one to install??

Regards
Rikard
0 Likes
Message 11 of 12

Anonymous
Not applicable
This is listed as fixed and will be in Inventor 2008, and assuming there
will be an SP3 for Inventor 11, it will be in that.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5508165@discussion.autodesk.com...
Hi Brian,

Has this bug been solved yet??

if it's fixed... Which Hotfix is the one to install??

Regards
Rikard
0 Likes
Message 12 of 12

Anonymous
Not applicable
Brian,
Is there a way to tolerance bearing pocket bores to represent fit standards already present in Inventor? For example, I might want a k5 fit if the housing rotates or a g6 fit if the housing is stationary. Any ideas how I might write this type of code? Thanks.
Jon Holler
0 Likes