(defun c:mpd(/ plSet pLlst vLst oldOsn cAng cDis cPt)
(princ "\nSelect LwPolylines for aligned dimensioning")
(if(setq plSet(ssget '((0 . "LWPOLYLINE"))))
(progn
(setq pLlst(vl-remove-if 'listp
(mapcar 'cadr(ssnamex plSet))))
(setvar "OSMODE" 0)(setvar "CMDECHO" 0)
(foreach pl pLlst
(setq vLst(mapcar 'cdr
(vl-remove-if-not
'(lambda(x)(= 10(car x)))(entget pl)))
oldOsn(getvar "OSMODE")
); end setq
(while(< 1(length vLst))
(setq cAng(angle(car vLst)(cadr vLst))
cDis(/(distance(car vLst)(cadr vLst))2)
cPt(polar(polar(car vLst)cAng cDis)
(+ cAng(/ pi 2))(* 2(getvar "DIMTXT")))
); end setq
(command "_.dimaligned"(car vLst)(cadr vLst) cPt)
(setq vLst(cdr vLst))
); end while
); end foreach
(setvar "OSMODE" oldOsn)(setvar "CMDECHO" 1)
); end progn
); end if
(princ)
); end of c:pdim
(c:mpd)

Advertisements