hanhphuc Posted August 9, 2014 Share Posted August 9, 2014 https://www.dropbox.com/s/ph62nf8iit6b76s/ATTRIB.zip if failed then pm me your email address Quote Link to comment Share on other sites More sharing options...
AIberto Posted August 9, 2014 Author Share Posted August 9, 2014 (edited) https://www.dropbox.com/s/ph62nf8iit6b76s/ATTRIB.zipif failed then pm me your email address sorry! I means : I can't open "dropbox.com" , Can you email to me ? Edited August 9, 2014 by AIberto Quote Link to comment Share on other sites More sharing options...
AIberto Posted August 9, 2014 Author Share Posted August 9, 2014 I use this very simple routine to draw an arrow: by alanjt (defun c:Arrow (/ a b) ;; Draw quick arrow ;; Alan J. Thompson (if (and (setq a (getpoint "\nSpecify first point: ")) (setq b (getpoint a "\nSpecity next point: ")) ) (command "_.leader" "_non" a "_non" b "" "" "_N") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 11, 2014 Share Posted August 11, 2014 If use the arrow, the leader would not associated with the MTEXT i don't understand why not using normal arrow by leader it's associative. however you can opt settings (qleader p1 p2 str sz sty t ) t / nil switch. If you wanna change text height manually, just standard command: textsize Updated DOV.lsp v1.1 here anything? Quote Link to comment Share on other sites More sharing options...
AIberto Posted August 11, 2014 Author Share Posted August 11, 2014 If use the arrow, the leader would not associated with the MTEXTi don't understand why not using normal arrow by leader it's associative. however you can opt settings (qleader p1 p2 str sz sty t ) t / nil switch. If you wanna change text height manually, just standard command: textsize Updated DOV.lsp v1.1 here anything? Thanks Hp! It's good! I can accept the way of the qleader . But ,I don't want input "O" to set. I need pop-up dialog when run command. if can without attribute block... Quote Link to comment Share on other sites More sharing options...
AIberto Posted August 11, 2014 Author Share Posted August 11, 2014 Why don't you use the code of #15 Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 11, 2014 Share Posted August 11, 2014 (edited) Thanks Hp! It's good!I can accept the way of the qleader . But ,I don't want input "O" to set. I need pop-up dialog when run command. if can without attribute block... always pop up? just remove "run once" flag, 'if 'statement before 'while' [color="red"](if *dov:run-once*[/color] <----remove this (dov:dcl) [color="red"]) ;_ end of if [/color] <----remove this (while... The animated gif at 1st post can be done using grread effect, but just a fancy visual effect. yes, something like Lee Mac LM:grtext is cool This's my grread idea, (hp:pointer pt color entity) more flexible ok. i don't use vlax-curve- , but my method just use osnap "_nea" object Edited August 16, 2014 by hanhphuc add demo animation Quote Link to comment Share on other sites More sharing options...
AIberto Posted August 11, 2014 Author Share Posted August 11, 2014 always pop up? just remove "run once" flag, 'if 'statement before 'while' [color="red"](if *dov:run-once*[/color] <----remove this (dov:dcl) [color="red"]) ;_ end of if [/color] <----remove this (while... The animated gif at 1st post can be done using grread effect, but just a fancy visual effect. yes, something like Lee Mac LM:grtext is cool your means when Insert label.. ,use grread to Real-time status display ? ? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted August 29, 2014 Share Posted August 29, 2014 Good job! hanhphuc. Thank you for sharing. Quote Link to comment Share on other sites More sharing options...
andy_lee Posted August 29, 2014 Share Posted August 29, 2014 This is a simple example of drawing arrow. (defun c:tt () (setvar "CMDECHO" 0) (setq txt (getstring "\nEnter Text: ")) (while (and (setq pt1 (getpoint "\nStart point: ")) (setq pt2 (getpoint pt1 "\nEnd point: "))) (setq dis (distance pt1 pt2) ang (angle pt1 pt2) ang2 (angle pt2 pt1) ll (/ dis 4) dd (/ dis 10) ptm (mapcar '(lambda(a b) (/ (+ a b) 2)) pt1 pt2)) (setq ang1 (if (< (/ (* pi 2) 3) ang (/ (* pi 5) 3)) pi 0)) (setq an (+ ang (/ pi 2) ang1)) (command "_.PLINE" pt1 (polar pt2 ang2 ll) "W" dd 0 pt2 "") (if (/= txt "") (command "_.TEXT" "TC" (polar ptm an ll) dd (/ (* (- an (/ pi 2)) 180) pi) txt) ) ) (setvar "CMDECHO" 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 1, 2014 Author Share Posted September 1, 2014 This is a simple example of drawing arrow. (defun c:tt () (setvar "CMDECHO" 0) (setq txt (getstring "\nEnter Text: ")) (while (and (setq pt1 (getpoint "\nStart point: ")) (setq pt2 (getpoint pt1 "\nEnd point: "))) (setq dis (distance pt1 pt2) ang (angle pt1 pt2) ang2 (angle pt2 pt1) ll (/ dis 4) dd (/ dis 10) ptm (mapcar '(lambda(a b) (/ (+ a b) 2)) pt1 pt2)) (setq ang1 (if (< (/ (* pi 2) 3) ang (/ (* pi 5) 3)) pi 0)) (setq an (+ ang (/ pi 2) ang1)) (command "_.PLINE" pt1 (polar pt2 ang2 ll) "W" dd 0 pt2 "") (if (/= txt "") (command "_.TEXT" "TC" (polar ptm an ll) dd (/ (* (- an (/ pi 2)) 180) pi) txt) ) ) (setvar "CMDECHO" 1) (princ) ) @andy. A good example. Thanks for sharing . Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 1, 2014 Share Posted September 1, 2014 This is a simple example of drawing arrow.[\CODE] Thanx, is good for sharing credit to author DOV.lsp uses simple arrow by guru AlanJT's Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 1, 2014 Author Share Posted September 1, 2014 Thanx, is good for sharing credit to author DOV.lsp uses simple arrow by guru AlanJT's Dear hanhphuc. The new version done yet? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 1, 2014 Share Posted September 1, 2014 (edited) hi AIberto,This is just sub-functions credit to LM & mjtd's ;; Arc to Bulge - Lee Mac ;; c - center ;; a1,a2 - start, end angle ;; r - radius ;; Returns: (<vertex> <bulge> <vertex>) (defun [color="red"]LM:Arc->Bulge[/color] ( c a1 a2 r ) (list (polar c a1 r) ( (lambda ( a ) (/ (sin a) (cos a))) (/ (rem (+ pi pi (- a2 a1)) (+ pi pi)) 4.0) ) (polar c a2 r) ) ) ; courtesy mjtd's ...谁? (defun [color="red"]sk_mk_arc01[/color] (pt r ang1 ang2 l_lay l_col l_lt l_lts l_lw ) (if(and pt r ang1 ang2) (entmakex (list '(0 . "ARC") (cons 8 (if l_lay l_lay (getvar 'clayer))) (if l_col (cons 62 l_col)(cons 62 256)) (if l_lt (cons 6 l_lt)(cons 6 "bylayer")) (cons 48 (if l_lts l_lts (getvar 'celtscale))) (if l_lw (cons 370 l_lw)(cons 370 0)) (cons 10 pt) (cons 40 r) (cons 50 ang1) (cons 51 ang2) ) ) ) ) ;refer to mjtd's code #15 shared by AIberto (defun [color="red"]dov:arc[/color] ( pt r ccw? / l obj ap bp p1 p2 p3 ang1 ang2 bulge ) (if (and pt (not (= ccw? ""))) (progn (setq l (* 0.5 r)) (setq obj (vlax-ename->vla-object ([color="red"]sk_mk_arc01[/color] pt r 0 pi nil nil nil nil nil))) (setq ap '("StartPoint" "EndPoint") bp (mapcar ''((a b) (set (eval 'a) (vlax-get obj b))) '(p1 p3) (if ccw? ap (reverse ap) ) ;_ end of if ) ;_ end of mapcar p2 (vlax-curve-getPointAtDist obj (if ccw? (- (vla-get-arclength obj) l) l ) ;_ end of if ) ;_ end of vlax-curve-getPointAtDist ang1 (angle pt p2) ang2 (if ccw? 0 pi ) ;_ end of if bulge (cadr ([color="red"]LM:Arc->Bulge[/color] pt (if ccw? ang2 ang1 ) ;_ end of if (if ccw? ang1 ang2 ) ;_ end of if r ) ;_ end of LM:Arc->Bulge ) ;_ end of cadr ) ;_ end of setq (vla-delete obj) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 3) (cons 10 p1) (cons 42 (if ccw? bulge (* -1.0 bulge) ) ;_ end of if ) ;_ end of cons (cons 10 p2) (cons 40 (/ l 3.0)) (cons 41 0) (cons 10 p3) ) ;_ end of list ) ;_ end of entmakex ) ;_ end of progn ) ;_ end of if (princ) ) ;_ end of defun The grread effect, (hp:pointer ..) download link already in post #27 i'll just optimize an additional draw-arc function dov:arc if attributed CW.dwg & ACW.dwg broken support path or removed. i'll let you know whether need to repost new code or minor modification.... Edited September 1, 2014 by hanhphuc update image Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 1, 2014 Author Share Posted September 1, 2014 hi AIberto,This is just sub-functions credit to LM & mjtd's The grread effect, (hp:pointer ..) download link already in post #27 i'll just optimize an additional draw-arc function dov:arc if attributed CW.dwg & ACW.dwg broken support path or removed. i'll let you know whether need to repost new code or minor modification.... Sorry! I don't know how to do ! Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 1, 2014 Share Posted September 1, 2014 (edited) Just need to clarify, the routine only inserts attrib blocks if exist in support folder, so it normally draws ARC & Mtext as you requested. For your convenient i upload as attachment: DOV_1.2 (vanilla).LSP Edited September 3, 2014 by hanhphuc Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 1, 2014 Author Share Posted September 1, 2014 Just need to clarify, the routine only inserts attrib blocks if not exist in support folder, so it normally draws ARC & Mtext as you requested.For your convenient i upload as attachment: Nice routine. hanhphuc. Thank you very much! You seem to forget . If exist curved arrow , so No need the text "Rotation" How to modify the distance between the arrow and Mtext . Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 3, 2014 Author Share Posted September 3, 2014 @ Dear friend hanhphuc. The arrow on the left or on the right, it doesn't matter . If exist curved arrow , so No need the text "Rotation" Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 3, 2014 Share Posted September 3, 2014 sorry.. i just tested in block insertion btw, spot progn of last few lines, modify in blue. (defun c:dov [color="#696969"]( / ....) ... ... ... ... [color="black"](progn [/color](setq pt (trans pt 1 0))[/color] (dov:MTEXT [color="blue"] (if (= arc "") (strcat *SYM* " Rotation\\P\\O" *VSC*)(strcat *SYM* "\\P\\O" *VSC*))[/color] (polar pt (atan (apply '/ (cdr (reverse (getvar "ucsxdir"))))) (* txh [color="red"]6.[/color])) ;[color="red"]<--- space= text height x6[/color] txh ) ;_ end of dov:MTEXT[color="#696969"] (dov:arc pt txh arc) [color="black"]) ;_ end of progn [/color] ) ;_ end of if ) ;_ end of progn (if (= dd 1) (unload_dialog dcl_id) ) ;_ end of if ) ;_ end of if (setq *dov:run-once* nil) (princ)[/color] ) ;_ end of defun This is not pure vanilla anymore since i mixed with mjtd's code also dov:arc's "undocumented vlax-get" (credit to Tharwat & LM) Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 3, 2014 Author Share Posted September 3, 2014 sorry.. i just tested in block insertionbtw, spot progn of last few lines, modify in blue. This is not pure vanilla anymore since i mixed with mjtd's code also dov:arc's "undocumented vlax-get" (credit to Tharwat & LM) OK! Thanks so much! hanhphuc, 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.