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

RE: How to activate a model in C# V8i

$
0
0

I did.  Here is the ugly workaround.

Sub iterateModelsAndRunKeyin()
Dim Model As ModelReference
For Each Model In ActiveDesignFile.Models
        Model.Activate
        Pause 10
        CadInputQueue.SendKeyin "MDL LOAD ExpandPrintBorder,,unique"
        Pause 5
        CadInputQueue.SendKeyin "clr unLOAD domain unique"
        Pause 10
Next Model
End Sub

Public Sub Pause(sngSecs As Single)
    Dim sngEnd As Single
    sngEnd = Timer + sngSecs
    While Timer < sngEnd
        DoEvents
    Wend
End Sub

Then the ExpandPrintBorder is the dll for my app that uses the activemodelreference to do all the work.

I am not sure why this works in VBA but not in C#...I know I can interop with C++ to get this to work, but that seems like a drastic (yet effective) workaround.

Thank you for your help.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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