MSasu Posted March 25, 2012 Posted March 25, 2012 I am talking about this property To overide this property on dimensions please check this thread. Regards, Mircea Quote
jan_ek Posted March 25, 2012 Author Posted March 25, 2012 Will it be fine. Will there be the unexpected errors. (defun a_sc (/ dims sc) (vl-load-com) (setq dims (car (entsel "\nPick Dimension line: "))); (setq sc (vla-get-ScaleFactor (vlax-ename->vla-object dims))) ) Quote
MSasu Posted March 25, 2012 Posted March 25, 2012 Your code works well on my station; the only correction that I can suggest is to add a protection for missed/wrong selection: (defun a_sc ( / dims sc) (vl-load-com) (prompt "\nPick Dimension line... ") (if (setq dims (ssget "_:S:E" '((0 . "DIMENSION")))) (setq sc (vla-get-ScaleFactor (vlax-ename->vla-object (ssname dims 0)))) ) ) Regards, Mircea Quote
Lee Mac Posted March 25, 2012 Posted March 25, 2012 Another, should you wish to use Vanilla AutoLISP: ;; Get DimScale - Lee Mac ;; Returns the DimScale for a supplied Dimension Entity ;; dim = Dimension entity (defun _getdimscale ( dim / _override->dxf ) (defun _override->dxf ( lst / x1 ) (if (setq x1 (assoc 1070 lst)) (cons (cons (cdr x1) (cdar (setq lst (cdr (member x1 lst))))) (_override->dxf lst) ) ) ) (cond ( (cdr (assoc 40 (_override->dxf (cdadr (assoc -3 (entget dim '("ACAD")))))))) ( (cdr (assoc 40 (tblsearch "DIMSTYLE" (cdr (assoc 3 (entget dim))))))) ) ) Test Function: (defun c:test ( / s ) (if (setq s (ssget "_+.:E:S" '((0 . "DIMENSION")))) (_getdimscale (ssname s 0)) ) ) Quote
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.