-
Re: How works SelectByRay?
Michael Corriveau-Cote Feb 12, 2019 8:00 AM (in response to Maciej Mazik)Hey Maciej,
I'm quite confused. Your 3D Points are in the range of thousands and you specify a starting point @ (1.5,1,1.1) ?
What if startint point was something more like this : (1500,1050,1500) ?
Other than that, the direction of your vector seems fine.
EDIT : Know that if it fits you, you can also use MultiSelectByRay and use GetSelectedObjectCount2 to cycle through the faces.
-
Re: How works SelectByRay?
Josh Brady Feb 12, 2019 8:30 AM (in response to Michael Corriveau-Cote)Pretty sure the arguments are in system units (meters) rather than document units (mm)
-
Re: How works SelectByRay?
Maciej Mazik Feb 12, 2019 8:47 AM (in response to Josh Brady)This is it.
-
-
Re: How works SelectByRay?
Jim Sculley Feb 12, 2019 8:49 AM (in response to Michael Corriveau-Cote)Michael Corriveau-Cote wrote:
Hey Maciej,
I'm quite confused. Your 3D Points are in the range of thousands and you specify a starting point @ (1.5,1,1.1) ?
What if startint point was something more like this : (1500,1050,1500) ?
Other than that, the direction of your vector seems fine.
API calls like this are always specified in meters. The model is using millimeters. There isn't anything wrong with the code. This appears to be a bug. If you use the original (but now supposedly obsolete) ModelDoc2::SelectByRay, it works as expected:
-
Re: How works SelectByRay?
Maciej Mazik Feb 12, 2019 3:43 PM (in response to Jim Sculley)Its good answer and it really work . But I have problem, it works in Visual Basic, but not working in python
I suspect that is old function and maybe its doesnt work as it should. It all time give me false as result.
-
-
-
Re: How works SelectByRay?
Kamil Bojdol Feb 12, 2019 8:45 AM (in response to Maciej Mazik)My experience with SW scripting is quite short, but I don't find any of the selecting methods that you mentioned reliable for real life 3d models.
Way of reliably selecting faces that works for me is keeping the reference to feature(or body) and then taking reference to all faces out of it, and then choose correct face by method that you need. Then you can use selection manager and AddSelectionListObject method