Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

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))

Posted

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.

Posted

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

Posted

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!

Posted

You're welcome!

Glad I could help

 

 

Henrique

  • 2 years later...
Posted

would you happen to have that offset text routine available...would greatly appreciate it

thnx,

-Bill

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...