Hi
As a part of a bigger VBA-project I'm having trouble with this part. I want a copy a sheet model a couple of times. But the elements included in my sourcemodel are only included in the first copy. All following sheet models are completely empty.
Sourcemodel looks like this:
Second and third copy looks like this:
Here's my code:
Sub testCopyModels() Dim sheetTemplate As ModelReference Dim CreateNewModel As ModelReference Dim inputModelToCopy As String inputModelToCopy = "K-20-1-0101" Set sheetTemplate = ActiveDesignFile.Models(inputModelToCopy) Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0103") Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0104") Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0105") End Sub
I noticed that if I add some command in between everything works as expected:
Sub testCopyModels() Dim sheetTemplate As ModelReference Dim CreateNewModel As ModelReference Dim inputModelToCopy As String inputModelToCopy = "K-20-1-0101" Set sheetTemplate = ActiveDesignFile.Models(inputModelToCopy) Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0103") CadInputQueue.SendKeyin ("place smartline; xy=0,0;xy=100,100") Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0104") CadInputQueue.SendKeyin ("place smartline; xy=0,0;xy=100,100") Set CreateNewModel = ActiveDesignFile.Models.copy(sheetTemplate, "K-20-1-0105") CadInputQueue.SendKeyin ("place smartline; xy=0,0;xy=100,100") End Sub
Is this expected behavior? Can anyone explain what I might be doing wrong here?
Running Openbuildings CE U7 (MicroStation U14)
The sheet in which I've run the code is attached.
6153.Sheets.dgn
Hi Robert,
it seems to be bug in OBD, because in MicroStation CE U15 your first version of the code works fine (no "in a middle" commands are required). I recommend to log Service Ticket for this issue, plus to move this discussion to OpenBuilding Forum (because this is general Developers and Programming).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi all,
I can confirm this is a known issue with MicroStation, recognized with MS Update 14.We filed a Defect # 1090333 and this could be resolved with MicroStation Update 15.So all applications based on MicroStation Update 15 should not show this issue any more.
Best regards,
Artur
Answer Verified By: Marc Thomas
Ok, thanks both of you!