Revit Masterclass: Family Creation #2 (Parametric Arrays)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] g'day there you're watching the aussie bim guru my name is gavin and today i've got a tutorial for you where we're going to look at how to build a fencing family in revit i actually had a request from a viewer um called edikar khan i'm not quite sure where you're from or what you do i couldn't find you on linkedin but thank you for the request it actually comes from a tutorial by someone else where they didn't really share the how-to component of demonstrating a line-based generic model family so i'm going to show you how you can build arrays and also nest arrays into other arrays which is quite complex but i'm going to show you a little bit of a shortcut that i use sometimes which is a little bit of a cheat and hopefully by the end you'll be much more comfortable with how you can deal with arrays i'm also going to show you a really useful technique where you can array all the way down to one most of you probably know that an array less than two will typically break but i'll show you a little bit of a trick to get around that anyway without further ado um let's jump in i'll be using revit 2020 um and just building a family today so no dynamo required let's get started so whilst our goal is to build a parametric array the first things we should focus on are actually building the components that go into the ray itself so typically i would recommend building nested components in order to more easily control your array itself so we're going to begin just by making the fence panel so i've made a new generic model just new family generic model and i'm just going to start by making this the left reference plane because we're just going to make a fence panel left to right i'm going to make a new reference plane that's shortcut rp to make a new reference plane or create reference plane and i'm just going to constrain this with a dimension or di i'm going to add a parameter i'm going to call this panel width now i didn't call it width because with width isn't the greatest name for a parameter it can be used in some categories by default such as casework so i do try to avoid those types of words when building a family now there's various ways we can control the thickness of this panel i'm going to take a little bit of a shortcut here and i'm going to go to front view i'm going to make a reference plane up here which is going to be my top and i'm going to again assign a parameter here called panel height and i'm also going to add an offset for the panel as well i'm just going to make another reference plane down here and i'm going to call this panel elevation now i'm going to make this a type parameter unlike an instance parameter and i may also actually make panel height a tight parameter as well um the reason we can do this is the fence panels are always going to be the same height and this fence panel is going to be a non-nest a non-shared component so we'll be able to control its type parameters at an instance level now i'm going to create an extrusion and i'm just going to constrain it remember that i'm drawing in a front view here so i'm going to be drawing it away from the direction of my plan and i can just offset this by five and negative five oops five negative five it's up to you whether you want to make the thickness of this panel parametric for now i'm just going to keep it as a locked size and i'm also going to make a material and i'm just going to call that events panel and i'm going to make that type based as well so at this point we have a parametric fence panel that we can pretty much array as we want so i'm going to save this and i'm just going to save it to my desktop and i'll just call this fence panel and the next thing we're going to do is build an array um off this fence panel and then we're going to array this array to make the overall climbing fence panel array so it's a few arrays nested into each other so i'm just going to create a new family i'm going to make a generic model and i could do a line based for this one in this case i'm not going to i'm just going to make this a non-line based array [Music] so in this case now i can make a reference plane and i'm going to make this a little bit further away maybe like 2400 i'm just going to unpin that and i'm going to make this left and i'm going to make this one right and i'm going to be working between these to place my fence panels so i'm going to save this first of all i'm going to call this fence panel array and we're going to want this to be anywhere between one to any number of panels essentially so i'm going to load this fence panel into my fence panel array i'm just going to place one and i'm going to begin probably in this case just by nesting some parameters so i'm going to nest the panel elevation on a tight basis and i'm also going to nest the panel height so we can push those down further if we want because again this is going to be another non-shared component you could make these all shared if you wanted to schedule every single panel in this case i'm not going to from here we're going to be dealing with a few scenarios we're going to do with one scenario which is that the array is equal to 1. so in this case we're just going to have one panel constrained from start to finish i believe in this case i may need to go and check my reference planes for the fence panel so we have left origin make that right these are both strong references i believe that we should be okay there we go and i'm just going to constrain that i'm going to assign a visibility parameter to this panel and just call this one panel i'm going to make it other based on an instance basis and this is going to respond to the overall width of the fence panels so i'm just going to call this fencing width now we're going to have the other scenario which is at least one panel remember that if an array ever goes below two it breaks so we don't want that to happen so what i'm going to do is just add another reference plane in here this is going to be where the second panel starts starter and i'm just going to quickly make one change here i'm going to call this sub panel i'll call this um array panel with and i think i've nested everything else we'll nest the material as well whilst we're at it remember this is going to push down to all the fence panels even this one i'm going to make another visibility parameter and i'm going to call this two or more panels because these are going to turn on when we have two or more i'm then going to array and i'm going to associate a label here i'm going to call this array array count override now why am i calling this override well i'm going to use this to protect my array from ever becoming less than 2 but when it's less than two i'll turn off my array panel and turn on my my single panel it's a really handy little trick that a lot of people don't know about which lets you sort of protect an array from ever breaking but allowing the array to go down to one technically at least at the surface level the user sees that i'm going to associate this as my panel width um in this case a raid panel width just going to turn down my volume i think someone's messaging me on linkedin and in this case now we need to set up some formulas so in this case i'm going to have my actual array count and i'm going to make that an integer now we could work on a few bases here we could work on a max spacing if we wanted to in fact we may we may we could do that um or we could work with the max basing at the next level when we do our final fence i think we'll do that instead let's say in this case that our array count is three for now i'm going to build a formula to the override just to protect it in case it becomes less than two i'm going to say if array count is less than two it's two otherwise it's a ray count and this will essentially check if the array count ever goes below two see it became two so now we can protect our array from breaking i'm also going to base my array count override condition here i'm going to say that one panel is only the case when array count override equals one and otherwise in this case if the array count override is greater than one we'll have two panels so now i can account the various scenarios so let's say in this case i actually want to say that if the array count hmm actually no i can just use a different scenario here i can say if it's not one panel then i know it must be two panels so i'm just gonna say that two or more panels is not one panel and now this will say whenever this is not the case then this is so in this case array count override is not equal to one and it's off ah no this doesn't work so i need to actually use a rate count so we do need to make sure the user never goes below zero unfortunately um so we can just do this instead but if the user does go below zero then we are going to get an irrational outcome um what i could do is add an or condition or i could just say is the array count less than two if it is it's one panel that works there we go so now i can say that the arrayed panel width is going to be equal to the width fencing width divided by the array count override [Music] i think that's that's all we need actually that should be fine so now our array should rationalize itself so if i have four panels we can see that our array works and then we have four panels i'm going to turn on the preview visibility here and see what happens if i go down to say three looks good two looks good one perfect so we can see that now this one's on and our array is turned off so at that point we can essentially just turn that back up to something like four i'll just call this fencing array as its type name and from here we can pretty much move on to our next step which is to host this into a master array i'm just going to purge this family down clean it up delete all these materials we don't need just do a bit of housekeeping and then i'm just going to save that and at this point i could go and start a whole new array family i'm going to be a little bit smarter than that and i'm going to save this as a new family i'm going to call this fence defense array so this is the master array that holds it all together now i might be able to be a bit sneaky here i'm not sure if this will work i'm going to try reloading fence panel with fence panel array [Music] okay it wasn't quite right so in this case i do need to be careful that fencing width is then reassociated to the arrayed panel width but there we go now we can see that this array essentially is now an array of an array and we've built that in so in this case that's pretty much it in this case we've nested an array within an array so i can just check on preview visibility that that's all working and if we wanted to control in this case um how many panels our array has we could do it on a few bases um in this case i'm probably going to say that the user just specifies the number of panels between each post i'm just going to call this panel count but you could tie that to a maximum spacing formula as well i'm going to make that a data parameter in this case and i'll just make sure that all our type parameters are nested such as material but we can see the panel elevation and the panel height remained connected so a little bit of a sneaky shortcut there because now we have an array of an array and if i say maybe like you know i've got six panels for every one of them obviously they're all going to be equal the last thing we need to do is insert a post every x number of panels so to do that i'm just going to make a new generic model and i'm just going to build a nominal post profile i might just be a little bit lazy and in this case i'm just going to draw something fairly sloppy i'm just going to do a 50 by 50 and i'm just gonna in this case make a little eye section so just going to make a very nominal profile that i can place and i'm just going to move that across 25 and 25 so again not making this parametric in this case um but of course you know you could i just think that it's probably not the most exciting step to watch um because you probably already know how to make a parametric family if not there's some some videos on my channel that might help you so we've got a post in this case we can associate a material on a type basis and we can also just associate a height directly to the extrusion end and we'll just call this post height so at that point we have a very simple post that can be placed at each point and we're going to array this component as well so i'm going to save this family i'm just going to call this fence post i'm going to load this into my master array i'm going to click a component i'm going to place one and before i do anything else i'm going to nest my post height and make this my panel height now you could actually make this a type parameter if you wanted to the reason why i don't sometimes is sometimes people like to use these posts in various configurations and sometimes they may not be a fixed height in every case so i like to make that an instance based parameter okay so at that point we have one fence post but now we need to array it so obviously the first one is going to be here and the next post after that will be at a set spacing now we could array the fence posts in the same way that we're arraying our panel i think um the only difference is that we're arraying n plus one in this case so what we could do i think this should work if i array it once and i call this post array [Music] and i just lock the first one and i lock the second one i'm just not sure if this is going to work for the scenario where we have one two fence posts but i believe this should just always be the panel count plus one so the array count override plus one i think seven let's test the the the one-off scenario with one panel yep that works and if we go to so we're gonna have two by default as a minimum array count i think so in this case no so it doesn't quite work actually i'm thinking about this wrong i'm thinking about it wrong is it just a recount override i think in this case um the one-off scenario is something we have to account for individually so if i go to two panels it's correct so what i actually need to do is make this i need to use a formula so if the array count is less than two it's two otherwise it's a raycount i think oh it's a raycount plus one i think that'll do it i'm pretty sure and then if i go down to one my array count is now two so that's a problem what i actually need to do there is check my array panel width so at the moment my array panel width is on the array count override okay so this is a this is a challenge that we have to face as well in a technically our arrayed panel override is not correct in the scenario where a fence post is just at one spacing so we could create a whole different set out position for the fence post or we could find a way to make the arrayed panel double over in this case i might do that instead i might say if the array count is less than two [Music] then i'm going to say that it's equal to width otherwise fencing width on a row count override width i've typed it wrong it's fencing with so we're using quite a lot of if statements here to control the scenarios now this might look a bit weird it might look like we're over sailing but what is actually happening is this panel's off in this case because the array is not visible now we should have the ability to go down to two panels we can see our fence post picks that up we can say maybe we want four panels for every post there we go now we're in business so to do a little bit of housekeeping um just before we test this out i just realized i didn't make this a line based family of all the things to do um so i probably should have made this a line based family i'll show you how to nest this into a line-based family but you can essentially build this within the confines of a line-based family itself that's a bit of a pain i might also show you why i don't like line-based families as well and why it might be worth actually you know doing this as a non-line based family anyway so array count panel count panel elevation fencing width is the actual width material um is what it is at this point you may wish to nest the post material separately so we could say in this case this is a post material on a type basis now we could say the other one is a panel material and let's make the panel material look a bit nicer let's just make a new default material and i'll just call this fencing and for the surface pattern i'm going to do a model pattern i'm just going to give it an actual uh spacing at 90 degrees space it may be 50 50 mil maybe yeah 50 mil and i'll just call this fencing obviously not the greatest name for a pattern but it will just give a little bit of um articulation to the fence there we go so that's looking more like a fence um so at this point you could make this a shared family i would make it a work plan based family at the very least let's make it shared for now and i'm gonna nest this into a line based family and i'm going to show you the difference between line-based families i might change the name of this just so it's easier to understand what it is i'll just call this family fam fencing family overall i'm going to make a new generic model line based family so if i go down to generic model line based it's a little bit different to a standard family in that there's a reference line inside here and that represents the two points we're going to use to place the line based family so in this case i'm just going to make this say maybe 2400 and i'm going to load in my nested family and i'll make it shared so this is really just a container for the family itself and what we can do should be to associate the length yep and we can just nest the array count on an instance basis uh make that a other parameter i'll make a data it's really a data field of the element remember that at the project level this defense is going to hold on to its type properties as an individual family which means it doesn't have to be placed as a line-based family i'm just going to align a line so now this is sort of contained within a line based family i'll just i'll just call this typical but really this is just a container so again we can do a little bit of cleanup delete all but the fencing material that we care about purge out the assets and i'll just save this as a line based fence but we can remember we could have built that all within the linebase confines instead i don't recommend that just because i'll show you what's really bad about line based families i'm going to make a new project i'm going to load in the linebase family which will also load in the non-line based family as well because it's a nested shared component so it belongs to the project now if i place a linebase family i can click click to place my fence and i can see that regardless of the orientation of those two points it's always going to figure out how to how to space those elements in the orientation of the line based family that's the great thing about line based families as well as this i can push my parameters further down to change change my array components and i can see there now i have a fence that is essentially fully parametric on a nested array basis so pretty powerful um but one of the problems with line based families that i'll show you which is really the reason i don't use them quite quite a lot is if i create one and i just change its properties to be a little bit more normal and then i go and create another one right next to it and i try to move it away notice it snaps see that it's it's really frustrating it really ruins line based family sometimes because sometimes you want a little gap to exist between them and it just will not allow it um it's it's only fixable if you move it just a tiniest bit out of alignment but notice it's still still slightly irritating so if i copy one now they should have no interaction because their points aren't hitting each other so it's a serious problem with line-based families that i wish autodesk would fix um and it's a serious limitation as well because you really don't have control over those ends and unfortunately you know where's my disallowed join tool that would be the solution just disallow join on the end of a line-based family what you could do though is you could just tab select create similar and make the fencing family overall so i should have two so i've got my line based vents and i've got my actual fencing family that i can place normally and this one will not try to join to the end of any adjacent ones so that is a way around it and from there also of course we could do other things like we could control the visibility of the end post separately so that if you have one fence that becomes another fence obviously you only want one end post in this case so there are other things you could do with that um you could add more controls to it obviously i've just added a few uh in this case but you can see some limitations of line based families that we've come across here remember that this is nested inside all the other line-based families so if i select all of them there's actually five of them in the project the linebase family is just a container so hopefully that helps you learn more about arrays and how you can nest them control them and a couple of shortcuts you can take as well and i'll make sure to put this family on my github so you can have a look at it so there we go we've really played with a raise in this tutorial quite a lot um and hopefully you enjoyed that little trick at the end where we nested the line based family that the family into the line based family as well i actually wasn't planning to do it and then i realized it's a much better outcome so hopefully this also helps you etika khan thank you for requesting this and it's just a reminder that you know if you have any requests on the channel let me know and i'll see what i can do um if you're not already following and subscribing feel free to do so and also feel free to share the channel with anyone you think might be interested and i'll see you in future videos thanks take care bye you
Info
Channel: Aussie BIM Guru
Views: 5,477
Rating: 4.9776535 out of 5
Keywords: aussie, bim, guru, cad, revit, dynamo, computational, tutorial, demonstration, how to, educational, family, creation, content, development, geometry, constraint, reference, plane, line, 3D, master class, unistrut, parametric
Id: XTUd96GBueM
Channel Id: undefined
Length: 25min 8sec (1508 seconds)
Published: Wed Feb 24 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.