Maybe something like this, if there is only the one attribute [untested]:
{code}
(defun C:MeaPLDist (/ plobj space inc)
(setq
plobj (car (entsel "\nSelect Polyline: "))
space (getdist "\nSpacing of Blocks: ")
inc 1
); end setq
(setvar 'attdia 0)
(while ; as long as next position is not beyond end
(<=
(setq pldist (* inc space))
(vlax-curve-getDistAtParam plobj (vlax-curve-getEndParam plobj))
); end <=
(command
"_.insert"
"blockname"
(vlax-curve-getPointAtDist plobj pldist)
"" "" "" ; scale factors [1] and rotation [0]
(rtos pldist); answer to attribute value prompt
); end command
(setq inc (1+ inc))
); end while
); end defun
{code}
Save and restore the ATTDIA System Variable value if you like, add error handling, etc., etc. Add mode and precision arguments to the (rtos) function if you like [as written, it will just use the current settings], and (strcat) a suffix onto it if needed. Depending on your drawing unit, you may also need to convert if you want it expressed in km.
It would operate like Measure in the sense that it would *not* put one at the beginning of the Polyline. It could be made to by starting the 'inc' value at 0 instead of 1.
--
Kent Cooper
flopo wrote...
....do the same thing like Measure command, but to add at every block inserted at a certain distance ( 1km, or 0.1 km or other distance) the value of the distance?
....
Edited by: Kent1Cooper on Oct 27, 2009 9:46 AM
[corrected a ) to a " as stevor pointed out elsewhere]
Kent Cooper, AIA