Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

ActiveDesignFile.Levels.Find going crazy??

$
0
0

I use the following code phrase quite often:

Set lev = ActiveDesignFile.Levels.Find("SM3D_ELEKTRO_DECKENLEUCHTE")

If lev Is Nothing Then

  Set lev = ActiveDesignFile.AddNewLevel("SM3D_ELEKTRO_DECKENLEUCHTE")
  ActiveDesignFile.Levels.Rewrite

End If

Unfortunately there seems to be a weakness:

Sometimes the command "Set lev = ActiveDesignFile.Levels.Find("SM3D_ELEKTRO_DECKENLEUCHTE")" results in lev = nothing and therefore it tries to add the level.

But when doing "Set lev = ActiveDesignFile.AddNewLevel("SM3D_ELEKTRO_DECKENLEUCHTE")" then the message

pops up.

The message means that the level already exists!


I have no idea why "Set lev = ActiveDesignFile.Levels.Find("SM3D_ELEKTRO_DECKENLEUCHTE")" fails to find the level!

Does anyone have an idea what could be wrong here??


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>