OpenRoads Designer CONNECT Edition - 2019 Release 2 Update 7 - Version 10.07.03.18 - Windows 7 64-bit
First of all - not a programmer...just trying to help someone out...
The following macro attaches a reference file (found in a folder called Roadway in the current workset) to all of the SHEET models in the current dgn file.
It appears to work OK, however is there any method of using a WILDCARD in the filename?
For example, if there is a project number that comes before the 'rdwyborder' portion....such as A1234rdwyborder.dgn
I've looked in the discussions but found nothing about using any type of wildcards in a key in....
I suspect this is not possible. Confirmation would be appreciated.
Thanks.
----------
Sub RoadwayBdrLandscape() Dim myModel As ModelReference ' ' Iterate through all sheet models in the active file ' For Each myModel In ActiveDesignFile.Models ' ' test to see if it is a sheet model ' If myModel.Type = msdModelTypeSheet Then ' ' make the sheet model active ' myModel.Activate ' ' attach the reference dgn called rdwyborder.dgn ' CadInputQueue.SendKeyin "RF=..\Roadway\rdwyborder.dgn,sheet,,,,,live,," CadInputQueue.SendKeyin "FIT VIEW EXTENDED 1" CadInputQueue.SendKeyin "FILEDESIGN" End If Next ' grab the next model and do it again
MsgBox "Macro Completed", vbOKOnly
End Sub
Since your code is scripting key-ins vs. using the available APIs (eventually try to learn and use) maybe the MicroStation Reference Key-in Format docs will be of some help. Essentially anything that takes a <filespec> can use wildcards. Other parameters, not likely though.
HTH,Bob
Thx Robert.