Sending drawing commands from text file ?

Discussion in 'Microstation' started by JulienRouiller, Feb 9, 2005.

  1. Hi,

    Is there a way to import into a drawing lines defined in a text file?

    I want to draw polar measurements from a survey,
    before computing cartesian coordinates.
    The aim is to have a first overview of the measurements.

    I remember that points can be injected by:

    1°- Selecting the place point tool
    2°- Calling a file of coordinates by entering
    @"C:\mypath\myfile.txt"

    where myfile.txt has content like
    xy=494212.33,121456.13
    xy=494210.22,121432.45
    ...

    I hope something similar for other drawing elements
    but cannot find any help about this in Microstation.
    Even "@" is not listed in the index.

    The file content should select the line tool
    and set the parameters of each line to be drawn:
    Xstation, Ystation, Angle, Distance.

    .... something like:

    PLACE LINE CONSTRAINED
    494212.33,121456.12 33.152 0.000
    494212.33,121456.12 144.251 24.536
    494212.33,121456.12 34.785 202.451
    494212.33,121456.12 54.235 300.254
    494210.22,121432.45 3.125 50.236

    I could write a macro and run it in Microstation,
    but I prefer using another macro language and building
    a "ready-to-draw" file.

    Thanks.

    Julien
     
    JulienRouiller, Feb 9, 2005
    #1
  2. Julien,

    You can do it with this format:

    PLACE LINE CONSTRAINED
    xy=494212.33,121456.12;di=0.000,33.152;reset
    xy=494212.33,121456.12;di=24.536,144.251;reset
    xy=494212.33,121456.12;di=202.451,34.785;reset
    xy=494212.33,121456.12;di=300.254,54.235;reset
    xy=494210.22,121432.45;di=50.236,3.125;reset

    The di= keyin use distance followed by angle. The reverse of your
    request. Also the first line with a distance of 0.000 does not get placed.

    HTH
    Dan
     
    Daniel MacNeil, Feb 10, 2005
    #2
  3. JulienRouiller

    Julien Guest

    Thanks a lot Daniel,

    I had intuition: it is possible to import lines into Microstation.
    Have tried your example. It works fine.

    The distance of 0.000 was an error from me when typing some random
    data to show what I expected.

    Your answer leads me to another question: where can I find the
    ascii-import syntax in Microstation's help files?
    This must be useful in many cases when working with macros.

    Julien
     
    Julien, Feb 11, 2005
    #3
  4. Julien,

    I'm not sure what you mean by "ascii-import syntax". There is a command
    for importing coordinates that is available in some versions of
    microstation. I've never used it and I'm not sure what it's called. I'm
    sure someone else in the group will know it.

    This syntax:
    @"C:\mypath\myfile.txt"
    means, open this text file and interpert each line as a Microstation
    keyin. It can take a lot more than just coordinates. You can string
    together any sequence of commands you can dream up.

    Dan
     
    Daniel MacNeil, Feb 11, 2005
    #4
  5. JulienRouiller

    Julien Guest

    Daniel,

    Thanks again. Your answer learns me that each line of a text file can
    be processed as a keyin command and this allows to build a quite
    complex drawing from a text file of such commands.

    What I mean by "ascii-import syntax" is the command name and the
    arguments.
    The command names can be easily found in the user guide. Not the
    arguments.

    Looking at the following example:

    PLACE LINE CONSTRAINED(...)

    I could easily find the PLACE LINE CONSTRAINED command in Microstation
    help files.

    But where did you find that one should first give the start point
    coordinates, then the distance, then the angle and finally the reset
    keyword?
    In other words the order of arguments.
    The help about PLACE LINE does not speak about the keyin arguments.

    Where did you learned that arguments should be separated by ";"?

    What performs the "reset" keyword? I can figure it but is not listed
    in the index of the user guide.

    In other words, where can we find all the details of a text command.

    Thanks.

    Julien
     
    Julien, Feb 12, 2005
    #5
  6. Julien,

    These are "Precision Input Key-ins". If you search the help for di= you
    will find them. That section also talks about the vertical bar "|" which
    lets you repeat a command multiple times.

    The semi-colon ";" is the command separator. It allows you to put
    multiple commands on one line. (Note that these are all separate
    commands, not one command followed by arguments, which is why there was
    no mention of them in the place line constrained command). An example
    would be to create a custom toolbox through Workspace->Customize... on
    the pulldwon menus. You can put a series of commands in the keyin field.

    lv=1;co=5;lc=3;wt=3;place line constrained

    This will set the level, color, linecode and weight and activate the
    place line constrained command. This lets you do all your drawing setup
    with one click. This syntax can also be used on function keys and
    pulldown menus.

    The order of the commands would be the same as using them interactively.

    Reset is one of the built in commands and is the same as pressing the
    reset button. I don't see it in the Help either.

    The program to import/export coordinates is xyztxt.ma
    (Tools->Annotations->XYZ text)

    There are several dozen of those two letter short-cut keyins. They
    pre-date the GUI and are not used as much as they used to be but they
    are still very useful. Following is a list of 2-Character Keyins along
    with the full command names that someone posted to one of the news
    groups a few years ago. I don't know if it is still a complete list.

    Dan


    MicroStation 2-Character Keyins (some old/some new):

    Key Command
    --- -------------------
    AA= ACTIVE ANGLE
    AC= ACTIVE CELL
    AD= POINT ACSDELTA
    AE= ACTIVE ENTITY
    AM= ATTACH MENU
    AP= ACTIVE PATTERN CELL
    AR= ACTIVE RCELL
    AS= ACTIVE SCALE
    AT= TUTORIAL
    AX= POINT ACSABSOLUTE
    AZ= ACTIVE ZDEPTH ABSOLUTE
    CC= CREATE CELL
    CD= DELETE CELL
    CM= MATRIX CELL
    CO= ACTIVE COLOR
    CR= RENAME CELL
    CT= ATTACH COLORTABLE
    DA= ACTIVE DATYPE
    DB= ACTIVE DATABASE
    DD= SET DDEPTH RELATIVE
    DF= SHOW FONT
    DI= POINT DISTANCE
    DL= POINT DELTA
    DP= SET DDEPTH ABSOLUTE
    DR= TYPE
    DS= DEFINE SEARCH
    DV= DELETE VIEW
    DX= POINT VDELTA
    DZ= ACTIVE ZDEPTH RELATIVE
    EL= ELEMENT LIST
    FF= FENCE FILE
    FI= FIND
    FT= ACTIVE FONT
    GO= ACTIVE ORIGIN
    GR= ACTIVE GRIDREF
    GU= ACTIVE GRIDUNIT
    KY= ACTIVE KEYPNT
    LC= ACTIVE STYLE
    LD= DIMENSION LEVEL
    LL= ACTIVE LINE LENGTH
    LS= ACTIVE LINE SPACE
    LT= ACTIVE TERMINATOR
    LV= ACTIVE LEVEL
    NN= ACTIVE NODE
    OF= SET LEVELS OF
    ON= SET LEVELS ON
    OX= ACTIVE INDEX
    PA= ACTIVE PATTERN ANGLE
    PD= ACTIVE PATTERN DELTA
    PS= ACTIVE PATTERN SCALE
    PT= ACTIVE POINT
    PX= DELETE ACS
    RA= ACTIVE REVIEW
    RC= ATTACH LIBRARY
    RD= NEWFILE
    RF= ATTACH REFERENCE
    RS= ACTIVE REPORT
    RV= ROTATE VIEW
    RX= ATTACH ACS
    SD= ACTIVE STREAM DELTA
    SF= FENCE SEPARATE
    ST= ACTIVE STREAM TOLERANCE
    SV= SAVE VIEW
    SX= SAVE ACS
    TB= ACTIVE TAB
    TH= ACTIVE TXHEIGHT
    TI= ACTIVE TAG
    TS= ACTIVE TSCALE
    TV= DIMENSION TOLERANCE
    TW= ACTIVE TXWIDTH
    TX= ACTIVE TXSIZE
    UC= USERCOMMAND
    UR= ACTIVE UNITROUND
    WO= WINDOW ORIGIN
    WT= ACTIVE WEIGHT
    XD= EXCHANGEFILE
    XS= ACTIVE XSCALE
    XY= POINT ABSOLUTE
    YS= ACTIVE YSCALE
    ZS= ACTIVE ZSCALE
     
    Daniel MacNeil, Feb 15, 2005
    #6
  7. The Power of Keyins - Part 2
    .....learn how to create script files to streamline your workflows!
    http://www.askinga.com/article.asp?articleID=37


    Quick link to the keyboard shortcuts...you know those keyins like AD=, RC=,
    CD= and so forth. A great reference to print out and hang on your wall.
    http://www.askinga.com/article.asp?articleID=31

    BTW, If you haven't yet, you may also want to check out the Bentley
    discussion groups -- see
    http://discussion.bentley.com/help/ for more information regarding those.
     
    Inga Morozoff [Bentley], Feb 15, 2005
    #7
  8. JulienRouiller

    Julien Guest

    Daniel, Inga,

    Thanks a lot to you!

    Daniel's post was a very complete answer to my question.
    Thank you for the details about the semicolon, the "reset" keyword,...
    And for the very long list of keyboard shortcuts!
    I'm sure that I'll often look at it!

    Inga, thank you for the useful links.
    The www.askinga.com website looks great!
    I saw that there are useful articles there.

    Just one more question: when suscribing I'm asked to accept askinga
    "Terms of service". Where can I find them?

    Best regards.
    Julien
     
    Julien, Feb 18, 2005
    #8
  9. Phil Chouinard [Bentley], Feb 22, 2005
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.