Getting wrong SketchEntities from ProfileLoop - a bug in Fusion 360 C++ API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am developing add-in, which makes further actions over a SketchProfile selected by a user. I am trying to get SketchEntities of a ProfileLoop. In some special cases I get one segment twice and one is missing. The special case is when user creates sketch manually - it is not imported as a DXF (for example).
It can be reproduced by this steps:
- create new sketch on XY plane
- draw fit spline
- add 3 line segments
- add a rectangle crossing bottom line
- trim the segments to extend the profile
for an illustration there is a screenshot attached
Processing it in my code (c++) I get following trace output. It shows a list of start and end points of the loop segments.
There are 8 segments (SketchEntity)
IDX = 01 and IDX = 05 are the same. (01 and 05 are for this kind of shape made by this steps always the same)
One segment is missing.
[2020-05-12 10:34:51.193] [glchan] [debug] ProfileLoop Size: 8
[2020-05-12 10:34:51.193] [glchan] [debug] IDX = 00 adsk::fusion::SketchLine
[2020-05-12 10:34:51.193] [glchan] [debug] Start: [ 20.00, -72.50, 0.00]
[2020-05-12 10:34:51.193] [glchan] [debug] End: [ 20.00, -95.00, 0.00]
[2020-05-12 10:34:51.193] [glchan] [debug]
[2020-05-12 10:34:51.193] [glchan] [debug] IDX = 01 adsk::fusion::SketchLine
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [-61.83, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug] End: [-30.00, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug]
[2020-05-12 10:34:51.194] [glchan] [debug] IDX = 02 adsk::fusion::SketchLine
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [ 41.05, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug] End: [ 68.09, -17.72, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug]
[2020-05-12 10:34:51.194] [glchan] [debug] IDX = 03 adsk::fusion::SketchFittedSpline
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [ 68.09, -17.72, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug] End: [-61.83, -30.10, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug]
[2020-05-12 10:34:51.194] [glchan] [debug] IDX = 04 adsk::fusion::SketchLine
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [-61.83, -30.10, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug] End: [-61.83, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug]
[2020-05-12 10:34:51.194] [glchan] [debug] IDX = 05 adsk::fusion::SketchLine
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [-61.83, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug] End: [-30.00, -72.50, 0.00]
[2020-05-12 10:34:51.194] [glchan] [debug]
[2020-05-12 10:34:51.194] [glchan] [debug] IDX = 06 adsk::fusion::SketchLine
[2020-05-12 10:34:51.194] [glchan] [debug] Start: [-30.00, -95.00, 0.00]
[2020-05-12 10:34:51.195] [glchan] [debug] End: [-30.00, -72.50, 0.00]
[2020-05-12 10:34:51.195] [glchan] [debug]
[2020-05-12 10:34:51.195] [glchan] [debug] IDX = 07 adsk::fusion::SketchLine
[2020-05-12 10:34:51.195] [glchan] [debug] Start: [ 20.00, -95.00, 0.00]
[2020-05-12 10:34:51.195] [glchan] [debug] End: [-30.00, -95.00, 0.00]
The code is quite complex to be published here but it uses
ProfileLoop -> ProfileCurves -> ProfileCurve -> SketchEntity to get 'entity'
casting 'entity' to appropriate Sketch object to get
geometry()->evaluator()
and finally
evaluator()->getEndPoints(start_point, end_point))
to get start and end points
Let me know if my description is clear.
Is this the right place to submit this bug?
Jiri