Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Thread Error

1 REPLY 1
Reply
Message 1 of 2
mjtubos
341 Views, 1 Reply

Thread Error

hello

I have a rule in part, to scale automatically when the file is opened.
I am encountering error when performing the thread in the rule.

 

in line to apply the new thread, the following error appears:

 

 

 

Sub Main() 
If DI>=DE Then
   MessageBox.Show("Diametro Interno NaO pode ser superior ao Externo", "Title")
   Return

End If

Parameter("diam_ext") = DE
Parameter("diam_int") = DI
Parameter("compr") = L

 If temrosca = "TRUE" Then
    Feature.IsActive("Rosca_Graxeira")="True"
    Feature.IsActive("Furo_grax")="True"
    Feature.IsActive("Chanfro_rosca")="True"
    
    If rosca = "1/8 BSP"  Then
            diam_rosca = "8.8"
            Feature.SetThread("Rosca_Graxeira", "BSP Pipe Threads", "G 1/8-28", "")
    
    ElseIf rosca = "1/8 GAS" Then
            diam_rosca = "8.55"
            Feature.SetThread("Rosca_Graxeira", "BSP Pipe Threads", "G 1/8-28", "")
            
    ElseIf rosca = "1/8 NPT" Then
            diam_rosca = "8.70"
            Feature.SetThread("Rosca_Graxeira", "NPT", "1/8 -27NPT", "")
        
    ElseIf rosca = "3/8 BSP" Then
            diam_rosca = "15.3"
            Feature.SetThread("Rosca_Graxeira", "BSP Pipe Threads", "G 3/8-19", "")

    ElseIf rosca = "M10 x 1" Then
            diam_rosca = "9"
            Feature.SetThread("Rosca_Graxeira", "ANSI Metric M Profile", "M10x1", "6H")

    ElseIf rosca = "M6 x 1" Then
            diam_rosca = "5"
            Feature.SetThread("Rosca_Graxeira", "ANSI Metric M Profile", "M6x1", "6H")

    ElseIf rosca = "M8 x 1" Then
            diam_rosca = "7"
            Feature.SetThread("Rosca_Graxeira", "ANSI Metric M Profile", "M8x1", "6H")

    ElseIf rosca = "M8 x 1,25" Then
            diam_rosca = "7.75"
            Feature.SetThread("Rosca_Graxeira", "ANSI Metric M Profile", "M8x1.25", "6H")

    End If
    
    Parameter.UpdateAfterChange = True

    
 Else
    Feature.IsActive("Rosca_Graxeira")="False"
    Feature.IsActive("Furo_grax")="False"
    Feature.IsActive("Chanfro_rosca")="False"
    Return
 End If


 Return
End Sub
Marcus Roberto Jung
Mechanical Engineer / / Porto Alegre / / Brazil

Inventor Pro 2013
Intel Core i7 12GB RAM
Windows 7 - 64bits
1 REPLY 1
Message 2 of 2
Holgarsson
in reply to: mjtubos

Try removing the "8.8" from the dimension assignment.

 

diam_rosca = 8.8

 

etc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report