ObjectARX

Reply
New Member
sparrowharks
Posts: 1
Registered: ‎03-28-2012
Message 1 of 2 (274 Views)

How to highlight the entity in the xref

274 Views, 1 Replies
03-30-2012 02:01 AM

I want a solution that can highlight the entity which is selected in the xref.

Any suggestions?

thanks.
 

ADN Support Specialist
adam.nagy
Posts: 583
Registered: ‎03-26-2007
Message 2 of 2 (250 Views)

Re: How to highlight the entity in the xref

04-03-2012 05:39 PM in reply to: sparrowharks

Hi there,

 

I found this note:

>>>>>

Issue

How do I select and highlight sub entities (edges, faces) of 3D solids nested
inside a block?

Solution

In order to highlight sub entities you need the AcDbFullSubentPath which you will pass to the AcDbEntity::highlight() function. An AcDbFullSubentPath describes the "way" to an (sub)entity inside the drawing. If an AcDb3dSolid resides in a block, the "way" to that solid is first to use the AcDbBlockReference, then the solid. That means you have to open the AcDbBlockReference and then call the highlight function.

In order to retrieve the AcDbFullSubentPath, use the ads_ssget function with the :N option. Afterwards, you can call ads_ssnamex to return a resbuf list that describes the way in which entities in the selection set were selected. For detailed information, see the ObjectARX reference manual regarding ads_ssnamex.

With the result of ads_ssnamex, you now have the GsMarker (enumerated index of a subentity the user picked), a pick point, the ObjectId's of nested entities, and the information you pass to AcDbEntity::getSubentPathAtGsMarker(). The information you have to provide to that function is the SubentType depending of the type of subentity you want. AcDbEntity::getSubentPathAtGsMarker() returns now an array of AcDbFullSubentPath's.

In the case where you extrude two rectangles which are coincident at one point, unite these two solids to get one solid where four faces are connected to one edge. If you select that edge and pass in AcDb::kFaceSubentType as subentType to getSubentPathAtGsMarker, you will get four AcDbFullSubentPath's returned.

Call the highlight() function which each of returned AcDbFullSubentPath's and ask the user which face he wants.

IMPORTANT NOTE: Because of the new architecture of Cool Whip, you should always unhighlight the entities you highlighted. 

<<<<<

 

I hope it is useful.

 

Cheers,

Adam Nagy

Autodesk Developer Network



Adam Nagy
Developer Technical Services
Autodesk Developer Network
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.