iLogic: If any parameter exceeds "Thickness", then change manufacturing process

iLogic: If any parameter exceeds "Thickness", then change manufacturing process

iogurt1
Advocate Advocate
424 Views
2 Replies
Message 1 of 3

iLogic: If any parameter exceeds "Thickness", then change manufacturing process

iogurt1
Advocate
Advocate

Hey everyone,

 

I'm using iLogic right now to enter the overall dimensions of a formed part into my iProperties. That works great. Now I would like to also get a code that changes the manufacturing process, depending on a few things:
If it's just a flat plate, then the process should say "laser cut". If it has any forming feature on it, it should say "laser cut & formed". My thinking was that if any of X, Y or Z parameters are larger than "Thickness", then I know it's a formed part (except in the rare case where the width of the part is less than "Thickness" but that basically won't ever happen). Can someone give me a hint of why the 2nd part of my code doesn't work? Thanks!

 

'Get Component bounding box measurements

Model_X=Round(Measure.ExtentsLength, 0) 'X-axis BB length
Model_Y=Round(Measure.ExtentsWidth, 0)  'Y-axis BB length
Model_Z=Round(Measure.ExtentsHeight, 0) 'Z-axis BB length
Dim oValue As String
oValue = (Model_X & "x" & Model_Y & "x" & Model_Z) 
iProperties.Value("Summary", "Title") = oValue

'try to see if it's formed or flat
If Model_X Or Model_Y Or Model_Z > Thickness Then 
	iProperties.Value("Summary", "Manager") = "Laser Cut & Formed"
Else If Model_X Or Model_Y Or Model_Z <= Thickness Then 
	iProperties.Value("Summary", "Manager") = "Laser Cut"
End If
0 Likes
Accepted solutions (1)
425 Views
2 Replies
Replies (2)
Message 2 of 3

JoãoASilva
Advocate
Advocate
Accepted solution

Hello @iogurt1 ,

 

Try to give a look at this post:

https://forums.autodesk.com/t5/inventor-forum/iproperty-if-bended/m-p/7511105#M666446

 

I use the same process as you, I just changed that code a bit and it works fine for me.

Give it a try and, if you don't succed, i'll try to help you 👍

João Silva

Mechanical Engineer

 

Message 3 of 3

iogurt1
Advocate
Advocate

Thank you! It worked perfectly after adjusting it to this:

 

'Get Component bounding box measurements

Model_X=Round(Measure.ExtentsLength, 0) 'X-axis BB length
Model_Y=Round(Measure.ExtentsWidth, 0)  'Y-axis BB length
Model_Z=Round(Measure.ExtentsHeight, 0) 'Z-axis BB length
Dim oValue As String
oValue = (Model_X & "x" & Model_Y & "x" & Model_Z) 
iProperties.Value("Summary", "Title") = oValue


'change mfg process
Dim smDef As SheetMetalComponentDefinition = ThisDoc.Document.ComponentDefinition
Dim pf As PartFeature

'set our custom properties to NO to start with..
iProperties.Value("Summary", "Manager") = "Lasern"

'loop through each part feature
For Each pf In smDef.Features
	If pf.Suppressed = False Then
		If TypeOf pf Is FlangeFeature Then
		iProperties.Value("Summary", "Manager") = "Lasern & Gekanted"
		End If
		
		If TypeOf pf Is ContourFlangeFeature Then
		iProperties.Value("Summary", "Manager") = "Lasern & Gekanted"
		End If
		
		If TypeOf pf Is HemFeature Then
		iProperties.Value("Summary", "Manager") = "Lasern & Gekanted"
		End If
		
		If TypeOf pf Is FoldFeature Then
		iProperties.Value("Summary", "Manager") = "Lasern & Gekanted"
		End If			
		
	End If
Next
'updates all parameters Parameter.UpdateAfterChange = True