Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Calculate Projected area

rashi_guptaMZDTK
Explorer

Calculate Projected area

rashi_guptaMZDTK
Explorer
Explorer

I imported a stp file to fusion 360. I need to find it's projected area using scripting. I successfully projected the model to XY plane but it is not giving me the correct area for the different profiles that it created.

The same code is giving the correct area for a model that I am creating in Fusion 360 but giving wrong values for the imported stp file. Is there anything that needs to be changed in stp files for this to work?

0 Likes
Reply
667 Views
6 Replies
Replies (6)

BrianEkins
Mentor
Mentor

I'm unsure exactly what it is you're doing. Based on what I think you're doing, I wouldn't expect any difference between a model imported from STEP or one created in Fusion. Can you provide an example case that can be used to reproduce the problem.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes

rashi_guptaMZDTK
Explorer
Explorer

Hi, 

Thank you for your response. @BrianEkins 

I am trying to find the area projected by a component on XY plane using a script. Let's say I created the following model in fusion. 

rashi_guptaMZDTK_0-1707309206495.png

This model projects a certain area on the XY plane as shown below.

rashi_guptaMZDTK_1-1707309902328.png

I wrote a script to project this area on the XY plane and prompt the total area of the two different profiles that it is creating. One for the outer profile and second for the inner circle profile as shown below. 

rashi_guptaMZDTK_2-1707310031170.png

The script is working for any model that I create in fusion 360 but when I try to use the same script for an imported .stp file it is projecting the are but unable to give the area of the projected profile. Also, I am unable to click or work on this projected profile as shown below. 

rashi_guptaMZDTK_0-1707310903323.png

 

 

 

0 Likes

BrianEkins
Mentor
Mentor

I did a quick test using a part created in Fusion and one imported from STEP, and they both work for me. In your pictures, it also looks like the STEP model was successfully projected onto the sketch and created a valid profile.

 

I have seen cases where the Project command fails to create a closed outline so a profile can't be created. This is fairly rare but can happen with models created in Fusion or imported using STEP or another neutral format. Can you post your STEP file here?

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes

rashi_guptaMZDTK
Explorer
Explorer

Hi, 

Thank you for you response @BrianEkins 

I am receiving this error when I am executing my code with this particular stp file (Test). 

rashi_guptaMZDTK_0-1707328121010.png

I tested out the code with an stp files of a model created on fusion and it works fine. And in those I am able to click and edit the sketches. So I'm not sure if there is something specific I need to execute or such complex geometries. 

 

 

With another stp file (Test 2) which has more complex geometry, the code is executing completely but is not giving the correct value of the projected area. 

rashi_guptaMZDTK_1-1707329600912.png

 

I have attached the stp files. Please have a look and let me know if there is anything I need to additionally execute when working with such complex geometries.  

Also, if you could tell me how to identify different profiles in the projected area and know the index number of different profiles, it'd be very helpful.

Thank you. 

 

 

0 Likes

rashi_guptaMZDTK
Explorer
Explorer
Hi,
Were you able to take a look at the files?
Thanks in advance!
0 Likes

jordan783ZS
Advocate
Advocate
You probably have to share your script too
0 Likes