MicroStation Script

I’m trying to run a script that detaches a reference file.  However, there are multiple attachments, and I only want to detach the one without a logical name. 

I can detach any with a logical with reference detach 476002_3B_BR006_17.dgn [logical name].  But when I try reference detach 476002_3B_BR006_17.dgn it detaches all of those that match the file name.  reference detach 476002_3B_BR006_17.dgn “” doesn’t work either.

Any ideas?

Thank you!

  • Unknown said:
    I’m trying to run a script

    Please reveal a little more of your situation.  For example...

    • What version of MicroStation are you using?
    • By 'script', do you mean an @script, a batch script, a VBA macro or something else?

     
    Regards, Jon Summers
    LA Solutions

  • Hi Karl,

    I agree with Jon you should provide more details, often MicroStation version information is crucial. Please read MicroStation Programming Forum best practices for more information.

    Unknown said:
    Any ideas?

    I assume this option is not supported by reference detach key-in. The problem is that there is no easy way to distinguish between empty string and normal end of key-in. And it seems the key-in does not recognize quotation marks without content correctly.

    Maybe the solution would be VBA macro that will accept the reference file name as argument and will search for all such attachments without logical name defined.

    With regards,

      Jan

  • I'm using MicroStation V8i (SELECTseries) - Ver 08.11.09.459

    I'm using a batch script that contains key-in commands.  This is a small piece of a bigger process for detaching unnecessary reference attachments prior to a client design file submittal.  I generate a report of the reference attachments to each sheet file within a bridge set.  I parse the report into Excel and a series of Excel macros highlights the reference attachments that need to be detached.  Another Excel macro generates a unique .scr for each sheet that contains key-in commands to detach the references.  I launch MicroStation and run the unique scripts in order one-sheet-at-a-time via a .bat that launches MicroStatin on each sheet, runs it's particular .scr, Exits and opens the next sheet file until the process is complete.

    I'm not a MicroStation VBA programmer, and I don't want to reprogram the existing process just because of this one roadblock.

    If there's no key-in that can detach a reference attachment that has no assigned (blank) logical name without detaching others of the same file name, I guess I'll just run a pre-process that assigns a default logical "Name".  Then the key-in can detach it, since the logical name will be populated and unique.

  • Unknown said:
    I guess I'll just run a pre-process that assigns a default logical "Name".  Then the key-in can detach it, since the logical name will be populated and unique

    Probably a good resolution.

    Not sure if it helps, but you can give a DGN model a default logical name so that, when it is attached as a reference to another model, MicroStation uses that default.  That avoids altogether the problem of the empty logical name.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Karl Bajzek