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

How to highlight the entity in the xref

1 REPLY 1
Reply
Message 1 of 2
sparrowharks
711 Views, 1 Reply

How to highlight the entity in the xref

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

Any suggestions?

thanks.
 

Tags (2)
1 REPLY 1
Message 2 of 2
adam.nagy
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
Autodesk Platform Services

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

Post to forums  

Autodesk Design & Make Report

”Boost