Author Topic: Need some help.  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

MvdP

  • Guest
Need some help.
« on: May 11, 2010, 01:31:12 PM »
Don't know if this the right or best way to do this.
I want the result to show in a dcl and it shows decimals.
How can  I oppress the decimal places?


LSP
Code: [Select]
(setq aperture (rtos(getvar "aperture")))
(set_tile "aperture" aperture)

DCL
Code: [Select]
:text{key = "aperture" ;width = 20;}
« Last Edit: May 11, 2010, 01:37:19 PM by MvdP »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need some help.
« Reply #1 on: May 11, 2010, 02:16:56 PM »
To suppress the decimal places use this

Code: [Select]
(setq aperture (rtos(getvar "aperture") 2 0))
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.

Crank

  • Water Moccasin
  • Posts: 1503
Re: Need some help.
« Reply #2 on: May 11, 2010, 02:26:21 PM »
Also study the DIMZIN variable.

Controls the suppression of zeros in the primary unit value. DIMZIN stores this value when you enter it on the command line or set it under Primary Units in the Annotation dialog box. DIMZIN values 0-3 affect feet-and-inch dimensions only.

Vault Professional 2023     +     AEC Collection

efernal

  • Bull Frog
  • Posts: 206
Re: Need some help.
« Reply #3 on: May 11, 2010, 03:14:52 PM »
as aperture must be an integer between 1 and 50, why not use ITOA?

(SET_TILE "XXX" (ITOA (GETVAR "APERTURE")))

e.fernal
e.fernal

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need some help.
« Reply #4 on: May 11, 2010, 03:35:44 PM »
Yes that's the correct way. 8-)
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.

MvdP

  • Guest
Re: Need some help.
« Reply #5 on: May 12, 2010, 01:47:28 AM »
Thanks e.fernal
Working great.