copy from ref

Anonymous
Anonymous

Helllo,

Parents
  • Unknown said:

    Helllo,

    I have question about how to write script to Batch process, which inludes copying objects from references to dgn? I have about 500 files, which are empty and are connected with another files with reference. I want to copy all objects from reference to my 500 files.

    I'm a layman. I made only 1 file, which moved some objects from 1 layer to another, but here:

    I tried to connect some sentences, but it didn't work:

    #Clear SelectBy list

    reference display on *
    reference levels on * *;selview all
    on=*;selview all
    reference display on border
    reference levels border;selview all

    selectby type all;selectby execute;makecopy on;selectby execute;xy=   DELETE THIS LINE and replace with  "reference merge all"  

    #----------------------------------------------------------------------------------
    #fit view
    FIT VIEW EXTENDED

    #----------------------------------------------------------------------------------
    #file>save settings
    filedesign

    #----------------------------------------------------------------------------------
    #file>save
    save design

    See my  editing of your script above in red, if you dont do this you will have duplicates of all the elements from the ref files

    The Merge will do the copying  for you but remember you only get the elements  that are  in levels that are  turned on

    so you previous commands to turn on levels is correct..

    Beware if you have  nested refs ie refs inside refs and you want to turn on all level   you need to have  extra   *.*  -> *  to turn on  levels that are off in the  nest..

    But I dont  know if thats a good thing either  if the  files have levels off for  presentation both in the  ref and  nest do you still want  capture those  elements?

    for more script info  on levels look in help especially the special command    " -> "  for nested refs

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

Reply Children
  • Anonymous
    0 Anonymous in reply to Anonymous

    Hello,
    I used Beatas script and I wrote another.
    But I met a problem with moving elements from layer, which weren'`t written in script .
    this script moved all my objects from korrect layers to another. I don`t want to that.
    My question: I have to change some properties or variable in Microstation?

  • First I think you should create the  new  levels first in your active file

    then later (I snipped this  out from the  microstation help  under levels keyins, lots of  good stuff there worth printing for future use)

    you can use the level element move, to move all  objects from one level to another level

    LEVEL ELEMENT MOVE [dest:level-spec2] <level-spec1>

    Moves all elements on “level-spec1” to specified destination “level-spec2”. The destination level specification is optional. If it is not specified, then the elements are moved to the “Default” level.

    Then use the  keyin to delete empty levels or the compress command with all the options  preset

    I suggest  you break your script up and test it  then  join back up if it all works...

    if you save your script say c:\temp\script.txt

    you can add it to an F key  as @c:\temp\script.txt then you can run it on a single file by pressing the assigned F key instead of batch processor this is also a quick way to test the  script  so you dont damage a lot  of files with trial and error or just  want to do it to one file, plus its quicker than typing  @c:\temp\script.txt ...

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

  • Anonymous
    0 Anonymous in reply to Lorys

    thanks a lot, I try to later, because I have to do another things with Batch.

  • Unknown said:
    Is there any instruction to write these kinds of scripts?

    A batch script is little more than a sequence of MicroStation key-ins.  Search MicroStation help for Batch Process Dialog...

    The Batch Process utility lets you create and run a script that can be performed on individual files or entire directories of files. The script is a text file that contains a series of MicroStation key-ins that can run commands, MicroStation BASIC macros, VBA Macros, or MDL applications.

    You need to know about MicroStation command key-ins.  The key-in browser (menu Utilities|Key-in) will help, and some key-ins are even documented in MicroStation help.

    Another way to find what commands MicroStation is using is to record a VBA macro while you perform some task.  If you look at the recording, you will see the commands used.

    Unknown said:
    reference merge layer "A

    MicroStation has levels.  Other CAD tools may use the term layer.

    Unknown said:
    I tried to also sth with choosing A layer and then merge, but also wrong

    Experiment with reference merge interactively before you write your batch script.  What happens if you turn off all levels except level A, then do reference merge?

     
    Regards, Jon Summers
    LA Solutions