ILoveMadoka Posted July 22, 2021 Share Posted July 22, 2021 This code works perfectly in what it does (if (setq A2 (ssget "_X" '((0 . "TEXT,MTEXT")))) (foreach ent (mapcar 'cadr (ssnamex A2)) (vla-put-layer (vlax-ename->vla-object ent) "TEXT") (vla-put-color (vlax-ename->vla-object ent) "256") (vla-put-lineweight (vlax-ename->vla-object ent) "-1") (vla-put-linetype (vlax-ename->vla-object ent) "ByLayer") ) ) I want to add a line to also change the text style. I thought it would be as simple as this (vla-put-stylename (vlax-ename->vla-object ent) "MyPredefinedTextStyle") but that does not work. I've tried a couple of these vla-put-activetextstyle vla-put-fontfile vla-put-stylename vla-put-textfont vla-put-textfontstyle vla-put-textstyle vla-put-textstylename (but not all) so I thought I'd ask. Am I close or way off base? Quote Link to comment Share on other sites More sharing options...
mhupp Posted July 22, 2021 Share Posted July 22, 2021 (edited) that's it make sure its not on a locked/forzen layer. might not work if text is inside a block. (vla-put-stylename (vlax-ename->vla-object ent) "standard") also make sure you spelling the named style right. Edited July 22, 2021 by mhupp Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted July 23, 2021 Author Share Posted July 23, 2021 Gahhhhhh!! I had it correct but I had a typo in my style name! Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.