custom parameters

custom parameters

stevehattCXSXP
Explorer Explorer
1,423 Views
12 Replies
Message 1 of 13

custom parameters

stevehattCXSXP
Explorer
Explorer

scenario - I have a part 500mm long that has 2 holes in it, if I want to increase it to 750mm I want 3 holes in it (equally spaced) and depending on rule to increase number of holes based on overall length, over 1000mm 4 holes etc etc.

Is there a way to create a custom parameter to work this out? I can do it with the same amount of holes and automatically adjust the spacing but can't get my head around increasing the number of holes based on changing the length...

0 Likes
Accepted solutions (1)
1,424 Views
12 Replies
Replies (12)
Message 2 of 13

jacob.michaels
Enthusiast
Enthusiast
Make a user parameter with no value that's your desired relationship between length and the number of holes. In this case (length/250mm). if length=750, the value will be 3. Use this parameter as the number value in a rectangular pattern, or pattern on path. you can play around more with this and add more granularity to this by adding floor() to the function to round the value down until you get to your next whole number.
Message 3 of 13

kandennti
Mentor
Mentor

Hi @stevehattCXSXP -San.

 

I'm not talking about the API, am I?


An update a while ago made IF minutes available as a parameter, so you can make a conditional decision.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-76272551-3275-46C4-AE4D-10D58B408C20 

1.png

 

 

This is a Japanese forum, so everything is in Japanese, but we all had fun sharing ideas about a modeling problem where the number of reinforcing ribs changes depending on the height of the boss.

https://forums.autodesk.com/t5/fusion-360-ri-ben-yu/ribuno-ben-shuga-ke-biansurumoderu/m-p/11936412 

0 Likes
Message 4 of 13

stevehattCXSXP
Explorer
Explorer

Hi, I can relate to this but can only get it to give me a couple of variables. 

My scenario is to return a value to meet the following -

'length'<500,2

'length'>499<750,3

'length'>750<1000,4

else 1

 

(if(length<500;2;if((length>499);3;if(length>750;4;1)))) fusion accepts the expression but it doesn't work, only the first 2 arguments. 

 

What am I missing please, or is there another way of doing it?

0 Likes
Message 5 of 13

Jorge_Jaramillo
Collaborator
Collaborator

Hi @stevehattCXSXP ,

 

This formula works for me:

if(length <= 500 mm; 2; if(length <= 750 mm; 3; if(length <= 1000 mm; 4; 1)))

wtallerdemadera_1-1693319932654.png

 

Please note that if you want to use "number_holes" variable in a dimension that is not related to a distance, it has to be defined without unit.

 

Regards,

Jorge Jaramillo

Software Engineer

 

 

 

Message 6 of 13

kandennti
Mentor
Mentor

@stevehattCXSXP -San.

 

Your expression "499.5" would not give the desired result, since both "length<500" and "length>499" would be valid.


It is easier to understand if the direction of the inequality sign is unified.

length < 500 mm --> 2
length < 750 mm --> 3
length < 1000 mm --> 4
more than that --> 5

 

the following will do what you want.

if(length < 500 mm; 2; if(length < 750 mm; 3; if(length < 1000 mm; 4; 5)))

 

The file is attached.

0 Likes
Message 7 of 13

stevehattCXSXP
Explorer
Explorer

Thanks for that, makes sense. Now I need to learn how to introduce this into a pattern to drive the number of holes in a component.  This is where I am at but I can't assign the 'spacing' to the R-Pattern, any ideas please?

stevehattCXSXP_0-1693322090286.png

 

0 Likes
Message 8 of 13

Jorge_Jaramillo
Collaborator
Collaborator

Hi @stevehattCXSXP,

 

This are the parameters and its expressions:

wtallerdemadera_0-1693324941835.png

 

The R-Pattern was defined like so:

wtallerdemadera_1-1693324992290.png

 

 

And this is the result:

wtallerdemadera_2-1693325038698.png

 

 

I hope this could help you out.

 

Regards,

Jorge Jaramillo

Software Engineer

 

 

Message 9 of 13

stevehattCXSXP
Explorer
Explorer

Thanks, that looks what I am after. However, the issue I keep getting is that it won't allow me to input anything other than a numerical answer in the 2 yellow boxes. If I type number_holes the text stays red and then disappears when I hit return.

stevehattCXSXP_0-1693381079363.png

 

0 Likes
Message 10 of 13

Jorge_Jaramillo
Collaborator
Collaborator
Hi,
Could you share in an image how are you parameters defined?
I believe you have issues with the units.
0 Likes
Message 11 of 13

stevehattCXSXP
Explorer
Explorer

stevehattCXSXP_0-1693399052533.png

 

0 Likes
Message 12 of 13

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

Hi,

 

This is your problem:

wtallerdemadera_0-1693399226908.png

Delete number_holes parameter and re-create it WITHOUT units.

 

 

 

 

Message 13 of 13

stevehattCXSXP
Explorer
Explorer

thanks for everyone's help, I can see how it works now!

0 Likes