[MSCE 2023 C#] What class to inherit for command

Hi,

What would be the best practice if I want to create a command that need one or more elements as input to create som new elements? No modification.

I've used DgnElementSetTool and it works fine for most cases and it has support for drag lines, Reset for identifying overlapping elements etc. I wonder if it would be better to use DgnPrimitiveTool and use the Locate functions to identify the input elements if they are available in .NET.

I'm trying different solutions mainly because I have the need for non standard workflow (not my decicion!) and I also find it hard to figure out if OnResetButton was called because of cycling through elements or just a plain Reset.

Any ideas?

Regards,

Krister

Parents
  • Hi Krister,

    I wonder if it would be better to use DgnPrimitiveTool and use the Locate functions to identify the input elements if they are available in .NET.

    I always prefer to use DgnElementSetTool when more elements to be selected.

    In my opinion it is better to ignore rich functionality, available inside DgnElementSetTool than to implement potentially complex location mechanism to extend DgnPrimitiveTool. But I can imagine in some situations the complexity can be equal in both classes.

    Recently I implemented quite complex workflow, consisting from selection 1 - 3 elements, sequentially from reference and active and model, and mixing with cells placement under defined geometric constrains. Although I guess I use only a fraction of DgnElementSetTool functionality (I do not even use ElementAgenda ;-), I did not think about DgnPrimitiveTool as an alternative.

    and I also find it hard to figure out if OnResetButton was called because of cycling through elements or just a plain Reset.

    I do not know details, but for it it sounds more like problem in the workflow design. When you cannot figure out the situation in code, can it be solved when simulated manually? I guess not ;-)

    With regards,

      Jan

  • Thanks for your input,

    Now that I've focused on DgnElementSetTool i'm starting to figure things out (a bit!).

    Still working on a good approach to find out if the Reset is loop-overlapping-element Reset or a "normal" Reset.

    Regards,

    Krister

    Owner consultant at Surell Consulting AB

Reply Children
No Data