Sungam Posted April 29, 2010 Posted April 29, 2010 Hi, Have just made my very first LISP program. Thanks to Lee Mac I got the PLine to block to work. But know I need some help... In addition to what's allready included (Yes I know, it can be done better) I want to: 1. Include the blockname as text inside the block 2. Add the lengths of the offsetlines and it's diagonal (A-C) to attributes. Is this easily done? Thanks, Magnus (defun c:glas () (setq A (getpoint "Pick point A: ")) (setq B (getpoint "Pick point B: ")) (setq C (getpoint "Pick point C: ")) (setq D (getpoint "Pick point D: ")) ;(command "text" A 100 0 A) ;(command "text" B 100 0 B) ;(command "text" C 100 0 C) ;(command "text" D 100 0 D) (setq E (command "pline" A B C D)) (command "close") ;(setq rad (angle A B)) (command "rectangle" A C) (command "offset" 10 (entlast) (getpoint "Pick point: ")) (command "exit") (cond ( (not (setq ss (ssget '((0 . "~VIEWPORT")))))) ( (while (progn (setq bNme (getstring t "\nSpecify Block Name: ")) (cond ( (not (snvalid bNme)) (princ "\n** Invalid Block Name **")) ( (tblsearch "BLOCK" bNme) (princ "\n** Block Already Exists **")))))) ( (not (setq i -1 pt (getpoint "\nSpecify Base Point: ")))) (t (entmake (list (cons 0 "BLOCK") (cons 10 pt) (cons 2 bNme) (cons 70 0))) (while (setq ent (ssname ss (setq i (1+ i)))) (entmake (entget ent)) (and (= 1 (cdr (assoc 66 (entget (setq sub ent))))) (while (not (eq "SEQEND" (cdr (assoc 0 (entget (setq sub (entnext sub))))))) (entmake (entget sub))) (entmake (entget sub))) (entdel ent)) (entmake (list (cons 0 "ENDBLK") (cons 8 "0"))) (entmake (list (cons 0 "INSERT") (cons 2 bNme) (cons 10 pt))))) (princ)) ) (princ) Quote
alanjt Posted April 29, 2010 Posted April 29, 2010 Please post code within code tags. Code Posting Etiquette Quote
Lee Mac Posted April 29, 2010 Posted April 29, 2010 Magnus, It is common coding etiquette to give credit to the author of the code that you have quite clearly stolen. Quote
alanjt Posted April 29, 2010 Posted April 29, 2010 Magnus, It is common coding etiquette to give credit to the author of the code that you have quite clearly stolen. We don't take kindly to people who don't take kindly. Quote
Sungam Posted April 29, 2010 Author Posted April 29, 2010 Magnus, It is common coding etiquette to give credit to the author of the code that you have quite clearly stolen. Ok, I'm so very sorry. I thought "Thanks to Lee Mac..." was a kind of cred, but apparently not enough. And I didn't know it was possible to steal something, posted in a forum, for everyone to see, without any leagal right texts...but apparently it is. So very sorry! Quote
alanjt Posted April 29, 2010 Posted April 29, 2010 Ok, I'm so very sorry. I thought "Thanks to Lee Mac..." was a kind of cred, but apparently not enough. And I didn't know it was possible to steal something, posted in a forum, for everyone to see, without any leagal right texts...but apparently it is. So very sorry! Is it not still his code. He has creator rights and you should denote that. Code posted in forums still belongs to the original author, he has just given usage and editing rights. However, any and all credit to coding from original author must remain intact and/or given. If you take a piece of posted code and modify it, keep all original author's information intact AND label where you made modifications. I think I covered everything. Quote
Lee Mac Posted April 29, 2010 Posted April 29, 2010 I think I covered everything. Pretty much - more info here. Quote
alanjt Posted April 29, 2010 Posted April 29, 2010 Pretty much - more info here. Oh yeah, forgot to link that. 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.