Happy Friday! As you know, I am tackling placing exterior elevations based on selected walls. This week we can add in the final piece: allowing users to select the wall.
Part 1: elevation by wall
Part 2: phases
Part 3: rotating elevation markers
I’m starting to learn WPF so for this plug-in I made a very simple user interface with the instructions for using the plug-in. I’m just beginning to learn so it’s nothing complicated. I won’t walk through this portion because I have done a couple posts on user interfaces and there are a lot of WPF resources out there. In our execute method, we need to first create a new instance of our form. Our form needs the active document which we had previously assigned to a variable called UIdoc. In the WPF code, depending on if the user clicked cancel or accept, it will return false or true for the dialog result. If the user pressed the cancel button, we want to stop our application.
If the user did not cancel, then they are going to select the walls. We can use the PickObjects method for this selection. One thing to note, is that the user will be able to select things other than walls with this method. One way to filter the user’s selection is to use the method that allows you to enter an ISelectionFilter as an input parameter. You can also filter for it in your code. Since we know all of our elements need to be walls specifically, we can just take our list of user elements and see if they are walls and if they are not, we don’t add them to our list. Finally, we just assign our list of user selected walls to our variable for the list of walls that we use for our program.
And those few steps are all it takes to add user selection to our plug-in. This wraps up the create exterior elevations plug-in. You can access the code on my GitHub account and complied DLL is there to download as well. I’m taking a pause next week and will return the week after with a new plug-in. See you May 15th!