cadamrao Posted July 28, 2011 Share Posted July 28, 2011 Hi, Any one can give polygon command (short cut) with 3 sides (inscribed in circle) Thanks in advance amr Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 28, 2011 Share Posted July 28, 2011 Try running the command normally making sure to use the desired oprions, then write a LISP that uses the exact same options. When done test. Post your code here if you have any issues. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 28, 2011 Share Posted July 28, 2011 (if (setq p (getpoint "\n Specify center of Polygon :")) (vl-cmdf "_.polygon" 3 p "" pause) ) Quote Link to comment Share on other sites More sharing options...
cadamrao Posted July 28, 2011 Author Share Posted July 28, 2011 need lisp for save time and reduce no.of pick&type Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 28, 2011 Share Posted July 28, 2011 need lisp for save time and reduce no.of pick&type ًBring your codes and we will help you with it . My post first is a lisp but without a defun , name , and princ at last, and if you need it continuously you can add while . Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 28, 2011 Share Posted July 28, 2011 (if (setq p (getpoint "\n Specify center of [color=blue]Triangle[/color]:")) (vl-cmdf "_.polygon" 3 p [color=red]"inscribed"[/color] pause) ) @ Tharwat - Polygon with three sides = Triangle. :wink: Also, instead of using an empty string ("") as the option, consider explicitely specifying the desired option as "inscribed." If the user last selected "Circumscribed about circle" the empty string ("") will not return "Inscribed in circle" as desired in the OP. Technically "I", "_i", or others would work too... I simply prefer to spell out the options for clarity when reading the code. I've also seen where the letter options within a command have changed from version to version. Just something to be aware of. Obviously, do what works best for you. Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 28, 2011 Share Posted July 28, 2011 (defun c:tri (/ point) (if (setq point (getpoint "\nSpecify triangle center point: ")) (command "_.polygon" 3 "_non" point "_inscribed") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 28, 2011 Share Posted July 28, 2011 A simple macro: ^C^C_.polygon;3;\_I;\ Quote Link to comment Share on other sites More sharing options...
troggarf Posted July 28, 2011 Share Posted July 28, 2011 Found this a while ago. I don't know where I got it from. It will search your entire drawing and add a circumscribed polygon to the circles. I don't have time right now to try to tweak it for inscribed. So you can try doing that or get help. ; Searches for circles in a drawing and puts circumscribed polygons outside of these circles. (defun c:polyincirc (/ ss i sset e) (if (setq ss (ssget "_x" '((0 . "CIRCLE")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (setq e (entget sset)) (command "_.polygon" 3 "_non" (cdr (assoc 10 e)) "_c" (cdr (assoc 40 e))) ) (princ "\n No Circle(s) found") ) (princ) ) 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.