Grigs,
Please read the CODE POSTING GUIDELINES and edit the code in your post.
Registered forum members do not see this ad.
Try this ...
Code:(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) )
- When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said
Grigs,
Please read the CODE POSTING GUIDELINES and edit the code in your post.
“A narrow mind and a fat head invariably come on the same person” Zig Zigler
![]()


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.


Nevermind, I got it.


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 ..... ?
Code:(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) )
- When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said


Once again you came thru for me. Works perfectly. Thanks!!!
Bookmarks