asos2000 Posted January 5, 2010 Posted January 5, 2010 What is the gideline for creating this routine What is lisp command to add dimension Thanks Quote
CAB Posted January 6, 2010 Posted January 6, 2010 You can start with a simple LISP that makes use of the ACAD commands. (defun c:test(/ p1 p2 p3 p4 p5) (setq p1 (getpoint "\nPick Center point.")) (setq p2 (getpoint "\nPick Corner point.")) (setq p3 (list (max (car p1)(car p2))(max (cadr p1)(cadr p2)))) (setq p4 (list (min (car p1)(car p2))(max (cadr p1)(cadr p2)))) (setq p5 (list (min (car p1)(car p2))(min (cadr p1)(cadr p2)))) (setq p6 (list (- (min (car p3)(car p4)) 400)(+ 400 (max (cadr p4)(cadr p5))))) (command "_.dimlinear" "_non" p3 "_non" p4 "_non" (polar p3 (/ pi 2.) 400) ) (command "_.dimlinear" "_non" p4 "_non" p5 "_non" (polar p5 pi 400) ) (entmakex (list (cons 0 "TEXT") ;*** (cons 1 "My Text") ;* the string (cons 40 (getvar "textsize")) ;* Text height (cons 10 p6))) (princ) ) Quote
asos2000 Posted January 6, 2010 Author Posted January 6, 2010 Thanx CAB There is another idea to pick a point inside rec (or any shape) then pick a point outside and using IF to run one of four cases showen the point is how to how to compare between the 2 points to deside which case will be run. this is my idea to create a Pline using -boundary command then find max X and Y for vertexs of the Pline then complete the routine (defun c:tst2 ()(setq p1 (getpoint "\nPick point inside: ")) (setq p2 (getpoint "\nPick point outside: ")) (Command "-boundary" "p1" "") but i halted at this point to create the boundary the command does not accept p1 Is this way correct or there is better way? Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 A possible example of what you are looking for: http://web2.airmail.net/terrycad/LISP/DPL.lsp Quote
asos2000 Posted January 6, 2010 Author Posted January 6, 2010 It is great Routine but I do not know how to go through and get the point what I am looking for. I am new, It is my first step in lisp. Quote
BlackAlnet Posted January 6, 2010 Posted January 6, 2010 What's the difference of "entmake" and "entmakex" ? Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 What's the difference of "entmake" and "entmakex" ? entmakex will return the newly created entity name - check it in the Visual LISP Editor Help file Quote
asos2000 Posted January 7, 2010 Author Posted January 7, 2010 whats wrong with this (Command "-boundary" "p1" "") does not accept p1 this error 2D point or option keyword required. Quote
flowerrobot Posted January 7, 2010 Posted January 7, 2010 (Command "-boundary" [b]"[/b]p1[b]"[/b] "") First thought is (Command "-boundary" p1 "") Quote
CAB Posted January 7, 2010 Posted January 7, 2010 Yes anything in quotes is a string and the command is looking for a point list. Another option: (command ".boundary" "A" "I" "Y" "O" "P" "" p1 "") 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.