bradb Posted June 11, 2009 Share Posted June 11, 2009 Alot of time I have to change dimension unit properties form Fractional to a 3 or 4 place decimal. The property tool pallete to annoing to me. I would like to write a routine to do this via keyboard. The problem is I can't seem to find a AutoCAD command to do this. I know I can write the lisp just don't know the command. I tryed properties, change and dimtedit. None of these are right. Can someone tell the the command name I am looking for. I can take it from there. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted June 11, 2009 Share Posted June 11, 2009 Alot of time I have to change dimension unit properties form Fractional to a 3 or 4 place decimal. The property tool pallete to annoing to me. I would like to write a routine to do this via keyboard. The problem is I can't seem to find a AutoCAD command to do this. I know I can write the lisp just don't know the command. I tryed properties, change and dimtedit. None of these are right. Can someone tell the the command name I am looking for. I can take it from there. Thanks in advance. Check DIMVAR (Dimension Variables) Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted June 11, 2009 Share Posted June 11, 2009 Check DIMVAR (Dimension Variables) The variable is DIMLUNIT and DIMFRAC. From the ACAD help section: Type: Integer Saved in: Drawing Initial value: 2 Obsolete. Has no effect except to preserve the integrity of scripts. DIMUNIT is replaced by DIMLUNIT and DIMFRAC. Quote Link to comment Share on other sites More sharing options...
bradb Posted June 11, 2009 Author Share Posted June 11, 2009 The variable is DIMLUNIT and DIMFRAC. From the ACAD help section: Type: Integer Saved in: Drawing Initial value: 2 Obsolete. Has no effect except to preserve the integrity of scripts. DIMUNIT is replaced by DIMLUNIT and DIMFRAC. Thanks I look everywhere including autocad help never came across this thanks again I will try them Quote Link to comment Share on other sites More sharing options...
bradb Posted June 11, 2009 Author Share Posted June 11, 2009 The variable is DIMLUNIT and DIMFRAC. From the ACAD help section: Type: Integer Saved in: Drawing Initial value: 2 Obsolete. Has no effect except to preserve the integrity of scripts. DIMUNIT is replaced by DIMLUNIT and DIMFRAC. Those only seem to work for next time dimensions. I'm want to change a existing dimension as of now If I have a dimension on screen with fractional 1/64 precision and want to change it to decimal with .xxx precision I have to select dimension - properties (which brings up the properties tool pallete) change fractional to decimal then change .xxxxxx to .xxx precision. I wondering if I could write a lisp that command to3plcs select dimensions to change result change dimensions from fractional to a 3 places decimal Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted June 11, 2009 Share Posted June 11, 2009 Those only seem to work for next time dimensions. I'm want to change a existing dimension as of now If I have a dimension on screen with fractional 1/64 precision and want to change it to decimal with .xxx precision I have to select dimension - properties (which brings up the properties tool pallete) change fractional to decimal then change .xxxxxx to .xxx precision. I wondering if I could write a lisp that command to3plcs select dimensions to change result change dimensions from fractional to a 3 places decimal Try the command Dimoverride Also in ACAD help under commands Overrides dimensioning system variables DIMOVERRIDE overrides dimensioning system variable settings that are associated with a dimension object but doesn't affect the current dimension style. You can also use the command to clear overrides from dimensions. Dimension menu: Override Command line: dimoverride Enter dimension variable name to override or [Clear overrides]: Enter the name of a dimension variable, or enter c Dimension Variable Name to Override Overrides the value of the dimensioning system variable you specify. Enter new value for dimension variable : Enter a value or press ENTER If you enter a new value, AutoCAD redisplays the Dimension Variable Name to Override prompt. If you press ENTER, AutoCAD prompts you to select the dimensions. Select objects: Use an object selection method to select the dimensions AutoCAD applies the overrides to the selected dimensions. Clear Overrides Clears any overrides on selected dimensions. Select objects: Use an object selection method to select the dimensions AutoCAD clears the overrides, and the dimension objects return to the settings defined by their dimension style. Quote Link to comment Share on other sites More sharing options...
bradb Posted June 11, 2009 Author Share Posted June 11, 2009 Try the command Dimoverride Also in ACAD help under commands Thanks for the help. I'll check out the override command but for now this is working (defun c:to3plc () (setq OLDDIMDEC (getvar "DIMDEC") OLDDIMLUNIT (getvar "DIMLUNIT") );end setq (setvar "DIMDEC" 3) (setvar "DIMLUNIT" 2) (command "dim" "update" pause pause) (command "exit") (setvar "DIMDEC" OLDDIMDEC) (setvar "DIMLUNIT" OLDDIMLUNIT) (princ) );end defun Quote Link to comment Share on other sites More sharing options...
bradb Posted June 12, 2009 Author Share Posted June 12, 2009 (defun c:t3 (/ OLDDIMDEC OLDDIMLUNIT) (setq OLDDIMDEC (getvar "DIMDEC") OLDDIMLUNIT (getvar "DIMLUNIT") );end setq (setvar "DIMDEC" 3) (setvar "DIMLUNIT" 2) (command "dim" "update" pause pause) (command "exit") (setvar "DIMDEC" OLDDIMDEC) (setvar "DIMLUNIT" OLDDIMLUNIT) (princ) );end defun Problem with this on is it works fine if you select on one command. If you select more than on then dim variable do not get set back. I need it to be able to select mulitply dimension convert them to 3 plc decimal and have the dim varible be set back to what they were before exicuting the command. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 12, 2009 Share Posted June 12, 2009 try this Bradb: (defun c:T3 (/ ss Objlst) (vl-load-com) (if (setq ss (ssget '((0 . "DIMENSION")))) (progn (setq objlst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (mapcar (function (lambda (x) (vla-put-UnitsFormat x acDimLDecimal))) ObjLst) (mapcar (function (lambda (x) (vla-put-PrimaryUnitsPrecision x acDimPrecisionThree))) ObjLst)) (princ "\n<< Nothing Selected >>")) (princ)) Quote Link to comment Share on other sites More sharing options...
bradb Posted June 12, 2009 Author Share Posted June 12, 2009 try this Bradb: (defun c:T3 (/ ss Objlst) (vl-load-com) (if (setq ss (ssget '((0 . "DIMENSION")))) (progn (setq objlst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (mapcar (function (lambda (x) (vla-put-UnitsFormat x acDimLDecimal))) ObjLst) (mapcar (function (lambda (x) (vla-put-PrimaryUnitsPrecision x acDimPrecisionThree))) ObjLst)) (princ "\n<< Nothing Selected >>")) (princ)) Thanks Lee that works but i need more. I do not understand visual lisp so i dont know what to edit on this lisp. I need 3 more commands t3m to change to 3plc and move text to outside line (DIMTMOVE 0) tf to change to fractional (DIMLUNIT 5 DIMFRAC 1) tfm to change to fractional and move text to outside line (DIMTMOVE 0) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 12, 2009 Share Posted June 12, 2009 Like this? (defun c:3plc (/ ss Objlst) (vl-load-com) (if (setq ss (ssget '((0 . "DIMENSION")))) (progn (setq objlst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (mapcar (function (lambda (x) (vla-put-TextMovement x acDimLineWithText))) ObjLst)) (princ "\n<< Nothing Selected >>")) (princ)) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 12, 2009 Share Posted June 12, 2009 Or maybe: (defun c:tfm (/ ss Objlst) (vl-load-com) (if (setq ss (ssget '((0 . "DIMENSION")))) (progn (setq objlst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (mapcar (function (lambda (x) (vla-put-UnitsFormat x acDimLFractional))) ObjLst) (mapcar (function (lambda (x) (vla-put-PrimaryUnitsPrecision x acDimPrecisionFive))) ObjLst) (mapcar (function (lambda (x) (vla-put-TextMovement x acDimLineWithText))) ObjLst)) (princ "\n<< Nothing Selected >>")) (princ)) Quote Link to comment Share on other sites More sharing options...
bradb Posted June 12, 2009 Author Share Posted June 12, 2009 Or maybe: (defun c:tfm (/ ss Objlst) (vl-load-com) (if (setq ss (ssget '((0 . "DIMENSION")))) (progn (setq objlst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (mapcar (function (lambda (x) (vla-put-UnitsFormat x acDimLFractional))) ObjLst) (mapcar (function (lambda (x) (vla-put-PrimaryUnitsPrecision x acDimPrecisionFive))) ObjLst) (mapcar (function (lambda (x) (vla-put-TextMovement x acDimLineWithText))) ObjLst)) (princ "\n<< Nothing Selected >>")) (princ)) Thanks that works I'm trying the Visiual Lisp Help Tutorials now so maybe i learn to write them on my own Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 12, 2009 Share Posted June 12, 2009 Its not too difficult once you get the hang of it 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.