PC-Dmis 2010 Object Library | Send comments on this topic. | See Object Hierarchy Chart
Add Method
See Also

Collapse All Expand All

Type
  Required LONG in the OBTYPE enumeration that denotes what type of object to create.

AutoPosition

  Required Boolean that determines what should happen when the new Command object is being inserted in an inappropriate place in the part program.

  - If AutoPosition is FALSE, it will not be inserted at all.
  - If it is TRUE, the new Command will be inserted at the new appropriate position.

# Description

Adds a new command to the command collection This method adds a Command.

# Syntax

Visual Basic

    Public Function Add( _
       ByVal Type As OBTYPE, _
       ByVal AutoPosition As Boolean _
    ) As Command

# Parameters

Type

  Value | Description
  --- | ---
  START_ALIGN |
  LEVEL_ALIGN |
  ROTATE_ALIGN |
  TRANS_ALIGN |
  TRANSOFF_ALIGN |
  ROTATEOFF_ALIGN |
  SAVE_ALIGN |
  RECALL_ALIGN |
  EQUATE_ALIGN |
  ITER_ALIGN |
  BF2D_ALIGN |
  ROTATE_CIRCLE_ALIGN |
  BF3D_ALIGN |
  POINTCLOUD_ALIGN |
  BFUSER_ALIGN |
  END_ALIGN |
  SET_WORKPLANE |
  ATTACH_PROGRAM |
  CURVE_FEATURE |
  SURFACE_FEATURE |
  MOVE_SPEED |
  TOUCH_SPEED |
  SCAN_SPEED |
  VIEWSET |
  RECALL_VIEWSET |
  SET_ACTIVE_TIP |
  GET_PROBE_DATA |
  TEMP_COMP |
  LOOP_START |
  LOOP_END |
  LABEL_CMD |
  GOTO_COMMAND |
  IF_GOTO_COMMAND |
  START_SUBROUTINE |
  CALL_SUBROUTINE |
  END_SUBROUTINE |
  ONERROR |
  WHILE_COMMAND |
  ENDWHILE_COMMAND |
  DO_COMMAND |
  END_IF_COMMAND |
  END_ELSE_IF_COMMAND |
  END_ELSE_COMMAND |
  END_CASE_COMMAND |
  END_SELECT_COMMAND |
  END_DEFAULT_CASE_COMMAND |
  UNTIL_COMMAND |
  IF_BLOCK_COMMAND |
  ELSE_IF_COMMAND |
  ELSE_COMMAND |
  CASE_COMMAND |
  SELECT_COMMAND |
  DEFAULT_CASE_COMMAND |
  ARRAY_INDEX |
  FILE_IO_OBJECT |
  CLAMP |
  PREHIT_DISTANCE |
  RETRACT_DISTANCE |
  CHECK_DISTANCE |
  MAN_DCC_MODE |
  BASIC_HIT |
  VECTOR_HIT |
  CORNER_HIT |
  ANGLE_HIT |
  SURFACE_HIT |
  EDGE_HIT |
  RMEAS_MODE |
  OPTIONPROBE |
  OPTIONMOTION |
  POLARVECTORCOMP |
  DISPLAYPRECISION |
  LEAPFROG |
  AUTOTRIGGERCOMMAND |
  MANRETRACT |
  VIDEOSETUP |
  IGNOREMOTIONERRORS |
  IOCHANNELCOMMAND |
  BUNDLE_ALIGN |
  CLEARANCE_PLANE |
  PROBE_COMPENSATION |
  CALIB_SPHERE |
  CALIB_ASSEMBLY |
  AUTOCALIB_PROBE_COMMAND |
  AUTOCALIB_MASTERSLAVE_COMMAND |
  MOVE_POINT |
  MOVE_CLEARP |
  MOVE_ROTAB |
  MOVE_INCREMENT |
  MOVE_CIRCULAR |
  MOVE_PH9_OFFSET |
  MOVE_SYNC |
  START_MOVE_SWEEP |
  END_MOVE_SWEEP |
  MOVE_SWEEP_POINT |
  MOVE_EXCLUSIVE |
  MOVE_ALL |
  FLY_MODE |
  END_PROGRAM |
  SET_COMMENT |
  LOAD_MACHINE |
  LOAD_FIXTURE |
  LOAD_COLUMN |
  EXTERNAL_COMMAND |
  ANALYSIS_VIEW |
  TABLE_FORMAT |
  DIMENSION_FORMAT |
  COLUMN132_DISPLAY |
  DIMENSION_INFORMATION |
  POINT_INFO |
  FEATURE_CONTROL_FRAME |
  STATISTICS |
  TRACEFIELD |
  READ_POINT |
  GAP_ONLY |
  RETROLINEAR_ONLY |
  ASSIGNMENT |
  POSITIVE_REPORTING |
  MEASURED_POINT |
  MEASURED_CIRCLE |
  MEASURED_SPHERE |
  MEASURED_LINE |
  MEASURED_CONE |
  MEASURED_CYLINDER |
  MEASURED_PLANE |
  MEASURED_ROUND_SLOT |
  MEASURED_SQUARE_SLOT |
  MEASURED_SET |
  DCCSCAN_OBJECT |
  MANSCAN_OBJECT |
  END_MEASURED_FEATURE |
  BASIC_SCAN_OBJECT |
  ANYORDER_EXECUTETOL |
  TRIGGER_TOLERANCE |
  TRIGGER_PLANE_COMMAND |
  TRACKER_LEVEL_TO_GRAVITY |
  VISION_SURFACE_POINT_FEATURE |
  VISION_EDGE_POINT_FEATURE |
  VISION_LINE_FEATURE |
  VISION_ELLIPSE_FEATURE |
  VISION_CIRCLE_FEATURE |
  VISION_SLOT_ROUND_FEATURE |
  VISION_PROFILE_2D_FEATURE |
  VISION_SLOT_SQUARE_FEATURE |
  VISION_ANGLE_POINT_FEATURE |
  VISION_SLOT_NOTCH_FEATURE |
  VISION_POLYGON_FEATURE |
  GET_PROBECHANGER_DATA |
  LASER_CIRCLE_FEATURE |
  LASER_SURFACE_POINT_FEATURE |
  LASER_PLANE_FEATURE |
  LASER_SLOT_FEATURE |
  LASER_FLUSH_AND_GAP_FEATURE |
  LASER_SPHERE_FEATURE |
  LASER_EDGE_POINT_FEATURE |
  LASER_LINE_FEATURE |
  LASER_SLOT_SQUARE_FEATURE |
  LASER_CYLINDER_FEATURE |
  LASER_POLYGON_FEATURE |
  CONST_ROUND_SLOT |
  CONST_BF_SLOT |
  CONST_BFRE_SLOT |
  CONST_ORIG_POINT |
  CONST_OFF_POINT |
  CONST_PROJ_POINT |
  CONST_MID_POINT |
  CONST_DROP_POINT |
  CONST_PIERCE_POINT |
  CONST_INT_POINT |
  CONST_CAST_POINT |
  CONST_CORNER_POINT |
  CONST_VECT_DIST_POINT |
  CONST_BFRE_CIRCLE |
  CONST_BF_CIRCLE |
  CONST_PROJ_CIRCLE |
  CONST_REV_CIRCLE |
  CONST_CONE_CIRCLE |
  CONST_CAST_CIRCLE |
  CONST_INT_CIRCLE |
  CONST_SCAN_SEG_ARC |
  CONST_MIN_CIRCLE_SCAN |
  CONST_TANLINES_CIRCLE |
  CONST_BFRE_SPHERE |
  CONST_BF_SPHERE |
  CONST_PROJ_SPHERE |
  CONST_REV_SPHERE |
  CONST_CAST_SPHERE |
  CONST_TANCIRCLES_CIRCLE |
  CONST_SCAN_SEG_LINE |
  CONST_BFRE_LINE |
  CONST_BF_LINE |
  CONST_PROJ_LINE |
  CONST_REV_LINE |
  CONST_MID_LINE |
  CONST_CAST_LINE |
  CONST_INT_LINE |
  CONST_OFF_LINE |
  CONST_ALN_LINE |
  CONST_PRTO_LINE |
  CONST_PLTO_LINE |
  CONST_BFRE_CONE |
  CONST_BF_CONE |
  CONST_PROJ_CONE |
  CONST_REV_CONE |
  CONST_CAST_CONE |
  CONST_BFRE_CYLINDER |
  CONST_BF_CYLINDER |
  CONST_PROJ_CYLINDER |
  CONST_REV_CYLINDER |
  CONST_CAST_CYLINDER |
  CONST_BFRE_PLANE |
  CONST_BF_PLANE |
  CONST_REV_PLANE |
  CONST_MID_PLANE |
  CONST_CAST_PLANE |
  CONST_OFF_PLANE |
  CONST_ALN_PLANE |
  CONST_PRTO_PLANE |
  CONST_PLTO_PLANE |
  CONST_HIPNT_PLANE |
  CONST_BFRE_ELLIPSE |
  CONST_BF_ELLIPSE |
  CONST_PROJ_ELLIPSE |
  CONST_REV_ELLIPSE |
  CONST_CAST_ELLIPSE |
  CONST_INT_ELLIPSE |
  ADJUST_FILTER |
  CONST_SET |
  GENERIC_CONSTRUCTION |
  FILTER_SET |
  AUTO_VECTOR_FEATURE |
  AUTO_SURFACE_FEATURE |
  AUTO_EDGE_FEATURE |
  AUTO_ANGLE_FEATURE |
  AUTO_CORNER_FEATURE |
  AUTO_HIGH_POINT_FEATURE |
  AUTO_CIRCLE |
  AUTO_SPHERE |
  AUTO_LINE |
  AUTO_CONE |
  AUTO_CYLINDER |
  AUTO_PLANE |
  AUTO_ROUND_SLOT |
  AUTO_SQUARE_SLOT |
  AUTO_ELLIPSE |
  AUTO_NOTCH |
  AUTO_PROFILE_2D |
  AUTO_SLOT |
  AUTO_FLUSH_GAP |
  AUTO_BLOB |
  AUTO_POLYGON |
  CONTACT_VECTOR_POINT_FEATURE |
  CONTACT_SURFACE_POINT_FEATURE |
  CONTACT_EDGE_POINT_FEATURE |
  CONTACT_ANGLE_POINT_FEATURE |
  CONTACT_CORNER_POINT_FEATURE |
  CONTACT_HIGH_POINT_FEATURE |
  CONTACT_LINE_FEATURE |
  CONTACT_PLANE_FEATURE |
  CONTACT_CIRCLE_FEATURE |
  CONTACT_ELLIPSE_FEATURE |
  CONTACT_SLOT_ROUND_FEATURE |
  CONTACT_SLOT_SQUARE_FEATURE |
  CONTACT_SLOT_NOTCH_FEATURE |
  CONTACT_SLOT_FEATURE |
  CONTACT_POLYGON_FEATURE |
  CONTACT_CONE_FEATURE |
  CONTACT_CYLINDER_FEATURE |
  CONTACT_SPHERE_FEATURE |
  DISPLAY_METAFILE |
  PRINT_FORM_FEED |
  PRINT_REPORT |
  EW_GROUP_START |
  EW_GROUP_END |
  SPC_QUERY |
  CNC_UPDATE_WORKOFSET |
  CNC_USE_WORKOFSET |
  CNC_SET_PROTECTION_COMMAND |
  CNC_UPDATE_TOOLOFSET |
  CNC_WRITE_VARIABLE |
  CNC_READ_VARIABLE |
  CNC_PASS_THRU_COMMAND |
  CNC_SELECT_TABLE_COMMAND |
  IGNOREROTAB_COMMAND |
  CALIBRATEROTAB_COMMAND |
  DIMENSION_START_LOCATION |
  DIMENSION_END_LOCATION |
  DIMENSION_X_LOCATION |
  DIMENSION_Y_LOCATION |
  DIMENSION_Z_LOCATION |
  DIMENSION_D_LOCATION |
  DIMENSION_R_LOCATION |
  DIMENSION_A_LOCATION |
  DIMENSION_T_LOCATION |
  DIMENSION_PR_LOCATION |
  DIMENSION_PA_LOCATION |
  DIMENSION_V_LOCATION |
  DIMENSION_L_LOCATION |
  DIMENSION_PD_LOCATION |
  DIMENSION_RT_LOCATION |
  DIMENSION_S_LOCATION |
  DIMENSION_RS_LOCATION |
  DIMENSION_H_LOCATION |
  DIMENSION_FLATNESS_LOCATION |
  DIMENSION_ROUNDNESS_LOCATION |
  DIMENSION_STRAIGHTNESS_LOCATION |
  DIMENSION_STRAIGHTNESS |
  DIMENSION_ROUNDNESS |
  DIMENSION_CIRCULARITY |
  DIMENSION_FLATNESS |
  DIMENSION_PERPENDICULARITY |
  DIMENSION_PARALLELISM |
  DIMENSION_PROFILE |
  DIMENSION_PROFILE_SURFACE |
  DIMENSION_3D_DISTANCE |
  DIMENSION_2D_DISTANCE |
  DIMENSION_3D_ANGLE |
  DIMENSION_2D_ANGLE |
  DIMENSION_RUNOUT |
  DIMENSION_TOTAL_RUNOUT |
  DIMENSION_CONCENTRICITY |
  DIMENSION_ANGULARITY |
  DIMENSION_KEYIN |
  DIMENSION_COAXIALITY |
  DIMENSION_SYMMETRY |
  DIMENSION_CYLINDRICITY |
  DIMENSION_CIRCULAR_RUNOUT |
  DIMENSION_PROFILE_LINE |
  DIMENSION_TRUE_START_POSITION |
  DIMENSION_TRUE_END_POSITION |
  DIMENSION_TRUE_X_LOCATION |
  DIMENSION_TRUE_Y_LOCATION |
  DIMENSION_TRUE_Z_LOCATION |
  DIMENSION_TRUE_DD_LOCATION |
  DIMENSION_TRUE_DF_LOCATION |
  DIMENSION_TRUE_PR_LOCATION |
  DIMENSION_TRUE_PA_LOCATION |
  DIMENSION_TRUE_DIAM_LOCATION |
  DIMENSION_TRUE_LD_LOCATION |
  DIMENSION_TRUE_WD_LOCATION |
  DIMENSION_TRUE_LF_LOCATION |
  DIMENSION_TRUE_WF_LOCATION |
  DIMENSION_TRUE_D1_LOCATION |
  DIMENSION_TRUE_D2_LOCATION |
  DIMENSION_TRUE_D3_LOCATION |
  DIMENSION_TRUE_FLATNESS_LOCATION |
  DIMENSION_TRUE_ROUNDNESS_LOCATION |
  DIMENSION_TRUE_STRAIGHTNESS_LOCATION |
  DATDEF_COMMAND |
  SIMULTANEOUS_EVALUATION |
  INBETWEEN_TOL |
  POINTCLOUD |
  POINTCLOUD_OPER |
  BASIC_SCRIPT |
  END_SCRIPT |
  HYPER_LEGACY |
  END_HYPER_REPORT |
  HYPER_FORM |
  END_HYPER_FORM |
  HYPER_CUSTOM |
  HYPER_TEMPLATE |
  HYPER_REPORT |

  Required LONG in the OBTYPE enumeration that denotes what type of object to create.
