Message 1 of 10
Error: Bad Function: 7 when trying to add local variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
New to coding autolisp, I'm trying to make a simple lisp to add a user input number to a block attribute so far I have the input and the attribute value assigned to variables but the problem comes when I try to add them. I get error bad function: 7 as a response to running this.
(defun C:IterBlock (/ ent blk tag, old, val, inc, new)
(setq ent (car (entsel)))
(setq blk (vlax-ename->vla-object ent))
(setq tag "TAG")
(setq old (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (vla-get-textstring att))) (vlax-invoke blk 'getattributes)))
(setq inc (getint "Increment "))
(setq val (read old))
(setq new (+ val inc))
)
Am I just doing the summation wrong?