MWAutoNumber for MechWorks PDM Automation.

Appendix D: Custom Scripting – DataEntr_PreEvent.LST example

.VBSCRIPT '.x64 'NOTE: To cancel from this script, call "CancelCustomScript" Sub Main() '---------------------------------------------------------' '------------DO NOT CUSTOMIZE THIS SECTION----------------' '---------------------------------------------------------' DBWInit( TRUE ) '-------Load the library--------' If DBWLoadScript( "DataEntr.LIB" ) = False Then

DBWMsgBox "Script not found or error in script: DataEntr.lib" Exit Sub

End If If DBWLoadScript( "MwAutoNumber.LIB" ) = False Then

DBWMsgBox "Script not found or error in script: MwAutoNumber.lib" Exit Sub

End If '-----------------------------' '---------Input necessary values-------' If Not LoadAllInput() Then Exit Sub End If '--------------------------------------' '---Call Any MwAutoNumber Prep----'

Call MwAutoNumber_Prep() '----------------------------------' '---------------------------------------------------------' '--------END DO NOT CUSTOMIZE THIS SECTION----------------' '---------------------------------------------------------'

'Customize starting here: If Len(OriginalPathName) > 4 Then

If UCase(Right(OriginalPathName, 4 )) = ".PDF" Then 'PDF about to be registered If UCase(DBWGetUserGroup()) = "DBWORKS TRAINEE" Then 'User is trainee DBWMsgBox( "Users in training are not allowed to register PDF." ) Call CancelCustomScript() End If End If End If 'Uncomment the next line to cancel the save as process entirely 'Call CancelCustomScript() End Sub

40136 Bologna Italy

www.mechworks.com

119

Made with FlippingBook - Online Brochure Maker