LISP associative autodimension polyline

LISP associative autodimension polyline

ramirez.m.1989
Enthusiast Enthusiast
1,262 Views
4 Replies
Message 1 of 5

LISP associative autodimension polyline

ramirez.m.1989
Enthusiast
Enthusiast

 

I need to modify the attached routine so that the dimensions can be associative.

 

0 Likes
Accepted solutions (1)
1,263 Views
4 Replies
Replies (4)
Message 2 of 5

pbejse
Mentor
Mentor
Accepted solution

@ramirez.m.1989 wrote:

 

I need to modify the attached routine so that the dimensions can be associative.

 


(defun c:pdim(/ plSet pLlst vLst oldOsn cAng cDis cPt)
(setvar "DIMASSOC" 2) (princ "\n<<< Select LwPolyline for 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" "_endp" (car vLst) "_endp" (cadr vLst) cPt) (setq vLst(cdr vLst)) ); end while ); end foreach (setvar "OSMODE" oldOsn)(setvar "CMDECHO" 1) ); end progn ); end if (princ) )

make sure Dimassoc is 2

0 Likes
Message 3 of 5

ramirez.m.1989
Enthusiast
Enthusiast
It does not work. I added the line *(setvar "DIMASSOC" 2)* and check that
DIMASSOC was 2.

The dimensions continue to appear as non-associative.
0 Likes
Message 4 of 5

pbejse
Mentor
Mentor
Did you try the code in post #2?
0 Likes
Message 5 of 5

ramirez.m.1989
Enthusiast
Enthusiast

Sorry my mistake. It works perfect.

 

Thank you very much.

0 Likes