Author Topic: Modifying an old routine  (Read 1648 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Modifying an old routine
« on: March 08, 2016, 01:16:16 PM »
I cleaning today, and found this routine I think I used a long time ago. Its alittle different than how we do things now. I was wondering how I could get it to act like this:

10 SPACES @ 9.0000 = 90.0
(Now this text override the dim <>)

Its close to what we do now, but how could I get it to read:

10 SPACES @ 9.0'=<>


Code: [Select]
(defun C:SPACE_COUNT  (/ ename obj dim div total fract)
  (setq ename (car (entsel "\nSelect dimension: ")))
  (setq obj (vlax-ename->vla-object ename))
  (setq dim (vla-get-measurement obj))
  (if (not def)
    (setq def 1))
  (setq div (getdist (strcat "\nDivide into <" (rtos def) ">: ")))
  (if (not div)
    (setq div def)
    (setq def div))

  (setq total (/ dim div))
  (setq fract (- total (fix total)))

  (vla-put-textoverride
    obj
    (strcat (itoa (fix total))
    " SPACES @ "
    (rtos div)
    " = "
    (rtos (* (fix total) div) 2 1)))
  (princ))


Thank you for any help!
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Modifying an old routine
« Reply #1 on: March 08, 2016, 02:04:24 PM »
replace these 2 lines:

             " = "
       (rtos (* (fix total) div) 2 1)))

with:

             " = <>"
       ))

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Modifying an old routine
« Reply #2 on: March 08, 2016, 02:18:16 PM »
replace these 2 lines:

             " = "
       (rtos (* (fix total) div) 2 1)))

with:

             " = <>"
       ))
You beat me to it....lol

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Modifying an old routine
« Reply #3 on: March 08, 2016, 02:25:44 PM »
just want to point this out. After seeing that, I do feel alittle dumb lol. I should have caught that one.

Ok got one more for you. I am trying to get the value "9" to show up in the label as 9.0'. Any ideas?
Civil3D 2020

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Modifying an old routine
« Reply #4 on: March 08, 2016, 02:54:54 PM »
DIMLUNIT=2
DIMDEC=1
DIMPOST=<>'