IF Statements in

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 มิ.ย. 2024
  • In this video we are going to take a look at the newly added IF statement logic in Fusion 360 parameters. This has been a long time coming and at a first glance is a bit tricky to use, so in this video we are going to look at 3 cases and walk through how to build out IF, Nested IF and logic based parameters.
    If you want to follow along here is the dataset in the video.
    a360.co/43DqfjY
    And here is a link to the Fusion 360 help fil.
    help.autodesk.com/view/fusion...
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 36

  • @timangus
    @timangus ปีที่แล้ว +11

    I think a more intuitive way of writing nested ifs for the purposes of ranges is to keep the operator sense the same for each conditional. e.g.:
    if( FlangeOD >= 6 in; 8; if( FlangeOD >= 5 in; 6; 4 ))
    That way the resultant values are always close to their respective condition and the last value is always the if-nothing-else-matches value. Much easier to read:
    if( FlangeOD >= 8 in; 10; if( FlangeOD >= 6 in; 8; if( FlangeOD >= 5 in; 6; if( FlangeOD >= 4 in; 4; 3 ))))

    • @jpjpJPJPG
      @jpjpJPJPG ปีที่แล้ว +1

      That's what my brain wanted to see, thank you for that.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  ปีที่แล้ว +3

      Great point Tim! Something I overlooked making the video since my end goal wasn't really a functional part, but I 100% agree with you! Pinned the comment so others can see. thanks

    • @woodcraftloop
      @woodcraftloop 8 หลายเดือนก่อน

      Yeah, the if statement can be written exactly like in a MS Excel. No need to bracket the nested if's.

  • @thePawelSroczynski
    @thePawelSroczynski 9 หลายเดือนก่อน +2

    your video seems to be the only one on YT on conditionals in fusion right now.
    thanks! ;-)

  • @bwilliams1815
    @bwilliams1815 ปีที่แล้ว +1

    Truly awesome. I got frustarted with syntax errors in Creo for years. Did not use parameter charts. Will try again in Fusion. Thanks for the videos like always.

  • @hillfortherstudios2757
    @hillfortherstudios2757 11 หลายเดือนก่อน

    I can tell this will take some practice and likely some further training. Thanks for this video!

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  11 หลายเดือนก่อน

      Yes it will, but worth it for sure. I have been using it on a few designs since it was released. Not perfect but great for configuring a design.

  • @michaellitzkow8123
    @michaellitzkow8123 ปีที่แล้ว +1

    Many of us have been waiting years for this! I used to shake my head and wonder - isn't this program created by programmers? How can they fail to understand that you need logic statements in parameters? Every time I saw my timeline populate with cascading errors and couldn't find a way around it because of this lack, I would just sigh - oh this again... It's too bad they have failed to include a "switch" or "case" statement for handling ranges. It would be soooo much nicer. Anyway, many thanks for introducing this great new feature.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  ปีที่แล้ว

      yup. There are some ways around it sort of (the switch/case example). min and max in conjunction with if/and/or maybe. but it does seem very odd that we just got If and i have been asking for years for it :)

  • @gabrielemastaglio4240
    @gabrielemastaglio4240 6 หลายเดือนก่อน

    GRAZIE MILLE MI HAI AIUTATO TANTISSIMO.
    COMPLIMENTI PER IL TUTORIAL E BUONA VITA!

  • @evo-labs
    @evo-labs ปีที่แล้ว +6

    It's the year 2023 and we are celebrating a CAD tool adding ternary if statements to its parameters that should have been added years ago 🤣

  • @Markevans36301
    @Markevans36301 8 หลายเดือนก่อน

    Thank you so much for this! I knew you could do any of this if you wanted to get fancy shmancy and write a python script but I had no idea that I could do these things right from the parameters box. This could be a game changer as I progress. Sure would be nice to design a box once and then control its size and number of dividers etc. without writing a full program.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  8 หลายเดือนก่อน

      Agreed, it tool a long time for IF to make it into the parameters. This and the new addition of configurations (if you are on a commercial or edu license) really helps with the types of designs you are talking about.

  • @r3dsign
    @r3dsign ปีที่แล้ว +2

    Its time to fusion add some nodes like grasshopper it would be amazing to get sliders and in full parametric design enviroment.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  ปีที่แล้ว

      That would be cool! There used to be something close called Dynamo(which is still around) and had a plugin for Fusion, but that was dropped a few years ago. dynamobim.org/download/ I haven't tried the Sandbox yet but if you google Dynamo Fusion 360 I am sure some old videos will surface.

  • @trunkerdixon
    @trunkerdixon ปีที่แล้ว

    Very helpful.
    T

  • @spiderpat21
    @spiderpat21 10 หลายเดือนก่อน

    Here's a subject that will meet my expectations. Coming from a CAD/CAM practice for 38 years on Siemens NX (formerly MacDonald Douglass' Unigraphics), Siemens Solid Edge and SolidWorks before retiring. Siemens NX was my favorite software right from the introduction of freeforms, which could be combined with surface and modeling. This was a daily practice that I didn't even know existed in Fusion360. The sintaxis of the conditional is close to that in Siemens NX. What I also regret is the possibility of working with Excel files to retrieve variables and inject them into Fusion360.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  10 หลายเดือนก่อน

      Thanks for sharing! I used NX 3/4 back in probably 2006 time frame and i was a Solidworks user from 2008 to 2019. I had done a lot with design tables for configuring models, even VBA scripts in excel to control models as well as working with Driveworks. I know exactly what you mean on the spreadsheets. I wish that was in Fusion, even to the level it is in Inventor. There will be an update in September that I am hoping will bring some more functionality in this area.
      On the freeform model, NX being built for big industry had some great tools. Solid Edge not so much(for me). the freeform tools were somewhat of a joke sadly. For solidworks the add-in Power Surfacing was a great and I highly recommend it to anyone staying in the solidworks ecosystem. Their 3d Experience has SubD, but its not "there".

    • @gedr7664
      @gedr7664 8 หลายเดือนก่อน

      there's an addon for that called sheeter - it uses google sheets

  • @David_Best
    @David_Best ปีที่แล้ว +2

    Great, thanks for doing this. Now, you said you'd prefer to work this out in something like Excel first, so I'd like to see how you'd take IF/THEN/ELSE logic from an Excel worksheet and pull that directly into Fusion. I've been doing all this complicated conditional work in Excel having it create the output variables that I plug into Parameters in Fusion, but I'd rather have the logic in Fusion itself rather than in an adjunct Excel file. A classic case I work with is a Fusion model for a kitchen cabinet, where the number if drawers varies, and the relative height of each drawer face varies in proportion to the number of drawers.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  ปีที่แล้ว

      Thanks David, that part may have been a little misleading because the formatting is a little different so its not just a copy paste method. I just meant to work out the logic. Excel does a lot of auto formatting in the logic so you can get away with doing IF(A1=1,TRUE,FALSE) where Fusion needs numbers and not strings for example. but it can help plan how you want to approach it, then transpose the logic. In solidworks I would do this directly in excel in a design table as that was very easy and popped up directly in SWx and would even make use of vba buttons and dialogs.
      I'll think about a more elaborate example like your kitchen cabinet and see about the logic layout and how I would do that and let you know.

    • @David_Best
      @David_Best ปีที่แล้ว

      @@LearnEverythingAboutDesign Actually, after I made the suggestion to you, I was able to make my own spreadsheet in Excel that has all the complex IF/THEN parameter formulas for a cabinet design model with variable drawer counts/heights, then save that as a CSV file and import it directly into Fusion using the Parameters I/O extension. It took a while to automatically deal with syntax differences, but it works great. Thanks for the inspiration.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  ปีที่แล้ว

      @@David_Best That is awesome to hear! But you were able to somehow automatically deal with the If syntax differences like , in Excel vs ; in Fusion?

    • @David_Best
      @David_Best ปีที่แล้ว +1

      @@LearnEverythingAboutDesign Yes, there are text manipulation functions that will do just that and extract an Excel formula into a text string. It’s not something I would suggest for the average Excel jockey, but it could be turned into a canned Macro that anyone could use. I’ll be working toward that later this week.

    • @spiderpat21
      @spiderpat21 10 หลายเดือนก่อน

      Hello David, Which plugin do you use to transfer output variables to Fusion? Or is it a manual injection...

  • @larrybud
    @larrybud 10 หลายเดือนก่อน +1

    Now if they could only retain the sort option in the parameters... e.g. click on the "name" header to sort by name. Close the parameters, open them back up, and they are no longer sorted.

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  10 หลายเดือนก่อน +1

      Yeah, or let you keep the dialog open on another screen and keep working. I will mention the sorting thing next time I talk to a developer.

  • @geranna3654
    @geranna3654 3 หลายเดือนก่อน

    RE: Logic Parameters
    I use Notepad ++, for writing my VBA (Fusion looks similar other than semicolons replace commas)
    as it helps highlight for correct bracketing, eg:
    IF(condition1; A,
    IF(condition2; B,
    IF(condition3, C, D)))
    Does Fusion accept Copy/Paste code with 'Line-breaks' ?
    Also can 'AND' 'OR' Logic combinations be used ?

    • @LearnEverythingAboutDesign
      @LearnEverythingAboutDesign  3 หลายเดือนก่อน +1

      Fusion parameters are still a bit limited (as are most CAD programs). Here is the reference of what you can do in parameters in fusion. help.autodesk.com/view/fusion360/ENU/?guid=GUID-76272551-3275-46C4-AE4D-10D58B408C20
      If, AND, OR, and NOT were added at the same time so yup you can use those logic functions. As for copy/paste code, no not really. There is a free app from the autodesk app store called Parameter IO that lets you pull in CSV data into parameters. apps.autodesk.com/FUSION/en/Detail/Index?id=1801418194626000805&os=Win64&appLang=en
      I also have a few videos on how to program a script in fusion in the API series that deals with creating, setting, and updating parameters with python.