Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now that we have our pickets multiplying as we scale our fence, we can do the same for the fence posts. Now I am going to go ahead and turn this around and take a look at this. We have two types of fence posts. We have the ones that are going to automatically fill in but we also have an EndPost that has to be at the end of the line. So let's go ahead and first of all figure that one out. So I am going to go into Component Attributes to make sure I have my Fencing component selected. Then I am going to go to my EndPost.
Now what I need to do is make sure that this is at the end of this. So basically I want this post to be at the end of the line here. Now the best way to do that is to figure out how long one of these individual components is. So probably the best thing to do is to put it at the end of one of these rails, such as the Top or the Bottom Rail. So let's go ahead and open up the Top Rail here and see what value changes. We can see here that as we scale this, the length in X is what's changing.
So we can use that to determine the position of the EndPost. So in order to do this, I am going to go ahead and go into the X position of the EndPost, type equals and then click on the TopRail length X. So now the position is equal to the length of the TopRail. So if I hit Enter, you could see now that the EndPost pretty much fits itself to the end of that rail. But we have a little bit of a problem here is that it's actually aligning the outer edge of this.
So what we need to do is subtract out the width of that post. So we need to go in here. It's the length of X minus and I know that this post is 4 inches, so -4. Now this will always be at the end of that rail, no matter what. So we always have that end of that rail aligned to that EndPost. Now we still have another issue that we can work with here and that is as I scale it out a little lot more, you notice here that we are going to have a point where we're going to need more fence posts in the middle.
So let's go ahead and do that. So I am going to do this almost exactly the same as I did with the picket. So I am going to go ahead and select post, and then I'm going to go ahead and add in an attribute for Copies as well as a custom attribute called Spacing. So we're just going to type that in. So now I have two attributes here, Copies and Spacing. Then I am going to go ahead and create a formula for the Copies, but what's really cool is I already have that formula here. I've got them already set up for picket.
So I can just go into the Copies attribute here, copy it. Now my spacing here, notice how when I hit Enter I get a red mark here. That's because my spacing has been determined. I don't have a number typed in here. So let's go ahead and just type in say 72 inches. So we will make those posts 6 feet apart, and so now I have 0 Copies. But we still have the same problem that we had with the pickets which is that the copy hasn't moved. So this copy that's sitting here actually needs to move out depending upon the spacing.
So we can do that again just by copying this equation here and pasting it into position X. Again that's Copy, which is the copy number of the post, times the Spacing. So again it's not copies, but copy. So it's 0+Copy*Spacing. So now I get that other post in there. If I zoom out here, we can scale this. You can see now I'm getting posts that fill in. So as we can see we have the behavior of the fence pretty much set up.
Now the next thing we can do is add in some additional controls to make it even more customizable.
Get unlimited access to all courses for just $25/month.Become a member
109 Video lessons · 11842 Viewers
102 Video lessons · 8881 Viewers
83 Video lessons · 13101 Viewers
56 Video lessons · 15434 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.