Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

third decimal digit smaller

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
2298 Views, 9 Replies

third decimal digit smaller

Hi there.

I would like to know if there's a way to add extra customization to dimension styles; The way I use dimensions, I always assure that I have at least two decimal digits, but I work with 3 decimal digits; When I have a dimension that has mm (i work in meters), it shows the third decimal digit, but if it's a zero, it supresses it; However, I don't want it to supress the second decimal digit if it's a zero, because I've figured out in my experience people make more mistakes in the construction site if I do. I end up using a 3 decimal digit dim style, and then changing manually to 2 digits when the last the third one is a zero, but it's a time consuming process. Is there another way to work this? Something like, supress trailing zeros after the 'N'th decimal digit.

Other thing I'd like to do, because people read dimensions easier that way, is to have the third decimal digit smaller and higher than the other digits. I do this when I handsketch and most workers read those dimensions better. I know it's technically not the correct way of representation but it works so I'd like to use it in AutoCAD.

See the attached jpeg for exemples of how I'd like to be able to set upa a dim style.

Anyone knows a way of doing this? Can it be done through scripting? Thanks

 

9 REPLIES 9
Message 2 of 10
jggerth
in reply to: Anonymous

AFAIK, ther's no way to accomplish that via dimenstyles.

 

I would also find that a very confusing way of showing a distance,  since 7,42 superscript 5  means 7,42 raised to the fifth power, e.g. 7.42 X 7.42 X 7.42 X 7.42 X7.42 

 

that's very different than 7.425 .....

 

Creating 'unique' meanings that conflict with normal/typical meanings is not IMO the best way to communicte design intent.

Message 3 of 10
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

...When I have a dimension that has mm (i work in meters), it shows the third decimal digit, but if it's a zero, it supresses it; However, I don't want it to supress the second decimal digit if it's a zero ...


I think that would require a text-content override.  One could make a routine that would convert the measured value to a string using (rtos), and check for the number of decimal places, adjusting them appropriately, even within the process of drawing a dimension.  But that would mean that if you stretched whatever it's dimensioning, the dimension text would not adjust accordingly.

 

I can sort of imagine getting closer, with something that would check the measured distance, and if it would result in a one-decimal-place displayed value, tack a zero on the end, that is, make the content "<>0" [the <> representing the measured distance].  That would be better than a complete text override, because the real measured value would always be in there.  But then if you had one that measured, for example, 7,6 and that made it display as 7,60, if you stretched things so that the new actual measurement was 7,853, the displayed value would become 7,8530.

 

However, I don't think it would be hard to come up with something that you could apply only when a drawing is really finished, adjusting all dimensions that need it then, rather than doing it as you create each dimension.

Kent Cooper, AIA
Message 4 of 10
victormeyer
in reply to: Anonymous

I also use that dimension superscript "style" to convey that it's half a millimeter.

 

But, fortunately, I do not use that often, so my "solution" is:

while using a 2 decimals precision dimension, I override the text on the specific dimension, using the richtext editor to superscript the 5 (half millimeter).

 

It's not time-effective if that's the norm for your drawings, but is a quick workaround.

 

 

Hope it helps, even if 4 years later!

 

superscript.JPG

Message 5 of 10
barry2104
in reply to: Kent1Cooper

although an old post with (then) no efficient solution, I'm wondering whether perhaps newer Versions of CAD or newer knowledge in lisping may reveal an appropriate solution to this Problem?

(In Germany, it is Standard practice to have the 3rd decimal place superscripted.)

Running AutoCAD Architecture 2020, in German
Message 6 of 10
cadffm
in reply to: barry2104

Autocad(?) Is not the right product for this.
You will find some Tools to create dimension in this kind, but only with that add-ons!
If you create new or edit dimensions without that tools, the dim text is wrong again until you start the tool again.

Search for ArchDim (ArchTools) or CHBH.lsp

- Sebastian -
Message 7 of 10
Kent1Cooper
in reply to: barry2104


@barry2104 wrote:

.... newer knowledge in lisping may reveal an appropriate solution to this Problem?

(In Germany, it is Standard practice to have the 3rd decimal place superscripted.)


 

Newer thinking about it  may:

