tmelancon Posted November 12, 2014 Posted November 12, 2014 I am so close to getting this code to perform but need some final touches and manipulaton.. Currently it offsets all text on a specific layer and copy's and moves it up "0.15" which is what we already have doing with another layer we use in our drawings. (we use this to add specific descriptions above a labeled point.) What I am looking for now is to change the code so that instead of offseting/copying/moving every string of text on DEFICIENCY layer within the drawing, I would like for it to prompt me which individual string of text I would like to offset - i.e. ("\nSelect Text to Offset: "), THEN after I make that selection it offset/copy/move that string up "0.15" and be put on DEFICIENCY layer with its respective properties... Hoping someone can chime in soon and thank you all for the support! Quote
hmsilva Posted November 12, 2014 Posted November 12, 2014 Without seeing the code it's hard to help... But if your code is in AutoLISP, and uses the ssget function and the selection method "_X", try changing the selection method to "_+.:E:S" Henrique Quote
tmelancon Posted November 13, 2014 Author Posted November 13, 2014 My absolute sincerest apologies, that has to be a rookie move on my part.. Please see code below. ;;;OFFSET DEFICIENCY NOTES (defun c:DEF () (input1) (execute1)) (defun input1 () (setq lay_name "*DEFICIENCY") (setq ss1 (ssget "X" (list (cons 0 "TEXT")(cons 8 lay_name))))) (defun execute1 () (command "-layer" "n" "TEXT" "c" "104" "TEXT" "") (command "copy" SS1 "" "0,0" "") (command "move" SS1 "" "0,0" "@0,.15") (command "chprop" "p" "" "la" "DEFICIENCY" "") (princ)) Quote
tmelancon Posted November 13, 2014 Author Posted November 13, 2014 Ok the selection method you suggested worked perfectly! Kudos! Is there a way to allow the user to continue selecting text until hitting enter to end command or clicking off? Right now its just executing the command once then ending. Quote
hmsilva Posted November 13, 2014 Posted November 13, 2014 Try ;;;OFFSET DEFICIENCY NOTES (defun c:DEF (/ execute1 input1) (defun input1 () (setq lay_name "*DEFICIENCY") (princ "\nSelect text to offset: ") (setq ss1 (ssget "_+.:E:S" (list (cons 0 "TEXT") (cons 8 lay_name)))) ) (defun execute1 () (command "-layer" "n" "TEXT" "c" "104" "TEXT" "") (command "copy" SS1 "" "0,0" "") (command "move" SS1 "" "0,0" "@0,.15") (command "chprop" "p" "" "la" "DEFICIENCY" "") ) (while (input1) (execute1) ) (princ) ) One question, the layer Text is created for? Henrique Quote
tmelancon Posted November 13, 2014 Author Posted November 13, 2014 Worked perfectly thanks Henrique. I deleted the text layer piece, that was actually a part of the other code were using. Its redundant in this one. Blessings brother! Quote
hmsilva Posted November 13, 2014 Posted November 13, 2014 You're welcome! Glad I could help Henrique Quote
zemoe1 Posted March 17, 2017 Posted March 17, 2017 would you happen to have that offset text routine available...would greatly appreciate it thnx, -Bill 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.