program correction

Discussion of Common Lisp
Post Reply
scridondarius
Posts: 1
Joined: Tue May 22, 2018 10:59 am

program correction

Post by scridondarius » Tue May 22, 2018 11:11 am

anyone can help my 3 corection need


; the program selects the circles and changes their radius by half
(defun C:radius(/ OR_OPEN OR_CLOSE filter ss tent telem tcontent
telemupper n)
; retrieve the selection set containing both
; single and multiline text objects
(setq filter (list '(0 . "CIRCLE") )
ss (ssget "X" filter)
)
; iterate over the selection set
(setq n 0)
(repeat (ssname ss)
(setq tent (entget (sslength ss n)))
(print tent)
(setq telem (assoc 40 tent))
(print telem)
(setq tcontent (cdr telem))
(print tcontent)
(setq razan (/ tcontent 2))
(print razan)
(setq telemupper (cons 10 razan))
(print telemupper)
(setq tent (subst telemupper telem tent))
(print tent);
(entmod tent)
(setq n (1+ n))
)
(princ)
)

Kohath
Posts: 61
Joined: Mon Jul 07, 2008 8:06 pm
Location: Toowoomba, Queensland, Australia
Contact:

Re: program correction

Post by Kohath » Sun Jun 17, 2018 3:24 am

Dear scridondarius

Please use the code tag:

Code: Select all

(defun C:radius (/ OR_OPEN OR_CLOSE filter ss tent telem tcontent telemupper n)
    ; retrieve the selection set containing both
    ; single and multiline text objects
    (setq filter (list '(0 . "CIRCLE"))
        ss (ssget "X" filter))
    ; iterate over the selection set
    (setq n 0)
    (repeat (ssname ss)
        (setq tent (entget (sslength ss n)))
        (print tent)
        (setq telem (assoc 40 tent))
        (print telem)
        (setq tcontent (cdr telem))
        (print tcontent)
        (setq razan (/ tcontent 2))
        (print razan)
        (setq telemupper (cons 10 razan))
        (print telemupper)
        (setq tent (subst telemupper telem tent))
        (print tent);
        (entmod tent)
        (setq n (1+ n)))
    (princ))
I'm afraid I'd need some more context to be able to help you...

Post Reply