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: 

Getting wrong SketchEntities from ProfileLoop - a bug in Fusion 360 C++ API

0 REPLIES 0
Reply
Message 1 of 1
jiri.manak
190 Views, 0 Replies

Getting wrong SketchEntities from ProfileLoop - a bug in Fusion 360 C++ API

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:

  1. create  new sketch on XY plane
  2. draw fit spline
  3. add 3 line segments 
  4. add a rectangle crossing bottom line
  5. 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

 

 

Labels (3)
0 REPLIES 0

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