Microstation Basic and text nodes question

Discussion in 'Microstation' started by Francois Dauberlieu, Oct 10, 2003.

  1. Hi people,

    Long time no write.

    I've be out of the Ustn business for a while now and feel like a complete
    beginner again.

    I found a piece of code to modify texts in a text node doing the following,
    once the node header is found:
     
    Francois Dauberlieu, Oct 10, 2003
    #1
  2. as I said, a real beginner.

    I forgot to specify that it's for MS SE and J, not V8
     
    Francois Dauberlieu, Oct 10, 2003
    #2
  3. Hi Francois. Nice to speak again.
    I often have problems getting on this NG so I'll post here and to you
    offline as well.
    The piece of code replaces all text in existing textnodes with "xxxxx" but
    what is the objective of populating blank text nodes and how many lines of
    text would you want.I'll send you a macro in a short while
     
    david.preston316i, Oct 11, 2003
    #3
  4. Sorry to tell you that now most of the Microstation Community reads (and
    answers) in bentley.* hierarchy
    It's possibile to find a web interface to some of these newsgroups in my own
    web site, for example vba programming is here:

    http://www.b3soft.com/phpnuke/newsgroup-4-0.html

    and try the search engine you can find in the upper part of the page, it's
    very powerful
     
    Alessandro Trebbi, Oct 12, 2003
    #4
  5. Hi Dave,

    Indeed, nice to see that all the good ole boys are still around.

    Basically, the text nodes are part of the title blocks and I'm writing an
    interface between Ustn and Documentum (EDMS) to populate the title block
    with values extracted from Document attributes, such as Document Name,
    Version number, last modif date, etc....

    Of course, the first time a title block is placed in the design file, the
    text nodes are empty, hence my problem

    Cheers

    Francois
     
    Francois Dauberlieu, Oct 12, 2003
    #5
  6. Francois Dauberlieu

    Dave Preston Guest

    So, does the macro do what you want?
     
    Dave Preston, Oct 12, 2003
    #6
  7. Hi Francois,

    Yup. I'm present.
    But I know even less than you about Basic :-o

    Hey, my brain has been effectively marinated in MDL and spicey C for decades
    so I guess it is too late now to change this taste ;-)

    Cheers,
    /Chris Z.
     
    Chris Zakrewsky, Oct 12, 2003
    #7
  8. Which macro, mine ????

    if it's mine, it doesn't. I works only for text nodes with a text already in
    them.

    If it's yours, I didn't receive it :-(

    Regards,
    Francois
     
    Francois Dauberlieu, Oct 13, 2003
    #8
  9. Francois Dauberlieu

    Dave Preston Guest

    Sent offline, but I'll try here again - first time I could get on here in a
    few days
     
    Dave Preston, Oct 14, 2003
    #9
  10. Francois Dauberlieu

    Dave Preston Guest

    I can see an attachment on the posting now, so should be OK.
     
    Dave Preston, Oct 14, 2003
    #10
  11. Hello Dave,

    I don't see an attachment, I don't think that you can use attachments
    on these newsgroups anymore.

    Harry Stegeman
     
    Harry Stegeman, Oct 14, 2003
    #11
  12. Francois Dauberlieu

    Dave Preston Guest

    Her it is:-

    'macro to swap text nodes for "xxxxx"

    sub main
    dim filepos as long
    dim endoffilepos as long
    dim element as New MbeElement
    dim origin as MbePoint
    dim ElemText as string
    dim ChangeText as string

    EndofFilePos = MbeDgnInfo.endoffile
    ChangeText = "xxxxx"

    MbeSendCommand "null"

    'disable text editor
    MbeSetAppVariable "MGDSHOOK", "userPrefsP->textEditorStyle", 2#


    'scan through each element in file
    filepos = element.fromfile (0)
    do while filepos >= 0 and filepos <= EndofFilepos
    filesize = element.filesize
    if element.type = Mbe_TextNode then

    'if no text, edit it
    if element.nextComponent <> Mbe_Success then
    stat = element.getOrigin(origin)
    mbesendcommand "edit text"
    mbelocateelement filepos
    mbesenddatapoint origin
    mbesendkeyin changetext

    'if text change it
    else
    do
    If element.getString(elemText) = Mbe_Success Then
    status = element.setString(ChangeText)
    End If
    loop while element.nextComponent = Mbe_Success
    status = element.rewrite()

    end if
    end if
    filepos = element.fromfile (filepos + filesize)
    loop

    'enable text editor
    MbeSetAppVariable "MGDSHOOK", "userPrefsP->textEditorStyle", 0#

    end sub
     
    Dave Preston, Oct 14, 2003
    #12
  13. Francois Dauberlieu

    Wallaby Guest

    Hi Francois,
    Where's the 'Ferrari in your e-mail address gone? :)
     
    Wallaby, Oct 15, 2003
    #13
  14. And it does exactly what I needed.

    Thanx a lot Dave

    Francois
     
    Francois Dauberlieu, Oct 15, 2003
    #14
  15. uhhh ????


     
    Francois Dauberlieu, Oct 15, 2003
    #15
  16. He probably meant BMW, no, wait, he meant Bentley ;-)

    /Chris Z.
     
    Chris Zakrewsky, Oct 15, 2003
    #16
  17. Francois Dauberlieu

    Wallaby Guest

    McLaren of course! I do get them funny looking cars mixed up. Are you now
    manager of Planet Hollywood in NL and that is where your new e-mail address
    comes from?
     
    Wallaby, Oct 15, 2003
    #17
  18. No Planet is only my ISP in the NL

    McLaren is history for me and I don't miss it. I usually don't burn bridges
    behind me but I have to say that it is good to be alive again
     
    Francois Dauberlieu, Oct 15, 2003
    #18
  19. Francois Dauberlieu

    Dave Preston Guest

    No problem - glad to be of help
     
    Dave Preston, Oct 16, 2003
    #19
  20. Francois Dauberlieu

    Simon Guest


    Hi Francois,
    Conecting external data to _text nodes_ in a title block is definately
    the way to go, especially for the title itself which can be 1 line or x
    lines. I'm tired of whiz-bang EDMS that ony work with tag data
    (single-line only) or plain text (also single-line). Also, text nodes
    are readily editable by the users, so it's not weird to edit titles
    on-the-fly when necessary (it's _always_ necessary to do this), but
    you'll need a way to extract title block data...

    Anyway, just one tidbit: I learned that it was necessary to use the
    "Preserve Text Nodes" user preference (Workspace > Preferences, Text,
    check Preserve Text Nodes) to allow the text node to shrink to one line
    (as drawing titles can be) without becoming plain text (Type 17).
    Without this option, text nodes would become plain text as single-line
    titles, then it was difficult to go back to 2 or more lines of text. I
    don't remember the details exactly, but doing this made it a lot easier
    to code the macro.

    HTH,
    Simon
     
    Simon, Oct 16, 2003
    #20
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.