Jump to content

Turning dimension leaders on and off


JerryFiedler

Recommended Posts

Greetings,

I have buttons on a panel to make dimensions either with both leaders, one leader (first or second) and no leaders. The macro on a the "both leaders" button is: ^C^C(setvar "dimse1" 0)(setvar "dimse2" 0);_dimlinear

The other buttons have the same macro but the values for the variables are either 1 or 0 as appropriate.

 

When I first open AutoCAD the "both leaders" works fine and the others also work. I can switch back and forth between the single leaders and no leaders but when I go back to use the "both leaders" button the dimension repeats the previous setting. The only way to return to both leaders is by entering the system variables on the command line.

 

What am I doing wrong? Any help will be greatly appreciated.

 

Regards,

Jerry

Link to comment
Share on other sites

Not sure if its what you are after, but I wrote this a while back...

 

;; Toggles the display of Dimension Extension Lines
;; Helpful when OSnapping near dimensions!

(defun c:dtog ( / doc ss )
 (vl-load-com)
 ;; © Lee Mac  ~  11.06.10
 
 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))

 (if (ssget "_X" '((0 . "DIMENSION")))
   (progn
     (vla-StartUndoMark doc)
     (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))                  
       (if (vl-every
             (function
               (lambda ( p ) (vlax-property-available-p obj p))
             )
             '(ExtLine1Suppress ExtLine2Suppress)
           )
         (mapcar
           (function
             (lambda (x) (vlax-put obj x (~ (vlax-get obj x))))
           )
           '(ExtLine1Suppress ExtLine2Suppress)
         )
       )
     )
     (vla-delete ss)
     (vla-EndUndoMark doc)
   )
 )
 (princ)
)

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...