hidxb123 Posted November 23, 2016 Posted November 23, 2016 (edited) Friends Please help to add suffix in the following lisp , i need suffix increment along with no's increment Example 1A,2A The starting no i want to type on the screen unless it will be '1' (DEFUN C:WS() (setvar "insunits" 4) (setvar "dimasz" 3.0) (command "snap" "off") (SETQ NUM (getint "\nEnter Weld No. [1]: ")) (if (= NUM nil) (SETQ NUM (fix 1))) (while (setq P1 (getpoint "\nSelect First Point: ")) (setq P2 (getpoint "\nSelect Second Point: ")) (command "donut" 0 3.2 P1 "" ".dim" "lea" P1 P2 ^C "exit" "circle" P2 "6.40") (setq Las1 (entlast)) (command "TRIM" Las1 "" P2 "" "erase" Las1 "" "-insert" "C:\\hpc\\SYM_S0.dwg" "S" "14" p2 "" NUM ) (setq NUM (1+ NUM)) );while );defun Edited November 23, 2016 by hidxb123 Quote
asos2000 Posted November 23, 2016 Posted November 23, 2016 Give this a try http://lee-mac.com/numinc.html Quote
hidxb123 Posted November 23, 2016 Author Posted November 23, 2016 Please edit in my lisp , Give this a tryhttp://lee-mac.com/numinc.html Quote
hidxb123 Posted November 23, 2016 Author Posted November 23, 2016 Dear Girr Can you please edit on my lisp , Related task. Quote
Grrr Posted November 23, 2016 Posted November 23, 2016 Dear Girr Can you please edit on my lisp , Try it, I can't test it: (defun C:WS ( / *error* Svars num suff P1 P2 ) (defun *error* (m) (and Svars (mapcar 'setvar (mapcar 'car Svars) (mapcar 'cdr Svars))) (print m) (princ) ) (setq Svars (mapcar '(lambda (x) (cons x (getvar x))) '("INSUNITS" "DIMASZ" "CMDECHO"))) (and Svars (mapcar 'setvar (mapcar 'car Svars) '(4 3.0 0))) (command "_.SNAP" "OFF") (or (setq num (getint "\nEnter Weld No. < 1 >:")) (setq num 1)) (setq suff (getstring "\nSpecify Suffix: ")) (while (and (setq P1 (getpoint "\nSelect First Point: ")) (setq P2 (getpoint "\nSelect Second Point: "))) (if (not (command "_.DONUT" 0 3.2 P1 "" ".dim" "lea" P1 P2 ^C "exit" "CIRCLE" P2 "6.40")) (command "_.TRIM" (entlast) "" P2 "" "erase" (entlast) "" "-INSERT" "C:\\hpc\\SYM_S0.dwg" "S" "14" P2 "" (strcat (rtos num 2 0) suff) ) ) (setq num (1+ num)) );while (and Svars (mapcar 'setvar (mapcar 'car Svars) (mapcar 'cdr Svars))) (princ) ) 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.