Author Topic: Programmatically select Solid3d faces  (Read 2029 times)

0 Members and 1 Guest are viewing this topic.

Danipon

  • Mosquito
  • Posts: 5
Programmatically select Solid3d faces
« on: November 20, 2018, 10:52:35 AM »
I can't find a way to programmatically select solid3d subentities (faces or edges). Editor method SetImpliedSelection requires an array of ObjectId (unsuitable for subentities).

Code: [Select]
public void SetImpliedSelection(ObjectId[] selectedObjects);
Arx provides the acedSSSubentAdd function. I could probably PInvoke that function but, since I have several CAD versions to target, a natively managed method would be the best option.

None of the Editor Select* methods seems to accept a SubentityId or FullSubentityPath.

A possible (awful) workaround is to subscribe the Editor SelectionAdded event. The SelectionAddedEventArgs provides a promising AddSubEntity(SelectedSubObject) method, but no way to make it working. Here is the code I used.

Code: [Select]
var subEntPath = new FullSubentityPath(new[] { entId }, subentId);
var sso = new SelectedSubObject(subEntPath, SelectionMethod.NonGraphical, IntPtr.Zero);

Any suggestions would be appreciated.

Daniele

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Programmatically select Solid3d faces
« Reply #1 on: November 20, 2018, 11:44:24 AM »
http://adndevblog.typepad.com/autocad/2012/07/retrieving-a-solidThree-D has some good stuff.
I pick the solid then find the edge or face. It is very difficult to know what face was picked though

Danipon

  • Mosquito
  • Posts: 5
Re: Programmatically select Solid3d faces
« Reply #2 on: November 21, 2018, 03:02:04 AM »
I noticed I didn't explain properly. The problem is not selecting a face.
I already have the face/faces. What I need is setting the implied (active/pickfirst) selection providing my faces. This is possible to achieve using the mouse pointer so I guess there is a way to do that via code. The attached picture makes the concept clear.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Programmatically select Solid3d faces
« Reply #3 on: November 22, 2018, 03:25:33 PM »

Danipon

  • Mosquito
  • Posts: 5
Re: Programmatically select Solid3d faces
« Reply #4 on: November 23, 2018, 11:43:14 AM »
For what I can see there is no definition of the implicit selection (PICKFIRST) of subentities (3D faces) on that post.