kareemuddin Posted April 26, 2018 Share Posted April 26, 2018 (edited) Hello, I have found a lisp (code) from the current threads which makes dimensioning to polylines selected (doesn't work on lines) , it would be of great help if the lisp can be modified so that it works on both (polylines and lines) I have posted below the coding for reference note:- I am very new to auto lisp and would really appreciate the help (defun c:pdim(/ plSet pLlst vLst oldOsn cAng cDis cPt) (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"(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 Edited April 26, 2018 by SLW210 Added Code Tags Quote Link to comment Share on other sites More sharing options...
SLW210 Posted April 26, 2018 Share Posted April 26, 2018 Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 26, 2018 Share Posted April 26, 2018 Hi, Replace this: (= 10 (car x)) With this: (member (car x) '(10 11)) And this: (0 . "LWPOLYLINE") With this: (0 . "LWPOLYLINE,LINE") Quote Link to comment Share on other sites More sharing options...
kareemuddin Posted April 26, 2018 Author Share Posted April 26, 2018 Thanks Tharwat looking forward for Saturday Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 26, 2018 Share Posted April 26, 2018 Thanks Tharwat looking forward for Saturday You're welcome and I would be on time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.