[CONNECT Update 16 C#] Add new model programmaticaly starts with four views (but I need only one).

Hi

I'm trying to add new models to an existing dgn file. 

The new model must have only one view, but actually is created with 4 views.

The active Model actually has one only one view (but this not propagated to new models).

Here a snippets of my code:

var activeFile = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp.ActiveDesignFile;
var activeModel = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp.ActiveModelReference;
var model = activeFile.Models.Add(activeModel, "NAME", "DESCRIPTION", MsdModelType.Normal, true);

Same behaviour using new API:

var activeFileNet = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnFile();
var activeModelNet = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModel();
var newModel = activeFileNet.CreateNewModel(out var err, "NET", DgnModelType.Normal, true, activeModelNet);

I'm already tried to fill the variables: MS_VIEWGROUPSEED and MS_VIEWGROUPSEEDNAME pointing to a seed file with a seed view group that contain only one view, but it doesn't work.

Thanks in advance

Patrizio Gasperi

Parents Reply Children
No Data