Getting amount and parameters of several parts on the same drawing without placing all views on drawing Hello,

Getting amount and parameters of several parts on the same drawing without placing all views on drawing Hello,

Charlies_3D_T
Advocate Advocate
363 Views
2 Replies
Message 1 of 3

Getting amount and parameters of several parts on the same drawing without placing all views on drawing Hello,

Charlies_3D_T
Advocate
Advocate
 

I want to do the following: 

 

I have a beam 50x50x3 and i have them saved as multiple files. Each beam has a specific length and an amount that is controlled in the assembly. I want to be able to get a table on a drawing where i can place a list with 1 view where i name the dimension that changes A for example. Then the workers can look at the list and see how many beams they need to make from each length. I can not place all these beams in an assembly because they are placed inside sub assemblies in the master assembly. I was able to place the length of each beam inside a parameter and export this parameter to one of the beams and import this beam in the drawing and read all the parameters. But for the amount it's not that easy. Any ideas? 

 

What can i do with ilogic to write to this drawing and get the amounts of the parts located inside the master assembly? 

0 Likes
364 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Are you talking about creating cutting list? One solution  I know is iPart. But will take a look at how to do it with iLogic as we have the same problem. Are you files saved in one folder?

0 Likes
Message 3 of 3

J-Camper
Advisor
Advisor

If you already have the parameters exported as custom iProperties, you can add them to the assembly parts list in your drawing environment:

temp_pic.JPG

And if you need to export the parameter in each file first, here is some code I used for the case you see above:

Sub Main
If ThisApplication.ActiveDocument.DocumentType = kPartDocumentObject Or ThisApplication.ActiveDocument.DocumentType = kAssemblyDocumentObject Then Else Exit Sub
Dim openDoc As Document = ThisApplication.ActiveDocument
'Look at all of the files referenced in the open document
Dim docFile As Document
Dim oTrans As Transaction = ThisApplication.TransactionManager.StartTransaction(openDoc, "iProperty Formatting")
If openDoc.DocumentType = kPartDocumentObject
	Call Formatting(openDoc) 
Else
	For Each docFile In openDoc.AllReferencedDocuments
		'look at only part files that are modifiable
    	If docFile.DocumentType = kPartDocumentObject And docFile.IsModifiable = True And InStr(docFile.FullFileName,"-CAS-") >0
			Call Formatting(docFile)
		End If
	Next 
End If
oTrans.End
iLogicVb.UpdateWhenDone = True
End Sub

Sub Formatting(oDoc As PartDocument)
	'[
	'For Jamb Width Parameter
	Try
		oJamb = oDoc.ComponentDefinition.Parameters.Item("DOOR_JW")
	Catch
		oJamb = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("DOOR_JW", 36, "in")
	End Try	
	oJamb.ExposedAsProperty = True

	oFormat=oJamb.CustomPropertyFormat
	oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
	oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixtyFourthsFractionalLengthPrecision
	oFormat.Units = "in"
'	oFormat.ShowUnitsString = False
'	oFormat.ShowLeadingZeros = False
'	oFormat.ShowTrailingZeros = True
	
	'] For Jamb Width Parameter
	
	'[
	'For Jamb Height Parameter
	Try
		oJamb = oDoc.ComponentDefinition.Parameters.Item("DOOR_JH")
	Catch
		oJamb = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("DOOR_JH", 84, "in")
	End Try	
	oJamb.ExposedAsProperty = True

	oFormat=oJamb.CustomPropertyFormat
	oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
	oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixtyFourthsFractionalLengthPrecision
	oFormat.Units = "in"
'	oFormat.ShowUnitsString = False
'	oFormat.ShowLeadingZeros = False
'	oFormat.ShowTrailingZeros = True
	
	'] For Jamb Height Parameter
	
	'[
	'For Jamb Depth Parameter
	Try
		oJamb = oDoc.ComponentDefinition.Parameters.Item("JD")
	Catch
		oJamb = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("JD", 6, "in")
	End Try	
	oJamb.ExposedAsProperty = True

	oFormat=oJamb.CustomPropertyFormat
	oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
	oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixtyFourthsFractionalLengthPrecision
	oFormat.Units = "in"
'	oFormat.ShowUnitsString = False
'	oFormat.ShowLeadingZeros = False
'	oFormat.ShowTrailingZeros = True
	
	'] For Jamb Depth Parameter
	
	'[
	'For Jamb Width Parameter
	Try
		oJamb = oDoc.ComponentDefinition.Parameters.Item("FACE_JW")
	Catch
		oJamb = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("FACE_JW", 36, "in")
	End Try	
	oJamb.ExposedAsProperty = True

	oFormat=oJamb.CustomPropertyFormat
	oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
	oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixtyFourthsFractionalLengthPrecision
	oFormat.Units = "in"
'	oFormat.ShowUnitsString = False
'	oFormat.ShowLeadingZeros = False
'	oFormat.ShowTrailingZeros = True
	
	'] For Jamb Width Parameter
	
	'[
	'For Jamb Height Parameter
	Try
		oJamb = oDoc.ComponentDefinition.Parameters.Item("FACE_JH")
	Catch
		oJamb = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("FACE_JH", 84, "in")
	End Try	
	oJamb.ExposedAsProperty = True

	oFormat=oJamb.CustomPropertyFormat
	oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
	oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixtyFourthsFractionalLengthPrecision
	oFormat.Units = "in"
'	oFormat.ShowUnitsString = False
'	oFormat.ShowLeadingZeros = False
'	oFormat.ShowTrailingZeros = True
	
	'] For Jamb Height Parameter
		
	oDoc.Rebuild
End Sub

You will want to modify the parameter names in the sub routine and the filter in the main sub to look for only your Beam parts.

 

Let me know if you have any questions.

0 Likes