home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 October / PCO_1098.ISO / filesbbs / os2 / bluecad.arj / BLUECAD.ZIP / macro.rx_ / crsim.rxm < prev    next >
Encoding:
Text File  |  1996-04-15  |  2.4 KB  |  52 lines

  1. /*****************************************************************************/
  2. /*                                                                                                          */
  3. /*  BlueCAD REXX Macro                                                                             */
  4. /*                                                                                                           */
  5. /*  Example of the use of REXX macro in BlueCAD                                            */
  6. /*                                     -  Creation of a  block  -                                     */
  7. /*                                                                                                           */
  8. /*  (c) 1995 CadWare s.r.l.                                                                          */
  9. /*                                                                                                           */
  10. /*****************************************************************************/
  11.  
  12.    call CADOutMes 'Insert the two vertices of the rectangle'
  13.  
  14.                                    /* Input of the two vertices of the rectangle */
  15.    call CADInput 'POINT', 'p1'
  16.  
  17.    call CADInput 'POINT', 'p2'
  18.  
  19.                         /* Opens the queue of the drawing's primitives */
  20.    que = CADDbOpenQue( 'PRIQUE' )
  21.  
  22.                /* Creates the four sides of the rectangle and saves their identifier*/
  23.                                                          
  24.    call CADCmd 'segmento' p1.x','p1.y p2.x','p1.y
  25.    id1 = CADDbLast( que, 'code' )
  26.  
  27.    call CADCmd 'segmento' p2.x','p1.y p2.x','p2.y
  28.    id2 = CADDbLast( que, 'code' )
  29.  
  30.    call CADCmd 'segmento' p2.x','p2.y p1.x','p2.y
  31.    id3 = CADDbLast( que, 'code' )
  32.  
  33.    call CADCmd 'segmento' p1.x','p2.y p1.x','p1.y
  34.    id4 = CADDbLast( que, 'code' )
  35.  
  36.                                                /* Asks for the block's name */
  37.    call CADOutMes 'Please, digit the name of the block'
  38.    call CADInput 'STRING', 'namesym'
  39.  
  40.                      /* Inserts the four segments into the selection queue */
  41.    call CADClearSel
  42.    call CADInsel id1
  43.    call CADInsel id2
  44.    call CADInsel id3
  45.    call CADInsel id4
  46.  
  47.                                                           /* Creates the block */
  48.    ids = CADCrSim( namesym.str, p1.x, p1.y )
  49.  
  50.                                            /* Closes the queue of the primitives */
  51.    call CADDbCloseQue que
  52.