symoin Posted January 7, 2019 Share Posted January 7, 2019 Hi, I have a lisp by Ranjith Singh, downloaded from autodesk forum and modified to show the ratio of vertical to horizontal. All I need is to select multiple lines and get the answer. Thanks in advance ratio.lsp Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 7, 2019 Share Posted January 7, 2019 (edited) Try This Codes Updated (defun c:sr (/ answer ss snm sp ep ) (defun answer (pt1 pt2);ranjith sing (entmakex (list '(0 . "TEXT") '(100 . "AcDbText") (cons 10 (trans (mapcar '+ (mapcar '/ (mapcar '+ pt1 pt2) '(2 2))) 1 0)) (cons 11 (trans (mapcar '+ (mapcar '/ (mapcar '+ pt1 pt2) '(2 2))) 1 0)) (cons 1 (strcat "1:"(rtos (abs((lambda (x) (/ (car x) (abs (cadr x)))) (mapcar '- pt1 pt2))) 2 2) )) '(71 . 0) '(72 . 1) (cons 40 1) (cons 50 0)))) (if (setq ss (ssget '((0 . "LINE")))) (progn (repeat (setq i (sslength ss)) (setq snm (ssname ss (setq i (1- i)))) (setq sp (vlax-curve-getstartpoint snm)) (setq ep (vlax-curve-getendpoint snm)) (answer sp ep)) ) ) (princ) ) Edited January 7, 2019 by gS7 Quote Link to comment Share on other sites More sharing options...
symoin Posted January 7, 2019 Author Share Posted January 7, 2019 Thanks GS7, Yes This is what I was looking for; I need a small modification, can the mtext chaged to text and the rotation to 0degree. Quote Link to comment Share on other sites More sharing options...
gS7 Posted January 7, 2019 Share Posted January 7, 2019 1 hour ago, symoin said: Thanks GS7, Yes This is what I was looking for; I need a small modification, can the mtext chaged to text and the rotation to 0degree. above codes updated Quote Link to comment Share on other sites More sharing options...
symoin Posted January 7, 2019 Author Share Posted January 7, 2019 (edited) sorry my bad; it is not the requirement at all Edited January 8, 2019 by symoin 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.