ibanez_222 Posted December 19, 2011 Posted December 19, 2011 I had an idea for a justification lisp that if someone was bored and wanted to try, because I wouldn't know where to begin, I'm still new to lisp. I think if some one would make a lisp that would divide a box into 9 sections around a piece of text for top center, top right, top left, middle left, bottom right, bottom center, bottom left, middle right and middle center. When you would click in these areas it would make the text that justification, if that makes any sense to anyone. I find myself changing justification a lot and i think on the fly this would be a nice routine if you were to add a ctrl+J or something key shortcut with. Don't know if this is something hard or not but if someone agrees that this would be nice and would want to try that would be cool. Thanks. Quote
fixo Posted December 19, 2011 Posted December 19, 2011 Start with command justifytext in the command line Cheers Quote
alanjt Posted December 19, 2011 Posted December 19, 2011 ;; Justification Macros ;; Alan J. Thomspon (defun _justifyIt (justify title / ss) (princ (strcat "\nSelect *Text to " title " justify: ")) (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,TEXT")))) (command "_.justifytext" ss "" justify) ) (princ) ) (defun c:JC (/) (_justifyIt "_MC" "Middle Center")) (defun c:JL (/) (_justifyIt "_ML" "Middle Left")) (defun c:JR (/) (_justifyIt "_MR" "Middle Right")) (defun c:BC (/) (_justifyIt "_BC" "Bottom Center")) (defun c:TC (/) (_justifyIt "_TC" "Top Center")) Quote
ibanez_222 Posted December 20, 2011 Author Posted December 20, 2011 (edited) I do like that lisp. I added the top right/left and bottom right/left to it though, because I use all of them a lot. I am just trying to find the fastest way to do this, because in a lot of cases I change the justification a lot. Thanks for the help Alan. Here is what I added and it works great: ;; Justification Macros ;; Alan J. Thomspon (defun _justifyIt (justify title / ss) (princ (strcat "\nSelect *Text to " title " justify: ")) (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,TEXT")))) (command "_.justifytext" ss "" justify) ) (princ) ) (defun c:ML (/) (_justifyIt "_ML" "Middle Left")) (defun c:MR (/) (_justifyIt "_MR" "Middle Right")) (defun c:BC (/) (_justifyIt "_BC" "Bottom Center")) (defun c:TC (/) (_justifyIt "_TC" "Top Center")) (defun c:BR (/) (_justifyIt "_BR" "Bottom Right")) (defun c:BL (/) (_justifyIt "_BL" "Bottom Left")) (defun c:TL (/) (_justifyIt "_TL" "Top Left")) (defun c:TR (/) (_justifyIt "_TR" "Top Right")) (defun c:MC (/) (_justifyIt "_MC" "Middle Center")) Edited December 20, 2011 by ibanez_222 Quote
alanjt Posted December 20, 2011 Posted December 20, 2011 I do like that lisp. I added the top right/left and bottom right/left to it though, because I use all of them a lot. I am just trying to find the fastest way to do this, because in a lot of cases I change the justification a lot. Thanks for the help Alan. Here is what I added and it works great: Good to hear you found something that works. BTW, you didn't copy everything - look at last line. Quote
ibanez_222 Posted December 20, 2011 Author Posted December 20, 2011 Good to hear you found something that works. BTW, you didn't copy everything - look at last line. Your quick, I didn't get to fix it before you replied, but it's right now. Thanks. Quote
alanjt Posted December 20, 2011 Posted December 20, 2011 Your quick, I didn't get to fix it before you replied, but it's right now. Thanks. FYI, you're defining the same option (middle center, etc.) twice - once with some of my macros and another with yours. Quote
ibanez_222 Posted December 20, 2011 Author Posted December 20, 2011 FYI, you're defining the same option (middle center, etc.) twice - once with some of my macros and another with yours. Yea I noticed that, and edited it again, and used mine. I don't know if there was a special reason for the JC, JR, JL, instead of MC, MR, and ML? I assumed it was because you already had those used up. Quote
alanjt Posted December 20, 2011 Posted December 20, 2011 Yea I noticed that, and edited it again, and used mine. I don't know if there was a special reason for the JC, JR, JL, instead of MC, MR, and ML? I assumed it was because you already had those used up.Correct.I generally only use JC/JR/JL, so it initially started out as Justify[name]. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.