Help with ilogic rule number type format

Help with ilogic rule number type format

Manuelcamposcosta
Advocate Advocate
830 Views
7 Replies
Message 1 of 8

Help with ilogic rule number type format

Manuelcamposcosta
Advocate
Advocate

Hello,

 

I made this rule to get the overall part dimensions but for the parameter "Comprimento" (Length) it's coming with incorrect decimal values.

This part is 500 mm long, all the other dimensions are correct, what I'm doing right? I'm new to inventor and a newbie in programming, there is an image of my parameters.

 

If you look at "Espessura" (Thickness) and "Largura" (Width) it's displaying right.

 

thanks!

 

oDoc = ThisDoc.Document 
If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" 'Verifica se é do tipo sheet metal e calcula as dimensões e organiza-as 
Comprimento = Max(SheetMetal.FlatExtentsLength, SheetMetal.FlatExtentsWidth) 
Largura = Min(SheetMetal.FlatExtentsLength, SheetMetal.FlatExtentsWidth) 
Espessura = Thickness 
End If 
If oDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" 'Verifica se é do tipo normal e calcula as dimensões e organiza-as 
Float= z 
Float = a 
Float = b 
Float = c 
a = Measure.ExtentsLength 
b = Measure.ExtentsHeight 
c = Measure.ExtentsWidth 
If a>b Then 
z = a 
a = b 
b = z 
End If 
If a>c Then 
z = a 
a = c 
c = z 
End If 
If b>c Then 
z = b 
b = c 
c = z 
End If 
Comprimento = c 
Largura = b 
Espessura = a 
End If 
Manuel Campos Costa
0 Likes
831 Views
7 Replies
Replies (7)
Message 2 of 8

johnsonshiue
Community Manager
Community Manager

Hi! Inventor 3D geometry is accurate up to 0.00001mm. The length value decimal point is much smaller than the geometry accuracy. It can be considered numerical noise. You can change Display Precision to avoid seeing the numerical noise (go to Tools -> Doc Settings -> Units -> Length Display Precision).

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 8

Manuelcamposcosta
Advocate
Advocate

I understand that, but it's funny because that dimension is the one I have control the others are related to the original size of the imported part.

 

Basically it's a sketch with a block from an imported file then I extrude it to "L" length, this dimension isn't correct but the others are.

 

Am I defining the values a/b/c/z  right?

Manuel Campos Costa
0 Likes
Message 4 of 8

Manuelcamposcosta
Advocate
Advocate

Can you see the attachment I made in the first post? Just noticed I can't see it.

Manuel Campos Costa
0 Likes
Message 5 of 8

mcgyvr
Consultant
Consultant

@Manuelcamposcosta wrote:

Can you see the attachment I made in the first post? Just noticed I can't see it.


We can see it but you need to download the image (press the down arrow icon to the right of the filename) and open it vs using the forums built in file viewer.

The built in file viewer is broken at the moment.



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 6 of 8

Curtis_Waguespack
Consultant
Consultant

Hi @Manuelcamposcosta 

 

You might just be able to use a round function to correct this... something like this:

 

Comprimento = Round(c,0)

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 7 of 8

Manuelcamposcosta
Advocate
Advocate

I understand all of those solutions but I don't understand is I'm not getting that noise in the others dimensions.

 

Do I need to place this in the code? If I delete them everything works the same.

 

Float= z 
Float = a 
Float = b 
Float = c 

 

Manuel Campos Costa
0 Likes
Message 8 of 8

Curtis_Waguespack
Consultant
Consultant

@Manuelcamposcosta wrote:

I understand all of those solutions but I don't understand is I'm not getting that noise in the others dimensions.

 

Do I need to place this in the code? If I delete them everything works the same.

 

Float= z 
Float = a 
Float = b 
Float = c 

 


Hi @Manuelcamposcosta ,

I'm not sure I see the need for those "Float" lines... as written it appears that  "Float" is just a string that is being set to z, then a, then b, then c... and then not used anywhere ... so it seems to be unneeded, but I don't see why that would be causing the problem either. 

 

If taking the Float lines out resolves the issue, then I would do so.... but you might also search the Inventor Customization forum for related issues, maybe someone has posted something there in the past that might shed some light on cause:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

EESignature