iLogic Help

iLogic Help

Anonymous
Not applicable
361 Views
3 Replies
Message 1 of 4

iLogic Help

Anonymous
Not applicable

I am designing some code to provide the quantity of rungs for a ladder of a certain order size with a certain space from top and bottom of concrete. 

 

If they order 4000mm, the amount of rungs that can fit are 4000 ("ORDER")-200("First_rung") / 300 ("RungSpace") = 12.67 so 13.

This makes the space between the bottom rung and the ground: 4000 - [ 12*300 (one less) +200 ] = 200mm

 

The critical points are when the bottom rung is 0<x<50, in these cases we want parameter "First_rung" to be changed to 150. 0 is fine because in this case it will compute 12 rungs and 50 is fine because the bottom rail will be touching the ground. I have some code working that was half right, then i re-wrote in an effort to clean it up but now the "Rungs" parameter is just staying at 0. 

0 Likes
362 Views
3 Replies
Replies (3)
Message 2 of 4

Mark.Lancaster
Consultant
Consultant

@Anonymous

 

iLogic/programming questions and issue should be posted in the Inventor Customization forum https://forums.autodesk.com/t5/inventor-customization/bd-p/120 for best results.   I will have the moderator relocate it there to better suit your needs.

 

 

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 4

bradeneuropeArthur
Mentor
Mentor

use floor()

or Use Ceil()

e.g.:

parx = 12.34

pary =Ceil(parx) >>> gives 13

pary =floor(parx) >>> gives 12

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
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 !

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 4

Anonymous
Not applicable

Arthur,

 

My question was more how to ensure the spacing changes from 150 to 200 and back to 200 when not needed. But i figured it out by getting rid of the value + (or -) 50 line and making it a direct swap.

 

Thanks for looking into it though!

 

SyntaxEditor Code Snippet

Parameter("Rungs") = Ceil((Order-FirstRung)/RungSpace)

VarSpace = Order-FirstRung-(Parameter("Rungs")-1)*300

If (VarSpace > 0) AndAlso (VarSpace < d2) Then
	Parameter("FirstRung") = 150
	Else
		Parameter("FirstRung") = 200
	End If

 

0 Likes