round off

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun c:BOP()
(defun _Text ( str)
(entmake
(list
'(000 . "TEXT")
(cons 007 (getvar 'textstyle))
(cons 001 str)
(cons 050 ang)
(cons 040 hgt)
(cons 010 tp)
(cons 011 tp)
'(072 . 1)
'(073 . 2)
(cons 210 ocs)
)
)
)
(setvar "osmode" 16383)
(setq osn (getvar "osmode"))
(setvar "osmode" osn)
(setq S1 (getdist "\nEnter Previous BOP:"))
(setq P (getdist "\nEnter Slope %:"))
(setq p1 (getpoint "\n Pipe Running Start Point: "))
(setq p2 (getpoint p1 "\n Pipe Running end Point: "))
(setq L (distance p1 p2))
(setq S2 (/ L P))
(setq BOP1 (- S1 S2))
(setvar "osmode" 0)
(setq tp (getpoint "\n Text Placing Point: "))
(setvar "osmode" osn)
(setq BOP2 (rtos BOP1 2 2))
(setq str (strcat "BOP " BOP2 " SOS"))
(setq hgt (getvar 'textsize)
ocs (trans '(0.0 0.0 1.0) 1 0 t)
ang (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t))
)
(_Text str )
(princ)
)
i this programe i want to round off BOP1 into end 0 or 5
eg; 233.23(235) 232.1(230) 232.7(235)
any one help me