Move cell to desired level

I've scoured these forums and google and cannot seem to figure this one out on my own.

With VBA I'm able to place a cell into my design file.  It does not come in on the desired level, however (not necessarily the active level) and I don't know how to change the cell's level.  Some things I've noticed are

1) if, when the cell was drawn,  the level that the cell was drawn on does not exist in my design file, that level is created in my design file

2) in my code, immediately after "ActiveModelReference.AddElement myNewCell", the command "MsgBox(myNewCell.Level)" throws a "variable not set" error so I tried "Set myNewCell.Level = someLevel" but I get the same error on this line of code

What am I missing here?

Thanks

Parents
  • alternate_exterior:

    I don't know how to change a cell's level. I tried "Set myNewCell.Level = someLevel" but I get the same error on this line of code

    Normal Cells

    If you use the Analyze Element tool to examine a normal cell, you will see that the type 2 cell header level is greyed out. In fact, the cell header doesn't have any level, since it's not a graphic element but a container for one or more other elements, some of which may be graphic. Those component graphic elements will each have a level. It's necessary to iterate the components of a cell instance (i.e. after you have added it to a DGN model) and rewrite the cell if you want to change their levels.

    Point Cells

    Point cells behave differently. Useful methods are CellElement.IsPoint and CellElement.SetLevelRelative.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • hi how r u hope u r doing well. Plz i need your help im trying to write a vba code to move  cell to desired level for example i have some cells in the level 1 and the same cells in the level 2. i want to move all this same cells in the level 3 for example. how can i do it? plz if u know send me the all program cause im very bad in vba. thank you so much.

  • millenium:

    If u know send me the all program cause im very bad in VBA …

    These Forums are here to provide help, not a free development service.

    If you are a newcomer to MicroStation VBA, why not take a training course? I believe that the Bentley Institute provides class-based and on-line training.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

Reply Children
No Data