Tharwat Posted July 11, 2012 Posted July 11, 2012 Try this ... (defun c:Test (/ *error* p1 p2 e w) (vl-load-com) ;;; Tharwat 11. July. 2012 ;;; (defun *error* (msg) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")) ) (princ) ) (if (not (tblsearch "LAYER" "A-Wall-Patt")) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(2 . "A-Wall-Patt") '(62 . 252) '(70 . 0)) ) ) (if (and (setq p1 (getpoint "\n Specify first point :")) (setq p2 (getpoint p1 "\n Next point :")) ) (setq e (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(8 . "A-Wall-Patt") '(90 . 2) '(70 . 0) (cons 10 (trans p1 1 0)) (cons 10 (trans p2 1 0)) ) ) ) ) (if (setq w (getdist "\n Specify width of Polyline :")) (vla-put-constantwidth (vlax-ename->vla-object e) w) (princ) ) (princ) ) Quote
SLW210 Posted July 11, 2012 Posted July 11, 2012 Grigs, Please read the CODE POSTING GUIDELINES and edit the code in your post. Quote
Grigs Posted July 11, 2012 Author Posted July 11, 2012 Tharwat I really appreciate all the help you've given me. One last thing. 'w' defines the width of the polyline. What if I wanted the width to be 0.5 inches less than the picked width? How would that code be implemented. Quote
Grigs Posted July 24, 2012 Author Posted July 24, 2012 Tharwat, the lisp routine works well. I just have 1 question. Is it possible to alter the lisp to that you can pick multiple points? For instance, if you had a corner situation. The lisp would let you keep picking points then you would pick the 2 points that define the width and the entire polyline would be that width. Quote
Tharwat Posted July 25, 2012 Posted July 25, 2012 Grigs said: Tharwat, the lisp routine works well. I just have 1 question. Is it possible to alter the lisp to that you can pick multiple points? For instance, if you had a corner situation. The lisp would let you keep picking points then you would pick the 2 points that define the width and the entire polyline would be that width. Is this what you mean ..... ? (defun c:Test (/ *error* e w) (vl-load-com) ;;; Tharwat 11. July. 2012 ;;; (defun *error* (msg) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")) ) (princ) )(setq e nil) (if (not (tblsearch "LAYER" "A-Wall-Patt")) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord" ) '(100 . "AcDbLayerTableRecord" ) '(2 . "A-Wall-Patt") '(62 . 252) '(70 . 0)) ) ) (command "_.pline") (while (eq (getvar 'cmdactive) 1) (command pause)) (if (setq w (getdist "\n Specify width of Polyline :")) (progn (vla-put-layer (setq e (vlax-ename->vla-object (entlast))) "A-Wall-Patt" ) (vla-put-constantwidth e w) ) (princ) ) (princ) ) Quote
Grigs Posted July 25, 2012 Author Posted July 25, 2012 Once again you came thru for me. Works perfectly. Thanks!!! Quote
Tharwat Posted July 25, 2012 Posted July 25, 2012 Grigs said: Once again you came thru for me. Works perfectly. Thanks!!! You're welcome any time . Quote
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.