Alexia Posted June 7, 2024 Posted June 7, 2024 Hello, Does anyone have a lisp routine to quickly create curb lines? I'm looking for a LISP that can be done in one command line and two clicks: 1. Request to select a polyline and change it to P-PVMT-FOC layer 2. Ask to click in a direction above or below the first line, create a new polyline with a 0.5' offset and move this new line to P-PVMT-BOC 3. Create another polyline in the opposite direction from the second one with a 1.5' offset from the initial FOC line and move it to P-PVMT-EOP layer. To summarize: BOC -0.5- FOC -----1.5'----- EOP Thanks a lot!!! Quote
f700es Posted June 7, 2024 Posted June 7, 2024 Here is a free set of Civil cad tools that might be of some use. I'm not sure if there was any curb tools there. https://www.glamsen.se/CadTools.htm Quote
ronjonp Posted June 7, 2024 Posted June 7, 2024 @Alexia Give this a try: (defun c:foo (/ _lyr s) ;; RJP » 2024-06-07 (defun _lyr (e l) (entmod (append (entget e) (list (cons 8 l))))) (cond ((setq s (ssget ":L" '((0 . "LWPOLYLINE")))) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (_lyr e "P-PVMT-FOC") (and (setq p (getpoint "\nPick 0.5 offset side")) (command "_.offset" 0.5 e p "")) (_lyr (entlast) "P-PVMT-BOC") (and (setq p (getpoint "\nPick 1.5 offset side")) (command "_.offset" 1.5 e p "")) (_lyr (entlast) "P-PVMT-EOP") ) ) ) (princ) ) Quote
BIGAL Posted June 8, 2024 Posted June 8, 2024 (edited) Another method, if you pick a pline and want fixed offsets a simple trick is pick near start end, this can give direction of pline then use VLA-Offset will go left or right then automatically. ; change single pline to multiple ; By AlanH June 2024 (defun c:drawcurb ( / off1 off2 ent pt obj start end d1 d2 obj2 ent2) (command "-layer" "m" "P-PVMT-FOC" "C" 1 "" "M" "P-PVMT-BOC" "C" 2 "" "m" "P-PVMT-EOP" "C" 3 "" "") ; added in case layers don't exsit (setq off1 0.5 off2 1.5) (setq ent (entsel "\nPick pt near start of pline ")) (setq pt (cadr ent)) (setq obj (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj)) (setq end (vlax-curve-getendPoint obj)) (setq d1 (distance pt start)) (setq d2 (distance pt end)) (if (< d1 d2) (command "Pedit" ent "R" "") ) (setq ent2 (entget (car ent))) (entmod (subst (cons 8 "P-PVMT-FOC") (assoc 8 ent2) ent2)) (setq obj2 (vla-offset obj off1)) (setq ent2 (entget (entlast))) (entmod (subst (cons 8 "P-PVMT-BOC") (assoc 8 ent2) ent2)) (setq obj2 (vla-offset obj off2)) (setq ent2 (entget (entlast))) (entmod (subst (cons 8 "P-PVMT-EOP") (assoc 8 ent2) ent2)) (princ) ) (c:drawcurb) Ps if I have side wrong change change (> d1 d2) Edited June 8, 2024 by BIGAL 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.