26 Replies Latest reply on Aug 16, 2016 7:20 AM by Polytimi Sofotasiou

# how to get projected area of a part?

hi,everyone!

i do not know how to get projected area of a part when we choose a plane of projection?please help me,thank you!

• ###### Re: how to get projected area of a part?

Wen,

I would love to help but I do not understand your question.

Keith

Video Tutorials for the SolidWorks API

• ###### Re: how to get projected area of a part?

The question is interesting. Consider a solid body and a plane. Can you get the outline of the solid body as projected to the plane?

Or even better, you have a solid body, a direction and a surface of any type. Get the outline of the solid body on that surface based on the given direction.

Imagine directing parallel rays from above the solid body to the plane. Get the shadow outline.

• ###### Re: how to get projected area of a part?

Alin,

That makes a lot of sense.  Next I would need to know what he wants for the outline.  A split line?  A sketch?  If a split line and you don't mind an approximation then you can get the bounding box of the body, extract the appropriate coordinates, and use that with IFeatureManager::InsertSplitLineIntersect.  That method returns a feature.  You could use IFeature::GetFaces to get the face created by that feature, then use IFace2::GetArea to get the area.

If the bounding box coordinates aren't acceptable, it is still possible.  If the extreme points of the bodies are vertices then he'd need only traverse the vertices (IBody2::GetVertices) and get the most extreme coordinates using IVertex::GetPoint.  If the extreme points aren't vertices then he'd have to find the most extreme tessellation pts using ITessellation::GetVertexPoint.

Keith

Video Tutorials for the SolidWorks API

• ###### Re: how to get projected area of a part?

Hi dear Keith

I tried to use from your tutorials from:Video Tutorials for the SolidWorks API

but i couldn't see any thing

are all tutorials omitted from there?

I wonder if u contribute me to download any of tutorials as i'm not a native English and it takes me long time to understand them

• ###### Re: how to get projected area of a part?

You need to create a user login on that site. Only then you will be able to access some of the free videos as a basic user. If you're looking to upgrade to power user, I can highly recommend that.

• ###### Re: how to get projected area of a part?

I have been created a free user on that site

but unfortunatly yet i was not be able to watch any thing

is there any way to download a tutorial clip from a site like this, as i'm not a native English speaker it take long time to understand it.

therefor i need to wach it many times

• ###### Re: how to get projected area of a part?

thanks dear Deepak

• ###### Re: how to get projected area of a part?

hi,Keith

i draw a pic to describe my question, if you have any question, please tell me.

• ###### Re: how to get projected area of a part?

If you measure the face of the part at the widest partion it will tell you the area.

Or you can also creat a planner surface form the insert or part them measure the area.

• ###### Re: how to get projected area of a part?

Wen Yi,

If the shapes are that simple then it looks like the upper most planar surface could simply be measured to give you the correct answer as well.  But for more complex shapes, use the bounding box method I described.

Keith

Video Tutorials for the SolidWorks API

• ###### Re: how to get projected area of a part?

I will revive this old thread because I face the same issue;

@Kevin Drew: there is NO face, it is the projection of a complex assembly, like a telecom tower with attached antennas

@Keith Rice: I don't quite undersand your method...

Any ideas?   It is, in simple terms, the area of an orthogonal  projection.

Thanks.

• ###### Re: how to get projected area of a part?

I would suggest the Modeler::GetBodyOutline2 method which gets the outline curves of the body in a given direction. Than it is required to create a temporary sheet body, trim it with these curves (Surface::CreateTrimmedSheet4.) and get the area of its single face (Face2::GetArea). This is quite a bit of advanced SolidWorks programming but this is IMHO the only correct way to do this.

Another option may be to create a drawing view from this body in a given direction and convert all outline entities and calculate the area using the measure tool - but this is more manual process.

__________________________

Regards,

Artem Taturevych

Tel: +61 2 9454 4444

• ###### Re: how to get projected area of a part?

Thanks.

However, I know nothing about SW programming so this method won't work for me, I'm just an average user.

• ###### Re: how to get projected area of a part?

