I see a few items that may or may not be an issue:
- You're searching for the LevelID for the given name (In the active model only) and what happens when that level is not found?
- In the first code example, yhou are only "tweaking" view 0.
Are you utilizing the MicroStation API ? You *may* be able to use WString to get your "wide character" version of the level name(s).
Finally, is any kind of a view "refresh" required after turning a level on/off?
- You're searching for the LevelID for the given name (In the active model only) and what happens when that level is not found?
- In the first code example, yhou are only "tweaking" view 0.
Are you utilizing the MicroStation API ? You *may* be able to use WString to get your "wide character" version of the level name(s).
Finally, is any kind of a view "refresh" required after turning a level on/off?