johnpieter Posted June 3, 2011 Share Posted June 3, 2011 any body help!!!for place the leader line with text with particular layer(like 'Error' layer).! Quote Link to comment Share on other sites More sharing options...
ketxu Posted June 4, 2011 Share Posted June 4, 2011 I thing that you have to make a lisp to do that.... Something like that : (defun c:le (/ lst10 str ent) (setq oldlay (getvar "clayer")) (grtext -1 "Free Lisp LE from Cad-viet @ketxu") ;(setvar "clayer" "KCVN-MANH") : Leader Layer,del ";" and change with your layer (defun loc (lst vl /) (setq lst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) vl)) lst)))) (command "_qleader" pause pause pause) (command \U+001B) (setq ent (entget (entlast))) (setq lst10 (loc ent 10)) (setq str (getstring T "\n Input String : ")) ;(setvar "clayer" "KCVN-TEXT") ; Dtext Layer, del ";" and change with your layer (setq mp (mapcar '+ (nth 1 lst10) (nth 2 lst10)) mp (mapcar '* mp '(0.5 0.5 0.5))) (wtxt_l str (mapcar '+ mp '(0.0 0.7 00))) ; 0.7 : space from text to Line Leader along Y axis (setvar "clayer" oldlay) ) (defun wtxt_l(txt p / sty d h1 h2 wf h) ;;;Write txt on graphic screen at p, midle bottom (setq sty (getvar "textstyle") d (tblsearch "style" sty) h1 (cdr (assoc 40 d)) h2 (cdr (assoc 42 d)) wf (cdr (assoc 41 d))) (if (> h1 0) (setq h h1) (setq h h2)) (entmake (list (cons 0 "TEXT") (cons 7 sty) (cons 40 h) (cons 41 wf)(cons 72 1)(cons 11 p) (cons 1 txt) (cons 10 p)))) Quote Link to comment Share on other sites More sharing options...
johnpieter Posted June 4, 2011 Author Share Posted June 4, 2011 I want create One Layer "Error" and its should(Text and Leader) automatically place on that layer.How to correct this?any one help please? (defun c:Test (/ p1 p2 p3) (setvar “clayer” “Error”) (if (and (setq p1 (getpoint "\nSpecify leader Starting point: ")) (setq p2 (getpoint p1 "\nSpecify Next point: ")) ) (progn (grdraw p1 p2 7 1) (setq p3 (getpoint p2 "\nSpecify Next point : ")) (redraw) (initdia) (if p3 (progn (command "_.leader" "_non" p1 "_non" p2 "_non" p3 "_A" "" "_M" "") (command "_.leader" "_non" p1 "_non" p2 "_A" "" "_M" "") ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
ketxu Posted June 5, 2011 Share Posted June 5, 2011 Try this : (defun c:Test (/ p1 p2 p3) (setvar "clayer" "Error") (if (and (setq p1 (getpoint "\nSpecify leader Starting point: ")) (setq p2 (getpoint p1 "\nSpecify Next point: ")) ) (progn (grdraw p1 p2 7 1) (setq p3 (getpoint p2 "\nSpecify Next point <Annotation>: ")) (redraw) (initdia) (if p3 (command "_.leader" "_non" p1 "_non" p2 "_non" p3 "_A" "" "_M") (command "_.leader" "_non" p1 "_non" p2 "_A" "" "_M") ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
johnpieter Posted June 5, 2011 Author Share Posted June 5, 2011 thanks a lot ketxu..here how to define the text height and text colur ketxu Quote Link to comment Share on other sites More sharing options...
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.