home *** CD-ROM | disk | FTP | other *** search
- /* CMD: Center
- * Center Object by Bounding Box */
- /* By Arnie Cachelin © 1992 NewTek Inc. */
-
-
- libadd = addlib("LWModelerARexx.port",0)
- signal on error
- signal on syntax
- box=boundingbox() /* Should check out empty list ... */
- parse var box n x1 x2 y1 y2 z1 z2
- say box
- cx=-(x2+x1)/2
- cy=-(y2+y1)/2
- cz=-(z2+z1)/2
-
- /* Uncomment this stuff to get center info and a chance to avoid the move
- s1='@'x1 y1 z1
- s2='@'x2 y2 z2
- s3='@'abs(cx) abs(cy) abs(cz)
- if notify(2,'@Bounding Box:',s1,s2,'@Center position:',s3,'!Center Object?') then
- */
- call MOVE(cx cy cz)
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-
- syntax:
- error:
- t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-