Tagging assembly drawings to organize shared prints

Tagging assembly drawings to organize shared prints

dschulteHR4D5
Advocate Advocate
103 Views
0 Replies
Message 1 of 1

Tagging assembly drawings to organize shared prints

dschulteHR4D5
Advocate
Advocate

Hello I have a rule that I have put together over some time, it's not pretty but it seems to work for what I initially wanted it to do. Essentially I was tasked with coming up with a way to organize prints for our guys who build the parts. When we are doing a new build one of the reoccurring issues for a long time is print packets getting prints mixed up within different assemblies and when the parts are built to print there is a lot of prints to sift through to figure out what print goes to what assembly. 

 

One of my first thoughts was to make a rule that will tag the assembly and each part within it with a letter to designate each assembly a specific letter, then within each lettered assembly, each print will have a number that pulls the tag from the BoM, either the parts only list or structured list depending on how I set the assembly drawing parts list and set the IDW to pull that information and put it on the top right corner on the IDW. That way when we sift through a finished build and it comes time to assemble, you can visually see which part goes with each assembly. So far it has been very helpful to our guys, but lately I've ran into another issue. Most of our builds there are shared parts within them. So when the rule tags a part say B17, make the print packet, run the rule on a different assembly, now this same part that is shared is now D9. So there is some confusion at times when it comes time to build, they are looking at the quantity and sometimes building double due to the quantity on the print from looking at shared prints from different assemblies. I set the quantity for the total on the whole build project not per assembly, as one assembly might require two and another assembly might require 4 so then I would need to have separate prints for each assembly. 

 

Long story short I am wondering if there is a better way to manage this with shared parts without having to make a separate part/print for each that is shared with a different assembly.

 

**Is there a way to get the rule to say if this custom iproperty "ASM TAG" or "ITEM" exists, create a new custom iproperty then I can keep the tag that it has within both assemblies, or even if it could tag the part and create a custom property to say "SHARED" or something would be helpful also.** Right now the rule with delete an existing property.

 

Couple screenshots of an IDW just to show as an example, I have the template set to pull the custom iproperty the rule makes on the part. 

 

This is the rule, it's not pretty at all but it seems to work. Any tips or advice on managing shared IDWs or a cleaner way to run this rule would be greatly appreciated. Thank you for your time.

 

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oInvApp As Inventor.Application = ThisApplication
Dim oBOM As BOM
oBOM = oAssyDoc.ComponentDefinition.BOM
oBOM.PartsOnlyViewEnabled = True
'Enter assembly tag letter
Dim oasmtag As String = InputBox("ENTER ASSEMBLY PRINT TAG LETTER", "ASM TAG")
'Select parts only or structured BOM
Choix1 = InputRadioBox("Choose BOM Format : ", "Parts Only", "Structured", True, Title := "ASM BOM RULE")
iProperties.Value("Project", "Stock Number") = "SEE ASM PRINTS - " & oasmtag
Dim oBOMView As BOMView
If Choix1 = True
oBOMView = oBOM.BOMViews.Item("Parts Only")
Else If Choix1 = False
oBOMView = oBOM.BOMViews.Item("Structured")
End If
'define list of custom properties
Dim MyArrayList As New ArrayList
MyArrayList.Add("ITEM")
MyArrayList.Add("ASM TAG")

oAsSYCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'Iterate through all of the occurrences
'This will delete all current asm tags ONLY if visible
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsSYCompDef.Occurrences.AllReferencedOccurrences(oAsSYCompDef)
	
If oOccurrence.Visible = False Then Continue For

oCustomPropertySet = oOccurrence.Definition.Document.PropertySets.Item("Inventor User Defined Properties")
'look at each property in the collection
For Each oCustProp In oCustomPropertySet
'check property name against the list  
If MyArrayList.Contains(oCustProp.Name) Then
'delete the custom iProperty
	oCustProp.Delete 
End If
Next
Next
For Each oRow In oBOMView.BOMRows
Dim invCustomPropertySet As PropertySet
Try
invCustomPropertySet = oRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("Inventor User Defined Properties")
invProperty = invCustomPropertySet.Add(oRow.ItemNumber, "ITEM")
Catch
End Try
Next
For Each oRow In oBOMView.BOMRows
Dim invCustomPropertySet As PropertySet
Try
Dim invasmCustomPropertySet As PropertySet
invasmCustomPropertySet = oRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("Inventor User Defined Properties")
invTagProperty = invasmCustomPropertySet.Add(oasmtag, "ASM TAG")
iProperties.Value("Custom", "ASM TAG") = oasmtag
Catch
End TRY
Next
' Create the custom iProperty set if it doesn't exist
Dim oDoc As Inventor.Document = ThisApplication.ActiveDocument
'Create the custom iProperty set if it doesn't exist
Dim oCustPropSet As Inventor.PropertySet = oDoc.PropertySets("Inventor User Defined Properties")
Try : oCustPropSet("ASM TAG").Value = oasmtag
Catch : oCustPropSet.Add(oasmtag, "ASM TAG") : End Try

 

 

0 Likes
104 Views
0 Replies
Replies (0)