I did, a couple of months ago, a part with a rule containing some input boxes. It worked without a bug and set it as a specific template, on Inventor 2012.
I tried to reuse it as a template without changing its rule on Inventor 2013. When the input box pops out and ask the value it needs, if I type "0.2" it says that "string's conversion "0.2" in a 'double' type isn't valid". But if I type "0,2" I have absolutely no problems.
Work on widows 7
Autodesk design suite premium 2013 french.
Hi voutilainen,
Can you post the code, and maybe an example part with the rule setup within?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi Curtis. Thanks for taking a look. Here is the code. The fact is that most of input in boxes are in french, I hope you'll understand the requests.
Travail = InputListBox("Selection du travail a effectuer", MultiValue.List("Travail"), Travail, Title := "Travail", ListName := "") Norme = InputListBox("Selection de la norme désirée", MultiValue.List("Norme"), Norme, Title := "Norme", ListName := "Normes disponibles:") If Norme = "NIHS 20-25" Then Type= "Renvoi" MultiValue.SetList("Type", "Renvoi") ElseIf Norme = "NIHS 20-02" Then MultiValue.SetList("Type", "Pignon", "Roue") Type = InputListBox("Selection roue ou pignon", MultiValue.List("Type"), Type, Title := "Type", ListName := "Type de pièce:") End If If Travail = "Modification" Then If Norme = "NIHS 20-25" Then Select Case Nombre_dents Case <8 MessageBox.Show("Le nombre de dents est trop petit. 8 dents minimum.", "Erreur",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error) End Select Else If Norme = "NIHS 20-02" Then If Type = "Pignon" Then Select Case Nombre_dents Case <6 MessageBox.Show("Le nombre de dents est trop petit. 6 dents de pignon minimum", "Erreur",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error) Nombre_dents=6 Goto setpignon Case >20 MessageBox.Show("Le nombre de dents est trop grand. 20 dents de pignon maximum", "Erreur",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error) Nombre_dents=20 End Select ElseIf Type = "Roue" Then Select Case Nombre_dents_pignon Case <6 MessageBox.Show("Le nombre de dents est trop petit. 6 dents de pignon minimum", "Erreur",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error) Nombre_dents_pignon=6 Goto setroue Case >20 MessageBox.Show("Le nombre de dents est trop grand. 20 dents de pignon maximum", "Erreur",MessageBoxButtons.RetryCancel,MessageBoxIcon.Error) Nombre_dents_pignon=20 End Select End If End If Goto miseajour ElseIf Travail = "Nouvelle pièce" Then If Norme = "NIHS 20-25" Then setrenvoi: Nombre_dents = InputBox("Entrez le nombre de dents du renvoi:","NIHS 20-25", "") Select Case Nombre_dents Case <8 MessageBox.Show("Le nombre de dents est trop petit. 8 dents minimum.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto setrenvoi End Select Module = InputBox("Entrez le module du renvoi:","NIHS 20-25 ","") Epaisseur = InputBox("Entrez l'épaisseur du renvoi:","NIHS 20-25 ","") ElseIf Norme = "NIHS 20-02" Then If Type= "Pignon" Then setpignon: Nombre_dents = InputBox("Entrez le nombre de dents du pignon:","NIHS 20-02", "") Select Case Nombre_dents Case <6 MessageBox.Show("Le nombre de dents est trop petit. 6 dents de pignon minimum", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Nombre_dents=6 Goto setpignon Case >20 MessageBox.Show("Le nombre de dents est trop grand. 20 dents de pignon maximum", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Nombre_dents=20 Goto setpignon End Select Module = InputBox("Entrez le module du pignon:","NIHS 20-02","") Epaisseur = InputBox("Entrez l'épaisseur du pignon:","NIHS 20-02","") ElseIf Type= "Roue" Then setroue: Nombre_dents_pignon = InputBox("Entrez le nombre de dents du pignon engrenant avec la roue :","NIHS 20-02", "") Select Case Nombre_dents_pignon Case <6 MessageBox.Show("Le nombre de dents est trop petit. 6 dents de pignon minimum", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Nombre_dents_pignon=6 Goto setroue Case >20 MessageBox.Show("Le nombre de dents est trop grand. 20 dents de pignon maximum", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Nombre_dents_pignon=20 Goto setroue End Select Nombre_dents = InputBox("Entrez le nombre de dents de la roue:","NIHS 20-25", "") Module = InputBox("Entrez le module de la roue:","NIHS 20-02","") Epaisseur = InputBox("Entrez l'épaisseur de la roue:","NIHS 20-02","") End If End If Type_centre = InputListBox("Selection du type de centre", MultiValue.List("Type_centre"), Type_centre, Title := "Centre", ListName := "Type de centres:") If Type_centre = "Trou" Then settrou: Dia_trou = InputBox("Diamètre du trou:", "Trou", "") If (Dia_trou+0.5)>Dfond Then MessageBox.Show("Diamètre du trou trop grand.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto settrou End If tolsuptrou = InputBox("Tolérance supérieure du trou:", "Trou", "") tolinftrou = InputBox("Tolérance inférieure du trou:", "Trou", "") ElseIf Type_centre = "Tigerons et pivots" Then settigesup: Dia_tige_sup = InputBox("Diamètre du tigeron supérieur:", "Tigeron supérieur", "") If (Dia_tige_sup+0.10)>Dfond Then MessageBox.Show("Diamètre du tigeron supérieur trop grand.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto settigesup End If L_tige_sup = InputBox("Longueur du tigeron supérieur:", "Tigeron supérieur", "") settigeinf: Dia_tige_inf = InputBox("Diamètre du tigeron inférieur:", "Tigeron inférieur", "") If (Dia_tige_inf+0.10)>Dfond Then MessageBox.Show("Diamètre du tigeron inférieur trop grand.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto settigeinf End If L_tige_inf = InputBox("Longueur du tigeron inférieur:", "Tigeron inférieur", "") setpivotsup: Dia_pivot_sup = InputBox("Diamètre du pivot supérieur:", "Pivot supérieur", "") If (Dia_pivot_sup+0.10)>Dia_tige_sup Then MessageBox.Show("Diamètre du pivot supérieur trop grand.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto setpivotsup End If tolsuppivotsup = InputBox("Tolérance supérieure du pivot supérieur:", "Pivot supérieur", "") tolinfpivotsup = InputBox("Tolérance inférieure du pivot supérieur:", "Pivot supérieur", "") L_pivot_sup = InputBox("Longueur du pivot supérieur:", "pivot supérieur", "") setpivotinf: Dia_pivot_inf = InputBox("Diamètre du pivot inférieur:", "Pivot inférieur", "") If (Dia_pivot_inf+0.10)>Dia_tige_inf Then MessageBox.Show("Diamètre du pivot inférieur trop grand.", "Erreur",MessageBoxButtons.OK,MessageBoxIcon.Error) Goto setpivotinf End If tolsuppivotinf = InputBox("Tolérance supérieure du pivot inférieur:", "Pivot inférieur", "") tolinfpivotinf = InputBox("Tolérance inférieure du pivot inférieur:", "Pivot inférieur", "") L_pivot_inf = InputBox("Longueur du pivot inférieur:", "pivot supérieur", "") Type_bouts = InputListBox("Selection du type de terminaison des pivots", MultiValue.List("Type_bouts"), Type_bouts, Title := "Type de terminaison", ListName := "Type de terminaisons:") End If MultiValue.List("Matière") = iProperties.Materials Matière = InputListBox("Selection de la matière", MultiValue.List("Matière"), Matière, Title := "Matière", ListName := "Matières disponibles:") End If miseajour: If Norme = "NIHS 20-25" Then Type= "Renvoi" MultiValue.SetList("Type", "Renvoi") Select Case Nombre_dents Case 8 Facteur_f=2.32 Case 9 Facteur_f=2.34 Case 10,11 Facteur_f=2.38 Case 12,13 Facteur_f=2.40 Case 14 To 16 Facteur_f=2.44 Case 17 To 20 Facteur_f=2.48 Case 21 To 25 Facteur_f=2.52 Case 26 To 34 Facteur_f=2.54 Case 35 To 54 Facteur_f=2.58 Case 55 To 134 Facteur_f=2.62 Case >= 135 Facteur_f=2.64 End Select Dtete=Module*(Nombre_dents+Facteur_f) Dprimitif=Module*Nombre_dents Dfond=Module*(Nombre_dents-3.5) Epaisseur_s=1.41*Module Rogive=0.8*Facteur_f*Module Distance_t=Rogive-(Epaisseur_s/2) ElseIf Norme = "NIHS 20-02" Then MultiValue.SetList("Type", "Pignon", "Roue") If Type= "Pignon" Then Select Case Nombre_dents Case 6 ha=1.64 hf=3.20 r=1.05 Case 7 ha=1.64 hf=3.30 r=1.05 Case 8 ha=1.52 hf=3.40 r=0.95 Case 9 ha=1.52 hf=3.45 r=0.95 Case 10 ha=1.52 hf=3.50 r=0.95 Case 11 To 20 ha=1.44 hf=3.60 r=0.85 End Select Dtete=Module*(Nombre_dents+ha) Dprimitif=Module*Nombre_dents Dfond=Module*(Nombre_dents-hf) Epaisseur_s=1.10*Module Rogive=r*Module Distance_t=Rogive-(Epaisseur_s/2) ElseIf Type= "Roue" Then Select Case Nombre_dentspignon Case 6 ha=2.40 hf=2.80 Case 7 ha=2.50 hf=2.70 Case 8 ha=2.60 hf=2.60 Case 9 ha=2.65 hf=2.55 Case 10 ha=2.70 hf=2.50 Case 11 To 20 ha=2.80 hf=2.40 End Select Dtete=Module*(Nombre_dents+ha) Dprimitif=Module*Nombre_dents Dfond=Module*(Nombre_dents-hf) Epaisseur_s=1.60*Module Rogive=2.00*Module Distance_t=Rogive-(Epaisseur_s/2) End If End If If Type_centre = "Aucun" Then Feature.IsActive("Trou") = False Feature.IsActive("Chanfreins trou") = False Feature.IsActive("Chanfreins pivots") = False Feature.IsActive("Sphères pivots") = False Feature.IsActive("Chanfreins tigerons") = False Feature.IsActive("Pivot inférieur") = False Feature.IsActive("Pivot supérieur") = False Feature.IsActive("Tigeron inférieur") = False Feature.IsActive("Tigeron supérieur") = False ElseIf Type_centre = "Trou" Then Feature.IsActive("Chanfreins pivots") = False Feature.IsActive("Sphères pivots") = False Feature.IsActive("Chanfreins tigerons") = False Feature.IsActive("Pivot inférieur") = False Feature.IsActive("Pivot supérieur") = False Feature.IsActive("Tigeron inférieur") = False Feature.IsActive("Tigeron supérieur") = False Parameter.Param("Dia_trou").Tolerance.SetToDeviation(tolsuptrou, tolinftrou) Feature.IsActive("Trou") = True Feature.IsActive("Chanfreins trou") = True ElseIf Type_centre = "Tigerons et pivots" Then Feature.IsActive("Trou") = False Feature.IsActive("Chanfreins trou") = False Feature.IsActive("Tigeron supérieur") = True Feature.IsActive("Tigeron inférieur") = True Feature.IsActive("Chanfreins tigerons") = True Parameter.Param("Dia_pivot_sup").Tolerance.SetToDeviation(tolsuppivotsup, tolinfpivotsup) Feature.IsActive("Pivot supérieur") = True Parameter.Param("Dia_pivot_inf").Tolerance.SetToDeviation(tolsuppivotinf, tolinfpivotinf) Feature.IsActive("Pivot inférieur") = True If Type_bouts = "Aucun" Then Feature.IsActive("Chanfreins pivots") = False Feature.IsActive("Sphères pivots") = False ElseIf Type_bouts ="Chanfreins" Then Feature.IsActive("Sphères pivots") = False Feature.IsActive("Chanfreins pivots") = True ElseIf Type_bouts = "Sphères" Then Feature.IsActive("Chanfreins pivots") = False Feature.IsActive("Sphères pivots") = True End If End If iProperties.Material = Matière iLogicVb.UpdateWhenDone = True
This a code for creating a gear from a swiss horological standard.
Here it is a part with the code. If you just want to check to the rule, when the first list box opened, you should choose "modifications" and then "NIHS 20-25" and then nothing will happened to the part.
I must add that I'm a selfmade man in this case, I never learned how to code a thing, so maybe some things could looks absurd to you.
Hi voutilainen,
I tested your file in 2013 and could not replicate the issue using a decimal point or comma. I tried going to Tools tab > Application Options > File tab > Configure Default Template, but I'm not sure how that would even be a likely cause, and indeed it had no impact on the results.
Unfortunately, I don't have any suggestions other than that you might post a new topic on the Inventor Customization forum (posting a link back to this thread maybe). I think you might have a better chance of getting someone with a solution on that forum. Also, be sure and add the words Inventor 2013 to the thread title. The Autodesk staff members are watching for issues with the new 2013 release and I think this might be "2013" related. So hopefully one of them will have a look.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I simply opened the part in 2013 and I got a lot of errors in the part.
Esquisse12
constraint to unresolved reference geometry
dimension to unresolved reference geometry
more ......
Esquisse13
constraint to unresolved reference geometry
dimension to unresolved reference geometry
more.....
This may be effecting your script?
Otherwise, as a template I don't get any errors inputting a dot or a comma and the derived part does not contain any errors.
Hi andy, thanks for your reply.
The issues you've got are because those revolutions are made on sketch who needs a geometry from the part that does'nt exist yet, until you choose to add some pivots when you're choosing to do a "nouvelle pièce".
Thanks for trying it.