home *** CD-ROM | disk | FTP | other *** search
- /* CMD: ½QuickMove */
- /* By Brett Evan Hester 13032 Copenhill Rd. Dallas, Tx. 75240-5302 */
- MacrosName = "QuickMove"
- /* Macro Type: */
- /* MODIFIES * OBJECTS * LAYER * REMEMBERS */
- /* Description: */
-
- Info1A = "!Quick Move © Information 1 of 2"
- Info1B = ""
- Info1C = "@This macro moves the ENTIRE layer. Moving the "
- Info1D = "@center of the layer to new coordinates. "
- Info1E = ""
- Info1F = "þ The default position to MOVE TO is that of the "
- Info1G = " previous settings for this macro. "
- Info1H = "¤ If no previous settings are found; then, the "
- Info1I = " default coordinates are those of the "
- Info1J = " background layers' center. "
- Info1K = "¤ If there are no background layers; then, the "
- Info1L = " default coordinates are those of the current "
- Info1M = " layers' center. (The layer would not move.) "
- Info1N = ""
-
- Info2A = "!Quick Move © Information 2 of 2"
- Info2B = "@ Plug-Ins and Go! © "
- Info2C = " Hester and associates"
- Info2D = " 13032 Copenhill Road "
- Info2E = " Dallas, Texas 75240 "
- Info2F = "@Special Thanks to: "
- Info2G = "Arnie Cachelin Henry Ribron Mark J. Holland "
- Info2H = "J. Phil Kelso Terry Wester Steven K. Simms "
- Info2I = "Kevin DeRita Greg Glaser William S. Hawes"
- Info2J = "NewTek © Commodore © INOVAtronics © "
- Info2K = ""
- Info2L = "@This macro represents a lot of time & hard work."
- Info2M = "@Encourage people to create new ones and not kill"
- Info2N = "@that possibility by stealing those that are out."
-
- /* -------------------------------------------------------------------- */
- /* Start Error Detection (See End) */
- SIGNAL ON ERROR
- SIGNAL ON SYNTAX
- /* Address LightWave */
- VT3DLib = ADDLIB("LWModelerARexx.port",0)
- ADDRESS "LWModelerARexx.port"
-
- /* -------------------------------------------------------------------- */
- /* Reading Global Macro Preferences */
- BEHDefaultFilePath = "Sys:"
- BEHSettingsSavedTo = "T:"
- BEHSpeechAndSound = "1"
-
- IF (EXISTS("S:PlugInPrefs")) THEN DO
- IF (~OPEN(PlugInPrefs, "S:PlugInPrefs", 'R')) THEN BREAK
- IF (READLN(PlugInPrefs) ~= "PlugInPrefs") THEN BREAK
- BEHDefaultFilePath = READLN(PlugInPrefs)
- BEHSettingsSavedTo = READLN(PlugInPrefs)
- BEHSpeechAndSound = READLN(PlugInPrefs)
- CALL CLOSE(PlugInPrefs)
- END
-
- /* -------------------------------------------------------------------- */
- /* Recalling Macro Settings */
- CL = CurLayer()
- PARSE value BoundingBox() with N X1 X2 Y1 Y2 Z1 Z2
-
- BL = CurBLayer()
- IF WORDS(BL) ~= 0 THEN PARSE value BoundingBox(BL) with N X1 X2 Y1 Y2 Z1 Z2
-
- ReqX = (X1/2)+(X2/2) ; ReqY = (Y1/2)+(Y2/2) ; ReqZ = (Z1/2)+(Z2/2)
-
- PrefsFileName = BEHSettingsSavedTo||MacrosName||".PLUG"
-
- IF (EXISTS(PrefsFileName)) THEN DO
- IF (~OPEN(PrefsFile, PrefsFileName, 'R')) THEN BREAK
- IF (READLN(PrefsFile) ~= MacrosName) THEN BREAK
-
- PARSE value READLN(PrefsFile) with ReqX ReqY ReqZ .
-
- CALL CLOSE(PrefsFile)
- END
-
- /* -------------------------------------------------------------------- */
- /* For Information Window */
- BEHInfo = 1
- /* For Coming Back to Main Menu after Info Window */
- DO WHILE BEHInfo
-
- /* -------------------------------------------------------------------- */
- /* User Interface */
- CALL Req_Begin("Quick Move © by Brett Hester")
-
- ReqA = Req_AddControl("Move To",'V',1)
- ReqB = Req_AddControl("",'CH',"Information")
-
- CALL Req_SetVal(ReqA, ReqX ReqY ReqZ)
- CALL Req_SetVal(ReqB, 0)
-
- OKorCANCEL = Req_Post() ; IF OKorCANCEL = 0 THEN CALL Exiting
-
- PARSE value Req_GetVal(ReqA) with ReqX ReqY ReqZ
- BEHInfo = Req_GetVal(ReqB)
-
- CALL Req_End()
-
- IF BEHInfo = 1 THEN CALL InformationWindows
-
- END
-
- /* -------------------------------------------------------------------- */
- /* Main Body of Code */
- PARSE value BoundingBox() with N X1 X2 Y1 Y2 Z1 Z2
-
- CX = (X1/2)+(X2/2) ; CY = (Y1/2)+(Y2/2) ; CZ = (Z1/2)+(Z2/2)
- OffsetX = ReqX - CX ; OffsetY = ReqY - CY ; OffsetZ = ReqZ - CZ
-
- CALL Move(OffsetX OffsetY OffsetZ)
-
- /* -------------------------------------------------------------------- */
- /* Recording Macro Settings */
- IF (OPEN(PrefsFile, PrefsFileName, 'W')) THEN DO
- CALL WRITELN(PrefsFile, MacrosName)
-
- CALL WRITELN(PrefsFile, ReqX ReqY ReqZ)
-
- CALL CLOSE(PrefsFile)
- END
-
- CALL Exiting
-
- /* -------------------------------------------------------------------- */
- /* Ending */
- Exiting:
-
- IF (VT3DLib) THEN CALL remlib("LWModelerARexx.port")
- EXIT
-
- RETURN
-
- /* -------------------------------------------------------------------- */
- /* Information Windows */
- InformationWindows:
-
- OKorCancel = Notify(2, Info1A, Info1B, Info1C, Info1D, Info1E, Info1F, Info1G, Info1H, Info1I, Info1J, Info1K, Info1L, Info1M, Info1N)
- IF OKorCancel = 1 THEN CALL Notify(1, Info2A, Info2B, Info2C, Info2D, Info2E, Info2F, Info2G, Info2H, Info2I, Info2J, Info2K, Info2L, Info2M, Info2N)
-
- RETURN
-
- /* -------------------------------------------------------------------- */
- /* Error Handling */
- SYNTAX:
- ERROR:
-
- ErrCode = RC
- ErrLine = SIGL
- ErrInfo = ERRORTEXT(ErrCode)
-
- Err1 = "!Sorry!"
- Err2 = "An Error has been detected"
- Err3 = "@þ Macro - "
- Err4 = "@þ Line Number - "
- Err5 = "@þ Error Code - "
- Err6 = "@þ Error Description -"
- Err7 = "@¤ Please Inform - "
- Err8 = ' "Error Notice" '
- Err9 = " 13032 Copenhill Rd."
- Err10 = " Dallas, TX. 75240 "
-
- Call Notify(1,Err1,Err2,Err3,MacrosName,Err4,ErrLine,Err5,ErrCode,Err6,ErrInfo,Err7,Err8,Err9,Err10)
-
- /* -------------------------------------------------------------------- */
- /* Advanced Error Handling */
- CALL SETCLIP("ErrorMacro",MacrosName)
- CALL SETCLIP("ErrorLine",ErrLine)
- CALL SETCLIP("ErrorCode",ErrCode)
- CALL SETCLIP("ErrorDesc",ErrInfo)
-
- PARSE SOURCE TempA TempB ErrFile TempC TempD TempE
-
- CALL SETCLIP("ErrorFile",ErrFile)
-
- /* -------------------------------------------------------------------- */
-
- IF (VT3DLib) THEN CALL REMLIB("LWModelerARexx.port")
- EXIT
-