Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure - Area of multiple faces at once

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
roloNCC
4398 Views, 17 Replies

Measure - Area of multiple faces at once

Is there a way to measure the are of multiple faces at once? I can easily select multiple faces, but when the measure feature is on, I can only seem to be able to select one face at a time. 

 

 

17 REPLIES 17
Message 2 of 18
johnsonshiue
in reply to: roloNCC

Hi! It looks like you can select up to two faces and hit Measure tool. The tool should report the area measurement for the two selected faces.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 18
Curtis_Waguespack
in reply to: roloNCC

Hi @roloNCC 

 

I think we lost the ability to get accumulate totals with the measure tools as we could in the past (I don't recall exactly how things worked in the past though) ... but I had an iLogic rule on hand from a recent topic here on this forum where someone was wanting to total the selected edge selections... I took a minute to modify that code to get the total of the selected faces.

 

This should work in a part or assembly file. Post back if you have any issues with it.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

oPrecision = 3
Dim TotalLength As Double
Dim oHighLight As Inventor.HighlightSet
oHighLight = ThisDoc.Document.CreateHighlightSet
On Error GoTo EndRule
oUOM = ThisDoc.Document.UnitsOfMeasure
oLUnits = oUOM.LengthUnits
oUnitString = oUOM.GetStringFromType(oLUnits)
oArea = " "
Dim oPrompt1 As String 
oPrompt1 = "Select Faces, then press Escape to end..."
While True

	selectFace = ThisApplication.CommandManager.Pick _
		(SelectionFilterEnum.kAllPlanarEntities, oPrompt1 & oPrompt2 )
		
		'if nothing then exit
	If IsNothing(selectFace) Then Exit While
   
   		Dim oEval As SurfaceEvaluator = selectFace.Evaluator
        	oArea = oEval.Area

		Call oHighLight.AddItem(selectFace)
		TotalArea = TotalArea + oArea	
		
		oPrompt1 = Round(oUOM.ConvertUnits(oArea	, "cm", _
			oLUnits), oPrecision) & " " & oUnitString & "^2"
		
		oPrompt2 = Round(oUOM.ConvertUnits(TotalArea, "cm", _
			oLUnits), oPrecision) & " " & oUnitString & "^2"
			
		If oPrompt2 = oPrompt1 Then
			oPrompt2 = ""
		Else
			oPrompt1 = "[ " & oPrompt1 & " ]   Sum: " 
			
		End If
		

End While
InputBox("Total:", "ilogic", oPrompt2)

EndRule :
oHighLight.Clear

 

Message 4 of 18
roloNCC
in reply to: johnsonshiue

Correct, and I want to be able to do more than 2 faces at once. Im looking to do about 15 faces at once and get the area of all together rather than doing one at a time and having to add. I know I can do this by setting up the BOM to read that, but Im talking about a quick measure here at part/assembly level. 

Message 5 of 18
MattEds
in reply to: roloNCC

Within the measure command there will be a small + button to the right hand of the window. As the tooltip will show you this is a "add to accumulated value" which will allow you to select other faces and come up with a total value.

 

Measure.png

Message 6 of 18
roloNCC
in reply to: MattEds

It seems to only do 2 at a time. It doesn't allow you to do more than two faces. 

 

https://autode.sk/3a4LDTB

Message 7 of 18
MattEds
in reply to: roloNCC

Rand, the correct workflow would be:

measure -> select face or surface -> hit add to accumulative value.

select new face or surface -> hit add to accumulative value.

repeat for each selection you want to accumulate.

 

hope this helps.

Message 8 of 18
roloNCC
in reply to: MattEds

Yup, just like you predicted. I was looking for all selected faces to stay highlighted, which would be helpful as a visual check, but it does add them up. 

 

Maybe this is a good one for the Autodesk engineers, allow for all faces added to stay highlighted in order to keep track of what has been selected. 

Message 9 of 18

This code works well but the conversion needs to take into account that you are converting area, and not simply length. 

 

Therefore you have an error of one time the conversion from cm to whatever the model's length unit is. I checked it and this is indeed the case with the current code. 

 

The workaround is to convert from "cm cm" to oLUnits where oLUnits is twice the string of the model's length unit, for example "in in".

 

Message 10 of 18
R.nnie
in reply to: Curtis_Waguespack

Hi @Curtis_Waguespack 
Is there a way to modify this for round surfaces eg. cylindrical surface? I can't select them using this rule.
Thanks!

Message 11 of 18
Curtis_Waguespack
in reply to: R.nnie

Hi @R.nnie 

 

I think you can change the line as shown to kAllCircularEntities or kAllEntitiesFilter to meet your needs.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Curtis_Waguespack_0-1675864912968.png

 

Message 12 of 18
R.nnie
in reply to: roloNCC

@Curtis_Waguespack 
Thanks a million, this seems to work the charm!
I have another issue as @ajremillard mentioned the units conversion throws my result off by a decimal place (working in mm). 
I'm still fairly green when it comes to ilogic but would it work if I chose a different function for the ConvertUnits which could just get the value as is in mm?

 

Message 13 of 18
Curtis_Waguespack
in reply to: R.nnie

Hi @R.nnie ,

 

I think just adding /10 as in this example should do it.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

		oPrompt2 = Round(oUOM.ConvertUnits(TotalArea, "cm", _
			oLUnits), oPrecision) / 10 & " " & oUnitString & "^2"

 

Message 14 of 18
ajremillard
in reply to: R.nnie

Hi, here's how I modified @Curtis_Waguespack 's code to fix the unit conversion:

Select Case oLUnits

	Case 11272 'Inch units
	oLUnits = "in in"
	
	Case 11269 'Millimeter units
	oLUnits = "mm mm"
	
	Case 11270 'Meter units
	oLUnits = "m m"
	
	Case 11273 'Feet units
	oLUnits = "ft ft"
	
	Case 11275 'Mile units
	oLUnits = "mil mil"

End Select

 

 

oPrompt2 = Round(oUOM.ConvertUnits(TotalArea, "cm cm", oLUnits), oPrecision) & " " & oUnitString & "^2"

 

 

Message 15 of 18
R.nnie
in reply to: roloNCC

@ajremillard @Curtis_Waguespack thanks for the help!

 

Message 16 of 18
Michael.RostZ454J
in reply to: roloNCC

Hello everyone.
Regardless of the solution above, I have been working on a similar function to work around a problem that the code above also has.
If an area is accidentally selected multiple times, it will also be counted multiple times and due to the highlighting, you will unfortunately not notice the multi-selection.
It also shows the same strange behavior as my function. If each selected area is selected again, the highlighting disappears. 🙈

 

"highlightset is not highlighted after second pick of the same face" 

 

Message 17 of 18

Hi,

i find your solution works great but i some cases i have assembly with hundreds of faces and i want to know if there is a way to change code to not pick faces one by one but to sum area for hold and drag (best way if it would be working left to right and right to left dragging and marking faces as it works in inventor)

 

i don't use ilogic in that level so sorry if it is ridiculous question and iLogic don't allow that

Message 18 of 18

That is such a frustrating system to use...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report