iLogic Assistance With Parameters and such for a ladder

iLogic Assistance With Parameters and such for a ladder

SleikerBF
Contributor Contributor
1,291 Views
11 Replies
Message 1 of 12

iLogic Assistance With Parameters and such for a ladder

SleikerBF
Contributor
Contributor

Good morning, 

I'm new to iLogic I have a real basic understanding of this but with what my manager has tasked me with is quite more advanced. I'm doing a ladder that has a 10 degree incline that is constant always. the Height is a max of 20' so how as well a max rung span from 10"-14" and the first rung off the ground has a min and max of 6"-14". How exactly do you go about creating code/parameters to do this I'm slightly lost and overwhelmed.

Any help is appreciated with this topic.

0 Likes
Accepted solutions (1)
1,292 Views
11 Replies
Replies (11)
Message 2 of 12

WCrihfield
Mentor
Mentor

OK. So, it sounds like the following things are the variables in this situation:

  • Overall Height
  • First Step Height
  • Other Steps Offset
  • Quantity Of Steps

I would create UserParameters for those numbers.

What will be the Input values from the user, to control the size of the finished product?

I assume that since there are so many variables, there are also a number of input possibilities.

Is the Overall Height going to be one of the direct entries the 'user' will be specifying?

You will most likely have to specify a mathematical equation within the Equation column of the Parameters dialog box for the First Step Height, Other Steps Offset, and the Quantity Of Steps parameters, which reference the Overall Height parameter, but since they have an acceptable range, just put a simple value in place for now.

Next you would create an iLogic rule within that document.  We can specify how those Parameters will be figured within that rule.  You can use If...Then...End If statements to check if the controlling input values are equal to, greater than, or less than, to make sure the values that have acceptable ranges to them, stay within those ranges.  Then do some division by the Overall Height to get your quantity of steps.  Just for starters.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 12

SleikerBF
Contributor
Contributor

How would you write code to accommodate saying height cant go past 240 and cant go less then just say 12 inches?

0 Likes
Message 4 of 12

WCrihfield
Mentor
Mentor

Here is a simple example of the code you can use within a local iLogic rule to limit the value of a parameter named "Overall_Height" to a value between 12 and 240.  If you enter a number higher it tells you, then sets the value to the maximum limit.  If you enter a value to low, it tells you, then sets the value to the minimum limit.

 

 

If Overall_Height > 240 Then
	MsgBox("That Overall Height is too tall.  Please enter a value between 12 and 240.", vbOKOnly, "TOO TALL")
	Overall_Height = 240
ElseIf Overall_Height < 12 Then
	MsgBox("That Overall Height is too short.  Please enter a value between 12 and 240.", vbOKOnly, "TOO SHORT")
	Overall_Height = 12
End If

 

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 12

J-Camper
Advisor
Advisor

I've done something similar to what your asking:

'Forces length of component to fall between avalible lengths
If DESIRED_L > MIN_L And DESIRED_L < MAX_L
	LENGTH = DESIRED_L
Else If DESIRED_L < MIN_L
	LENGTH = MIN_L
Else If DESIRED_L > MAX_L
	LENGTH = MAX_L
End If
'Forces length of component to fall between avalible lengths

This sample is based on a group of Parameters, but some of the variables [like MAX_L & MIN_L] could be coded into the rule instead.  The user changes "DESIRED_L" but the model sketch is based on "LENGTH".

 

You can do a similar thing with the bottom rung and then the quantity & spacing of the subsequent rungs.

 

For the subsequent rungs I would use a array along the axis of the ladder pitch, to easily control quantity and spacing without modifying sketches. 

 

If you want more help, I have a simple ladder I made recently that I could write a similar rule to control and share that.  Just let me know.

0 Likes
Message 6 of 12

SleikerBF
Contributor
Contributor

One last question how would one go about creating a formula for say Height has spaces divided by so many spaces with a min of 10" and max of 14" how would you go about this? Sorry this is all new to me like started only 3 days ago. 

0 Likes
Message 7 of 12

SleikerBF
Contributor
Contributor

Would you be able to share the ladder it be nice to look at the code to better understand it. 

0 Likes
Message 8 of 12

SleikerBF
Contributor
Contributor

Also this is to anyone who know how to get around this is there an easy way to adjust for the slope of something when using a rectangular pattern? cause I want the max not to be going with the slope but instead of vertical.

SleikerBF_0-1586541862750.png

SleikerBF_1-1586542135911.png

 

cause in the dialogue box for the spacing it really comes out to be 12.185 for 12  like the RUNG_SPACING shown is how i measure the max/min spacing. And if you do 10 then the dialogue box should be 10.154 I know there should be an equation that you can use but not sure what that equation would be and how to use it in code so everything updates all at once.

0 Likes
Message 9 of 12

WCrihfield
Mentor
Mentor

Unless you want to get into a bunch of Trigomometry math, I suggest you use sketches and sketch-based patterns to control the pattern, instead of trying to pattern an already existing solid body.  Or you can use a "Sketch Driven" pattern to pattern the first solid body.  Either way, instead of your pattern being constained to a rectangular pattern, you can use a dimensioned construction line to set your angle, then create a point (or your step profile) on it, then pattern that point (or step profile) along the construction line.  When creating this sketch pattern, use the Quantity parameter and the Spacing parameter within it.  Then you can use that sketch to either extrude your steps (if you used the profile sketches), or base your "Sketch Driven" pattern by (if you used the points).


If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 10 of 12

J-Camper
Advisor
Advisor

Here is a simple ladder I made a while ago for wood construction.  It didn't have any size controlling rules to begin with because it was a one-off for a project.  I added a simple rule to control the upper and lower bounds of several key parameters which should be a good starting point if you want to make the part smarter.  The rung spacing is handled by the settings in "Rectangular Pattern1"

0 Likes
Message 11 of 12

SleikerBF
Contributor
Contributor

Here is my assembly

0 Likes
Message 12 of 12

J-Camper
Advisor
Advisor
Accepted solution

I played around with your assembly a little, and did a little bit of parameter naming in your part files.  I have re-attached the files to this post.  I think it is functioning the way you want it to, so take a look at them and let me know if you have any questions.

0 Likes