Command to drop a shared cell?

Discussion in 'Microstation' started by paulm88, Nov 16, 2005.

  1. paulm88

    paulm88 Guest

    I am trying to drop a specific shared cell to a normal cell so that I
    can then batch process replacing some text. This has to be done on 300+
    files, so there can't be any user intervention. I have everything
    working except for dropping the shared cells to normal cells. I found
    this macro posted below, but it causes all of my tags to disappear? Is
    there a way to modify this to select a specific shared cell by name or
    is there some way to keep it from loosing all of my tags? Any input
    would be greatly appreciated

    Thanks,
    Paul


    Const STARTofFILE% = 0

    '-----------------------
    'VARIABLES
    '-----------------------
    Dim element As MbeElement
    Dim filePos As Long
    Dim origin As MbePoint
    Dim endOfFile As Long
    Dim aantal as Long

    '-----------------------------------------------------------
    'subroutine ProcessEinde
    '-----------------------------------------------------------
    Sub ProcessEinde
    MbeSendCommand("NULL")
    MbeStartDefaultCommand
    MbeWritePrompt "The macro is stopped, " + cstr(aantal) + " elements
    are dropped"
    MbeSendCommand "ECHO"
    End
    End sub

    '-----------------------------------------------------------
    'Main
    '-----------------------------------------------------------
    Sub Main
    Set Element = New MbeElement

    aantal = 0
    endOfFile = MbeDgnInfo.endOfFile
    filePos = element.fromFile(STARTofFILE)

    'Set a variable associated with a dialog box
    MbeSetAppVariable "DROP", "dropOptions.sharedCells", -1&
    MbeSetAppVariable "DROP", "dropOptions.sharedToNormal", 1&

    While filePos < ENDofFILE AND filePos >= 0

    If (element.type = 35) Then
    If element.getOrigin(Origin) = MBE_Success Then
    aantal = aantal + 1
    MbeSendCommand "DROP sharecell "
    MbeLocateElement filePos,filePos,0,origin
    MbeSendDataPoint 0,0,0,1
    End if
    End If
    filePos = element.fromFile(filePos + element.fileSize)
    Wend

    ProcessEinde

    End Sub
     
    paulm88, Nov 16, 2005
    #1
  2. Paul

    Wish I could help you I need to do the same thing.

    Please let me know when you find the answer.

    Ed Leaders
     
    eagle.falcon.1, Nov 18, 2005
    #2
  3. paulm88

    dave Guest

    Hi Paul,

    Would it be easier just replace the the cell?.
    Look for fromto.ma and it will replace your old cell
    with new ones without opening any drawing.

    Good Luck
     
    dave, Dec 4, 2005
    #3
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.