(defun c:distoncurve
( / *error* rtosta statof c r ch f dc st txts otxts lp p att attd bl loop gr gp a d bll atl
)
(defun *error* ( msg
/ bln
) )
)
)
;; rtosta by ymg September 2013 ;
;; ;
;; Arguments: sta Real number to format as a Station ;
;; unit 1 for Imperials, ;
;; 2 for Metrics. ;
;; prec Integer for number of decimals ;
;; ;
;; Examples: (rtosta 0 1 0) -> "0+00" (rtosta 1328.325 1 2) -> "13+28.33" ;
;; (rtosta 0 2 0) -> "0+000" (rtosta 1328.325 2 2) -> "1+328.33" ;
;; ;
;; If sta is negative, format is as follow: ;
;; (rtosta -1328.325 1 2) -> "13-28.33" ;
;; (rtosta -1328.325 2 2) -> "1-328.33" ;
;; ;
(defun rtosta
( sta unit prec
/ str a b dz
)
(while (< (strlen str
) (if (= prec
0) (+ unit
2) (+ prec
(+ unit
3)))) )
)
)
;; statof by ymg September 2013 ;
;; ;
;; Argument: String in format of a Station. ;
;; ;
;; Examples: (statof "0+00") -> 0.0 (statof "13+28.33") -> 1328.33 ;
;; (statof "1+328.33") -> 1328.33 ;
;; ;
;; If sta is negative, format is as follow: ;
;; (statof "13-28.33") -> -1328.33 ;
;; (statof "1-328.33") -> -1328.33 ;
;; ;
(defun statof
( sta
/ p
) )
)
(prompt "\nPicked entity doesn't belong to curve entities... Try again...") )
(setq ch
(getkword "\nDo you want to operate on real length or corrected length [Yes/No] (Yes-real) (No-corrected) : ")) (setq dc
(getdist "\nPick or specify corrected length of curve : ")) )
)
(setq st
(getstring "\nSpecify starting distance of curve in format <0+000.00> : ")) '(0 . "ATTDEF")
'(100 . "AcDbEntity")
'(100 . "AcDbText")
'(1 . "DISTANCE")
(cons 50 (* 3.0 (/ pi
2.0))) '(41 . 1.0)
'(51 . 0.0)
'(7 . "Standard")
'(71 . 0)
'(72 . 0)
'(10 0.0 0.0 0.0)
(* pi -0.5)
)
)
'(210 0.0 0.0 1.0)
'(100 . "AcDbAttributeDefinition")
'(280 . 0)
'(3 . "DISTANCE-Prompt")
'(2 . "DISTANCE")
'(70 . 0)
'(73 . 0)
'(74 . 1)
'(280 . 0)
)
)
)
"Label"
'(0.0 0.0 0.0)
""
)
)
)
(command "_.-insert" "Label" '
(0.0 0.0 0.0) "" "" "" "DISTANCE") )
)
(*error* nil)
)
)
)
)
)