extract element attributes out of my file

Discussion in 'Microstation' started by AL-MARAGHI, Jan 8, 2004.

  1. AL-MARAGHI

    AL-MARAGHI Guest

    Hi everybody

    I have hundreds of DGN files include thousands of places & buildings
    names, is there any mdl or macro that enables me to extract those
    names with all attributes (LV, CO, WT, TX, FT etc)

    Any help will be appreciated
     
    AL-MARAGHI, Jan 8, 2004
    #1
  2. Hi Al,

    I can understand why you might want to extract the text itself, but don't
    understand why you would want to extract the attributes as well. Are you
    needing to spec-check your drawings perhaps?
     
    Inga Morozoff [Bentley], Jan 8, 2004
    #2
  3. AL-MARAGHI

    AL-MARAGHI Guest

    Hi Inga..
    Thanx for responding..

    well I need to do that to build our database.

    Thanx again
     
    AL-MARAGHI, Jan 9, 2004
    #3
  4. AL-MARAGHI

    Dave Preston Guest

    Sub Main
    Dim FileRoot as string
    Dim OutFile as string
    Dim element as New MbeElement
    Dim filepos as long
    Dim ThisText as string

    OutFile = fileparse$(MbeDgninfo.dgnFileName,2) & _
    "\" & fileparse$(MbeDgninfo.dgnFileName,3) & ".txt"
    open Outfile for output as #1

    MbeWriteMessage "Scanning All Elements For Text"
    filePos = element.fromfile (0)
    do While filePos >= 0
    if element.type = 17 Then
    Stat = Element.getstring(ThisText)
    OutLine$ = ThisText & "," & trim$(str$(element.level)) & "," _
    & trim$(str$(element.color)) & "," _
    & trim$(str$(element.weight)) & "," _
    & trim$(str$(element.charheight)) & "," _
    & trim$(str$(element.charwidth)) & "," _
    & trim$(str$(element.font))

    print #1, OutLine
    end if
    filePos = element.fromFile(filePos + element.fileSize)
    loop 'next element

    'close files
    close
    MbeWritemessage "All Done"
    End sub
     
    Dave Preston, Jan 10, 2004
    #4
  5. AL-MARAGHI

    AL-MARAGHI Guest

    Hi Dave..

    Thank you very much for your responding, & for the macro which u posted..
    You really did a big & nice job which was making a big headache to me.

    Once again Thanx alot Dave.
     
    AL-MARAGHI, Jan 10, 2004
    #5
  6. AL-MARAGHI

    Dave Preston Guest

    That's no problem - I have done so many macros that do some of what you want
    it was only a case of copying and pasting it together
     
    Dave Preston, Jan 11, 2004
    #6
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.