iLogic code for Parts List selection

iLogic code for Parts List selection

mtmarchant
Advocate Advocate
1,212 Views
8 Replies
Message 1 of 9

iLogic code for Parts List selection

mtmarchant
Advocate
Advocate

I have been piecing together a bit of code, trying to accomplish a few goals:

 *Note: This is all occurring with an assembly drawing that utilizes multiple parts list, assemblies, parts, and drawing views.

 

1.) Automatically setting view labels - I want to pull both parts list data and iproperty data to be used in the view label. I have figured out the code to this point and it is working as intended.

mackGW49W_0-1665062372162.png

2.) This plays into goal number 1. I am pulling the quantity data directly from the parts list. This works great, however, we have times where we are building the same assembly, multiple times. I have played with making a multiplier column in the parts list, however this seems cumbersome to effectively modify on larger assemblies, as I have to enter in a multiplier value to each individual row. If possible, I would like to be able to have a form, wherein you enter a Total Assembly Quantity, and it maps that value you enter there to either a parameter or a new custom property, that could then be used to multiply the quantities accordingly. Here is a screenshot of basically what I am doing now:

mackGW49W_1-1665062691846.png

3.) The majority of our drawings have multiple parts lists within them. The code I have so far works great - for the very first parts list found in the drawing. However, whenever I am working my way through the drawing, and have come to the next sub-assembly and it's respective parts list, the code stops working, and it will not update the view labels. This is the one that I have been stumped on the most, as, like I said, I have mostly pieced my current code together using other forum posts and such.

 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
 
Dim oSheets As Sheets
oSheets = oDrawDoc.Sheets
Dim oSheet As Sheet'Inventor.Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
Dim oPartsLists As PartsLists
Dim oPartsList As PartsList
 
For Each oSheet In oSheets
    'declare the PartsLists 
    oPartsLists = oSheet.PartsLists
 
            'try and get the parts list from the table of this sheet
            Try
                'this doesn't work when you have a material list like on frame drawings
                'oPartsList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
                'place a parts list on the drawing and search for it 
                'rather than using an id number
                
                For i=1 To oPartsLists.Count
                    If oPartsLists.Item(i).Title = "PARTS LIST" Then
                        'MessageBox.Show("found table", "ilogic")
                        oPartsList = oPartsLists.Item(i)
                        Exit For
                    Else
                        'do nothing
                    End If
                Next

		
                
            Catch 'on error try and search all sheets for first found parts list            
                'iterate through each sheet
                Dim j As Long
                For j = 1 To oDrawDoc.Sheets.Count
                    If oDrawDoc.Sheets.Item(j).PartsLists.Count > 0 Then Exit For
                Next
                            
                'this doesn't work when you have other parts lists like a 
                '"material list" like on frame drawing
                'oPartList = oDrawDoc.Sheets.Item(i).PartsLists.Item(1)
                'place a parts list on the drawing and search for it 
                'rather than using an id number to locate the first
            
                For i=1 To oPartsLists.Count
                    If oPartsLists.Item(i).Title = "PARTS LIST" Then
                        'MessageBox.Show("found table", "ilogic")
                        oPartsList = oPartsLists.Item(i)
                        Exit For
                    Else
                        'do nothing
                    End If
                Next
                'MessageBox.Show("parts list found on: " & j, "Title")
            End Try
            
    oViews = oSheet.DrawingViews            

        'get view from user
        While True
            oView = ThisApplication.CommandManager.Pick( _
            SelectionFilterEnum.kDrawingViewFilter, "Select a View") 
        
            'Get the full filename Of the view model
            Dim oModelFileName As String
            oModelFileName = oView.ReferencedDocumentDescriptor.ReferencedDocument.FullFileName
            'MessageBox.Show("view model name" & oModelFileName, "Title")
                
            ' Iterate through the contents of the parts list.
            Dim j As Long
            For j = 1 To oPartsList.PartsListRows.Count
                ' Get the current row.
                Dim oRow As PartsListRow
                oRow = oPartsList.PartsListRows.Item(j)
                'get filename of model in row
                Dim oRowFileName As String
                Try ' try and get the full file name of the PL item
                    oRowFileName = oRow.ReferencedFiles.Item(1).FullFileName
                Catch 'on error go to next item
