Group Selection versus CreateCellElement1()

Fellow Microstation Developers,

When I select some elements and issue the "Group Selection" key-in it makes a cell.  This can be verified in VBA with the .IsCellElement property also.  However, when I pass an array containing these three elements to the CreateCellElement() in VBA I get a slightly different result.  Specifically how a Tag is incorporated.  When I "Group Select" them through the user interface it makes one nice cell.  When I use the CreateCellElement() function in MVBA I get a tag that is "kind of weird".  It behaves almost like it is both within the cell and external to the cell at the same time.  For example, if I pick an object which is not the tag element and drag it around, the tag element moves with the rest of the cell.  Similarly, if I delete the cell, the tag element is also removed.  However, if I grab the tag element and move it, it just moves without the other objects of the cell.  Also I can delete it and only the tag element goes away.  The other elements and the cell remain.

I guess I was incorrectly assuming the "Group Selection" via the user interface was the just a way/method of calling the CreateCellElement() function.  Evidently I was wrong.  What I'm seeking is some way to duplicate the "Group Selection" functionality in code.

I'm using Microstation V8i, SS3.

Thanks in advance,

Christmas May

Parents
  • Thanks for the responses.  They are GREATLY appreciated.

    What happens if you manually group the graphic elements but exclude the tag element?  Does the tag now become attached to its original host inside the group?

    The tag elements don't have "BaseElements" for whatever reason.  I'm not sure if this is the result of a translation issue, or if they were placed this way via the user dialog for placing tags.  When placing tags, there is a check box regarding associativity which can be disabled making the tags NOT have a "BaseElement".  Therefore, when I group them via "Group Selection" the tag seems to be in NO way associated with the other grouped elements.

    Maybe the discussion perspective should be changed: What do you want to achieve and what do you need? Is it "I want to group elements including tags into "movable as one" object"?

    Initially I didn't even realize there was a difference between the standard key-in and the VBA function.  This discrepancy took me "awhile" to figure out.  Also the "difference" is kind of the point to this thread/discussion.  With that in mind, I believe I would like to now focus on grouping elements including tags into "movable as one" objects.  If this needs to become a new thread, that would be fine.  I'm now seeking a way to accomplish the same thing as the "Group Selection" key-in through the Microstation standard user interface.  I don't necessarily believe the "Group Selection" key-in is the same as a "graphic group" but could easily be wrong?  Is it possible to use key-in commands in either MDL API (C) or MicrostationAPI(C)?

  • I believe I would like to now focus on grouping elements including tags into "movable as one" objects.

    In my opinion, in V8i (defined precisely, from V8.1), the standard tool how to group elements in a flexbile way are Named Groups I mentioned earlier. All DGN V7 ways like Graphic Groups and unnamed cells (Ctrl+G) are treated as osbsolete, even though grouping elements into cell makes still sense in some situations.

    An advantage of Named Groups is that they are the native feature of DGN V8 format, so there is no collision with other tool and they provide consistent behaviour.

    I'm now seeking a way to accomplish the same thing as the "Group Selection" key-in through the Microstation standard user interface.

    Menu item Edit > Group, shortcut Ctrl+G and key-in "group selection" are a presentation of the same functionality.

    I don't necessarily believe the "Group Selection" key-in is the same as a "graphic group" but could easily be wrong?

    No, they are completely different, but both are "old ways" when talking about grouping elements.

    Is it possible to use key-in commands in either MDL API (C) or MicrostationAPI(C)?

    Of course it is (from MDL C API, not sure about C++ MicroStationAPI as it's a bit limited in V8i). But I am not quite sure how we moved from original VBA to C API. In nearly any possible situation, when MDL API is used, there is absolutely no reason to use key-ins from the code, because MDL provides the best access to MicroStation features, so anything can be done using API directly.

    With regards,

      Jan

  • When I wrote, "I'm now seeking a way to accomplish the same thing as the "Group Selection" key-in through the Microstation standard user interface." I meant with code programmatically.  If I wanted to avoid using the key-in how would I do this programmatically with VBA code?  It also sounds like once I learn how to do this, I should not because it is an older way of doing things and should do it using "named groups".  So now my two questions revolve around how to duplicate the "Group Selection" with vba code (perhaps unnamed cells?)  and then how do I do it the new way with "named groups".  I will start searching Microstation help and the interweb to see what I can come up with, however, if you wouldn't mind posting a few lines of code that would be greatly appreciated.

  • Hi,

    So now my two questions revolve around how to duplicate the "Group Selection" with vba code (perhaps unnamed cells?)

    Group Selection is equal to unnamed cell, there is no difference: When the elements are groupped, a graphic cell without name is created at background. Use Element information dialog (Ctrl+I) and also old, but still usefull Analyze element tool (key-in analyze element), to find out what MicroStation creates when any tool is used.

    wouldn't mind posting a few lines of code that would be greatly appreciated

    Everything you need is available in MicroStation VBA help already. See NamedGroupElement object description and examples available in the help (e.g. Creating a NamedGroup and Adding Elements).

    With regards,

      Jan

Reply Children
No Data