broncos15 Posted June 27, 2016 Share Posted June 27, 2016 I had a quick question if it is possible to turn off all the background masks for 3D label styles. I have 2 identical drawings (one is just a copy of the other that is done at the end of the project), one which must have the background mask on, and one that cannot have them on. I am wanting to quickly turn off the background masks, which is easy for things like dimensions, mtext, multileaders, etc., but I can't figure out how to do this for AECC label styles. Is there some quick way to do this (especially because editing label styles is a time consuming process)? Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted June 27, 2016 Share Posted June 27, 2016 (edited) Threw this together from some existing similar code (hence the dumb var names...) (defun c:foo () (setq C3Ddoc (vla-get-activedocument (vla-getinterfaceobject (vlax-get-acad-object) "AeccXUiLand.AeccApplication.11.0") ;; number will vary, this is for 2017 ) ) (setq gnl (vlax-get C3Ddoc 'GeneralNoteLabelStyles)) (setq std (vlax-get-property gnl 'item "Standard")) ;; Name of the style here. (setq xxxx (vlax-get std 'TextComponents)) (setq yyyy (vlax-get-property xxxx 'item 0)) (setq zzzz (vlax-get yyyy 'BorderStyle)) (vlax-put-Property zzzz 'BackGroundMask :vlax-false) ) Your mileage may vary, as there are a lot of assumptions made here and this is only a sample for one single style. Basically, you just have to drill your way down to the object you want to modify, then modify it. No guarantees that the API exists for each object you may want to modify however. Edited June 28, 2016 by rkmcswain add more info & correct typo in code Quote Link to comment Share on other sites More sharing options...
broncos15 Posted June 27, 2016 Author Share Posted June 27, 2016 (edited) Threw this together from some existing similar code (hence the dumb var names...) (defun c:foo () (setq C3Ddoc (vla-get-activedocument (vla-getinterfaceobject (vlax-get-acad-object) "AeccXUiLand.AeccApplication.11.0") ;; number will vary, this is for 2017 ) ) (setq gnl (vlax-get C3Ddoc 'GeneralNoteLabelStyles)) (setq std (vlax-get-property gnl 'item "Standard")) ;; Name of the style here. (setq xxxx (vlax-get std 'TextComponents)) (setq yyyy (vlax-get-property xxxx 'item 0)) (setq zzzz (vlax-get yyyy 'BorderStyle)) (vlax-put-Property zzzz 'BackGroundMask :vlax-false) ) Your mileage may vary, as there are a lot of assumptions made here and this is only a sample for one single style. Basically, you just have to drill your way down to the object you want to modify, then modify it. No guarantees that the API exists for each object you may want to modify however. Thank you! So for my instance, I'll need to find all the label styles present in the document, then just do a repeat loop over all of them to change the property. I'll begin messing with it and see what I can do. Thanks again for the help. Edited June 28, 2016 by rkmcswain Correct typo Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 28, 2016 Share Posted June 28, 2016 Is this correct vlax:falss Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted June 28, 2016 Share Posted June 28, 2016 Fixed. Thanks. 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.