'                    Dim oCellValue As String
'                    oCellValue = oRow.Item("Item").Value
'                    MessageBox.Show("Error Processing item: " & oCellValue, "Title")
                    Continue For
                End Try
                'compare the filenames
                'Performs a text comparison, based on a case-insensitive text sort order
                'If strings equal returns 0
                If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 
                    'Get the value of Item from the Parts List
                    'Row name needs to be case sensitive or use 1 for first 2 for second etc.
                    oCell  = oPartsList.PartsListRows.Item(j).Item("Item") 
                'Row name needs to be case sensitive or use 1 for first 2 for second etc.
                    'get the value of text in cell
                    Dim oItemValue As String
                    oItemValue = oCell.Value
					
                    
                    'Show the view label
                    oView.ShowLabel = True
                    'format the next line
                    oStringItem = "<StyleOverride Underline='True' FontSize='0.25'> ITEM " & oItemValue & " </StyleOverride>"
                    'format the next line
                    
					'Scale is not being utilized at this time
					'oStringScale = "<Br/><StyleOverride FontSize='0.2'>Scale <DrawingViewScale/></StyleOverride>"
					
					'format the next line
					'This pulls the part number iProperty from the reference file
					oStringPNumber = "<Br/><StyleOverride Underline='False' FontSize='0.2'> P#: <Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
					'format the next line
					'This pulls the revision iProperty from the reference file
					oRev = iProperties.Value(docFName,"Project","Revision Number")
					'oStringViewRev = "<StyleOVerride Underline='False' FontSize='0.2'> REV: " & oRev & " </StyleOverride>"
					'format the next line
					'This pulls the description iProperty from the reference file
					oStringViewDesc = "<Br/><StyleOverride Underline='False' FontSize='0.2'> DESC: <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
					'format the next line
					'This pulls the material iProperty data from the reference file
					oStringViewMat = "<Br/><StyleOverride Underline='False' FontSize='0.2'> MATERIAL: <Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>MATERAIL</Property></StyleOverride>"
					'format the next line
					'This pulls quantity data from the parts list
					oCellQuantity = oPartsList.PartsListRows.Item(j).Item("Item QTY")
					Dim oListQuantity As String
					oListQuantity = oCellQuantity.Value
					oStringListQuantity = "<Br/><StyleOverride Underline='False' FontSize='0.2'> QTY: " & oListQuantity & " </StyleOverride>"

                    
                    'add to the view label
                    oView.Label.FormattedText =  oStringItem & oStringViewDesc & oStringPNumber & oStringViewMat & oStringListQuantity
                End If  
            Next
      End While
Next

 

 

Mack Marchant - Project Engineer
0 Likes
Accepted solutions (1)
1,213 Views
8 Replies
Replies (8)
Message 2 of 9

A.Acheson
Mentor
Mentor

Here is a slightly different way of writing this. The main issues I saw was this line here

" If StrComp(oModelFileName, oRowFileName, CompareMethod.Text =0 Then"

also to activate each sheet to select the views. I turned off a few labels that I hadn't available in testing. 

 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
 
Dim oSheets As Sheets = oDrawDoc.Sheets
Dim oSheet As Sheet'Inventor.Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
Dim oPartsLists As PartsLists
Dim oPartsList As PartsList	
Dim j As Long

'iterate through each sheet
For Each oSheet in oSheets
    If oSheet.PartsLists.Count > 0 Then 
		
		oSheet.Activate
