Hi all, could anyone help me with a VBA code to perform the following scenarios?
Font = ENGINEERING (3)Height = 1.4Width = 1.4Justification = CenterCenter
Font = ENGINEERING (3)Height = 0.8Width = 0.8Justification = CenterCenter
The DGN Model could have a huge amount of text in different type of levels.
I've also tried to record some simple macros, but the result is not what I need. My macro only records commands to check/uncheck the boxes in the Change Text Attributes tool and modify my text with those attributes that are already by default. I've not figured out yet how to change those attributes (font, size, justification) with mine in the code.
Bentley Microstation V8i (SELECTSeries 3) 08.11.09.578
Thank u in advance!
Below u can find my recorded macro for one type of text:
Sub ChangeTextAtt() Dim startPoint As Point3d Dim point As Point3d, point2 As Point3d Dim lngTemp As Long ' Start a command CadInputQueue.SendCommand "MDL SILENTLOAD SELECTBY dialog" CadInputQueue.SendCommand "DIALOG SELECTBY" CadInputQueue.SendCommand "SELECTBY LEVEL EXI_410" CadInputQueue.SendCommand "SELECTBY LEVEL EXI_410" ' Set a variable associated with a dialog box SetCExpressionValue "selectorGlobals.typemask[0]", 5009, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[1]", -1223, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[2]", -30, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[3]", -1, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[4]", -1, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[5]", -8257, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[6]", -257, "SELECTBY" SetCExpressionValue "selectorGlobals.typemask[7]", -1, "SELECTBY" ' The following statement opens modal dialog "Alert" CadInputQueue.SendCommand "SELECTBY EXECUTE" CadInputQueue.SendCommand "MDL UNLOAD SELECTBY" CadInputQueue.SendCommand "MODIFY TEXT" SetCExpressionValue "tcb->msToolSettings.changeText.font", 1, "MODIFY" SetCExpressionValue "tcb->msToolSettings.changeText.height", 1, "MODIFY" SetCExpressionValue "tcb->msToolSettings.changeText.width", 1, "MODIFY" SetCExpressionValue "tcb->msToolSettings.changeText.just", 1, "MODIFY" CommandState.StartDefaultCommand End Sub
yaxo winx said:could anyone help me
With which version (e.g. v10.x.y.z) of MicroStation?
yaxo winx said:All text in the level <EXI_410> in my design file must be changed
By far the easiest way to manage text appearance is to use Text Styles. Text Styles have been available in MicroStation for many generations, including your version of V8i. If your organisation used Text Styles then you would not have had to ask this question.
yaxo winx said:All text in the level <EXI_410> in my design file
A DGN file is a container. It contains one or more DGN models. A DGN model contains DGN elements. When you say 'all text in my design file' do you mean:
or
The way to find text in a DGN model is to scan the model. There are examples of the scanner in VBA help, here and here.
If you want to use Text Styles with VBA, then read this article.
Regards, Jon Summers LA Solutions
Hi,