AutoPosition

  Required Boolean that determines what should happen when the new Command object is being inserted in an inappropriate place in the part program.

  - If AutoPosition is FALSE, it will not be inserted at all.
  - If it is TRUE, the new Command will be inserted at the new appropriate position.

# Return Type

Command object.

# Remarks

PC-DMIS only supports one way for adding commands while executing a part program in PC-DMIS: Insert a script command (select Insert | Basic Script from within PC-DMIS) that points to the BASIC script containing the Add method. Otherwise, you will need to run your script with the Add method first and control part program execution from within your script.

# Example

Sub main()

' This sample script shows how to add a GROUP/ and ENDGROUP/ command into the end of your part program.

Dim pcd As Object

Dim pp As Object

Dim cmds As Object

Dim cmd As Object

Dim start_grp As Object

Dim end_grp As Object

Dim uidstr As String

Dim RetVal As Boolean

Set pcd = CreateObject("PCDLRN.Application.4.2")

Set pp = pcd.ActivePartProgram

Set cmds = pp.Commands

Set cmd = cmds.LastCommand

cmds.InsertionPointAfter cmd

Set start_grp = cmds.Add(752, True)

start_grp.ID = "I"

start_grp.ReDraw

cmds.InsertionPointAfter start_grp

Set end_grp = cmds.Add(753, True)

end_grp.ReDraw

uidstr = end_grp.GetText(PCDLRN.uid, 0)

RetVal = start_grp.PutText(uidstr, PCDLRN.REF_UID, 0)

uidstr = start_grp.GetText(PCDLRN.uid, 0)

RetVal = end_grp.PutText(uidstr, PCDLRN.REF_UID, 0)

pp.RefreshPart

End Sub

# See Also

Commands Object | Remove Method

© Wilcox Associates, Inc. All Rights Reserved.

© 2010 All Rights Reserved.