bbryson_2000 Posted February 25, 2016 Share Posted February 25, 2016 I need a lisp routine that will draw a pline with a defined width of 1/32". User to give a start point and an end point. Thanks .......JerryB Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted February 25, 2016 Share Posted February 25, 2016 Use PLINEWID sysvar and when set correct width 1/32'' continue to draw pline with standard PLINE command... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 25, 2016 Share Posted February 25, 2016 (defun c:mypline ( / plw ) (setq plw (getvar 'plinewid)) (setvar 'plinewid 0.03125) (vl-cmdf "_.pline") (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\")) (setvar 'plinewid plw) (princ) ) Quote Link to comment Share on other sites More sharing options...
bbryson_2000 Posted February 25, 2016 Author Share Posted February 25, 2016 That was quick... Thank you very much... I will try this later today. Jerry Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 26, 2016 Share Posted February 26, 2016 Simple and to the point as usual Lee a thought referring to the error trapping reactor posted previously by me, the user would type p132 on command line ie pline 1/32 wide p18 1/8 so no hard coding of width. Watch this space. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 26, 2016 Share Posted February 26, 2016 Have a go at this you will need to do P0-03125 for a 1/32 width 2nd version could do p132 ; Enter the filet radius as part of a command line entry f100, offset O234, circle c123-45, P123 for pline width ; note - is used for decimal point ; original code and methology by Alan H ; assistance and code that worked by Lee-Mac ; OCT 2015 ( (lambda nil (vl-load-com) (foreach obj (cdar (vlr-reactors :vlr-command-reactor)) (if (= "fillet-reactor" (vlr-data obj)) (vlr-remove obj) ) ) (vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback))) ) ) (defun plwid ( / width oldwidth) (setq width (distof (substr com 2) 2)) (setq oldwidth (getvar 'plinewid)) (if (<= 0.0 width) (progn (setvar 'plinewid width ) (vla-sendcommand fillet-reactor-acdoc "_.pline ") (setvar 'plinewid oldwidth) ) ) ) (defun filletrad ( / rad) (setq rad (distof (substr com 2) 2)) (if (<= 0.0 rad) (progn (setvar 'filletrad rad) (vla-sendcommand fillet-reactor-acdoc "_.fillet ") ) ) ) (defun makecirc ( / rad) (setq rad (distof (substr com 2) 2)) (if (<= 0.0 rad) (progn (setvar 'circlerad rad) (vla-sendcommand fillet-reactor-acdoc "_.Circle ") ) ) ) (defun offdist ( / dist) (setq dist (distof (substr com 2) 2)) (if (<= 0.0 dist) (progn (setvar 'offsetdist dist) (vla-sendcommand fillet-reactor-acdoc "_.Offset ") ) ) ) (defun fillet-reactor-callback ( obj com ) (setq com (vl-string-translate "-" "." (strcase (car com)))) (cond ( (and (wcmatch com "~*[~F.0-9]*") (wcmatch com "F*") (wcmatch com "~F*F*") (wcmatch com "~*.*.*") ) ; and (filletrad) ) ( (and (wcmatch com "~*[~C.0-9]*") (wcmatch com "C*") (wcmatch com "~C*C*") (wcmatch com "~*.*.*") ) ;and (makecirc) ) ( (and (wcmatch com "~*[~O.0-9]*") (wcmatch com "O*") (wcmatch com "~O*O*") (wcmatch com "~*.*.*") ) ; and (offdist) ) ( (and (wcmatch com "~*[~P.0-9]*") (wcmatch com "P*") (wcmatch com "~P*P*") (wcmatch com "~*.*.*") ) ; and (plwid) ) ) ; master cond ) ; defun (princ) (or fillet-reactor-acdoc (setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object))) ) (princ) ; next Point or option keyword required. 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.