a selection that becomes cell

Discussion in 'Microstation' started by yag, Nov 7, 2004.

  1. yag

    yag Guest

    I must make this:
    1. to convert one selection (fence or other) in cell
    2. to put the cell within a specific one file dgn (mylib)

    you can give one hand to advise to me queli functions to me to use?

    es:
    for point 2I have thought next to
    object.AttachCellLibrary CellLibraryName [, ConvertFromV7]
    but for point 1 I do not know like making

    note:
    the file dgn (lib) are not opened or active

    i use thi code but not working:
    .....
    _ElementEnumeratorPtr el_enum;
    _ElementPtr el;
    _CellElementPtr cell;
    Point3d p;

    _FencePtr selection = m_spApp->ActiveDesignFile->Fence;
    el_enum = selection->GetContents(true,true);
    SAFEARRAY *arrElements;
    arrElements =el_enum->BuildArrayFromContents();
    cell = m_spApp->CreateCellElement1("cella",&arrElements,&p,true);
    cell->Color = 111;
    cell->Redraw(msdDrawingModeNormal);
    m_spApp->ActiveModelReference->AddElement((_Element*)&cell); //crash
    ....


    TNKS
     
    yag, Nov 7, 2004
    #1
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.