Message 1 of 8

Not applicable
10-08-2019
03:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am having a problem with a part of my code. In this part, (i made it so that you can run independently) it asks you the block to change and the attribute value to change. Unfortunately, it says that there's too few arguments when I give the input.
Here's the code:
(defun c:abc (/ b l blk layertable layname) (setq blk (entsel "\nSelect block to modify: ")) (initget (+ 1 2 4)) (setq b (getreal "\nNew att value? (>0;1<)"))
;open layer (setq LayerTable (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) (if (and (tblsearch "LAYER" "MC_BLOCK") (setq layname (vla-item layertable "MC_BLOCK")) (= (vlax-get-property layname 'lock) :vlax-true) ) (vla-put-lock layname :vlax-false)) ;change attribute (setq l (cons (cons "CAMPO_6" (itoa (fix b))))) ;close layer (setq LayerTable (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) (if (and (tblsearch "LAYER" "MC_BLOCK") (setq layname (vla-item layertable "MC_BLOCK")) (= (vlax-get-property layname 'lock) :vlax-false) ) (vla-put-lock layname :vlax-true)) (princ) )
Thanks in advance
Solved! Go to Solution.