Just increment.

Discussion in 'Microstation' started by Jeff Finch, Dec 3, 2003.

  1. Jeff Finch

    Jeff Finch Guest

    I've got Microstation J and use the copy and increment command. I
    often just want to increment a selection of numbers by a value or a
    single number by clicking on it. Right now I have to edit each one or
    copy and increment then delete the original. I would have thought
    that this would be simple, I am just not finding anything.

    Thanks,

    Jeff
     
    Jeff Finch, Dec 3, 2003
    #1
  2. Jeff Finch

    Lorys Guest

    thats not working right.
    copy increament from the text tools should let you first select the
    increament amount and once set it remembers. then you select the text with a
    data point and where you want to place it with the new increamented text...
    it should allow you to take a piece of text with a number
    example xyz21 and increament it to plus 1
    where ever you next data point will be xyz21+1+n
    where n= number of data point times.
    Try keyin command
    increment text
    then if it don't work its a reinstall microstation as something is screwy!
     
    Lorys, Dec 4, 2003
    #2
  3. I think what Jeff is trying to do is increment the original text element
    without making a copy. Unfortunately, the command does not work that way.


    Dan
     
    Daniel MacNeil, Dec 4, 2003
    #3
  4. Jeff Finch

    DougW Guest

    "or a single number by clicking on it."

    Jeff,

    You could try a keyin like this:

    increment text;%d;dx=0,0;delete element;dx=0,0;dx=0,0;reset

    But the above would have to be re-entered for each time you wanted to
    bump the number up (or down).
    You could put it in a macro like below to keep the command continuous
    (hit a reset when finished):

    Sub main
    MbeWriteError "Pick text to increase..."
    MbeSendKeyin "incr text"
    Repeat1z:
    MbeGetInput MBE_DataPointInput, MBE_ResetInput,
    MBE_CommandInput, MBE_KeyinInput
    SELECT CASE MbeState.InputType
    CASE MBE_CommandInput
    MbeSendLastInput
    Exit Sub
    CASE MBE_KeyinInput
    MbeSendLastInput
    Exit Sub
    CASE MBE_ResetInput
    MbeSendLastInput
    mbesendkeyin "null"
    exit sub
    CASE MBE_DataPointInput
    MbeSendLastInput
    If MbeState.cmdResult = MBE_ElementNotFound then
    GoTo Repeat1z
    end if
    END SELECT
    mbesendkeyin "dx=0,0"
    mbesendreset
    MbeSendKeyin "delete"
    mbesendkeyin "dx=0,0"
    mbesendkeyin "dx=0,0"
    mbesendreset
    main
    End Sub

    Watch for word wrap on that 5th line!
    DougW
     
    DougW, Dec 4, 2003
    #4
  5. If this is a common problem for specific instance of text, such as item
    numbers, then you could look as using Data Fields for this. Data Fields let
    you modify the numbers in the way you seem to want to do it, by setting and
    increment and clicking on the text. You can create cells with a datafield
    and place them and edit them later which is easy if you have a sequence of
    numbers and they are far easier to update.

    Dennis Barker
    Innovision Technologies Pty Ltd
    Sydney Australia
     
    Dennis Barker, Dec 5, 2003
    #5
  6. Jeff Finch

    Dave Preston Guest

    If you're using V8, you can download an article I wrote for ControlAltDelete
    magazine, www.cadesignservices.co.uk which includes an MVBA called MathsText
    which may do what you want
     
    Dave Preston, Dec 5, 2003
    #6
  7. Jeff Finch

    Jeff Finch Guest

    Thank you all for your help. The mathstxt worked great but did
    something weird with 9s. Doug W's solution worked excellently(same as
    copy and increment but deleting the original), I just had to fix the
    formatting of some of the code when I pasted it into a new macro.

    Thanks again,

    Jeff
     
    Jeff Finch, Dec 11, 2003
    #7
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.