'declare the PartsLists
oPartsLists = oSheet.PartsLists For Each oPartslist In oPartsLists If oPartsList.Title = "PARTS LIST" Then MessageBox.Show("found table", "ilogic")
oViews = oSheet.DrawingViews 'get view from user While True oView = ThisApplication.CommandManager.Pick( _ SelectionFilterEnum.kDrawingViewFilter, "Select a View") If oView Is Nothing Then Exit While 'Get the full filename Of the view model Dim oModelFileName As String = oView.ReferencedDocumentDescriptor.ReferencedDocument.FullFileName 'MessageBox.Show("view model name" & oModelFileName, "Title") ' Iterate through the contents of the parts list. For j = 1 To oPartsList.PartsListRows.Count ' Get the current row. Dim oRow As PartsListRow = oPartsList.PartsListRows.Item(j) 'get filename of model in row Dim oRowFileName As String Try ' try and get the full file name of the PL item oRowFileName = oRow.ReferencedFiles.Item(1).FullFileName Catch 'on error go to next item Dim oCellValue As String = oRow.Item("Item").Value ' MessageBox.Show("Error Processing item: " & oCellValue, "Title") Continue For End Try 'compare the filenames 'Performs a text comparison, based on a case-insensitive text sort order 'If strings equal returns 0 ' If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 'Get the value of Item from the Parts List 'Row name needs to be case sensitive or use 1 for first 2 for second etc. oCell = oPartsList.PartsListRows.Item(j).Item("Item") 'Row name needs to be case sensitive or use 1 for first 2 for second etc. 'get the value of text in cell Dim oItemValue As String = oCell.Value 'Show the view label oView.ShowLabel = True 'format the next line oStringItem = "<StyleOverride Underline='True' FontSize='0.25'> ITEM " & oItemValue & " </StyleOverride>" 'format the next line 'Scale is not being utilized at this time 'oStringScale = "<Br/><StyleOverride FontSize='0.2'>Scale <DrawingViewScale/></StyleOverride>" 'format the next line 'This pulls the part number iProperty from the reference file oStringPNumber = "<Br/><StyleOverride Underline='False' FontSize='0.2'> P#: <Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>" 'format the next line 'This pulls the revision iProperty from the reference file oRev = iProperties.Value(docFName,"Project","Revision Number") 'oStringViewRev = "<StyleOVerride Underline='False' FontSize='0.2'> REV: " & oRev & " </StyleOverride>" 'format the next line 'This pulls the description iProperty from the reference file oStringViewDesc = "<Br/><StyleOverride Underline='False' FontSize='0.2'> DESC: <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>" 'format the next line 'This pulls the material iProperty data from the reference file oStringViewMat = "<Br/><StyleOverride Underline='False' FontSize='0.2'> MATERIAL: <Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>MATERAIL</Property></StyleOverride>" 'format the next line 'This pulls quantity data from the parts list 'oCellQuantity = oPartsList.PartsListRows.Item(j).Item("Item QTY") ' Dim oListQuantity As String ' oListQuantity = oCellQuantity.Value ' oStringListQuantity = "<Br/><StyleOverride Underline='False' FontSize='0.2'> QTY: " & oListQuantity & " </StyleOverride>" 'add to the view label oView.Label.FormattedText = oStringItem & oStringViewDesc & oStringPNumber & oStringViewMat & oStringListQuantity 'End If Next 'Partslistrowcount End While Exit For Else 'do nothing End If Next'Partslistloop End If Next 'SheetCount

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 9

mtmarchant
Advocate
Advocate
This is working great to find the next parts list in the drawing, however, our parts lists and drawing views do not always end up on the same sheet. When this is the case, the drawing views will always be on the sheets that appear AFTER the sheet that contains the parts list. Is there a way to reference this parts list, that is on a different sheet, cycle through the following sheets, selecting views as needed? This may not be the ideal workflow, but I am curious nonetheless if this is possible and practical.
Mack Marchant - Project Engineer
0 Likes
Message 4 of 9

A.Acheson
Mentor
Mentor

@mtmarchant I see now the workflow. Which is actually fairly typical and I hadn't accounted for that. My thinking is activate the sheet on each sheet, so move that line up. Then remove the move the following to a block of code just below the sheet activation (partlist count, partslist loop,partslist title check. This way you can check each sheet for a partlist and update the partslist object any time you find one. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 9

mtmarchant
Advocate
Advocate

@A.Acheson 

I want to preface with a thank you, for taking time out of your day to advise and assist on this.

 

I'm having a hard time following. I moved the sheet activation up before the partslists if statement, so as to activate each sheet before searching for the parts list. I changed the parts list counter to -1 from 0, in an effort to try and read the sheets that do not contain a parts list. I have excluded the while statement, in an effort to try and get the code to cycle through each sheet, regardless of whether that sheet has a parts list or not. Because the while contained a line of code that looks for a parts list title, I figured that on those sheets that do not contain a parts list, that this line of code would skip past those sheets because there is not a parts list to be found on that particular sheet.

 

The current code cycles through the drawing, finding the sheets that contain a parts list. I believe that what I need is a way to cycle through each sheet of the drawing, update the parts list as I'm cycling through, and update drawing views as needed as I cycle through.

 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
 
Dim oSheets As Sheets = oDrawDoc.Sheets
Dim oSheet As Sheet'Inventor.Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
Dim oPartsLists As PartsLists
Dim oPartsList As PartsList	
Dim j As Long


'iterate through each sheet
For Each oSheet In oSheets
	'Moved sheet activation up before the IF statement
	oSheet.Activate
	
							
							
	'Changed > value from 0 to -1 to try and account for sheets that do not have a parts list
    If oSheet.PartsLists.Count > -1 Then 
		
		'Disaled this sheet activation as it is being activated before the previous IF statement
		'oSheet.Activate

	 	'declare the PartsLists
                 oPartsLists = oSheet.PartsLists
		 For Each oPartslist In oPartsLists
            If oPartsList.Title = "PARTS LIST" Then
                MessageBox.Show("Parts List Found", "iLogic Rule")

				oViews = oSheet.DrawingViews            

