Jump to content

Is this worth a routine?


ILoveMadoka

Recommended Posts

We use two decimal places as a standard.

 

Is it possible to have an app that when run will return a 3 place

distance under these conditions?

(ie: Let's say I have a distance of .375 which when dimensioned displays .38, I want to verify the distance without having to change my units to three decimal places so that if I pick a distance I get the actual .375)

 

I'd like to be able to pick the distance (two points) and have the 3 place distance returned to the command line.

 

If there is a simpler workaround, Please instruct me!!

 

Thanks!!

Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    9

  • ReMark

    8

  • alanjt

    5

  • ILoveMadoka

    4

Top Posters In This Topic

Posted Images

Why not just change the precision of your drawing length units? I think AutoCAD goes out to 8 decimal places. Precise enough for you?

Link to comment
Share on other sites

I want to verify the distance without having to change my units to three decimal places

 

Why not just change the precision of your drawing length units?

 

... :) ...

Link to comment
Share on other sites

Perhaps:

 

(defun c:dist2 (/ p1 p2 Units Prec)

 (setq Units [color=Red][b]2[/b][/color] Prec [color=Red][b]3[/b][/color])

 (and (setq p1 (getpoint "\nFirst Point: "))
      (setq p2 (getpoint "\nSecond Point: " p1))
      (princ (strcat "\nDistance: " (rtos (distance p1 p2) Units Prec))))

 (princ))

Link to comment
Share on other sites

You are most accommodating Lee. Maybe I don't get it. Type Dist2 and pick two points to obtain a distance between them to three decimal places. OK. That part I do get. But if I set up my template with Units set to three decimal places and type the command alias for the distance command (di) and pick my two points how is that different? Unless of course I want to round off for display purposes whilst retaining three decimal point accuracy. I think even the rounding off could be set up in DimStyles, right?

Link to comment
Share on other sites

OK...

I guess I can't assume anything here..

 

We have two decimal places setup as our STANDARD for all dimensions.

If you pull a DIST command, you get a two place decimal distance.

(Am I totally off base acad newbie with this??)

There are clients that force (and enforce) a strict 2 decimal place standard.

 

To clarify...

I HAVE TO HAVE MY UNITS SET TO TWO DECIMAL PLACES!

What I'm looking for (and haven't tried the code yet) is to run the DIST

command WITHOUT changing ANYTHING yet still getting a 3 decimal place answer all the while my drawing remains at 2 decimal places per our company standard. It is only for doing Q/A.

 

If I allow users to change the units they'll forget to set it back and then place

dimensions with three decimal places which creates it's own set of problems.

 

I'm sorry but if you've had drafters work for you, you know have to idiot proof everything...

 

 

In my best neanderthal voice...

 

DUHHHHHH...

Units Command?

Never heard of that before!!!

Is that new??

Link to comment
Share on other sites

Lee,

 

As always your code works flawlessly and is exactly what I was looking for!

I appreciate both your knowledge (and sense of humor!)

 

Thanks for putting up with, and helping all of us!!

Link to comment
Share on other sites

What you see in the command line and what you see in the dimensions are set up completely differently.

 

The dimensions may be obligatory at two decimal places, but that does not prevent you from enjoying as many decimal places as you please in the command line.

Luprec.jpg

Link to comment
Share on other sites

Lee,

 

As always your code works flawlessly and is exactly what I was looking for!

I appreciate both your knowledge (and sense of humor!)

 

Thanks for putting up with, and helping all of us!!

 

No worries - I'm happy to code, and leave the actual AutoCAD'ing to others :)

Link to comment
Share on other sites

The UNITS command has been around for quite a while. Any newbie should have encountered it in AutoCAD basics.

 

I believe there is a way, in DimStyle to force AutoCAD to round up or down from three places to two.

 

If you draw/design to an accuracy of three decimal places I would think that a "good" thing. Making you round off to two places, in my opinion, is not necessarily a good thing. 0.375 becomes 0.38 and 0.372 becomes 0.37?

Link to comment
Share on other sites

Yep, I found it. DimStyles. Setting the precision of Round off option.

 

Round off.jpg

 

The straight line after the two zeros is not a "1" it's where my cursor ended up.

 

So as you see, you had at your fingertips the means to do what you wanted to do all along as provided for by your AutoCAD program.

 

Seek and ye shall find.

Link to comment
Share on other sites

ReMark, I wouldn't be that harsh... the way I see it is that ILoveMadoka knew about the precision in the UNITs command, but overlooked the precision as set in the dimstyle.

Link to comment
Share on other sites

While it may not be common or make the best sense, I can see either different designers within your own company (or engineers for that matter) or different customers calling things out in different ways. So I don't think the original reasoning driving ILoveMadoka's inquiry is all that strange.

 

What one engineer calls 3/8th, the model builder in the shop might call .375, and the new intern who just learned about significant digits but has yet to take a metrology class might call .38 (not realizing that the model maker will interpret two decimal places to +/- 0.010 and three decimal places to +/- 0.005). I once had an intern working in my group who asked for a very basic tool to be made with +/-0.001 just because the class she had recently taken talked about machine shop processes that could handle such tight tolerances. Sure, it could be made to that tolerance, but at 5X the lead time and cost! And when +/-0.05 is plenty, why go to the extra trouble.

 

So, depending upon the office environment, the number of CAD users and end users of the drawings, and the nature of the product, I could see where such functionality would be good to have.

 

And don't forget that one guy in the office who drafts everything in metric just to be a pain. Then you have to figure in the roundoff consequences of the conversion. :P

Link to comment
Share on other sites

What you see in the command line and what you see in the dimensions are set up completely differently.

 

The dimensions may be obligatory at two decimal places, but that does not prevent you from enjoying as many decimal places as you please in the command line.

 

Eldon, are you saying there is a setting somewhere to change the precision of the numbers returned in the command line (like from a dist inquiry)? If so, please instruct me as to how to do that. This would be useful to me at times, and I have not come across that customization anywhere yet.

 

Thanks!

Link to comment
Share on other sites

Eldon, are you saying there is a setting somewhere to change the precision of the numbers returned in the command line (like from a dist inquiry)? If so, please instruct me as to how to do that. This would be useful to me at times, and I have not come across that customization anywhere yet.

 

UNITS, as illustrated by ReMark above.

 

And as Eldon stated, your Dimstyle units and your Drawing units are two separate things. You can have your Dimstyle units set to 2 places but still have your Drawing units set to 4 places.

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