Hi,
(I am really not having any luck this evening..)
How do I toggle the Annotation scale on text elements?I have a few cell elements with some text inside. The text I create seem to get this "Annotation scale Lock" set by default. I need to turn it OFF on certain text elements.
I have tried (from the manual, all I could find?)On a just created text element, not added to model (the text element becomes part of cell, that again becomes part of another cell, so I really dont want to add it to the model "just yet")
Dim targetPH As PropertyHandler Set targetPH = CreatePropertyHandler(et) targetPH.SelectByAccessString "UseAnnotationScale" targetPH.SetValue (False)
That failed with a "Not available".. :S
I was hoping for something in the textstyle or dimensionstyle but there doesnt seem to be anything?I found an annotationscale double somewhere, and some overrideannotationscale bool, but it doesnt seem to be what I am looking for?
Thanks,
/Torben
Anybody?
I can easily toggle the "use annotaion scale LOCK" manually when creating a text element, by un-hilighting the annotation symbol in the text element dialog.
How to toggle/set in VBA?
System: Win7 64bit 16GB Ram - microStation V8i SS3 08.11.09.578. + PoinTools CONNECT. - Intel i7-4800MQ CPU@2.70GHz, 4 core / 8 Logic proc.
Please...
How do I toggle this value?
I am begging.......
Shameless selfbumping.. Sorry but this is making my project look stupid! And as we all know, "they" dont see what is working, but what isnt!! please help
Torben,
I do not know if someone contacted you offline about your issue, but I did create a service ticket for this issue so that you can follow up with me (at or with) Bentley Technical Support if you need to.
I researched your issue while working on another similar issue dealing with MicroStation VBA property handlers. This is an area that is really effective if you know how to get to the data and what objects you have access too. While getting my feet wet in this area I was able to create the code snip below that should do what you need to resolve the issue.
You only need to provide an element id of your own element to test. Then you should be able to wire this into your code providing elements to it; via scanning, selection set, or the method you are currently using.
Sub ElementToggleAnnotation()
' Recommend to handle any errors
On Error GoTo HandleError
' Obtain an appropriate element
Dim oEl As Element
Set oEl = ActiveModelReference.GetElementByID(DLongFromLong(662))
' Create a property handler for the element/class.
Dim oPH As PropertyHandler
Set oPH = CreatePropertyHandler(oEl)
' Specify which property that you want to access.
' NOTE: Most property names are obtainable via the element information tool.
' Observe the Category and Property Names displayed, remove spaces in name as needed.
Dim sAccessStr As String
sAccessStr = "IsAnnotation"
' Verify that a valid property name was provided
If Not oPH.SelectByAccessString(sAccessStr) Then
Debug.Print "Property: " & """" & sAccessStr & """" & " does not exist!"
Exit Sub
Else
' If we made it here we can get and display the current value, then set the property value.
Debug.Print "Value for " & """" & sAccessStr & """" & " [Before]: " & oPH.GetDisplayString
' Toggle the value of this element/class property
' NOTE: Some properties may be read-only and will not allow using SetValue
If oPH.GetValue = 0 Then
oPH.SetValue (1)
oPH.SetValue (0)
End If
Debug.Print "Value for " & """" & sAccessStr & """" & " [After]: " & oPH.GetDisplayString
' Unhandled error handler
HandleError:
Debug.Print Err.Description
End Sub
HTH,
Bob
Bob. I salute you! Thank you
Not a problem. Please let us all know if this helped resolve the issue and helps make more sense of this lesser known and useful area of the API.
Just a quick follow up, as I dont have the time to code on this project atm.
The only thing I can think of that would make it fail, is that my element is not yet added to the model when I need to set this value.
Didnt work on unadded elements.
Also, didnt work with elements inside cells.
The feature is cool, but the implementation is a hack! (Incidentally thats what I feel like when producing programs for microstation!)
DOCUMENTATION PLEASE!!!!!!!
Also, when I do:
Dim s() As Strings = ph.GetAccessStrings
on a CELL, "s" contains a reference to "IsAnnotaion", but when I read it, uStation tells me to "F&%K Ø%F" ?!? :S .... >:( ... >8(( )) !!!!!