Author Topic: Entities modify  (Read 2125 times)

0 Members and 1 Guest are viewing this topic.

dann.boy.001

  • Guest
Entities modify
« on: July 01, 2010, 05:22:27 AM »

Hello

Does somebody know how is posible to get which
entities user want to modify:

User can select entities and then start to copy, move, etc...

or

User can run command and then select to copy, move, etc...


Is there some way to we catch, before entities are started to modify,
which entities are selected (as list od objectids, or list of entites)?


Best regards
Danijel
.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Entities modify
« Reply #1 on: July 01, 2010, 05:43:11 AM »

Perhaps something like :
Code: [Select]
           ObjectIdCollection selSet = null;

            PromptSelectionResult selection = ed.GetSelection();
            if (selection.Status != PromptStatus.OK)
            {
                return false;
            }
            selSet = new ObjectIdCollection(selection.Value.GetObjectIds());
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

dann.boy.001

  • Guest
Re: Entities modify
« Reply #2 on: July 01, 2010, 06:23:17 AM »
Hello Kerry Brown!

Again thank you for your time.

I have code to get selected entities, but problem is becausse
I don't know how to get selected entities when user start to
for example mirror entities (or move, copy with base point).

1. User run mirror command
2. select entities (if not already selected)
3. pick first point of mirror line
4. pick second point of mirror line
5. press enter

I want to get entitites moment before user go to
3 or 4 step.
If user first select entities and than run command mirror
I can get selected entities, but, If user first run command
and then select entities I have no idea how to catch that
event.

Best regards,
Danijel I

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Entities modify
« Reply #3 on: July 05, 2010, 09:18:06 AM »
You can make your own version of the command in net.

xsfhlzh

  • Guest
Re: Entities modify
« Reply #4 on: July 05, 2010, 10:09:28 AM »
Code: [Select]
       [CommandMethod("t8", CommandFlags.UsePickSet)]
        public static void Test8()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            var resSel = ed.SelectImplied();

            if (resSel.Status != PromptStatus.OK)
            {
                resSel = ed.GetSelection();
            }



        }
« Last Edit: July 05, 2010, 10:12:55 AM by xsfhlzh »

dann.boy.001

  • Guest
Re: Entities modify
« Reply #5 on: July 05, 2010, 10:27:17 AM »
Thank you for advice  :-)!

I actually want to know when user run autocad's command
move, rotate, or some others.

I solved that problem:

First I activate event for command begin, end, cancel to know
which command user run.

If I catch that user start command for example: move,

then in command begin evet check are some entities already
selected. if not, then activate second event : on selection added.

When command end, I can know all entities which user
selected, before command, od after coomand start.

Works well.  :lol:

Best regards,
Danijel