Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Get ChamferNote Values and Tolerances

avincent
Participant

Get ChamferNote Values and Tolerances

avincent
Participant
Participant

I'm writing a macro in Microsoft Visual Basic for Applications for Autodesk Inventor Professional 2019. The intention for the macro is to automatically generate in-process inspection documents to accompany manufacturing process prints to the machine shop floor.

 

Is there a way to get the values and tolerances associated with a given ChamferNote? I believe that this question has been answered in the negative in this forum for versions of the software prior to 2010, with references to future improvements. I'm not seeing any more recent discussion of the issue. I'm not finding an answer to this question in the Inventor API Reference Manual.

Best regards,
Andrew
0 Likes
Reply
Accepted solutions (1)
557 Views
3 Replies
Replies (3)

chandra.shekar.g
Autodesk Support
Autodesk Support

@avincent,

 

 

Try below VBA code to determine values and tolerances of chamfer notes. Usually, tolerances will return in integer values which can mapped to respective LinearPrecisionEnum using below Inventor 2019 help documentation link.

 

http://help.autodesk.com/view/INVNTOR/2019/ENU/?guid=GUID-FBD80F0D-AF01-47AA-BC61-8DB782ACAE0D

 

Sub Main()

    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDoc.ActiveSheet
    
    Dim oChamferNote As ChamferNote
    Set oChamferNote = oSheet.DrawingNotes.ChamferNotes.Item(1)
    
    Debug.Print oChamferNote.Text
    
    Dim oStyle As DimensionStyle
    Set oStyle = oChamferNote.DimensionStyle
    
    Dim oLinear As LinearPrecisionEnum
    oLinear = oStyle.LinearPrecision
    
    Debug.Print "Linear precision : " & oLinear
    
    Dim oAngular As LinearPrecisionEnum
    oAngular = oStyle.AngularPrecision
     
    Debug.Print "Angular precision : " & oAngular
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

avincent
Participant
Participant

Thanks for the response. It appears that this provides the precision level of the default dimension.

I'm hoping to get the linear and angular tolerance ranges when the default dimensions are not used.

Best regards,
Andrew
0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@avincent,

 

Custom tolerances of chamfer note are available through FormattedChamferNote API as XML tags as shown below.

 

<Distance1 Precision='3' AlternatePrecision='0' UpperTolerance='0.000000' LowerTolerance='0.000000' ToleranceType='kSymmetricTolerance' TolerancePrecision='2' ToleranceAlternatePrecision='2'></Distance1> X <Angle Precision='2' UpperTolerance='0.000000' LowerTolerance='0.000000' ToleranceType='kSymmetricTolerance' TolerancePrecision='2'></Angle> Chamfer

VBA code:

Sub Main()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDoc.ActiveSheet
    
    Dim oChamferNote As ChamferNote
    Set oChamferNote = oSheet.DrawingNotes.ChamferNotes.Item(1)
    
    Debug.Print oChamferNote.FormattedChamferNote
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network