Jump to content

AECC Label Styles Editing Via LISP


broncos15

Recommended Posts

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)?

Link to comment
Share on other sites

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 by rkmcswain
add more info & correct typo in code
Link to comment
Share on other sites

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 by rkmcswain
Correct typo
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...