jsetti01 Posted December 4, 2015 Posted December 4, 2015 I have a "Revision Cloud" Lisp that makes a "rev cloud" and then inserts the revision tag. All works beautifully however I made this for my last place of employment. My new place of employment uses a lisp command for rev clouds however it is polyline based, by that I mean you are creating single polylines to create a rectangle. it is a slow process. I want to use my lisp command which allows me to pick objects. Where my problem exists is that I need to make the rev cloud line width thinner. I need to insert a "plinewid" Function into my lisp and am not sure how to do that while keeping a calligraphy rev cloud style. I added my lisp routine and the tag that it references. Any help would be greatly appreciated. Please also tell me where I went wrong or what iI need to add and why I do want to learn and not just use this as free lisp writing service. Thank you Revcloud-new (2).LSP Revision Tag-new.dwg Quote
rlx Posted December 4, 2015 Posted December 4, 2015 I have a "Revision Cloud" Lisp that makes a "rev cloud" and then inserts the revision tag. All works beautifully however I made this for my last place of employment. My new place of employment uses a lisp command for rev clouds however it is polyline based, by that I mean you are creating single polylines to create a rectangle. it is a slow process. I want to use my lisp command which allows me to pick objects. Where my problem exists is that I need to make the rev cloud line width thinner. I need to insert a "plinewid" Function into my lisp and am not sure how to do that while keeping a calligraphy rev cloud style. I added my lisp routine and the tag that it references. Any help would be greatly appreciated. Please also tell me where I went wrong or what iI need to add and why I do want to learn and not just use this as free lisp writing service. Thank you Before you insert your rev block add : (command "pedit" (entlast) "W" 50 "") just before (setvar 'attdia 0) I used 50 but of course it can be 0 or 1 , whatever you want. If have my written my own revcloud , see http://www.cadtutor.net/forum/showthread.php?93423-RlxCloud but maybe it is somewhat 'over the top' ;-) and parts are intergrated with some of my other routines at work so it may no be 100% generic , but I hope despite all that it may be a source of inspiration / learning. Good luck , gr. Rlx Quote
jsetti01 Posted December 7, 2015 Author Posted December 7, 2015 Thank you for the reply and the advice, I thought about adding a command to do a PEDIT. It worked great in the LISP however I need the style to stay Calligraphy. when I change the PEDIT/width size it takes away the calligraphy style of the revcloud. Is there a way around this? Thank you for direction as always, Jim Quote
rlx Posted December 7, 2015 Posted December 7, 2015 Must admit never heard of calligraphic style (language barrier I suppose) but thank the gods for google :-) Ok start and end width of a polyline. Dxf Group 40 and 41. Shouldn't be to hard to program routine to ask for (new) begin and end width , or a scale factor to scale them both. Info about polylines is plenty on this site or here http://www.afralisp.net/autolisp/tutorials/polylines-and-blocks.php Just cycle through the vertexes and replace start and end width for each vertex or apply a scale factor. Shouldn't be to complicated. Unfortunatly , time's up for me (here at work). Will have a look later but maybe some one else can answer this... Gr. Rlx Quote
rlx Posted December 8, 2015 Posted December 8, 2015 just a quicky... ;change cloud width ;based on info from [url]http://www.afralisp.net/visual-lisp/tutorials/polylines-part-1.php[/url] (defun c:ccw ( / cloud sw ew i) (vl-load-com) ;;; for testing (setq sw 0 ew 1) (if (and (setq i 0 cloud (car (entsel "\nSelect cloud : "))) (= (vlax-get-property (setq cloud (vlax-ename->vla-object cloud)) 'ObjectName) "AcDbPolyline")) (repeat (/ (length (vlax-safearray->list (variant-value (vlax-get-property cloud 'coordinates)))) 2) (vla-setwidth cloud i sw ew) (setq i (1+ i)) ) ) ) Gr. Rlx Quote
jsetti01 Posted December 8, 2015 Author Posted December 8, 2015 Thank you that is exactly what I needed it to do. I have 2 questions for my learning purposes- 1. Can I add the ccw lisp onto my existing lisp to create a lisp that will make 1 revision cloud then specify width? 2. How do I get the ccw lisp to ask for SW and EW and not have them specified within the lisp? Thank you again so much. Jim Quote
rlx Posted December 8, 2015 Posted December 8, 2015 Thank you that is exactly what I needed it to do. I have 2 questions for my learning purposes- 1. Can I add the ccw lisp onto my existing lisp to create a lisp that will make 1 revision cloud then specify width? 2. How do I get the ccw lisp to ask for SW and EW and not have them specified within the lisp? Thank you again so much. Jim try this : (defun c:ccw ( / cloud sw ew i) (vl-load-com) (command "_revcloud")(while (= 1 (logand (getvar "cmdactive") 1))(command pause)) (setq i 0 cloud (entlast) sw (getreal "\nStart width : ") ew (getreal "\nEnd width : ")) (if (and cloud sw ew (= (vlax-get-property (setq cloud (vlax-ename->vla-object cloud)) 'ObjectName) "AcDbPolyline")) (repeat (/ (length (vlax-safearray->list (variant-value (vlax-get-property cloud 'coordinates)))) 2) (vla-setwidth cloud i sw ew) (setq i (1+ i)) ) ) ) Gr. Rlx oh yeh , question 1 : yes :-) btw , now each time you have to specify start / end width , maybe a default would be nice. Check the following link : http://www.lee-mac.com/promptwithdefault.html Quote
jsetti01 Posted December 8, 2015 Author Posted December 8, 2015 While I am learning to write lisp commands I want to make sure I understand. if you put a " after the command it will prompt for input? Quote
rlx Posted December 8, 2015 Posted December 8, 2015 (edited) While I am learning to write lisp commands I want to make sure I understand. if you put a " after the command it will prompt for input? Nope... if you refer to the use of the command function you put the command between " " (command "line") or (command "revcloud"). But just like in a menu file the function stops when it's done. If you know you want to draw a line between 2 points you could use (command "line" pause pause). Then the command function will wait 2 times. But sometimes you do not know how many lines you want to draw so you dont know how many pauses you need. Or in a script to plot files , a drawing can be read-only when you try to open it. Then it would be nice to be able to have a 'extra' pause. Thats where the while cmdactive 'part comes in. But don't worry to much about that right now. Best way to learn is to start with a working program, mess it up an try to fix it :-) gr. Rlx Edited December 9, 2015 by rlx Quote
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.