Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Autolisp Lesson part 4 the legend continues.....

Status
Not open for further replies.

shadow

Computer
Mar 1, 2001
321
ok well then 2 things to talk about this time but first i want to say thanks to tigrek and striker cause im learning so much if i could i'd give you both 3 stars

ok well im ready to edit the linelength.lsp one more time. this time i want and need to do a couple of things. 1 set up so that when it lables its readable down & right. also i want to semi incorperate another lsp in this one to allow me to append and prefix each lable.And for all the settings i would like them to either default to a perticular setting or assume the last option the default unless otherwise changed. i think that this would be the most used part i would use!!!

as for the append/Precede lsp here is the code i called the lisp ADD2TXT.lsp

(defun c:addtxt()
(setq count 0)
(setq txt_t_add (getstring T "\nEnter additional text: "))
(initget "A P")
(setq AP (getkword &quot;\nAppend/<Precede>: &quot;))
(princ &quot;Select text: &quot;)
(setq txtset (ssget '((0 . &quot;TEXT&quot;))))
(repeat (sslength txtset)
(setq txt1 (entget (ssname txtset count))
txt2 (assoc 1 txt1)
txt (cdr txt2)
); end setquote
(cond
((= AP &quot;P&quot; )(setq newstrng (strcat txt_t_add txt)))
((= AP &quot;A&quot;)(setq newstrng (strcat txt txt_t_add)))
((null AP)(setq newstrng (strcat txt_t_add txt)))
);end cond
(setq nwtxtent (subst (cons 1 newstrng) txt2 txt1))
(ENTMOD nwtxtent)
(setq count (+ count 1))
);end repeat
)

ok now i just need to know at what point to tell it to use this command in our linelength.lsp

Also i have an object # lsp that supposedly uses #'s Letter's to kinda lable things but i would like to set it so it does either eddits text and adds a # to the end or a letter and then cycles thru a given sequence like say i only want it to go 1-10 or A-D/L/Z but have some kind of a way to specify and set defauls like i was talking about in the previous

PS tigrek
i agree with you on the text rotation its not really that important but say if you were aligning something with something it would probably be a good idea to know but i have sill yet to get the snipit to work later in this thread ill post the code with it set like that and show the errors i got

later guys gotta go home and fix the sink if everyone helps everybody the world will be a better place
 
Replies continue below

Recommended for you

I will post an example to show how to place text on top or right side of a line only.
 
Was just thinking a little more on the add2txt routine what about an option to add to the begining and the end at the same time how do ya goabout setting that up with what we got ??? if everyone helps everybody the world will be a better place
 
so striker what happened did you get bussy i thought you were going to show us an example of that code of how it does it :) if everyone helps everybody the world will be a better place
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor