Original Article Date: July 7, 2006
Another gem from Robert McCartney that creates multiple files or models from the contents of a fence. Quite a handy little macro!2007-04-05 Updated to include minor code changes and interface enhancements.
Download 301.zip and extract FenceExport.mvba from the zip file.Place the mvba in the folder pointed to by MS_VBASEARCHDIRECTORIESKeyin vba load fenceexport to load the project, or...Configure MS_VBAAUTOLOADPROJECTS to automatically load the mvba project upon startup.Keyin vba run [fenceexport]main to run the macro, or...Place the keyin on a function key or custom button for quick and easy access.Create Files from FencePlace a fence around your elements, and activate the macro.You can enter a Base Name if you want it to be different than the active file. If the Number is set to 1 then the Base Name will be a combination of the file name and the active model.Enter the number of files you want to create.Enter Prepend and Append values.Keyin a SeparatorClick the Create Files button. The create button will be disabled until a fence is placed and disabled when the fence is removed.The new files will be placed in the active file's directory.
Create Models from FenceThe only difference here is that you toggle the Create Models instead of files? option. Note that the macro will check for duplicate model names only once. It will then report an error the next time. If it finds an existing model name then it will adds -duplicate" to the end. Also, the models properties (type, dimension etc) are automatically inherited by the new model(s). Finally, click the Create Models button. The create button will be disabled until a fence is placed and disabled when the fence is removed.
Note: A mark is set in the active design each time FileFence Models or Fence Files are created. This allows you to easily undo the task if desired.
This program is supplied as is. This program does not come with support. AskInga, Bentley Systems Inc., and the author of the program assumes no liability for damages direct, indirect, or consequential, which may result from the use of this program. Use this program at your own risk.
AskInga Article #301