If I have this macro I would share this with you but I do not have one. You may request this custom programming. There is number of companies including my company which provide this service and may do this.

__________________________

Regards,

Artem Taturevych

Tel: +61 2 9454 4444

• ###### Re: how to get projected area of a part?

The projected area of a part can be found (estimated) by using the following method :

1. Rotate or align with the plane in the orientation you want to calc the area.

2. Use "Save  as DXF" with "annotation views" & current...

3. Open DXF as new part, extrude part based on the DXF outline.

4. Use standard measure tool to find the area, perimeter etc...

regards

Frode

• ###### Re: how to get projected area of a part?

Frode, great workaround. I wrote a macro using this approach that you can download on my web site. See "Get sketched outline / projected sketch of part" in our Macro LIbrary.

The disadvantage of this method is that it leaves a lot of extraneous sketch entities that the user still needs to delete manually.

As for Artem's method, there is an example in the API Help that will approximate the outline of a part using IModeler::GetBodyOutline2. See the API Help page for IModeler::GetBodyOutline2. I'm sure it could be modified to give an exact outline, though perhaps not easily.

Keith

SolidWorks API Tutorials

• ###### Re: how to get projected area of a part?

Keith,

In my experience, all the "IModeler::GetBodyOutline2" help examples only work for straight line parts. The one shown is a curved feature. Is there a way to convert the curve into a sketch or an edge ("swSketchMgr::SketchUseEdge" only works with edges)?

• ###### Re: how to get projected area of a part?

Wen, I recently started writing the macro for finding outlines (Re: Silhouette of a solid body projected on a face) and I added to it to compute the area of the face generated from that code. I attached what I believe can solve your original issue.

EDIT: The attached method only works for straight line parts without cavities.

Happy New Year,

Brandon

• ###### Re: how to get projected area of a part?

As I had recently the same question, I found an easier way to do it with convert entities:

1) Create a plane where the area will be projected

2) On the Plane create Sketch

3) Then click Convert Entities

4) Select the surfaces (curved or not,, fully or partly visible) that you need to use for the projected area

5) Click ok

6) The area is now projected on the plane as a sketch

7) Create an extrude of the sketch contours that you need and measure the area.

• ###### Re: how to get projected area of a part?

Polytimi Sofotasiou wrote:

As I had recently the same question, I found an easier way to do it with convert entities:

1) Create a plane where the area will be projected

2) On the Plane create Sketch

3) Then click Convert Entities

4) Select the surfaces (curved or not,, fully or partly visible) that you need to use for the projected area

5) Click ok

6) The area is now projected on the plane as a sketch

7) Create an extrude of the sketch contours that you need and measure the area.

What version of SOLIDWORKS are you using? What you described sounds like a nice enhancement, but does not work in the current version of SOLIDWORKS. You cannot project a body using the Convert Entities tool.

• ###### Re: how to get projected area of a part?

I use the 2015 version. These were the exact steps that i followed and the results are depicted in the attached image. The only thing that I had to do more is to connect the open edges to enable the extrude command!

• ###### Re: how to get projected area of a part?

Polytimi Sofotasiou wrote:

I use the 2015 version. These were the exact steps that i followed and the results are depicted in the attached image. The only thing that I had to do more is to connect the open edges to enable the extrude command!

Aha. Now I understand. By surfaces you mean faces. I thought you found a way to project a full body.

Your workflow would work on a very limited number of situations.

At at this time, the only reliable way I know to work is using the Parting Line technique. Watch this video:

• ###### Re: how to get projected area of a part?

For example for that case, because it has an elliptic shape, when I tried the same workflow the top flat phase was converted but the elliptic one did not: it gave the error "selected face does not have a peripheral loop" and thus I picked the face edges and it was converted, then i trimmed the internal ones and I got the projected area of the body with an easy way.

Even if it is applicable for these cases, it is an easy alternative without parting line! :-)

• ###### Re: how to get projected area of a part?

I remember that I wrote a macro to do this.

I think I based it on someone else's work but I can't remember who - apologies to them.

• ###### Re: how to get projected area of a part?

You can use the section view tool to create a temporary slice through the part then select the surface and the the mass properties tool.