'		        Get View From user
''While disabled in an effort to bypass the parts list title bit of code
'		        While True
		            oView = ThisApplication.CommandManager.Pick( _
		            SelectionFilterEnum.kDrawingViewFilter, "Select a View") 
		        	
					If oView Is Nothing Then
					End If
		            
					'Get the full filename Of the view model
		            Dim oModelFileName As String = oView.ReferencedDocumentDescriptor.ReferencedDocument.FullFileName
		            'MessageBox.Show("view model name" & oModelFileName, "Title")
		                
		            ' Iterate through the contents of the parts list.
		            
		            For j = 1 To oPartsList.PartsListRows.Count
		                ' Get the current row.
		                Dim oRow As PartsListRow = oPartsList.PartsListRows.Item(j)
		                'get filename of model in row
		                Dim oRowFileName As String
		                Try ' try and get the full file name of the PL item
		                    oRowFileName = oRow.ReferencedFiles.Item(1).FullFileName
		                Catch 'on error go to next item
		                    Dim oCellValue As String = oRow.Item("Item").Value
		'                    MessageBox.Show("Error Processing item: " & oCellValue, "Title")
		                    Continue For
		                End Try
		                'compare the filenames
		                'Performs a text comparison, based on a case-insensitive text sort order
		                'If strings equal returns 0
		               ' If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 
		                    'Get the value of Item from the Parts List
		                    'Row name needs to be case sensitive or use 1 for first 2 for second etc.
		                    oCell  = oPartsList.PartsListRows.Item(j).Item("Item") 
		                'Row name needs to be case sensitive or use 1 for first 2 for second etc.
		                    
							'get the value of text in cell
		                    Dim oItemValue As String = oCell.Value
							
		                    'Show the view label
		                    oView.ShowLabel = True
		                    'format the next line
		                    oStringItem = "<StyleOverride Underline='True' FontSize='0.25'> ITEM " & oItemValue & " </StyleOverride>"
		                    'format the next line
		                    
							'Scale is not being utilized at this time
							'oStringScale = "<Br/><StyleOverride FontSize='0.2'>Scale <DrawingViewScale/></StyleOverride>"
							
							'format the next line
							'This pulls the part number iProperty from the reference file
							oStringPNumber = "<Br/><StyleOverride Underline='False' FontSize='0.2'> P#: <Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
							
							'format the next line
							'This pulls the revision iProperty from the reference file
'							oRev = iProperties.Value(docFName,"Project","Revision Number")
							'oStringViewRev = "<StyleOVerride Underline='False' FontSize='0.2'> REV: " & oRev & " </StyleOverride>"
							
							'format the next line
							'This pulls the description iProperty from the reference file
							oStringViewDesc = "<Br/><StyleOverride Underline='False' FontSize='0.2'> DESC: <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
							
							'format the next line
							'This pulls the material iProperty data from the reference file
							oStringViewMat = "<Br/><StyleOverride Underline='False' FontSize='0.2'> MATERIAL: <Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>MATERAIL</Property></StyleOverride>"
							
							'format the next line
							'This pulls quantity data from the parts list
							oCellQuantity = oPartsList.PartsListRows.Item(j).Item("Item QTY")
							Dim oListQuantity As String
							oListQuantity = oCellQuantity.Value
							oStringListQuantity = "<Br/><StyleOverride Underline='False' FontSize='0.2'> QTY: " & oListQuantity & " </StyleOverride>"
		                    
		                    'add to the view label
		                    oView.Label.FormattedText =  oStringItem & oStringViewDesc & oStringPNumber & oStringViewMat & oStringListQuantity
'		                End If  
		            Next 'Partslistrowcount
			'While disabled in an effort to bypass the parts list title bit of code
'		      End While
			
	           Exit For
	        Else
	            'do nothing
	        End If
        Next'Partslistloop
	End If
Next 'SheetCount

 

Mack Marchant - Project Engineer
0 Likes
Message 6 of 9

A.Acheson
Mentor
Mentor

Try this one and see if it works for you. 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheets As Sheets = oDrawDoc.Sheets
Dim oSheet As Sheet'Inventor.Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
Dim oPartsLists As PartsLists
Dim oPartsList As PartsList	
Dim j As Long

