In simplest terms, try this:
(defun C:DDC (/ dim div mea num)
(setq
dim (car (entsel "\nSelect Dimension object to report on: "))
div (getdist "\nDivisor distance: ")
mea (cdr (assoc 42 (entget dim)))
num
(+
(fix (/ mea div))
(if (= (rem mea div) 0) 0 1)
)
)
(vlax-invoke
(vlax-get
(vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow)
'ClipBoardData
)
'SetData
"Text"
(itoa num)
)
)
That assumes rounding up to mean to the next integer value, and if it divides exactly, it doesn't jump it up by one.
It could use enhancements such as a check on the type of object selected [not just that it's a Dimension, but one of a linear nature, not angular and maybe not ordinate], and could report to the command line what it put into the clipboard, and probably some other things.
Kent Cooper, AIA