Hi All...
I have to find name of active level in a DGN file and want to use name of the active level with some extension to create new level in the DGN file.
for example if I have a level called Nose, then I need to get this level name and need to create new level as Nose_TXT. can any one suggest how to achieve this please.
Best rgrds,
Prasanna
You need something like (not tested):
BIM.Level active_level = ustn.ActiveSettings.Level;string new_level_name = active_level.Name + "_TXT";BIM.Level lvl = ustn.ActiveDesignFile.Levels.Find(new_level_name);if (lvl == null) lvl = ustn.ActiveDesignFile.AddNewLevel(new_level_name);// here you can copy properties of active_levelafter all changes call: ustn.ActiveDesignFile.Levels.Rewrite();
HTH
Answer Verified By: Prasanna S.K
Thanks DanPaul.
Best rgrds
Hello,
May I know how did you set ustn in the source code? Like Application app = Utilities.ComApp;
Best Regards,
Aldrin
Unknown said:May I know how did you set ustn in the source code? Like Application app = Utilities.ComApp;
using BIM = Bentley.Interop.MicroStationDGN;using BMIS = Bentley.MicroStation.InteropServices;namespace MyNS{ class MyClass { private static BIM.Application ustn; MyClass() { ustn = BMIS.Utilities.ComApp; } }}