Author Topic: Dimension text (inches only)  (Read 3638 times)

0 Members and 1 Guest are viewing this topic.

VerticalMojo

  • Guest
Dimension text (inches only)
« on: October 22, 2004, 03:39:06 PM »
This may be a easy one but I don’t use dimensions to often....

When I dimension a conduit rack (for example) and the dimension falls under 3'-0" how do I get the settings to show the dimension text only in inches and not feet and inches? I don’t want to use the text override if possible....

Thanks

VM  :?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Dimension text (inches only)
« Reply #1 on: October 22, 2004, 03:43:02 PM »
Override the individual dimension (if you don't want to modify your dimension style) to display in fractional format in the primary units. You can even add a suffix of an inch mark.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ELOQUINTET

  • Guest
Dimension text (inches only)
« Reply #2 on: October 22, 2004, 03:49:20 PM »
that's how our dimension style are setup fractional with " suffix  :wink:

VerticalMojo

  • Guest
Dimension text (inches only)
« Reply #3 on: October 22, 2004, 04:00:39 PM »
Wow.... I always used text override.  :shock: big no no  

Thanks Keith... I learn something new everyday  :)

BTW.... This may fall under the "CAD Standards" but.... Good drafting etiquette calls for dims under 3' (is it 3'?) to be inches correct?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Dimension text (inches only)
« Reply #4 on: October 22, 2004, 04:28:58 PM »
I wouldn't go that far VM, but I would suggest that many smaller dimensions are more easily read and interpreted if they are shown in inches only.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #5 on: October 22, 2004, 04:42:48 PM »
Quote from: Keith
Override the individual dimension (if you don't want to modify your dimension style) to display in fractional format in the primary units. You can even add a suffix of an inch mark.

Ok now we need a button to do automatically :D
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

VerticalMojo

  • Guest
Dimension text (inches only)
« Reply #6 on: October 22, 2004, 04:47:31 PM »
YES YES!  :D

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #7 on: October 23, 2004, 07:50:16 AM »
I did find this, it converts the dims <24 to fraction but does not add the inch mark.
There are others that deal with the dim overrides but it takes a lot of code as they are stored in x-data.
Revised : added the line to update the Override if no Override
Code: [Select]
(defun c:dova (/ ss ss2 ent obj meas prec txtov)
  ;;;
  ;;; Program prompts for a selection set filtered for
  ;;; dimensions only. It then applies a fractional units
  ;;; dimension override only to dimensions less then 24"
  ;;;
  ;;; Steve Doman
  ;;;
  ;;;  Revised by CAB 10/24/2004 to add <>" to override if no override
  ;;;
  (vl-load-com)
  (graphscr)
  (prompt "\nDimension Override Apply: Fraction < 24\"")
  (setq n 0
        ss2 (ssadd))
  (if (setq ss (ssget ":L" '((0 . "DIMENSION"))))
    (progn
      (princ
        (strcat "\n" (itoa (sslength ss)) " dimensions found ")
      )
      (repeat (sslength ss)
        (setq ent (ssname ss n))
        (setq obj (vlax-ename->vla-object ent))
        (setq meas (vla-get-measurement obj))
        (if (and (vlax-property-available-p obj 'PrimaryUnitsPrecision)
                 (vlax-property-available-p obj 'TextOverride)
            )
          (progn
            (setq prec (vla-get-primaryunitsprecision obj))
            (setq txtov (vla-get-textoverride obj))
            (if (and (< (distof (rtos meas 5 prec) 2) 24.0)
                     (or (= txtov "")
                         (wcmatch txtov "*<>*")
                     )
                )
              (progn
               (vla-put-textoverride obj "<>\""); CAB
               (setq ss2 (ssadd ent ss2))
              )
            )
            (setq n (1+ n))
          )
        )
      )
      (if ss2
        (progn
          (setvar "cmdecho" 0)
          (command ".dimoverride" "lunit" "5" "" ss2 "")
          (setvar "cmdecho" 1)
          (princ
            (strcat
              "   "
              (itoa (sslength ss2))
              " dimension(s) Dova'd "
            )
          )
        )
        (princ
          "   No dimensions found measuring less than 24\""
        )
      )
    )
  ) ;end big if

  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #8 on: October 23, 2004, 09:35:38 AM »
Well turns out it's not difficult at all using visual lisp.
Here is my version. Repeats until Enter or missed pick.
Code: [Select]
;;;  Dim2Inches.lsp
;;;
;;; FUNCTION
;;; change Dimension units to Fractions and add " to override
;;;
;;; ARGUMENTS
;;; none
;;;
;;; USAGE
;;; d2i
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2004 Charles Alan Butler
;;; ab2draft@TampaBay.rr.com
;;;
;;; VERSION
;;; 1.0 Oct. 23, 2004
;;; YOU MAY USE THIS CODE ONLY FOR *NON-COMMERCIAL*
;;; PURPOSES AND ONLY IF YOU RETAIN
;;; THIS HEADER COMPLETE AND UNALTERED
;;; you must contact me if you want to use it commercially
;;;
(defun c:d2i (/ ent obj )
  (vl-load-com)
  (graphscr)
  (while (setq ent (entsel "\nSelect Dimention to convert to inches."))
    (if (= (cdr (assoc 0 (setq elst (entget (car ent))))) "DIMENSION")
      (progn
        (setq ent (car ent)
              obj (vlax-ename->vla-object ent))
        (if (and (vlax-property-available-p obj 'primaryunitsprecision)
                 (vlax-property-available-p obj 'textoverride)
            )
          (progn
            (vla-put-UnitsFormat obj 5)
            (if (member (vla-get-textoverride obj) '("" "<>"))
              (progn
                (vla-put-textoverride obj "<>\"")
              ) ; progn
              (prompt "\n*-* Text Override already in effect, to Fractions only...")
            ) ; endif
          ) ; progn
          (prompt "\n*-* Can not edit this Dimension Object, Canceled...")
        ) ; endif
        (vlax-release-object obj)
      ) ; progn
      (prompt "\nNot a dimension.")
    ) ; endif
  )
  (princ)
)
(prompt "\nDim to Inches loaded, Enter d2i to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADwoman

  • Guest
Dimension text (inches only)
« Reply #9 on: March 17, 2005, 02:51:08 PM »
Good job CAB!

I made a revision to replace Textoverride object with TextSuffix. This way it puts the " as the suffix and not an override.
 
Code: [Select]
;;;  Dim2Inches.lsp
;;;  Dim2Inches.lsp
;;;
;;; FUNCTION
;;; change Dimension units to Fractions and add " to override
;;;
;;; ARGUMENTS
;;; none
;;;
;;; USAGE
;;; d2i
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2004 Charles Alan Butler
;;; ab2draft@TampaBay.rr.com
;;;
;;; VERSION
;;; 1.0 Oct. 23, 2004
;;; YOU MAY USE THIS CODE ONLY FOR *NON-COMMERCIAL*
;;; PURPOSES AND ONLY IF YOU RETAIN
;;; THIS HEADER COMPLETE AND UNALTERED
;;; you must contact me if you want to use it commercially
;;;
;;; REVISED By VINCENT POON
;;; VERSION
;;; 1.1 Mar. 17, 2005
;;;
(defun c:d2i (/ ent obj )
  (vl-load-com)
  (graphscr)
  (while (setq ent (entsel "\nSelect Dimention to convert to inches."))
    (if (= (cdr (assoc 0 (setq elst (entget (car ent))))) "DIMENSION")
      (progn
        (setq ent (car ent)
              obj (vlax-ename->vla-object ent))
        (if (and (vlax-property-available-p obj 'primaryunitsprecision)
                 (vlax-property-available-p obj 'textoverride)
            )
          (progn
            (vla-put-UnitsFormat obj 5)
            (if (member (vla-get-TextSuffix obj) '("" "<>"))
              (progn
                (vla-put-TextSuffix obj "<>\"")
              ) ; progn
              (prompt "\n*-* Text Override already in effect, to Fractions only...")
            ) ; endif
          ) ; progn
          (prompt "\n*-* Can not edit this Dimension Object, Canceled...")
        ) ; endif
        (vlax-release-object obj)
      ) ; progn
      (prompt "\nNot a dimension.")
    ) ; endif
  )
  (princ)
)
;(prompt "\nDim to Inches loaded, Enter d2i to run.")
(princ)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #10 on: March 17, 2005, 03:40:35 PM »
Thank you
and thanks for the update.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Hangman

  • Guest
Dimension text (inches only)
« Reply #11 on: March 23, 2005, 11:42:08 AM »
Morn'n all,
I was a look'n at CADwomans update here, but haven't been able to figure it out.  (I'm tone deaf see, don't understand VLA yet)
This isn't working for me, it doesn't show the " mark.  Looking at the properties, in the suffix, I have the \X listed.

Is there something missing ???  Also, appearantly the DIMPOST system variable gives the suffix label, would this have anything to do with it ??? Or I should ask, does the DIMPOST need to be listed in the lisp for it to work properly ???
Can someone help me with this, I don't know how to edit VLA, I'm ignorant to it.

Thanks.

Hangman

  • Guest
Dimension text (inches only)
« Reply #12 on: March 23, 2005, 01:02:50 PM »
Hey,  I actually figured it out.  COOL !!!
Never you mind, gott-it.
on the line:
  (progn
     (vla-put-TextSuffix obj "<>\"")
  ) ; progn
there needs to be a space like so;
    (vla-put-TextSuffix obj "<>\" ")
Cool eh ?.  :D

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #13 on: March 23, 2005, 01:15:40 PM »
I changed that line to this
Code: [Select]
(vla-put-TextSuffix obj "\"")
as the <> is not needed
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dimension text (inches only)
« Reply #14 on: March 23, 2005, 02:06:17 PM »
One more update:
This one will use suffix first but if in use, tries the override before quitting.

Code: [Select]
;;;  Dim2Inches.lsp
;;;
;;; FUNCTION
;;; change Dimension units to Fractions and add " to override
;;;
;;;
;;; ARGUMENTS
;;; none
;;;
;;; USAGE
;;; d2i
;;;
;;; PLATFORMS
;;; 2000+
;;;
;;; AUTHOR
;;; Copyright© 2004 Charles Alan Butler
;;; ab2draft@TampaBay.rr.com
;;;
;;; VERSION  1.0 Oct. 23, 2004
;;; YOU MAY USE THIS CODE ONLY FOR *NON-COMMERCIAL* PURPOSES AND ONLY
;;;  IF YOU RETAIN THIS HEADER COMPLETE AND UNALTERED
;;;
;;; you must contact me if you want to use it commercially
;;;
;;; REVISED By VINCENT POON
;;; VERSION  1.1 Mar. 17, 2005
;;;
;;; REVISED By CAB
;;; VERSION  1.2 Mar. 23, 2005
;;;  Changed to dimension to FRACTIONS & adds " to the suffix if empty
;;;   else adds " to the override if empty else does nothing
;;;
(defun c:d2i (/ ent obj )
  (vl-load-com)
  (graphscr)
  (while (setq ent (entsel "\n>>-->  Select Dimention to convert to inches."))
    (if (= (cdr (assoc 0 (setq elst (entget (car ent))))) "DIMENSION")
      (progn
        (setq ent (car ent)
              obj (vlax-ename->vla-object ent))
        (if (and (vlax-property-available-p obj 'primaryunitsprecision)
                 (vlax-property-available-p obj 'textoverride)
            )
          (progn
            (vla-put-UnitsFormat obj 5) ; make Fractional
            ;; changed from vla-get-textoverride to vla-get-TextSuffix
            (cond
              ((member (vla-get-TextSuffix obj) '("" "<>"))
                (vla-put-TextSuffix obj "\"")
              ) ; Suffix
              ((member (vla-get-textoverride obj) '("" "<>"))
                (vla-put-textoverride obj "<>\"")
               (prompt "\n*-* Text Suffix already in use, created override. *-*")
              )
              (T
                (prompt "\n*--* Text Suffix & Override in use, Change to Fractions.")
              )
            ) ; end cond stmt
          ) ; progn
          (prompt "\n**** Can not edit this Dimension Object, Canceled...")
        ) ; endif
        (vlax-release-object obj)
      ) ; progn
      (prompt "\n<<<  Not a dimension  >>>")
    ) ; endif
  )
  (princ)
)
;(prompt "\nDim to Inches loaded, Enter d2i to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.