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: 

Quick One: Flat Pattern Actual Area iLogic Command

2 REPLIES 2
Reply
Message 1 of 3
Vadim-the-Engineer
343 Views, 2 Replies

Quick One: Flat Pattern Actual Area iLogic Command

Looking for a command to get the actual area of the flat pattern similar to SheetMetal.FlatExtentsArea...

2 REPLIES 2
Message 2 of 3

Hi @Vadim-the-Engineer,

 

I don't think there is anything built into iLogic for this, but you can use the API to do it. Here is a quick example.

 

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

 

Dim oDoc As PartDocument 
oDoc = ThisApplication.ActiveDocument

Try 
	Dim oDef As SheetMetalComponentDefinition 
	oDef = oDoc.ComponentDefinition
	Dim oFlatPattern As FlatPattern 
	oFlatPattern = oDef.FlatPattern
	oArea = Round(oFlatPattern.TopFace.Evaluator.Area,3) 
	MessageBox.Show("Flat pattern area: " & oArea & " cm^2", "iLogic")
Catch
	MessageBox.Show("Error: Verify that a flat pattern exists", "iLogic")
End Try
Message 3 of 3

@Curtis_Waguespack,

 

Something kind of cool I stumbled across a while ago - if you add a line of code that references the flat pattern extents, such as shown below, then iLogic will just create the flat pattern for you instead of causing an error.  You don't actually have to use the extents for anything - simply referencing one of them is enough.

 

This would let you pull out the Try / Catch error handling, and instead makes Inventor just fix it for you if the flat pattern is missing.

 

X_Measure = SheetMetal.FlatExtentsLength

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

Post to forums  

Autodesk Design & Make Report