Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using findBRepByUsingPoint

1 REPLY 1
Reply
Message 1 of 2
pludikar
175 Views, 1 Reply

Using findBRepByUsingPoint

Hi,

 

I'm trying to use the findBRepByUsingPoint method found in component:

 

if I have a face entity:

 

face.assemblyContext.component.findBRepByUsingPoint(face.pointOnFace, adsk.fusion.BRepEntityTypes.BRepFaceEntityType)  >>  returns an objectCollection

 

but 

face.assemblyContext.component.findBRepByUsingPoint(face.pointOnFace, adsk.fusion.BRepEntityTypes.BRepFaceEntityType).count returns 0 - meaning it hasn't found anything.

 

I would have expected it to return count of 1.

 

 

Am I missing something?

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
1 REPLY 1
Message 2 of 2
pludikar
in reply to: pludikar

I think pressing the send button, is cathartic, makes me relax and when I'm relaxed I come up with solutions.

 

The issue is, and this seems to be the way F360 works, is when working and modifying Occurrences, you MUST be working with the NativeObject.  I had assumed that you had to be working with the Occurrence and, because everything is in same world coordinate space, and the occurrences would take care of the rest - Not so!!

 

face.assemblyContext.component.findBRepByUsingPoint(face.pointOnFace, adsk.fusion.BRepEntityTypes.BRepFaceEntityType)  >>  returns an objectCollection
face.assemblyContext.component.findBRepByUsingPoint(face.pointOnFace, adsk.fusion.BRepEntityTypes.BRepFaceEntityType).count returns 0

 

The component referred to by: 

face.assemblyContext.component

 is actually in the nativeObject space.  So 

face.pointOnFace

the resulting coordinates are in the wrong place

 

The solution:

 

face.nativeObject.pointOnFace

and now

 

face.assemblyContext.component.findBRepByUsingPoint(face.nativeObject.pointOnFace, adsk.fusion.BRepEntityTypes.BRepFaceEntityType).count >> returns 1

Hope that helps anyone else who has come across the same issue

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report