Excel VBA Macro for Upper Case Text Formatting

I find myself updating some documentation for the menu system I enhanced yesterday. While updating a spreadsheet, I spied the following vba macro. I thought you might find it handy for formatting selected cells.

Place the following in your “ThisWorkbook” module inside the vba editor.

Option Explicit

Sub Upper_Case()

‘ Upper_Case Macro
‘ Change Value of Selection to upper case

‘ Keyboard Shortcut: Ctrl+t

Dim myCell As Range
Set myCell = Application.ActiveCell
With myCell
.Select
.Value = UCase(.Text)
End With
End Sub

Then assign a shortcut to run the routine. (I use Ctrl+Shift+T) Then as you work in excel, you can select a cell that you want to format as upper case text and press your shortcut to reformat it.

…now back to work!

AutoCAD Menu Streamlining and Updating or When does 8 = 37?

I had the opportunity to update some AutoCAD toolbars recently and looking through other’s code is always a good time to either enhance something or learn from it. I chose to enhance the code and streamline it for future expansion.

The code itself is classic AutoCAD toolbar stuff. Lots of semicolons, back slashes, command line commands and options, and unfortunately, lots of hardcoded values associated with each scale. The tools worked, mostly, but trying to extend them or re-use them for new tools was problematic at best and hair-wrenching at times. As I looked through the toolbar code and built a table of the values for various scales, an opportunity to use some good old diesel code presented itself.

Let me give you a little background on the tools: The menu consisted of a series of toolbars, each one intended to be used for a particular drawing scale, providing a common method of inserting tags, dimensions, text, symbols, etc. The toolbars were wrapped up in flyouts, so that when a scale change was required, you simply picked it from the flyout and the correct associated tools were exposed and ready for use.

Anyway, as I started to build the tables to better understand the code and define patterns so that I could migrate this functionality for a Meter based metric project, I began to see how painstaking this process was going to become. To resolve the issues and simplify the maintenance, I changed all the hardcoded values into variables that could be multiplied by the current dimscale value. In doing so, I was able to create 10 new metric based toolbars from one master toolbar that only required two search and replace operations. Rather than copying each toolbar 10 times and then searching and replacing 22 different values for each scale, I reduced the effort to three operations, copy, search & replace, saveas.

Here is the tip: When does 8=37?

When you replace hard coded values with flexible diesel code!

Example code: $M=$(*,-0.0015875,$(getvar,dimscale))

Don’t use hardcoded values in your menu macros, rather generate a value based on a variable and use diesel to retrieve it. So when does 8=37?

When you build a diesel macro to retrieve a value multiplied by the dimscale variable. The best thing about using diesel is it is evaluated so the 37 characters are not counted against your character limit. Only the number of characters represented in the value returned by the function is counted against the character limit. And variables make your tools more flexible. Instead of creating 40 new toolbars for the new metric tool menu, I was able to create 4 instead….now back to migrating legacy code with you!!!

DWF Viewer Prevents RAC 2011 Install – Solution

Seems fairly intuitive, but sometimes designers just don’t read the messages that Revit displays for them. Do you have a habit of hitting the escape key or the enter key to dismiss dialog boxes without reading them? If you are having difficulty getting Revit 2011 to install, then maybe it is time to read the messages. Revit 2011 will only install the new combined material libraries if DWF Viewer 6.5 is currently installed. It will tell you (see image), but you actually have to read it to know what to do.

Install Problem

The solution is simple, go to your control panel and uninstall DWF Viewer 6.5. (see image)

DWF Viewer Uninstall

Now re-boot the machine and re-run your deployment. It should work correctly now as shown below:

Solution

How To Inserting Views/Sheets from Templates in Revit

How To Inserting Views/Sheets from Templates in Revit

Have you ever wished you could insert views or sheets from existing templates into a new project or template only to find Revit uncooperative? Did you attempt it and find that Revit replies with the dreaded “Error-cannot be ignored” dialog box?

You know the one that says, “Unable to copy elements from file.” It is the same window that only provides a cancel button reinforcing the software’s claim that this Error cannot be ignored.
Have no fear! All is not lost. The solution to this problem is to simply open the other template file into the current session of Revit. Once open, you can use the Insert View command to bring those sheets/views into your current project or template with seeing the image shown above. Don’t forget to change the file type selection to “All Files”. Hope you found this helpful!

Revit Family Editing – Project Tip

Are you working in a live project and need to modify a family? Are you going to add some new types or rename existing types and then add some new ones? Perhaps you are going to do all the above and then save the family back into your corporate standards library. Do yourself a favor, keep your project organized and the type list shorter by following this tip.

As a general workflow, do your renaming within your project file if you plan to reload the family. This will prevent your type list from growing since Revit will keep your old types and add the new or renamed types when it reloads the family from the family editor. If you’ve got workshare enabled and others are in the project, make sure that your synchronize with central, SWC (aka STC), and notify your team to do the same once the renames are complete and before you reload the family.

  1. Do your renaming within the live project. You can rename the types within the project browser as the starting point.
  2. Now rename the family (if required) within the project browser.
  3. Now SWC and notify your team if necessary.
  4. If you aren’t making structural changes to the family, then you can create your new types here as well.
  5. Now, If you are making structural or wholesale changes to the family, then it is probably time to edit the family directly. You can choose an instance in the project and click Edit Family on the ribbon or right click the family in the project browser and choose Edit.
  6. Once your edits are complete and you’ve flexed it, reload it into the live project and verify your changes work.
  7. All good? Ctrl + Tab back to your family file and save to your library.

This process should keep you from getting a never ending type list under your families… Now back to work!

Revit Material Tags got you down?

Are you tagging elements with Material tags and think that the tag is not reflecting the correct value? – Just face it… you’re wrong and Revit is right! Bwa ha ha ha ha.

Actually, you’re probably getting a different element than you think when you go to place the tag. If, like my frantic designer, you are tagging very thin floor slabs (as finishes like carpet or tile), then just ensure that you temporarily hide from view the underlying floor slab (probably concrete) before you attempt to tag by material.

In our practice, we add thin floor slabs as finish materials on top of the structural slab and tag them, so the designer thought they were tagging a carpet, but Revit was secretly choosing the structural floor slab below. Using the temporary hide element from view tool available under the “cool shades” icon on your view control bar, will allow Revit to select your thin floor finishes rather than the main floor slab.

And Viola! Revit is once again playing nice! … now back to work with you!

…Note: make sure your thin materials are indeed above the top of the structural slab to avoid this problem in the first place – My designer figured this out on their own and just reported back!