iLogic decimal

iLogic decimal

Cosmin_V
Advocate Advocate
601 Views
7 Replies
Message 1 of 8

iLogic decimal

Cosmin_V
Advocate
Advocate

Hi Everybody,

 

I have an iLogic assembly in which I what to see the value of 2 angels from a part.

For this I wrote this line.

Front_L_Angle = Parameter(oBin.Name,  "d45")
Front_R_Angle = Parameter(oBin.Name,  "d49")

If the "d45" is =37,56 deg. I dont understend why Front_L_Angle is = 37,5685920288275 deg.

Can the code be improved to show only 2 decimal?

 

Many thanks!

 

 

0 Likes
Accepted solutions (1)
602 Views
7 Replies
Replies (7)
Message 2 of 8

Justin.B.
Enthusiast
Enthusiast
Accepted solution
Round(Front_L_Angle,2)

 

0 Likes
Message 3 of 8

bradeneuropeArthur
Mentor
Mentor

Hi,

 

You need a kind of round-down:

Floor is the function you need:

 

Public Sub main
	
	Dim a As Double
	a = 1.23456
	
	MsgBox (floor(a*100)/100)
	End Sub
	

Round Down:

Ceil is the function you need then

 

Public Sub main
	
	Dim a As Double
	a = 1.23456
	
	MsgBox (Ceil(a*100)/100)
	End Sub
	

What you need is:

Public Sub main
	
	Dim a As Double
	a = 1.23456
	
	MsgBox (floor(d45*100)/100)
	End Sub

Like this:

Parameter("Front_L_Angle") = "floor(d45 / 1 deg * 100 ul) / 100 ul * 1 deg"
Parameter("Front_L_Angle") = "floor(d49 / 1 deg * 100 ul) / 100 ul * 1 deg"

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 8

Cosmin_V
Advocate
Advocate

Hi

 

Thanks, but no one of this codes are not working. 😞

0 Likes
Message 5 of 8

bradeneuropeArthur
Mentor
Mentor

could you upload the ipt file?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 8

Cosmin_V
Advocate
Advocate

No, unfortunately Im not aloud…:(

0 Likes
Message 7 of 8

bradeneuropeArthur
Mentor
Mentor

can you make a snapshot of the parameterbox

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 8 of 8

Cosmin_V
Advocate
Advocate

I create something similar whit the original...I hope is useful….

0 Likes