Hello all. I am brand-new to Dynamo, but have moderate experience with “old school” coding using tools such as AutoCAD Scripts, AutoLISP, and Visual Basic (the old form, not VB.net.) I work for a mechanical consulting firm, and one of my “sanity-challenging” tasks that would be better off if automated is the processing of Architectural files for linking into our Revit model. Specifically, my processing of these files involves:
- Removing non-essential views & all architectural sheets to cut down on file size.
- Stepping through the Architect’s material list, and changing the Surface and Cut patterns of all materials to “none”. This is done, in addition to Halftoning the Architect’s model, to lighten up the Architectural “Base Plan” in order to make MEP elements and features stand out better against the background on our drawings. This is also the step with the potential for error generation, because some Architectural and/or Electrical elements are dimensioned directly from a Surface Pattern feature. Therefore, what I’m looking to create is a Script that will:
A) Step through the materials list.
B) Test the Surface and Cut Pattern name of each material except Acoustic Ceiling Tiles for
C) Change the Surface and Cut Patterns of each Material to “none”, if it is not already so.
C) “Apply” the change for each material, pausing for regeneration, and testing for error messages each time a change is made. (Typical error message: “Unable to cut an element out of its host…etc.”) If an error message is encountered, “Cancel” is invoked, and the process is repeated, skipping the material that caused the error.
When doing this process manually, I run into hundreds of materials sometimes, and the process involves clicking on the first material, then clicking alternatingly on the down arrow, and “Enter” keys, all the while watching the Material Browser dialogue box for patterns. If I find one, I change the pattern(s) to , then click Apply, waiting for an error message. If I don’t get an error message, I then have to manually click on the next material in the list, to shift the focus back to the material list. Then, it’s back to Down Arrow/ Enter until I encounter the next pattern. Lather/ rinse/ repeat, ad nauseum.
This manual process is maddening at times, and I have to repeat it every time the Architect updates their Revit model. I realize that this won’t be a simple “fix” so, if anybody can point me in the right direction to learn how to assemble the pieces of what I need, I’d be most appreciative.