Surface Area in m^2 in iProp

Surface Area in m^2 in iProp

GKPByDesign
Advocate Advocate
1,350 Views
3 Replies
Message 1 of 4

Surface Area in m^2 in iProp

GKPByDesign
Advocate
Advocate

Hey,

 

I need at part level, to grab the surface area, to be added to a custom parameter/iprop called Surface_Area_PA Wirth the units being in m^2. I am struggling with the units. Any one help

0 Likes
Accepted solutions (2)
1,351 Views
3 Replies
Replies (3)
Message 2 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, here is an example of what you are looking for.
If it is a solid body, to which you want to extract the total surface you could use this path.
If you have the units of the file in mm, when you calculate the area it will be returned in that unit, that's why the correction factor to the calculation.

2.jpg

iProperties.Value("Custom", "Surface_Area_PA") = Round(iProperties.Area/1000000, 2) & " m^2"	

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

If it is surface bodies that you want to measure your area, this code could serve you, you must identify by item to which body you want to measure. I hope the code is useful, regards

 

Dim oDoc As Document = ThisDoc.Document
Dim dArea As Double
Dim Ident As Integer = 1 '''Identify WorkSurface 
Dim oSurf As SurfaceBodies
oSurf = oDoc.ComponentDefinition.WorkSurfaces.Item(1).SurfaceBodies

For Each oSurfBody As SurfaceBody In oSurf
	For Each oFace As Face In oSurfBody.Faces	
	dArea = Round(oFace.Evaluator.Area/1000000,3)
	iProperties.Value("Custom", "Surface_Area_PA")=dArea  & " m^2"
	Next
Next

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 4 of 4

moraesorlando
Advocate
Advocate

Hello @Sergio.D.Suárez !

 

I am trying to solve an issue about ilogic in the post

https://forums.autodesk.com/t5/inventor-customization/how-extract-areas-from-different-surfaces-usin...

 

I continue looking for a solution and I found this post where you helped a colleague with a code and look like this code can help in my case.

But I am new in ilogic and I don't know how to identify the item which I want to measure.

Could you explain a little bit how to do that?

 

Thanks,

 

thanks

0 Likes