'iterate through each sheet
For Each oSheet In oSheets
	oSheet.Activate 
	'[Set the partslist object as each one is found
	'declare the PartsLists
	oPartsLists = oSheet.PartsLists
    If oSheet.PartsLists.Count > 0 Then 
		 For Each oPartslist In oPartsLists
            If oPartsList.Title = "PARTS LIST" Then
                MessageBox.Show("found table", "ilogic")
		         Exit For
	        Else
	            'do nothing
	        End If
		Next'Partslistloop
	End If
	']

	'Pause and allow sheet to change and keep selecting views
	ThisApplication.UserInterfaceManager.DoEvents
	
	oViews = oSheet.DrawingViews            

    'get view from user
    While True
        oView = ThisApplication.CommandManager.Pick( _
        SelectionFilterEnum.kDrawingViewFilter, "Select a View") 
    	
		'Exit view and move to next sheet
		If oView Is Nothing Then Exit While
        
		'Get the full filename Of the view model
        Dim oModelFileName As String = oView.ReferencedDocumentDescriptor.ReferencedDocument.FullFileName
        'MessageBox.Show("view model name" & oModelFileName, "Title")
        
		Try
        ' Iterate through the contents of the parts list.
        For j = 1 To oPartsList.PartsListRows.Count
            ' Get the current row.
            Dim oRow As PartsListRow = oPartsList.PartsListRows.Item(j)
            'get filename of model in row
            Dim oRowFileName As String
            Try ' try and get the full file name of the PL item
                oRowFileName = oRow.ReferencedFiles.Item(1).FullFileName
            Catch 'on error go to next item
                Dim oCellValue As String = oRow.Item("Item").Value
'                    MessageBox.Show("Error Processing item: " & oCellValue, "Title")
                Continue For
            End Try
            
			'compare the filenames
            'Performs a text comparison, based on a case-insensitive text sort order
            'If strings equal returns 0
           ' If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 
                
				'Get the value of Item from the Parts List
                'Row name needs to be case sensitive or use 1 for first 2 for second etc.
                oCell  = oPartsList.PartsListRows.Item(j).Item("Item") 
            	'Row name needs to be case sensitive or use 1 for first 2 for second etc.
                
				'get the value of text in cell
                Dim oItemValue As String = oCell.Value
				
                'Show the view label
                oView.ShowLabel = True
                
				'format the next line
                oStringItem = "<StyleOverride Underline='True' FontSize='0.25'> ITEM " & oItemValue & " </StyleOverride>"
                
				'format the next line
				'Scale is not being utilized at this time
				oStringScale = "<Br/><StyleOverride FontSize='0.2'>Scale <DrawingViewScale/></StyleOverride>"
				
				'format the next line
				'This pulls the part number iProperty from the reference file
				oStringPNumber = "<Br/><StyleOverride Underline='False' FontSize='0.2'> P#: <Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
				
				'format the next line
				'This pulls the revision iProperty from the reference file
				oRev = iProperties.Value(docFName,"Project","Revision Number")
				oStringViewRev = "<StyleOVerride Underline='False' FontSize='0.2'> REV: " & oRev & " </StyleOverride>"
				
				'format the next line
				'This pulls the description iProperty from the reference file
				oStringViewDesc = "<Br/><StyleOverride Underline='False' FontSize='0.2'> DESC: <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
				
				'format the next line
				'This pulls the material iProperty data from the reference file
				oStringViewMat = "<Br/><StyleOverride Underline='False' FontSize='0.2'> MATERIAL: <Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>MATERAIL</Property></StyleOverride>"
				
				'format the next line
				'This pulls quantity data from the parts list
				oCellQuantity = oPartsList.PartsListRows.Item(j).Item("Item QTY")
				
				Dim oListQuantity As String = oCellQuantity.Value
				oStringListQuantity = "<Br/><StyleOverride Underline='False' FontSize='0.2'> QTY: " & oListQuantity & " </StyleOverride>"
                
                'add to the view label
                oView.Label.FormattedText =  oStringItem & oStringViewDesc & oStringPNumber & oStringViewMat & oStringListQuantity
            'End If  
        Next 'Partslistrowcount
		Catch
			MessageBox.Show("Error in partlsist cell loop", "Title")
		End Try
  End While
Next 'SheetLoop

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 7 of 9

mtmarchant
Advocate
Advocate
@A.Acheson the only issue I'm having with it now is that the Item # and Quantity are referencing the last row in the parts list. I've tried comparing this code to the other old versions of code to remedy this, but I'm not finding the inconsistency that is causing this particular issue.
Mack Marchant - Project Engineer
0 Likes
Message 8 of 9

A.Acheson
Mentor
Mentor
Accepted solution

I switched off this line which would be the detection of the partlist row against the view referenced . This is needed to ensure the right information is being passed to the view label. Maybe check that filter is working first. 

' If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 9 of 9

mtmarchant
Advocate
Advocate
That fixed it. The code is working beautifully.

Again, thank you for your assistance on this project.
Mack Marchant - Project Engineer
0 Likes