.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help to understand FullSubentityPath result of GetPickedEntities

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
1982 Views, 5 Replies

Help to understand FullSubentityPath result of GetPickedEntities

Hi

I'd like to get a good understanding of the result of GetPickedEntities function when used with a point monitor. I'd also like to understand more about the FullSubentityPath. Neither of these can be found by searching the ARX docs.

 

Here's a sample of the code I have at the beginning of my point monitor:

 

static void ed_PointMonitor(object sender, PointMonitorEventArgs e)
        {
            ...
                FullSubentityPath[] paths = e.Context.GetPickedEntities();
...

When my mouse pointer is hovered over a hatch I want to be able to process the hatch but I get 55 entities in the FullSubentityPath result. 

 

Thanks in advance.

Craig

5 REPLIES 5
Message 2 of 6
Balaji_Ram
in reply to: Anonymous

Hi Craig,

 

Here is an explanation about the FullSubentityPath from the managed API documentation :

 

<<<

An object of this class consists of array of object IDs and an SubentityId object.

The subentity ID object contains the graphics system marker of the subentity and the type of the subentity (that is, edge, face, vertex). The object ID array contains a sequential list of the object IDs for all the objects that make up the "path" from the outermost entity (in Model or Paper space) down into the "main" entity that the subentity is a part of.

>>>

 

Here is a sample code that I am using in the PointMonitor, which iterates the array. Can you see what it displays in your case for the hatch ? 

 

void OnPointMonitor(object sender, PointMonitorEventArgs e)
{
    try
    {
        FullSubentityPath[] paths = e.Context.GetPickedEntities();
        if (paths.Length == 0)
            return;

        Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
        foreach (FullSubentityPath fsp in paths)
        {
            //SubentityId sId = fsp.SubentId;
            //IntPtr subEntMarker = sId.IndexPtr;

            ObjectId[] oIds = fsp.GetObjectIds();
            foreach (ObjectId oId in oIds)
            {
                ed.WriteMessage("\n{0} - {1}", oId.Handle, oId.ObjectClass.Name);
            }
        }
    }
    catch (System.Exception exn)
    {
        Application.ShowAlertDialog(exn.Message);
    }
}

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 6
Anonymous
in reply to: Balaji_Ram

Hi Balaji,

From the description, the outermost entity seems to be what I need i.e. the element that would be selected if clicked by the user. Is that safe to say?

 

Also, I'd really like to know how you found the information in the managed API documentation. I've just gone back and looked again in the AutoCAD Managed Class Reference (arxmgd.CHM) and searched for FullSubentityPath, GetPickedEntities and PointMonitorEventArgs and none of them are found nor are they in the index. I can find PointMonitorEventArgs via the contents but there is not link back to the others.

 

Thanks

Craig  

 

 

Message 4 of 6
Balaji_Ram
in reply to: Anonymous

Hi Craig,

 

When looking for an explanation of a class or structure whose name is known, searching using "Index" usually provides better results. The explanation that I had pasted earlier is under "FullSubentityPath Structure" topic in the managed API documentation.

 

For the main entity you will need to access the first entity in the collection (index 0). This explanation from the help should clarify that point.

 

<<<<

For example, an edge of an Solid3d that's within a block definition that's referenced by an BlockReference would result in an object ID array with two object IDs. The first would be the object ID of the BlockReference. The second would be the object ID of the Solid3d.

>>>>

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 6
Anonymous
in reply to: Balaji_Ram

Hi Balaji,

I have found out why I do not see it. The indexes are not merged when viewed via arxdoc.chm. I thought they would be.

 

arxdocindexfull.jpg

Message 6 of 6
Balaji_Ram
in reply to: Anonymous

Hi Craig,

 

"FullSubentityPath" is the .Net equivalent of "AcDbFullSubentPath".

 

Looking for "FullSubentityPath" in "arxmgd.chm" or "AcDbFullSubentPath" in "arxdoc.chm" will show the topics.

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost