This LISP is not working in my case...
Command do run but furthur steps are not asked after performing the action..
Please Provide solution
Hi
AutoCAD has taken the command but further it's not executing the same...even after REGEN
Another solution
Replace all texts in simplex, romans, etc... in arial
(defun c:arial(/ chg doc ele obj) (defun chg(obj) (and (vlax-property-available-p obj 'stylename) (vl-position (strcase (vla-get-stylename obj)) '("ROMANS" "SIMPLEX" "TXT")) (vla-put-stylename obj "Arial") ) ) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark doc) (vlax-for ele (vla-get-blocks doc) (vlax-for obj ele (if (eq (vla-get-objectname obj) "AcDbBlockReference") (mapcar 'chg (vlax-invoke obj 'getattributes)) (chg obj) ) ) ) (vla-endundomark doc) (princ) )
@+
Hi
same error coming ...to be specific i want to convert all text styles in drawing to romans.shx
Hi,try this.
(defun c:demo (/ DOC FNTPTH STY ) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object) ) ) (setq FntPth (findfile "C:\\Windows\\Fonts\\arial.ttf")) (setq sty (vla-get-textstyles doc)) (vlax-for s sty (vla-put-fontfile s FntPth) ) (if (ssget "x" '((0 . "text"))) (vlax-for n (vla-get-activeselectionset doc) ) ) (vla-regen doc acAllViewports) (princ) )
Hi,
cool !!!..it's working....but i want to convert all text styles to "ROMANS.shx"...I made small changes in your lsp but doesn't work.Could you do that ?...I'm waiting...
Ok,try this.
(defun c:demo (/ DOC FNTPTH STY ) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object) ) ) (setq FntPth (findfile "ROMANS.shx")) (setq sty (vla-get-textstyles doc)) (vlax-for s sty (vla-put-fontfile s FntPth) ) (if (ssget "x" '((0 . "text"))) (vlax-for n (vla-get-activeselectionset doc) ) ) (vla-regen doc acAllViewports) (princ) )
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
Алексей Кулик aka kpblc | Aleksei Kulik aka kpblc Facebook | LinkedIn
autolisp.ru
Техническая поддержка программистов Autodesk в СНГ
Библиотека пользовательских lisp-функций | Custom Lisp-function library
I told - romas.shx could be placed at c:\windows\fonts, not at ACAD support folders. Secondary - style could be used BigFont. My code makes BigFont off. You can use your code or any other versions - noone can say to you what to do and how to do it 😉
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
Алексей Кулик aka kpblc | Aleksei Kulik aka kpblc Facebook | LinkedIn
autolisp.ru
Техническая поддержка программистов Autodesk в СНГ
Библиотека пользовательских lisp-функций | Custom Lisp-function library