Results 1 to 5 of 5

Thread: Need help with powerselector for a macro.

  1. #1
    Bryan Guest

    Need help with powerselector for a macro.

    Here's what I'd like to do and can't seem to find the proper commands
    to get it done.

    Here at work we do a lot of files, some of the information we use is
    not supposed to be printed and shipped out so it all gets put on level
    40. Here's what I would like to do:

    First select everything on level 40. I know the program does this
    pretty easy as I can go through powerselector, then level, then type
    in 40 and it does it.

    Then delete the selected items, that's easy enough.

    Then I would like to have the program search for the date and replace
    it. That's also easy since there is a find/relace text in the menu,
    but having the program do it would make it a lot faster.

    I think that's all I'd like to have it do for now. But I'd also like
    to know if either the program or somewhere on the internet has a list
    of commands that can be keyed in. I have yet to be able to figure out
    somethings by keyin, like the powerselector. I'm probably missing
    something easy, but it would also be nice if the program had a way of
    telling me exactly what commands I had just entered.

    I have tried to do the "make macro" option as well but that only turns
    on the powerselector and does not select everything on level 40.
    Hopefully someone can help me out here.

    Bryan

  2. #2
    Jeffrey Malter Guest
    Hello Bryan,

    A good way to find keyins (other than the helpfile :) is to open the keyin
    browser & drag its lower-right corner down to expose the browser fields. Tag
    the tables button & select the MDL you are wondering about (in your case,
    PSELECT) and its 'root' keyin commands are shown in the lower-left pane. Tag
    one of these, and selections for the next word (only those applicable to the
    selected first word) appear. This is a good way to find those 'hidden'
    command strings (that might not be in the helpfile :) for use in your
    macro's MbeSendKeyin "<command>" statements. Not all MDLs are loaded at
    start, some must be loaded manually for their keyins to show in the
    listings. Another source is the cmdlist.h file, which you want to make a
    copy of this, rename it cmdlist.txt, and peruse it in a texteditor. Under no
    circumstances make any alterations to the existing cmdlist.h file! AFAIK
    there is not now nor never will be a 'comprehensive-up-to-the-minute'
    listing, but when all else fails, Ask Inga! www.askinga.com and select
    Keyins from the Categories list.

    That said, IMO you should be using selectbyattributes rather than
    powerselector for your 'preprint' macro, remembering that selectby might
    already be loaded, and might already have choices made in it, it might be
    best to begin with:

    Sub Main()
    ' since selectby might already be running with various changes in its state,
    ' first unload it, then reload it to initialize its ground-state
    MbeSendCommand "MDL UNLOAD SELECTBY"
    ' reload selectby with clean settings
    MbeSendCommand "MDL LOAD SELECTBY"
    ' clear the levels
    MbeSendCommand "SELECTBY LEVEL NONE"
    ' select the desired level
    MbeSendCommand "SELECTBY LEVEL 40"
    ' start the search
    MbeSendCommand "SELECTBY EXECUTE"
    ' then delete the selected elems
    MbeSendCommand "DELETE ELEMENT"
    ' unload selectby
    MbeSendCommand "MDL UNLOAD SELECTBY"
    ' start the default command
    MbeStartDefaultCommand
    End Sub

    Changing the date by macro would be a little more difficult, it would help
    ENORMOUSLY if the date textelem has discrete attributes (a combination of
    Lv, Co, Lw & Ls) that are NEVER shared with any other textelems. Then the
    selectby can be set to search for the text-element type and those specific
    attributes, then match the elem attributes, match the text attributes, store
    the elem origin, build a string variable from the system clock, and place
    the string as a textelem at the stored MbePoint.

    Alternatives:
    1) Keep the actual print-date on the title-block ref file(s) where only
    these must be manually altered before plotting, or
    2) Instead of writing the actual date in the file, place the textstring
    $DATE$ in the file & use a pen table to replace it with the actual date.
    Search the help for "Text Substitutions". Replace $DATE$ with _DATE_ in the
    TextSubs dlog. The Windows OS will replace _DATE_ with your Windows locale
    short date format (mm/dd/yyyy in USA) but this can be changed with a uStn
    config var. I'll send you the details if you want to do this.
    3) You could use the same pen table to 'turn off' Level 40.
    The pentable filename should be specified in your plt file or plot.ini file
    or as a (standards.cfg or <project>.pcf) config var - it's easier to set it
    up to load automatically than it is to remember to load it manually.

    HTH,
    Jeffrey Malter



    "Bryan" <ldrbryan@yahoo.com> wrote in message
    news:424b45ef.0411190846.34bf2c24@posting.google.c om...
    Here's what I'd like to do and can't seem to find the proper commands
    to get it done.

    Here at work we do a lot of files, some of the information we use is
    not supposed to be printed and shipped out so it all gets put on level
    40. Here's what I would like to do:

    First select everything on level 40. I know the program does this
    pretty easy as I can go through powerselector, then level, then type
    in 40 and it does it.

    Then delete the selected items, that's easy enough.

    Then I would like to have the program search for the date and replace
    it. That's also easy since there is a find/relace text in the menu,
    but having the program do it would make it a lot faster.

    I think that's all I'd like to have it do for now. But I'd also like
    to know if either the program or somewhere on the internet has a list
    of commands that can be keyed in. I have yet to be able to figure out
    somethings by keyin, like the powerselector. I'm probably missing
    something easy, but it would also be nice if the program had a way of
    telling me exactly what commands I had just entered.

    I have tried to do the "make macro" option as well but that only turns
    on the powerselector and does not select everything on level 40.
    Hopefully someone can help me out here.

    Bryan

  3. #3
    Bryan Guest
    "Jeffrey Malter" <jmalter@nospam.earthlink.net> wrote in message
    A good way to find keyins (other than the helpfile :) is to open the keyin
    browser & drag its lower-right corner down to expose the browser fields. Tag
    the tables button & select the MDL you are wondering about (in your case,
    PSELECT) and its 'root' keyin commands are shown in the lower-left pane. Tag
    one of these, and selections for the next word (only those applicable to the
    selected first word) appear.
    Actually I do know about this, that's how I was trying to figure out
    how to do the Powerselector. I could get it to do everything else but
    select the level.



    Another source is the cmdlist.h file, which you want to make a
    copy of this, rename it cmdlist.txt, and peruse it in a texteditor. Under no
    circumstances make any alterations to the existing cmdlist.h file!
    I will have to look into this, maybe there are things in there that
    will help me in other areas.

    there is not now nor never will be a 'comprehensive-up-to-the-minute'
    listing, but when all else fails, Ask Inga! www.askinga.com and select
    Keyins from the Categories list.
    Again, another place I can look. I don't remember seeing this site
    when I was looking on Google for Microstation help.

    That said, IMO you should be using selectbyattributes rather than
    powerselector for your 'preprint' macro, remembering that selectby might
    already be loaded, and might already have choices made in it, it might be
    best to begin with:
    This worked perfect, just what I was looking for, thanks a lot. I
    didn't know about the selectbyattributes at all. We do very little
    around here that goes any deeper then line and text work. AFAIK I'm
    the only one that's looked into this type of thing at all.

    Changing the date by macro would be a little more difficult, it would help
    ENORMOUSLY if the date textelem has discrete attributes (a combination of
    Lv, Co, Lw & Ls) that are NEVER shared with any other textelems. Then the
    selectby can be set to search for the text-element type and those specific
    attributes, then match the elem attributes, match the text attributes, store
    the elem origin, build a string variable from the system clock, and place
    the string as a textelem at the stored MbePoint.

    Alternatives:
    1) Keep the actual print-date on the title-block ref file(s) where only
    these must be manually altered before plotting, or
    I guess I said it wrong, it's not really a date per say, it's a date
    the files will be printed on in the future. I make aeronautical
    charts so the date is the dat the chart is to be used. I actually
    wanted to do a global change all of the word FIG to 00000. Right now
    I just use the find/replace text under edit, I just thought there
    might be a better way, I just didn't say it correctly at first.


    3) You could use the same pen table to 'turn off' Level 40.
    The pentable filename should be specified in your plt file or plot.ini file
    or as a (standards.cfg or <project>.pcf) config var - it's easier to set it
    up to load automatically than it is to remember to load it manually.
    Well we have enough problems with people around here just remembering
    to print properly, let alone having them try to remember something
    else, hence the reason to just get rid of one level.

    Thanks again for the help Jeffery.

    Bryan

  4. #4
    Thomas Voghera Guest
    I don't see the original question- but also have a look at Quickset/Named
    groups if you are on late versions.

    --
    regards / Thomas Voghera


    "Bryan" <ldrbryan@yahoo.com> wrote in message
    news:424b45ef.0411220756.5af35212@posting.google.c om...
    "Jeffrey Malter" <jmalter@nospam.earthlink.net> wrote in message
    A good way to find keyins (other than the helpfile :) is to open the
    keyin
    browser & drag its lower-right corner down to expose the browser fields.
    Tag
    the tables button & select the MDL you are wondering about (in your
    case,
    PSELECT) and its 'root' keyin commands are shown in the lower-left pane.
    Tag
    one of these, and selections for the next word (only those applicable to
    the
    selected first word) appear.

    Actually I do know about this, that's how I was trying to figure out
    how to do the Powerselector. I could get it to do everything else but
    select the level.



    Another source is the cmdlist.h file, which you want to make a
    copy of this, rename it cmdlist.txt, and peruse it in a texteditor.
    Under no
    circumstances make any alterations to the existing cmdlist.h file!

    I will have to look into this, maybe there are things in there that
    will help me in other areas.

    there is not now nor never will be a 'comprehensive-up-to-the-minute'
    listing, but when all else fails, Ask Inga! www.askinga.com and select
    Keyins from the Categories list.

    Again, another place I can look. I don't remember seeing this site
    when I was looking on Google for Microstation help.

    That said, IMO you should be using selectbyattributes rather than
    powerselector for your 'preprint' macro, remembering that selectby might
    already be loaded, and might already have choices made in it, it might
    be
    best to begin with:

    This worked perfect, just what I was looking for, thanks a lot. I
    didn't know about the selectbyattributes at all. We do very little
    around here that goes any deeper then line and text work. AFAIK I'm
    the only one that's looked into this type of thing at all.

    Changing the date by macro would be a little more difficult, it would
    help
    ENORMOUSLY if the date textelem has discrete attributes (a combination
    of
    Lv, Co, Lw & Ls) that are NEVER shared with any other textelems. Then
    the
    selectby can be set to search for the text-element type and those
    specific
    attributes, then match the elem attributes, match the text attributes,
    store
    the elem origin, build a string variable from the system clock, and
    place
    the string as a textelem at the stored MbePoint.

    Alternatives:
    1) Keep the actual print-date on the title-block ref file(s) where only
    these must be manually altered before plotting, or

    I guess I said it wrong, it's not really a date per say, it's a date
    the files will be printed on in the future. I make aeronautical
    charts so the date is the dat the chart is to be used. I actually
    wanted to do a global change all of the word FIG to 00000. Right now
    I just use the find/replace text under edit, I just thought there
    might be a better way, I just didn't say it correctly at first.


    3) You could use the same pen table to 'turn off' Level 40.
    The pentable filename should be specified in your plt file or plot.ini
    file
    or as a (standards.cfg or <project>.pcf) config var - it's easier to set
    it
    up to load automatically than it is to remember to load it manually.

    Well we have enough problems with people around here just remembering
    to print properly, let alone having them try to remember something
    else, hence the reason to just get rid of one level.

    Thanks again for the help Jeffery.

    Bryan

  5. #5
    Inga Morozoff [Bentley] Guest
    In addition to what's already been posted,

    Select All Elements on Active Level
    http://www.askinga.com/tip.asp?TipID=244

    To select all elements on level 40, prepend the keyins noted in the tip with
    LV=40

    Also.....you may want to post this in the appropriate Bentley discussion
    group at:
    http://discussion.bentley.com

    You'll find a terrific community of MicroStation users over there who are
    always willing to help.


    --
    Best Regards,
    Inga Morozoff [Bentley]
    www.askinga.com


    "Bryan" <ldrbryan@yahoo.com> wrote in message
    news:424b45ef.0411190846.34bf2c24@posting.google.c om...

Similar Threads

  1. Macro Help
    By eitreb in forum AutoCAD
    Replies: 2
    Last Post: 01-29-2009, 01:31 AM
  2. Macro to rerun a macro
    By Wayne Tiffany in forum SolidWorks
    Replies: 5
    Last Post: 09-27-2005, 09:10 AM
  3. Macro Help
    By in forum MicroStation
    Replies: 0
    Last Post: 05-02-2005, 09:10 AM
  4. Can anyone help me with this macro ?
    By danferes in forum SolidWorks
    Replies: 2
    Last Post: 03-10-2005, 02:07 AM
  5. Is there a macro out there that...
    By BEN EADIE in forum SolidWorks
    Replies: 2
    Last Post: 02-02-2005, 05:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum