Change *Varies* Default in Parts List

Change *Varies* Default in Parts List

brent_e_barbour
Collaborator Collaborator
543 Views
4 Replies
Message 1 of 5

Change *Varies* Default in Parts List

brent_e_barbour
Collaborator
Collaborator

The screws in our library have torque values attached to them so when generating parts lists, torque values automatically populate the notes column..  However, the torque value will change depending on what they screw into.  If a .086-56 UNC screw is threaded into a helical insert, the “NOTES” column of the parts list will populate with “TRQ 20 IN-OZ.”  If a .086-56 UNC screw is threaded into a steel nut, the “NOTES” column of the parts list will populate with “TRQ 2.5 IN-LBS.”  If we insert multiples of the same screws threading into different materials, the notes column will populate with *Varies*.  Where is that *Varies* default set?  Is it possible to change the default to something like “REFER TO CALLOUT FOR TRQ”?  Obviously, I can manually overwrite the *Varies* value every time, but it would be really slick to have something  meaningful to us in there and save us a step.

 

0 Likes
Accepted solutions (1)
544 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @brent_e_barbour.  I highly doubt you will be able to specify custom text to appear instead of *Varies* in your parts list, because I've never seen any setting like that in all the years I've been at this.  However, there may be a workaround process to help in this situation.  You could probably develop an iLogic rule that would examine your parts list, and if it finds any cell(s) within specified column(s) that contains "Varies", you can have the code replace that with whatever value/text you want.  The value you want to replace that with though sounds pretty specific/custom, so you would probably have to edit that part within the iLogic rule, any time you want that value to be something different.  Or have the rule ask for what to replace it with, using an InputBox prompt.  Does this sound like something you would be interested in pursuing?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

brent_e_barbour
Collaborator
Collaborator

Maybe, but I've only tinkered with iLogic basics.  I wouldn't even know where to begin.  This kind of scenario where we have the same screw with more than 1 torque value in the same assembly is so rare, I don't know it'd be worth my time to figure it out, but if you're offering to write the code or point me in the right direction, I'd gladly accept.

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor
Accepted solution

I think I may have an iLogic rule you could use do automate this specific task.  However, you would have to manually run the rule when you want to use it.  You could either create this iLogic rule 'locally', within the document is it to effect, or create it as an external iLogic rule, so that it will be available to use on other documents, but the 'local' route is simplest to set-up and use quickly.

 

This rule first checks to make sure the 'active' document is a drawing, then if so, captures it.  Then it tries to find the first parts list in the drawing, as its target.  If it doesn't find one, it lets you know, then exits the rule.  It then checks for a column within this parts list with the title "NOTES".  If it doesn't find it, it lets you know, then exits the rule.  It then starts 'looping' through each row of the parts list, checking to see if the cell in that row that corresponds with the specified column contains the text "Varies".  If it does, it tries to replace the whole value of that cell with your custom value.  If it doesn't contain that text, it does nothing with that cell.  If it encounters an error while trying to check the value of the cell or while trying to change its value, it will let you know, then try to continue with any other rows that might remain.

 

Here is the code for this iLogic rule:

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule to work. Exiting.",vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisApplication.ActiveDocument
'find first parts list in the drawing, as target
Dim oPList As PartsList
For Each oSheet As Sheet In oDDoc.Sheets
	If oSheet.PartsLists.Count > 0 Then
		oPList = oSheet.PartsLists.Item(1)
		Exit For
	End If
Next
If IsNothing(oPList) Then
	MsgBox("No Parts List found in active drawing.  Exiting Rule.", , "iLogic")
	Exit Sub
End If
'make sure the "NOTES" column exists
Dim oNotesColExists As Boolean = False
For Each oCol As PartsListColumn In oPList.PartsListColumns
	If oCol.Title = "NOTES" Then
		oNotesColExists = True
		Exit For
	End If
Next
'make sure we found that specified column, if not, let user know then exit rule
If oNotesColExists = False Then
	MsgBox("The 'NOTES' column was not found.  Exiting Rule.", , "iLogic")
	Exit Sub
End If
'now start looping through each row, then each cell in each row
For Each oRow As PartsListRow In oPList.PartsListRows
	Try
		If oRow.Item("NOTES").Value.Contains("Varies") Then
			'replace this cell's Value with your custom value
			oRow.Item("NOTES").Value = "REFER TO CALLOUT FOR TRQ"
		End If
	Catch e As Exception
		MsgBox("Attempt to overwrite 'Varies' in Parts List cell failed." & vbCrLf & _
		e.Message & vbCrLf & e.StackTrace,vbInformation,"iLogic")
	End Try
Next

If you need help creating this rule within the document, and/or running it, just let me know.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 5

brent_e_barbour
Collaborator
Collaborator

Thank you!!!

0 Likes