Creating drawings for similar or different parts used in subassemblies

Creating drawings for similar or different parts used in subassemblies

Anonymous
Not applicable
769 Views
1 Reply
Message 1 of 2

Creating drawings for similar or different parts used in subassemblies

Anonymous
Not applicable

These are my two scenarios.

 

1.  Assembly

1.1  Subassembly1

1.1.1  Part1

1.2  Subassembly2

1.2.1  Part1

 

1.  Assembly

1.1  Subassembly1

1.1.1  Part1

1.2  Subassembly2

1.2.1  Part2

 

How do I write my code so that I call for the correct number of drawings for the part?  If I call for the drawings to be made at the subassembly level, I could end up making 2 drawings for the same part.  This does not work for scenario 1 but does work for scenario 2 because the parts are different.  So I will need to call for the drawings to be made from the assembly level.  How do I sort the parts to know if I need to make one or two drawings?

Reply
Reply
0 Likes
Accepted solutions (1)
770 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Got it...  

ListOfDrawingParts gives me a list of the unique parts with the 32digit part number.

CenterPlateDrawingList gives me the number of unique parts of the type CenterPlate.

You can see in the image that while there are two divverent center plates, there is a common BottomPan.

Thanks for looking

 

 

Parameter Rule ListOfDrawingParts As List
	ListOfDrawingParts = {}
	
	Dim tempDoc As Any 
	Dim tempPN As String 

	
	For x=1 To length(root.children)

		tempDoc = nth(x,root.children)
		tempPN = iv_PropertyGet(tempDoc,"Part Number")
							
		
		If find(tempPN, ListOfDrawingParts, key := :second) = NoValue  Then
			ListOfDrawingParts = ListOfDrawingParts + {{nth(x,root.children),tempPN}}
		End If
		
		If nth(x,root.children).iskindof?(:IvMateConstraint) Or _
			nth(x,root.children).iskindof?(:IvInsertConstraint) Or _
			nth(x,root.children).iskindof?(:IvWorkPlane) Then
		
		ElseIf nth(x,root.children).iskindof?(:CoilAssembly) Then 
			For y=1 To length(nth(x,root.children).children)

				
				If nth(y,nth(x,root.children).children).iskindof?(:IvMateConstraint) Or _
					nth(y,nth(x,root.children).children).iskindof?(:IvInsertConstraint) Or _
					nth(y,nth(x,root.children).children).iskindof?(:IvWorkPlane) Then
		
				ElseIf nth(y,nth(x,root.children).children).iskindof?(:IvAssemblyDocument) Then 
				
					tempDoc = nth(y,nth(x,root.children).children)
					tempPN = iv_PropertyGet(tempDoc,"Part Number")
										
					
					If find(tempPN, ListOfDrawingParts, key := :second) = NoValue  Then
						ListOfDrawingParts = ListOfDrawingParts + {{nth(y,nth(x,root.children).children),tempPN}}
											
						For z=1 To length(nth(y,nth(x,root.children).children).children)
							If nth(z,nth(y,nth(x,root.children).children).children).iskindof?(:IvMateConstraint) Or _
								nth(z,nth(y,nth(x,root.children).children).children).iskindof?(:IvInsertConstraint) Or _
								nth(z,nth(y,nth(x,root.children).children).children).iskindof?(:IvWorkPlane) Then
							
							Else
							
								tempDoc = nth(z,nth(y,nth(x,root.children).children).children)
								tempPN = iv_PropertyGet(tempDoc,"Part Number")
								
								If find(tempPN, ListOfDrawingParts, key := :second) = NoValue Then
									ListOfDrawingParts = ListOfDrawingParts + {{nth(z,nth(y,nth(x,root.children).children).children),tempPN}}
								End If
							
							End If
						Next
					End If 

				Else
											
					tempDoc = nth(y,nth(x,root.children).children)
					tempPN = iv_PropertyGet(tempDoc,"Part Number")
					
					If find(tempPN, ListOfDrawingParts, key := :second) = NoValue Then
						ListOfDrawingParts = ListOfDrawingParts + {{nth(y,nth(x,root.children).children),tempPN}}
					End If

				End If
			Next
			
		End If
	Next

	ListOfDrawingParts = sort(ListOfDrawingParts,:Ascending, key := :second)


End Rule


Parameter Rule CenterPlateDrawingList As List
	CenterPlateDrawingList = {}
	For x=1 To length(ListOfDrawingParts)
		If subString(second(nth(x,ListOfDrawingParts)),1,11) = "CenterPlate" Then
			CenterPlateDrawingList = CenterPlateDrawingList + {nth(x,ListOfDrawingParts)}
		End If
	Next
End Rule

 Capture.JPG

 

 

Reply
Reply
0 Likes