I have written a vba that diplays cells in a dialog. I found that when the cells contain text with annotation scale on and the current design file has a different annotation scale than the text, the display of the cell in the dialog is way off. Is there a way to turn off the "propagate annotation scale" when the cell is displayed, or some other trick that accomplishes this? I've attached a file with the display from the generic MicroStation Cell dialog which shows the correct cell on the left and the same cell using the vba I created as an example.
Thanks for any help,
Stephanie
Just a thought - how about querying for the current model Annotation Scale factor and "reverse scale" the cell you want to display in the dialog box?
I couldn't figure out how to get the current model's annotation scale factor to test this. I tried the following:
Set sourcePH = CreatePropertyHandler(ActiveModelReference)
sourcePH.SelectByAccessString("Annotation Scale")
but that doesn't return anything valid. Any ideas?
Unknown said:I couldn't figure out how to get the current model's annotation scale
Here's a possible (untested) MDL workaround …
' MDL Function Declaration: put this at the top of your VBA module Declare Function mdlModelRef_getEffectiveAnnotationScale _ Lib "stdmdlbltin.dll" ( _ ByVal modelRefIn As Long ) As Double
' VBA wrapper around MDL function Public Function ModelAnnotationScale ( _ ByVal oModel As ModelReference) As Double ModelAnnotationScale = _ mdlModelRef_getEffectiveAnnotationScale (oModel.MdlModelRefP ()) End Function
Example usage …
Dim oModel As ModelReference Set oModel = ActiveModelReference Dim annotationScale As Double annotationScale = ModelAnnotationScale (oModel) Debug.Print "Annotation scale=" & CStr(annotationScale)
Regards, Jon Summers LA Solutions
Thanks for the example, Jon. That worked just fine. The scale was 960 for this model. Unfortunately, trying to rescale the cell only resulted in errors when using the .getPicture method for the cell. I don't think scaling the whole cell display is the answer. Does anyone know how this is accomplished in the native MicroStation Cell dialog or have another suggestion?
Thanks,
Unknown said:Does anyone know how this is accomplished in the native MicroStation Cell dialog
That's most likely an MDL application.
Blast! You're probably right about the MDL solution. Any ideas how this may be accomplished in a VBA?