lisa-marie mueller

lisa-marie mueller

bullet pont

user wall selection link

May 1, 2020

ipad with title, large neon star, movie reel, marker, purple 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.

goals and considerations

  • create an elevation marker for exterior walls by having the user select the walls
  • place the marker and elevation offset from the wall so it is legible
  • correctly phase the elevation markers
  • accommodate curved and angled walls

if you missed it:

Part 1: elevation by wall

Part 2: phases

Part 3: rotating elevation markers

Part 4: align ViewSection CropBox to Wall CropBox

Part 5: finding the wall normal for curved walls

Part 6: align elevation markers to curved walls

windows presentation foundation (WPF)

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.

WPF form with instructions for exterior elevations

user wall selection

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.

summary

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!

resources

If you want to learn to code and don’t know where to start check out my posts about Steps to Learn to Code [for architects and designers] Part 1 and Part 2.

Revit API Docs

bullet pont

recommended next