home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************/
- /* */
- /* BlueCAD REXX Macro */
- /* */
- /* Example of the use of REXX macro in BlueCAD */
- /* - Creation of a block - */
- /* */
- /* (c) 1995 CadWare s.r.l. */
- /* */
- /*****************************************************************************/
-
- call CADOutMes 'Insert the two vertices of the rectangle'
-
- /* Input of the two vertices of the rectangle */
- call CADInput 'POINT', 'p1'
-
- call CADInput 'POINT', 'p2'
-
- /* Opens the queue of the drawing's primitives */
- que = CADDbOpenQue( 'PRIQUE' )
-
- /* Creates the four sides of the rectangle and saves their identifier*/
-
- call CADCmd 'segmento' p1.x','p1.y p2.x','p1.y
- id1 = CADDbLast( que, 'code' )
-
- call CADCmd 'segmento' p2.x','p1.y p2.x','p2.y
- id2 = CADDbLast( que, 'code' )
-
- call CADCmd 'segmento' p2.x','p2.y p1.x','p2.y
- id3 = CADDbLast( que, 'code' )
-
- call CADCmd 'segmento' p1.x','p2.y p1.x','p1.y
- id4 = CADDbLast( que, 'code' )
-
- /* Asks for the block's name */
- call CADOutMes 'Please, digit the name of the block'
- call CADInput 'STRING', 'namesym'
-
- /* Inserts the four segments into the selection queue */
- call CADClearSel
- call CADInsel id1
- call CADInsel id2
- call CADInsel id3
- call CADInsel id4
-
- /* Creates the block */
- ids = CADCrSim( namesym.str, p1.x, p1.y )
-
- /* Closes the queue of the primitives */
- call CADDbCloseQue que