Original Article Date: Nov 7, 2005
With thanks to Alexie Karavakis for this collection of macros that can be used to place cells, custom linestyles and patterns to scales calculated from the active model annotation scale. Note that these macros have been designed to be run from keyins which can be executed from a bar menu, the settings manager, user defined icons or web pages.
Download 271.zip and extract the contents from the zip file.Place all mvbas in the folder pointed to by MS_VBASEARCHDIRECTORIESKeyin vba load PlaceToScale to load the project, or...Configure MS_VBAAUTOLOADPROJECTS to automatically load the mvba project upon startup.Notes:This VBA Project contains a number of macros that are ideally kicked off with a keyin. These keyins can be executed via the Settings Manager, a bar menu, user defined icons or even a web page.You can also use these keyins as the foundation for "keyin scripts". For example, you could append ac=36InchDoor;place cell icon to the keyin for cellscaleIn the following descriptions, you'll see a reference to the active model scale, this is referring to the Annotation Scale setting located and defined in the Model Properties dialog.
LSSETKeyin vba run [PlaceToScale] modPlaceToScale.LSSETSets the active line style scale to the value set by the current active scale.For example, if the active scale is 4.83, then the line style scale factor will be set to 4.83LSSET_MKeyin vba run [PlaceToScale] modPlaceToScale.LSSET_M passed_stringSets the active line style scale to the value set by current active model scale or passed_string.If a string is passed it will use that rather than the active model scale.Sample: With the active model scale = 25, vba run [PlaceToScale] modPlaceToScale.LSSET_M, the line style scale will be 25Sample: With the active model scale = 25, vba run [PlaceToScale] modPlaceToScale.LSSET_M 15, will set the line style scale to 15.LSSCALEKeyin vba run [PlaceToScale] modPlaceToScale.LSSCALE passed_stringSets the active line style scale to the same value set by current active Scale X active model scale.Sample: With the active model scale = 25, and the active scale = 0.5, then the resulting line style scale is set to 12.5.LSSCALE_MKeyin vba run [PlaceToScale] modPlaceToScale.LSSCALE_M passed_stringSets the active line style scale to the value calculated by the active model scale X passed_string.If no string is passed, it will use a value of 1.Sample: With the active model scale = 20 and no string is passed, the line style scale will be set to a value of 20.Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.LSSCALE_M .1, will set the line style scale to 2.CELLSCALEKeyin vba run [PlaceToScale] modPlaceToScale.CELLSCALE passed_stringSets the active cell scale to a value calculated by the current active model scale x passed_string.Sample: With the active model scale = 20, and the active scale = 0.5, vba run [PlaceToScale] modPlaceToScale.CELLSCALE will set the active X, Y and Z scale factor is set to 10.CELLSCALE_MKeyin vba run [PlaceToScale] modPlaceToScale.CELLSCALE_M passed_stringSets the active cell X and Y scale to a value set by the current active model scale X passed_string.If no string is passed, it will use a value of 1.Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.CELLSCALE_M, will set the active scale X, Y & Z factor to 20.Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.CELLSCALE_M .1 will set the active scale X, Y & Z to 2.PATSCALEKeyin vba run [PlaceToScale] modPlaceToScale.PATSCALESets the active pattern scale to value set by the current active model scale X passed_stringSample: With the active model scale = 20, and the active scale = 0.5, vba run [PlaceToScale] modPlaceToScale.PATSCALE, will set the pattern scale to 10.PATSCALE_MKeyin vba run [PlaceToScale] modPlaceToScale.PATSCALE_M passed_stringSets the pattern scale to value set by current active scale X passed_string.If no string is passed, it will use a value of 1.Sample: With the active model scale = 20 vba run [PlaceToScale] modPlaceToScale.PATSCALE_M will set the pattern scale to 20.Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PATSCALE_M .1 will set the pattern scale to 2.PAT_R_SPACEKeyin vba run [PlaceToScale] modPlaceToScale.PAT_R_SPACE passed_stringSets pattern row spacing to value set by current active scale X passed_stringIf no string is passed, it uses 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PAT_R_SPACE will set the pattern row spacing to 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PATSCALE_M .1 will set the pattern row spacing to 2.PAT_C_SPACEKeyin vba run [PlaceToScale] modPlaceToScale.PAT_C_SPACE passed_stringSets the pattern column spacing to value set by current active scale X passed_stringIf no string is passed, it uses 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PAT_C_SPACE will set the pattern row spacing to 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PAT_C_SPACE .1 will set the pattern row spacing to 2.PAT_R_C_SPACEkeyin vba run [PlaceToScale] modPlaceToScale.PAT_R_C_SPACE passed_stringSets the pattern row and column spacing to a value set by current active scale X passed_stringIf no string is passed, it uses 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PAT_R_C_SPACE will set the pattern row and column spacing to 0Sample: With the active model scale = 20, vba run [PlaceToScale] modPlaceToScale.PAT_R_C_SPACE .1 will set the pattern row and column spacing to 2PAT_ANGLEkeyin vba run [PlaceToScale] modPlaceToScale.PAT_ANGLE passed_stringSets the pattern angle to value set by the current passed_string.Sample: vba run [PlaceToScale] modPlaceToScale.PAT_ANGLE 45 will set the pattern angle to 45.PLACETXTkeyin vba run [PlaceToScale] modPlaceToScale.PLACETXT passed_stringPuts the text you pass into the text editor dialog. Sample: vba run [PlaceToScale] modPlaceToScale.PLACETXT Concrete Walk will stick the word Concrete Walk into the text editor ready.
These programs are supplied as is. These programs do not come with support. AskInga, Bentley Systems Inc., and the author of these programs assume no liability for damages direct, indirect, or consequential, which may result from the use of these programs. Use these programs at your own risk.
AskInga Article #271