select within region

select within region

ChrisAtherton
Advocate Advocate
473 Views
3 Replies
Message 1 of 4

select within region

ChrisAtherton
Advocate
Advocate

 

Has anyone got some code to hand for the following situation.

 

I have 2 sub assemblies in a design and wan to turn off elements of the first that overlap with the second; imagine a box going through an array of beams and I only want the beams that the box interfears with to be suppressed.  I can do this via the API using an interference analysis however its slow.  So I wondered if anyone has code that would do this similar to the SELECT COMPONENT OFFSET in the assembly environment.

 

I'm sure I can work it out but am up against it here so any help appreciated.

 

Cheers


Chris

Chris Atherton
IEng MIMechE BEng Hons
Design Automation Services Manager | Symetri
https://uk.linkedin.com/in/chrissoathe
0 Likes
Accepted solutions (1)
474 Views
3 Replies
Replies (3)
Message 2 of 4

philippe.leefsma
Alumni
Alumni
Accepted solution

Hi Chris,

 

Rewritting the interference analysis with custom code would be probably a lot of work! Except if your assemblies contain only basic geometry primitives like boxes and spheres, but I doubt it is the case. I also doubt somebody could come up with interference checking code that would be significantly quicker than what the API provides, simply because you would need to somehow extract the geometry to be processed by your own logic and that would also take time anyway...

 

As you describe the problem, did you consider using "FindUsingRay" method instead of an interference check?

 

Another suggestion that may speed things up is to perform a bounding box check first between occurrences of your two assemblies, then perform an interference check only between those occurrences. But I would think the API is already doing that internally. Use the ComponentOccurrence.RangeBox, then do a box-box check, you should find easily code to do that on the web, but again you may end up having an even slower code at the end...

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 4

ChrisAtherton
Advocate
Advocate
Thanks Philippe for the point I the right direction as ever. Hadn't thought about using the findusingray method but will give it a go.

Thanks as always.

Chris
Chris Atherton
IEng MIMechE BEng Hons
Design Automation Services Manager | Symetri
https://uk.linkedin.com/in/chrissoathe
0 Likes
Message 4 of 4

philippe.leefsma
Alumni
Alumni

You're welcome, let us know how things go 😉

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes