Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Frame Generator - Miter and cut detail - customized BOM

25 REPLIES 25
SOLVED
Reply
Message 1 of 26
Anonymous
3278 Views, 25 Replies

Frame Generator - Miter and cut detail - customized BOM

Hi Guys,

This One is a good one for all you cleaver i Logic people.

 

I have a BOM that I want to use the Cutdetals from frame generator.

My need is for the figure of text that is created is not how my bosses want to use it.

The angle is created from the back edge of the box but typically the saw man will move the saw from 0 deg's which is 90 deg out from the the angle that inventor created. (hopefully you know what I mean)

so where Cutdetail says 51.33deg in my bom i want it to say 38.67deg.

first how would i do this???

also I want to bring the details into the Part number column to read as I have manually entered below.

Any Ideas on how to do this??

TEST BOM.JPG 

25 REPLIES 25
Message 2 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Can you please provide sample assembly data to study the feasibility ? please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 3 of 26
Anonymous
in reply to: chandra.shekar.g

What do you need.

The cutdetail is great but it give you the wrong angle for a std metal saw on a saw bench.

Message 4 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Can you please demonstrate the requirement with snapshots (non confidential data)?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 5 of 26
Anonymous
in reply to: chandra.shekar.g

PLEASE FIND ATTACHED A BOM WITH THE CUT DETAIL ON. THIS IS THE ANGLES THAT ARE GIVEN IN THE PIC 'ANGLE NEEDED' WHICH IS NOT HOW A STD SAW WORKS. 90deg minus 51.33 gives correct angle.

 

ANGLE NEEDEDANGLE NEEDEDTHE ANGLE A SAW PERSON WOULD NEEDTHE ANGLE A SAW PERSON WOULD NEEDCUT DETAIL AS IN BOMCUT DETAIL AS IN BOM

Message 6 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

From where Saw angle(57.33 deg) is available? Is it in parameter or iProperty?

 

Calculated angle (90 - 57.33) is supposed to be stored?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 7 of 26
Anonymous
in reply to: chandra.shekar.g

Hi Chandra.Shekar.g

The cut detail is stored in the custom I properties but does not feature in the Parameters.

So the Cut detail angle is pulled in on the BOM from the custom I properties.

If I understand this correct you are saying I can Change this?

 

Message 8 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous ,

 

Try below iLogic code to update needed angle in custom iProperty of "CUTDETAIL1".

Sub Main()  
	 
    ' Get the active assembly. 
    Dim oAsmDoc As AssemblyDocument 
    oAsmDoc = ThisApplication.ActiveDocument  
	 
    ' Get the assembly component definition. 
    Dim oAsmDef As AssemblyComponentDefinition 
    oAsmDef = oAsmDoc.ComponentDefinition 

    ' Get all of the leaf occurrences of the assembly. 
    Dim oLeafOccs As ComponentOccurrencesEnumerator 
    oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences 

    ' Iterate through the occurrences and print the name. 
	Dim cnt As Integer 
	cnt = 0
	Dim total As Double  
	 
	Dim oOcc As ComponentOccurrence
	For Each oOcc In oLeafOccs
		Try
			Dim sawAngle As String
			sawAngle = iProperties.Value(oOcc.Name, "Custom", "CUTDETAIL1") 
			Dim angle(2) As String 
			angle = sawAngle.Split(" ")
			
			If angle(0) = "Miter" Then
				
				Dim needAngle As Double
				needAngle = 90 - Convert.ToDouble(angle(1))
			
				iProperties.Value(oOcc.Name, "Custom", "CUTDETAIL1") = "Miter " + needAngle.ToString + " deg"
			
			End If  
			
		Catch 
		
		End Try 
		 
	Next   

End Sub

Thanks and regards


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 9 of 26
Anonymous
in reply to: chandra.shekar.g

HOW DO I GET CUT DETAIL 2 OR 3 IN THIS I LOGIC.

ALSO AS THESE ARE FRAME GENERATOR PARTS WHERE DO I PUT THE i LOGIC?

Message 10 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Just change the name of property (highlighted in red color).

Dim sawAngle As String
			sawAngle = iProperties.Value(oOcc.Name, "Custom", "CUTDETAIL1") 
			Dim angle(2) As String 
			angle = sawAngle.Split(" ")
			
			If angle(0) = "Miter" Then
				
				Dim needAngle As Double
				needAngle = 90 - Convert.ToDouble(angle(1))
			
				iProperties.Value(oOcc.Name, "Custom", "CUTDETAIL1") = "Miter " + needAngle.ToString + " deg"
			
			End If 

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 11 of 26
Anonymous
in reply to: chandra.shekar.g

Thanks,

And I should put this in the weldment template will it run automatically

Message 12 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Yes, It works for weldment assembly as well. If not, let me know.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 13 of 26
Anonymous
in reply to: Anonymous

Hi chandra

I tried this I logic and it didn't change a thing. I put your code in the weldment template and built a test frame gen weldment.test2 .JPGtest 2 bom.JPG

Message 14 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Can you please provide sample weldment assembly to test? Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 15 of 26
Anonymous
in reply to: chandra.shekar.g

I have attached a quick test piece for you

Message 16 of 26
Tony_Yates
in reply to: Anonymous

Hi there,

 

We have ilogic in our frame generator parts.

You have to get the family template and add your code there.

Then replace the family template in content centre with the new one with code in it.

image.pngimage.png

hope this helps.

Message 17 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

In attached weldment assembly, there is no "CUTDETAIL" column does not exists.

BOM.png

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 18 of 26
Anonymous
in reply to: chandra.shekar.g

Look in the part of the parts only BOM 

to see them in model part of BOM you have to create a custom Column called Cutdetail1 etc.

I only did it in Parts Only. 

Message 19 of 26
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Please create column ("CUTDETAIL1") and provide sample weldment assembly (Non confidential data).

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 20 of 26
Anonymous
in reply to: chandra.shekar.g

try this,

it should be in there

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report