(defun C:DS3DP (/ dz dent ddata mt3 mt2 mt3rd)
;; = Dimension Superscript 3rd Decimal Place [if other than 0]
;; Currently for linear/Ordinate varieties of Dimensions only -- if used on
;; Radius or Diameter Dimension, does not prefix with R or diameter symbol; ;; if used on Angular Dimension, puts it in radians, without degrees symbol. ;; Could be made to account for those varieties....

;; Dimension Style should be set up for 2 decimal places for those whose 3rd
;; decimal place would be 0, which will be left without override. (setq dz (getvar 'dimzin)) (setvar 'dimzin (boole 2 dz 8)); force to not suppress trailing zeros;
;; may not be necessary, if Style wants 2 decimal places including zeros
;; [i.e. DIMZIN would already be something less than 8] (setq dent (car (entsel "\nSelect Dimension to superscript 3rd decimal place: ")) ddata (entget dent) mt3 (rtos (cdr (assoc 42 ddata)) 2 3); measurement as text to 3 decimal places mt2 (substr mt3 1 (1- (strlen mt3))); lopped to 2 decimal places mt3rd (substr mt3 (strlen mt3)); 3rd decimal place ); setq   (entmod
    (subst
      (cons 1
        (if (= mt3rd "0"); third decimal place is 0?
          "" ; then [to re-do previously-altered/Stretched; strip override if new 3rd place = 0]
          (strcat mt2 "{\\H0.7x;\\S" mt3rd "^;}"); else -- superscript 3rd place
        ); if
      ); cons
      (assoc 1 ddata)
      ddata
    ); subst
  ); entmod (setvar 'dimzin dz) (princ) ); defun

HOWEVER, this does have the drawback I mentioned before:  it applies a text-content override, in order to achieve the superscript, so if dimensioned stuff gets Stretched, the content will not update  for any that this altered [it would for any whose 3rd digit would be 0, since they will be left alone to show the measured length].  You would need to be conscious of that, and run the command again.  If the new length results in a 3rd decimal place of 0, it strips off  the text override, but not until you run the command on the Dimension again.

 

 

No error handling, nor multiple-Dimension usage, nor whatever other enhancements could be applied, but those are all possible.

Kent Cooper, AIA
Message 8 of 10
barry2104
in reply to: Kent1Cooper

that's great Kent - thanks.

One tweak requested, if possible:

in Germany (DACH countries), we use commas where other countries use decimal Points, and we use decimal Points where other countries use commas. So nineteen and a half meters in German is typically written 19,5 m.

Your Lisp however overrides the existing (comma)separator and inserts a decimal Point in there.

Can the code be tweaked to simply Keep the existing separator rather than override with a decimal Point?

Running AutoCAD Architecture 2020, in German
Message 9 of 10
Kent1Cooper
in reply to: barry2104


@barry2104 wrote:

 

…. Your Lisp however overrides the existing (comma)separator and inserts a decimal Point in there.

Can the code be tweaked to simply Keep the existing separator rather than override with a decimal Point?


 

It's not my code that's overriding.  It's what the (rtos) function returns.  I'm a little surprised that in a version of AutoCAD that uses commas for that in Dimensions, (rtos) doesn't use the same.  But if not, and you can't find a setting to make it do so, you can force it -- change this:

 

mt3 (rtos (cdr (assoc 42 ddata)) 2 3); measurement as text to 3 decimal places

 

to this:

 

mt3 (vl-string-translate "." "," (rtos (cdr (assoc 42 ddata)) 2 3)); measurement as text to 3 decimal places

 

Kent Cooper, AIA
Message 10 of 10
cadffm
in reply to: Kent1Cooper

 

If you want to drive someone crazy, set DIMDSEP = [0-9];)

(Attention, optional, for measurement=1 standard templates = ",")
ACAD xdata, dp1070 with integer value, representing an ASCII character, which comes after (1070 . 278)

 

@barry2104

This short solution is a "stupid" override-text, if you change the dimension because your part changes,

then the previous value still appears.
The chance to make mistakes is far too big even for D-A-CH architects, or?

You also need a nice function to toggle the pre-zero for measurements larger/smaller than 1m.

Have you even tested my example mentioned: ->  CHBH.lsp ? Old but the best4free I think.

The German programmer has made the tool available for free and no longer claims it.

 

@Kent1Cooper

CHBH edit the dimension anonym blocks, so you get a working dimension when the dimension recalculated.

 

 

@cadffm

Maybe we should add a test-function for DIMLUNIT (LUNITS for dimensions)
ACAD xdata, dp1070 with integer value, representing LUNITS, which comes after (1070 . 277)

 

 

- Sebastian -

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost