블럭안의 색상을 하나로 변경시키는 리습인데요~
vl-load 명령어를 command 명령어로 변경 시켜주실분 계신가요~
lt버전에 icomtools를 사용해서 vl-load 명령어가 안되는거 같습니다.
고수님들의 도움을 요청드려요~
(defun c:bQ ( / oDocument BlockNameList )
(vl-load-com)
(setq oDocument (vla-get-activedocument (vlax-get-acad-object)))
(setq BlockNameList nil)
(and
(setq Sset (ssget (list (cons 0 “INSERT”))))
(setq col (strcase (getstring “n>> 색상 번호를 입력하세요 ? : “)))
(foreach item (mapcar ‘(lambda(x) (cdr (assoc 2 (entget x)))) (vl-remove-if ‘listp (mapcar ‘cadr (ssnamex Sset))))
(if (not (member item BlockNameList)) (setq BlockNameList (cons item BlockNameList)))
)
) ;and
(foreach BlockName BlockNameList (change:colorinblock oDocument BlockName col)) ;col 색
(vla-regen oDocument acallviewports)
(princ)
) ; defun
;==============================================
(defun change:colorinblock ( Document BlockName Color )
(vl-load-com)
(vlax-for item (vla-item (vla-get-blocks Document) BlockName)
(vla-put-color item Color)
(if (eq (vla-get-objectname item) “AcDbBlockReference”)
(change:colorinblock Document (vla-get-name item) Color)
) ;if
)
) ; defun