Jump to content

Dimension Property Edit


bradb

Recommended Posts

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ac.chickletred.gif

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.

 

ac.mouse.gif Dimension menu: Override

ac.keyboard.gif 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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


Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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