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

  1. /***********************************************************************************/
  2. /*                                                                                 */
  3. /*  BlueCAD REXX Macro                                                             */
  4. /*                                                                                 */
  5. /*  Example of the use of REXX macro in BlueCAD                                    */
  6. /*                              -  Scanning of the graphic database of a drawing - */
  7. /*                                                                                 */
  8. /*  (c) 1995 CadWare s.r.l.                                                        */
  9. /*                                                                                 */
  10. /***********************************************************************************/
  11.  
  12. /* Opens the queue of the drawing's primitives */
  13.  
  14.    sel = CADDbOpenQue( 'PRIQUE' )
  15.  
  16. /*------------- Scans the database of the drawing ------------*/
  17.  
  18.                                              /* First element in the data base */
  19.    id = CADDbFirst( sel, 'code' )
  20.    do while id > 0
  21.  
  22.      msg = 'id =' id 'Primitive's Identifier =' code
  23.      CADMsgBox( msg, 'Scanning the data base' )
  24.  
  25.                                  /* Recognizes a segment type primitive */
  26.      if code = 10 then
  27.        do
  28.        CADDbSegm( id, 'pt', 'attrib' )
  29.        msg = pt.P1x','pt.P1y  pt.P2x','pt.P2y
  30.        CADMsgBox( msg, 'Line end points' )      
  31.        end
  32.  
  33.                                      /* Recognizes an arc type primitive */
  34.      if code = 1 then
  35.        do
  36.        CADDbArc( id, 'arc', 'attrib' )
  37.        msg = arc.Cenx','arc.Ceny arc.Rad
  38.        CADMsgBox( msg, 'Arc Center and Radius' )
  39.        end
  40.  
  41.                                           /* Next element in the data base */
  42.      id = CADDbNext( sel, 'code' )
  43.      end
  44.  
  45.                                            /* Closes the queue of the drawing's primitives */
  46.    call CADDbCloseQue ( sel )
  47.