Author Topic: Highlight a nested block  (Read 11004 times)

0 Members and 1 Guest are viewing this topic.

Draftek

  • Guest
Highlight a nested block
« on: November 30, 2006, 07:07:52 PM »
I can get a nested entity by using the GetNestedEntity() method of the EditorInput object. Which will get me the block that contains it. If I try to highlight the nested block, and not the entire parent block nothing happens.

Anybody how to do this?
« Last Edit: November 30, 2006, 07:09:50 PM by Draftek »

Jeff_M

  • King Gator
  • Posts: 4088
  • C3D user & customizer
Re: Highlight a nested block
« Reply #1 on: November 30, 2006, 07:17:23 PM »
Quote
Anybody how to do this?
Well, using the old ActiveX API the only way I found to do it was to duplicate the block by adding a temporary insert of the desired block in the appropriate Space and highlight THAT object.
« Last Edit: November 30, 2006, 08:18:34 PM by Jeff_M »

Draftek

  • Guest
Re: Highlight a nested block
« Reply #2 on: November 30, 2006, 07:22:25 PM »
It's werid.

I know I'm getting the correct ObjectId. I've seen the arx sample and I'm thinking maybe it has something to do with the insert not being transformed in the correct space.

Thanks for the reply Jeff.

Glenn R

  • Guest
Re: Highlight a nested block
« Reply #3 on: November 30, 2006, 07:25:01 PM »
Hang on, let me belt something up to look into it.....

Draftek

  • Guest
Re: Highlight a nested block
« Reply #4 on: November 30, 2006, 07:28:00 PM »
thanks. If I don't respond, I am traveling back home with no internet connection until Saturday...

Glenn R

  • Guest
Re: Highlight a nested block
« Reply #5 on: November 30, 2006, 08:01:14 PM »
In my quick look at it, I can't get it to highlight a nested object either...

Draftek

  • Guest
Re: Highlight a nested block
« Reply #6 on: November 30, 2006, 08:07:48 PM »
I can highlight a face on a solid using a similar technique, just not a nested block for some reason...

Thanks for trying.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Highlight a nested block
« Reply #7 on: November 30, 2006, 09:17:59 PM »
is the Hilit.CPP code in the SDK relevant and translatable ?
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.

LE

  • Guest
Re: Highlight a nested block
« Reply #8 on: December 01, 2006, 12:17:30 PM »
is the Hilit.CPP code in the SDK relevant and translatable ?

I went, and did a new solution using just the hilitInsert(), and it does not highlight a nested insert - it highlights the main one, and from that, it will go into each of the items from the nested insert.

I did also a new command in C# and was able to highlight normal objects but not items inside of a insert, but was able to get the info from them

Draftek

  • Guest
Re: Highlight a nested block
« Reply #9 on: December 02, 2006, 08:37:58 AM »
Yes, I found hilitInsert in the polysamp project.

Louis - It did work for me as far as highlighting the insert.

I think I will try and wrap it so I can pass an ObjectId from .net.

Thanks guys.


LE

  • Guest
Re: Highlight a nested block
« Reply #10 on: December 02, 2006, 12:55:00 PM »
Luis - It did work for me as far as highlighting the insert.

I taught that you want it to highlight a nested insert - it does the highlight (but as I see it) just the main one... and then it loops trough each item.
« Last Edit: December 04, 2006, 12:09:24 PM by LE »

LE

  • Guest
Re: Highlight a nested block
« Reply #11 on: December 02, 2006, 01:09:17 PM »
Here is what I wrote in C# - it highlight the top block but not the nested one, but return the ent (nested) - HTH

Code: [Select]
[CommandMethod("TESTSELNEST")]
public void testselnest()
{
    Document doc = acadApp.DocumentManager.MdiActiveDocument;
    Editor ed = doc.Editor;
    Database db = doc.Database;
    PromptEntityResult res = ed.GetEntity("\nSelect a nest object: ");
    if (res.Status != PromptStatus.OK) return;
    using (Transaction tr = db.TransactionManager.StartTransaction())
    {
        ObjectId objId = res.ObjectId;
        AcEd.PromptNestedEntityOptions neOpts = new AcEd.PromptNestedEntityOptions("");
        neOpts.UseNonInteractivePickPoint = true;
        neOpts.NonInteractivePickPoint = res.PickedPoint;
        AcEd.PromptNestedEntityResult neRes = ed.GetNestedEntity(neOpts);
        if (neRes.Status == AcEd.PromptStatus.OK) objId = neRes.ObjectId;
        AcDb.Entity ent = (AcDb.Entity)tr.GetObject(objId, AcDb.OpenMode.ForWrite);
        ObjectId[] objs = neRes.GetContainers();
        foreach (ObjectId id in objs)
        {
            DBObject obj = tr.GetObject(id, OpenMode.ForWrite);
            Entity tmpEnt = (Entity)tr.GetObject(id, OpenMode.ForRead);
            ObjectId[] ids = new ObjectId[1];
            ids[0] = id;
            SubentityId index = new SubentityId(SubentityType.Null, 0);
            FullSubentityPath path = new FullSubentityPath(ids, index);
            tmpEnt.Highlight(path, true);
        }
        tr.Commit();
    }
}

BTW, I do not know why not posting any CODE at all...
« Last Edit: December 02, 2006, 01:11:22 PM by LE »

Draftek

  • Guest
Re: Highlight a nested block
« Reply #12 on: December 02, 2006, 10:47:09 PM »
Luis - Yes, I want to highlight a nested insert and yes it does highlight the nested insert. - the hilitinsert.cpp arx from the sdk polysamp example.

I can't post code I didn't write.

I will post the solution when I get it working.

I have to work on something else this weekend but I will work on it next week sometime.

Thanks.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Highlight a nested block
« Reply #13 on: December 14, 2006, 02:51:18 AM »

Good news :

Kean Walmsley from Autodesk has published one of the responses I received from the ADN in answer to this.


http://through-the-interface.typepad.com/through_the_interface/2006/12/highlighting_an.html

Good to see ! 

... and a mention of theSwamp to boot. !

... ps he thinks I'm a lady, but I've had worse said  ....

/// kwb

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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Highlight a nested block
« Reply #14 on: December 14, 2006, 03:06:28 AM »

The original question of highlighting a nested Block was resolved in another discussion. If Kean does not publish the code I will ask for permission to post it here.

/// kwb

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.