Author Topic: Trauncate 0's where possible!  (Read 2297 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
Trauncate 0's where possible!
« on: July 20, 2007, 10:34:45 AM »
I am in the process of writing my own hatch pattern maker/editor lisp.
My current problem is the trailing 0 (zero's). I am trying to think of a way to have autolisp write the number of (to a max 4) decimal places when needed, otherwise truncate all trailing 0's.

ie.
this 0,0.0000,4.2000,12.0000,12.0000,0.0000,-4.2000,0.6000,-6.0000,0.0000,-1.2000
becomes 0,0,4.2,12,12,0,-4.2,.6,-6,0,-1.2

Any help would be appreciated.
Cheers

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Trauncate 0's where possible!
« Reply #1 on: July 20, 2007, 10:42:50 AM »
Command Reference > System Variables > D System Variables >  DIMZIN
« Last Edit: July 20, 2007, 02:25:20 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CADaver

  • Guest
Re: Trauncate 0's where possible!
« Reply #2 on: July 20, 2007, 02:17:38 PM »
Command Reference > System Variables > D System Variables >  DIMTZIN
That would be DIMZIN, wouldn't it? dimTzin is for tolerance values only.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Trauncate 0's where possible!
« Reply #3 on: July 20, 2007, 02:25:05 PM »
What the ?? You're right, I didn't notice the typo - thanks my friend.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CADaver

  • Guest
Re: Trauncate 0's where possible!
« Reply #4 on: July 20, 2007, 02:34:56 PM »
You're quite welcome

(snicker, I got one right, woo hoo)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Trauncate 0's where possible!
« Reply #5 on: July 20, 2007, 02:37:52 PM »
(snicker, I got one right, woo hoo)

{ chortle }

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Shade

  • Guest
Re: Trauncate 0's where possible!
« Reply #6 on: July 26, 2007, 10:18:23 AM »
Thanks for the help. I was just about to write some code to truncate the 0's.
Its just too easy with the system variable! :)