Send Topic Feedback | See Object Hierarchy Chart
PC-DMIS 2023.1 Object Library
PCDLRN ActiveX DLL > PartPrograms Object : OpenRoutineEx Method
Required String. This is the file name of the PartProgram to open.
Required String. This is the pathway to the CAD file (.cad) to open.

If this is null or PC-DMIS can't find the CAD file, PC-DMIS instead loads the CAD file for the routine. This is the CAD file that has the same name as the routine. This behaves as if you used the OpenEx method with IncludeCAD to True.

Required String. This is the identifying string for your machine. If you're running in offline mode, use "Offline". If you're running in online mode use "CMM1".
out_StatusCode lets you see the status of the OpenRoutineEx operation.
OpenRoutineEx Method
Description
This behaves the same as the OpenEx method, except that you can define what CAD file to load.
Syntax
Visual Basic
Public Function OpenRoutineEx( _
   ByVal FileName As String, _
   ByVal CadFileName As String, _
   ByVal MachineName As String, _
   ByRef out_StatusCode As OpenRoutineStatus _
) As PartProgram
Parameters
FileName
Required String. This is the file name of the PartProgram to open.
CadFileName
Required String. This is the pathway to the CAD file (.cad) to open.

If this is null or PC-DMIS can't find the CAD file, PC-DMIS instead loads the CAD file for the routine. This is the CAD file that has the same name as the routine. This behaves as if you used the OpenEx method with IncludeCAD to True.

MachineName
Required String. This is the identifying string for your machine. If you're running in offline mode, use "Offline". If you're running in online mode use "CMM1".
out_StatusCode
ValueDescription
BranchMismatchErrorPC-DMIS cannot open the routine due to a branch mismatch error. This has a value of 8.
CannotOpenRoutineFilePC-DMIS cannot open the routine. This status has a value of 4.
DeserializationErrorPC-DMIS cannot open the routine because of a deserialization error. This has a value of 7.
ErrorClosingRoutineFilePC-DMIS cannot open the routine because it cannot close the routine after it reads it. This has a value of 5.
InternalErrorPC-DMIS cannot open the routine because of an internal error. This has a value of 3.
OpenedBackupCopyPC-DMIS opened a backup copy of the routine instead of the main routine. This has a value of 2.
PcdmisIsOpeningAnotherRoutinePC-DMIS cannot open the routine because it is in the process of opening another routine. This has a value of 10.
RoutineFileDoesNotExistPC-DMIS cannot open the routine because the routine file does not exist. This has a value of 6.
RoutineIsNewerErrorPC-DMIS cannot open the routine because the routine is newer than the version of PC-DMIS. This has a value of 9.
RoutineIsTooOldError 
RoutineOpenedPC-DMIS opened the routine without any errors. This has a value of 1.
UnknownStatusPC-DMIS cannot open the routine due to an unknown cause. This has a value of 0.
out_StatusCode lets you see the status of the OpenRoutineEx operation.
See Also