ModelingSettings.TappedHoleDiameter applies to all hole features

By Wayne Brill

The HoleTapInfo.DiameterInModel property used to work in older releases of Inventor but this does not work in the current version. Is there anyway we can access this property?

The DiameterInModel property is not supported on a per hole basis in Inventor. Hence the API property on HoleTapInfo has been removed. This property is now a document setting (ModelingSettings.TappedHoleDiameter ) and applies to all the hole features in the document. Here is a VB.NET example that gets the TappedHoleDiameter setting.

Sub getModelingSettingsForTappedHoleDia()                 Dim m_inventorApp As Inventor.Application            m_inventorApp = System.Runtime.                             InteropServices.Marshal.               GetActiveObject("Inventor.Application")                 Dim oPDoc As PartDocument =                          m_inventorApp.ActiveDocument                 Dim vVal As Object            Dim sbuf As String                 vVal = oPDoc.ModelingSettings.                                     TappedHoleDiameter            Select Case vVal                Case ModelDiameterFromThreadEnum.                                   kThreadMajorDiameter                    sbuf = "kThreadMajorDiameter"                Case ModelDiameterFromThreadEnum.                                   kThreadMinorDiameter                    sbuf = "kThreadMinorDiameter"                Case ModelDiameterFromThreadEnum.                                   kThreadPitchDiameter                    sbuf = "kThreadPitchDiameter"                Case ModelDiameterFromThreadEnum.                                kThreadTapDrillDiameter                    sbuf = "kThreadTapDrillDiameter"                Case Else                    sbuf = "UNKNOWN"            End Select                 sbuf = sbuf & " [" & vVal & "]"            MsgBox(sbuf)                  End Sub

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading