Inspection dim

Inspection dim

RodolfoZanni7664
Participant Participant
797 Views
5 Replies
Message 1 of 6

Inspection dim

RodolfoZanni7664
Participant
Participant

Good morning,

 
 
with iLogic rule,how can find and read (also the label) the inspection dimension  ?

 

 

With the follow code (found on the web), i can read the values but not the label :

 

;===================

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSubDoc As Inventor.Document
Dim oPropSets As PropertySets
' Get active sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet


oWrite = System.IO.File.CreateText(ThisDoc.PathAndFileName(False) & ".csv")

oWrite.WriteLine("Dim Text;Tol - Lower;Tol - Upper")
    ' Write each dimension to output file
    Dim oDrawingDim As DrawingDimension
    For Each oDrawingDim In oSheet.DrawingDimensions
        Dim sDimText As String
  
        sDimText = Replace(oDrawingDim.Text.Text, ",", ".")
  
  If oDrawingDim.IsInspectionDimension = True
  oWrite.WriteLine(sDimText & ";" & oDrawingDim.Tolerance.Lower & ";" & oDrawingDim.Tolerance.Upper)
 End If
  
    Next

oWrite.Close()

;===================

 

like......

oWrite.WriteLine( LABEL & ";" &  sDimText & ";" & oDrawingDim.Tolerance.Lower & ";" & oDrawingDim.Tolerance.Upper)

 

 

 

Thank’s for your help

Accepted solutions (1)
798 Views
5 Replies
Replies (5)
Message 2 of 6

sajith_subramanian
Autodesk Support
Autodesk Support
Accepted solution

Hi @RodolfoZanni7664,

 

You can call the GetInspectionDimensionData method on the oDrawingDim object to read the label value.

 

So your code could be something as below:

 

 

  Dim Label As String
  Dim Rate As String
 
  For Each oDrawingDim In oSheet.DrawingDimensions
 
   If ODrawingDim.IsInspectionDimension = True
     oDrawingDim.GetInspectionDimensionData(kNoInspectionBorder, Label, Rate)
     MessageBox.Show(Label, "Label Value")  'Label should contain desired string value

 End If

 

Let me know if this helps.

 

 

Regards,

Sajith 


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 3 of 6

RodolfoZanni7664
Participant
Participant

Thank you very much !!!!

Please, if you can and if you want, where i can find the list of method like 'GetInspectionDimensionData'.

 

Thank you

R.Zanni

0 Likes
Message 4 of 6

sajith_subramanian
Autodesk Support
Autodesk Support

Hi @RodolfoZanni7664

 

You can refer to the Programming/ API help file that is included with inventor for any methods available on a particular object. 

(Inside Inventor click on Help -> Programming /API help to navigate to the help file). So,if you search for DrawingDimension it will give you all the methods and properties that apply to that object.

 

 

 Regards,

Sajith

 

 


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 5 of 6

RodolfoZanni7664
Participant
Participant
Great!,
thank you very much for your very fast answer !

R.Zanni
0 Likes
Message 6 of 6

ashleyU6MWT
Explorer
Explorer

Hi, is it possible to modify this code to extract stacked limit dimensions rather than upper and lower tolerances?

 

thanks you

0 Likes