datalife Posted February 4, 2013 Share Posted February 4, 2013 Hello, I got this lisp from Tharwat on the cadtutor forum recently. Wow....it is wonderful and save lots of my drafting time. Any problem if I ask for some changes made on the lisp by separating the line,manhole (points) and text to different layers. Thanks a lot mhsw.lsp Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 4, 2013 Share Posted February 4, 2013 What are the layer names that you want to separate each entity in the routine to ? Quote Link to comment Share on other sites More sharing options...
datalife Posted February 4, 2013 Author Share Posted February 4, 2013 hello, great to see your reply. Say (1) line of pipe to layer name "pipe" (2) point(manhole) to layer name "manhole" (3) text to layer name " textlength" Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 4, 2013 Share Posted February 4, 2013 hello, great to see your reply. Say (1) line of pipe to layer name "pipe" (2) point(manhole) to layer name "manhole" (3) text to layer name " textlength" Thanks Here it goes , try it and let me know . (defun c:MHSW (/ _L _P _T p p1 p2 a ang l i) ;;; =============------------ Tharwat 27. Jan. 2013 -----------=========;;; ;;; Prompt to user to specify Distance between Manholes ;;; ;;; then height of the text and finally to specify start and end points ;;; (defun *error* (x) (princ "\n *Cancel*")) (cond ((not (tblsearch "LAYER" "pipe")) (progn (alert "Layer < pipe > is not found in drawing !!") (exit)) ) ((not (tblsearch "LAYER" "manhole")) (progn (alert "Layer < manhole > is not found in drawing !!") (exit)) ) ((not (tblsearch "LAYER" "textlength")) (progn (alert "Layer < textlength > is not found in drawing !!") (exit)) ) ) (defun _L (j k) (entmakex (list '(0 . "LINE") '(8 . "pipe") (cons 10 j) (cons 11 k)))) (defun _P (p) (entmakex (list '(0 . "POINT") '(8 . "manhole") (cons 10 p)))) (defun _T (p h s a) (entmakex (list '(0 . "TEXT") (cons 10 (trans p 1 0)) (cons 11 (trans p 1 0)) '(8 . "textlength") (cons 40 h) (cons 1 s) (cons 50 a) '(72 . 1) '(73 . 1) ) ) ) (if (and (if (progn (initget 6) (setq *d* (cond ((getdist (strcat "\n Specify distance between Manholes " (if *d* (strcat "< " (rtos *d* 2 2) " > :") " :" ) ) ) ) (t *d*) ) ) ) (setq *d* *d*) nil ) (if (progn (initget 6) (setq *h* (cond ((getdist (strcat "\n Specify Text Height " (if *h* (strcat "< " (rtos *h* 2 2) " > :") " :" ) ) ) ) (t *h*) ) ) ) (setq *h* *h*) nil ) (setq p1 (getpoint "\n specify start point :")) (setq p2 (getpoint "\n Specify end point :" p1)) ) (progn (setvar 'pdmode 65) (setq a (angle p1 p2) ang a ) (if (and (< (* pi 0.5) ang) (<= ang (* pi 1.5))) (setq ang (+ pi ang)) ang ) (mapcar '_P (list p1 p2)) (setq l (distance p1 p2)) (repeat (fix (/ l *d*)) (_L p1 (setq p (polar p1 a *d*))) (_P p) (_T (mapcar '(lambda (j k) (/ (+ j k) 2.)) p1 p) *h* (strcat "L= " (rtos *d* 2 1)) ang) (setq p1 p) ) (if (> (setq i (rem l *d*)) 0.) (progn (_L p1 p2) (_T (mapcar '(lambda (j k) (/ (+ j k) 2.)) p1 p2) *h* (strcat "L= " (if (< i 0.) (rtos i 2 2) (rtos i 2 1) ) ) ang ) ) ) ) (princ) ) (princ "\nWritten by Tharwat Al Shoufi") (princ) ) Quote Link to comment Share on other sites More sharing options...
datalife Posted February 4, 2013 Author Share Posted February 4, 2013 Great.....it works and thanks again Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 4, 2013 Share Posted February 4, 2013 Great.....it works and thanks again You're welcome anytime . Quote Link to comment Share on other sites More sharing options...
datalife Posted February 6, 2013 Author Share Posted February 6, 2013 Hi Tharwat.......two more question. Question 1 - After placing the points (manhole) in a specific layer. I need to hatch the points to solid square; is it possible? Question 2 - Is it possible to change the points (manhole) to solid circle instead of presently square? Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2013 Share Posted February 7, 2013 Hi Tharwat.......two more question. Question 1 - After placing the points (manhole) in a specific layer. I need to hatch the points to solid square; is it possible? Question 2 - Is it possible to change the points (manhole) to solid circle instead of presently square? Thanks Hi . Solid square or solid circle ? What about the circle' s diameter if circle, or the square ' s width and height if LWpolyline ? Quote Link to comment Share on other sites More sharing options...
datalife Posted February 7, 2013 Author Share Posted February 7, 2013 Hi Tharwat....thanks for the quick reply. Actually I need both solid square and solid circle. Maybe Lisp can prompt for the user to select which one would be used .; and later it can be adopted. As for the size of circle and square, is it possible to change it directly from the pdmode ie by hatching the points selected? Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2013 Share Posted February 7, 2013 directly from the pdmode ie by hatching the points selected? Thanks You can not hatch point entities . Quote Link to comment Share on other sites More sharing options...
pBe Posted February 7, 2013 Share Posted February 7, 2013 You can not hatch point entities . As for the size of circle and square, is it possible to change it directly from the pdmode ie by hatching the points selected? Thanks There's your answer tharwat. Depending on the variables PDSIZE/PDMODE you can convert the points to a circle/square then hatch. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 7, 2013 Share Posted February 7, 2013 There's your answer tharwat. Depending on the variables PDSIZE/PDMODE you can convert the points to a circle/square then hatch. Now get to work Tharwat! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2013 Share Posted February 7, 2013 (edited) There's your answer tharwat. Depending on the variables PDSIZE/PDMODE you can convert the points to a circle/square then hatch. I made it another way . Now get to work Tharwat! Here is what I come up with . To OP , put the DCL file into your support path (named manhole) as the following path if you are working on Autocad 2011 as shown into your profile . C:\Program Files\AutoCAD 2011\Support Then run the Lisp routine with the name drawmanholes ( you can change the name of the routine ) PLEASE DO NOT REMOVE THE AUTHOR NAME OF THE TWO FILES . All Opinions and Constructive Comments are welcomed . manhole.DCL manhole.LSP Edited February 13, 2013 by Tharwat Quote Link to comment Share on other sites More sharing options...
stevesfr Posted February 7, 2013 Share Posted February 7, 2013 Wow, you sure did more than expected ! thank you. one suggestion, but it may not be possible, how to save defaults of distance between MH, text size, and MH type. This would be great even when working in the current drawing. thanks Tharwat !!!! Steve Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2013 Share Posted February 7, 2013 Wow, you sure did more than expected ! thanks Tharwat !!!! Steve You're welcome Steve , I am really happy that you liked the program . one suggestion, but it may not be possible, how to save defaults of distance between MH, text size, and MH type. This would be great even when working in the current drawing. Sure it is possible , but please wait until we hear the OP 's opinion and I would modify it for you to get the maximum benefit of the program . Regards. Tharwat Quote Link to comment Share on other sites More sharing options...
pBe Posted February 8, 2013 Share Posted February 8, 2013 (edited) I made it another way . ... I see, i was led to believe the points are already existing. Carry on. EDIT: Comments Why not create the layers instead of alerting the user that it doesnt exist? Why not incorporate the "alerts" on the Dialog box itself, rather than accepting the wrong data on the edit box pressing "ok" then alerting the user in the middle of the routine and need to start allover again? Edited February 8, 2013 by pBe Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 8, 2013 Share Posted February 8, 2013 pBe , for the first comment , I do agree with you but if you go back to the OP's threads recently you'll find out that it is as they wanted , although I still want to change the introduction of the routine to obtain the layers if they are not already existed . For the other comment , I consider that the same issue since the next updated routine that I will post according to what Steve suggested will keep the same input values as global variables to be re-set again . Thanks for trying the codes . Quote Link to comment Share on other sites More sharing options...
datalife Posted February 16, 2013 Author Share Posted February 16, 2013 Hi Tharwat, Lately I search through previous forum and found something that can do the job, maybe you can help combine the earlier lisp (ie mhsw.lsp) with this one ; if possible? Thanks in advance for the help aa.lsp Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 16, 2013 Share Posted February 16, 2013 Hi Tharwat, Lately I search through previous forum and found something that can do the job, maybe you can help combine the earlier lisp (ie mhsw.lsp) with this one ; if possible? Thanks in advance for the help Didn't you try the that took hours to be made for you ? And why you are talking about something else with ignorance to the hard work that made just for you ? Quote Link to comment Share on other sites More sharing options...
pBe Posted February 16, 2013 Share Posted February 16, 2013 Didn't you try the that took hours to be made for you ? Now now tharwat. . I bet somebody else found a good use for your code like stevesfr. 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.