Hi guys,
I wrote this code, to set off all levels.
Sub AllLevelOff() Dim myLevel As Level Dim myLevels As Levels Dim myView As View Dim iViewIndex As Integer iViewIndex = 1 Set myLevels = ActiveDesignFile.Levels Set myView = ActiveDesignFile.Views(iViewIndex) For Each myLevel In myLevels 'MsgBox myView.Index 'Dim str As String 'str = myLevel.Name 'Set myLevel = ActiveDesignFile.Levels(myLevel.Name) myLevel.IsDisplayedInView(myView) = False 'myLevel.IsDisplayed = False 'myLevel.IsFrozen = True Next myLevel myLevels.Rewrite RedrawAllViews Dim sPipeID As String sPipeID = "LO-001" ActiveDesignFile.Levels(sPipeID & " - 3D - Axis").IsActive = True End Sub
but it works only for Global display and Frozen, not for View display.
I followed those articles/codes:
http://www.la-solutions.co.uk/content/V8/MVBA/MVBA-LevelControl.htm
https://communities.bentley.com/products/microstation/w/microstation__wiki/2895/2895
I work around the problem using the isdisplayed property, but I ask why it shouldn't work. Do you know anything about it?Now, I've seen an answer by Jon Summers in which he says, if I don't get it wrong, that isdisplayedinview is only available from version 8.01 of VBA.
But if so, why do I see the property among those available with Level objects? And anyway why doesn't my code work?
Thank you so much,Paolo
Paolo Maggiani said:I've seen an answer by Jon Summers in which he says, if I don't get it wrong, that isdisplayedinview is only available from version 8.01 of VBA
Whatever you may have read, look in VBA help. The date when a function was introduced is included in that documentation.
Regards, Jon Summers LA Solutions
Hi Jon,
as suggested, I looked for my question around the web and then in the forum.
I found two interesting (at least, in my opinion), I shared with the forum.
And thenI found that answer by you. As I supposed (and wrote) I was wrong. You was speaking abot v8 of Microstation but I understood (also deceived by the fact that my code didn't work) you were speaking abot VBA release. That's all :-)
Anyhow, your suggestion about documentation's date will be surely useful.
Thanks so much.
Best regards,
Paolo