home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************************/
- /* */
- /* BlueCAD REXX Macro */
- /* */
- /* Example of the use of REXX macro in BlueCAD */
- /* - Scanning of the graphic database of a drawing - */
- /* */
- /* (c) 1995 CadWare s.r.l. */
- /* */
- /***********************************************************************************/
-
- /* Opens the queue of the drawing's primitives */
-
- sel = CADDbOpenQue( 'PRIQUE' )
-
- /*------------- Scans the database of the drawing ------------*/
-
- /* First element in the data base */
- id = CADDbFirst( sel, 'code' )
- do while id > 0
-
- msg = 'id =' id 'Primitive's Identifier =' code
- CADMsgBox( msg, 'Scanning the data base' )
-
- /* Recognizes a segment type primitive */
- if code = 10 then
- do
- CADDbSegm( id, 'pt', 'attrib' )
- msg = pt.P1x','pt.P1y pt.P2x','pt.P2y
- CADMsgBox( msg, 'Line end points' )
- end
-
- /* Recognizes an arc type primitive */
- if code = 1 then
- do
- CADDbArc( id, 'arc', 'attrib' )
- msg = arc.Cenx','arc.Ceny arc.Rad
- CADMsgBox( msg, 'Arc Center and Radius' )
- end
-
- /* Next element in the data base */
- id = CADDbNext( sel, 'code' )
- end
-
- /* Closes the queue of the drawing's primitives */
- call CADDbCloseQue ( sel )