hello!
I was trying to use this macro :
(defun c:door ()
(setq ponto (getvar "osmode"))
(setvar "osmode" 1)
(setq p1 (getpoint "Indique o ponto onde a porta gira: "))
(setq p2 (getpoint "Indique o ponto onde a porta bate: "))
(setq p3 (getpoint "indique para que lado a porta abre indicando um pont: "))
(command "ucs" "n" "3" p1 p2 p3)
(setq p1t (trans p1 0 1) p2t (trans p2 0 1))
(command "arc" "c" p1t p2t "a" "90")
(command "line" p1t (list (car p1t) (+ (cadr p1t) (distance p1t p2t))) "")
(command "ucs" "world")
(setvar "osmode" ponto)
)
But i want to change it and make a doors that is opened only 45º and not 90º as is is in this macro. (see the pic that i add)
Someone help me?
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Solved by hmsilva. Go to Solution.
Hello Marta and welcome to the Autodesk Community!
Maybe something like this
(defun c:p45 (/ p1 p2 p3 osm) (setq osm (getvar "osmode")) (setvar "osmode" 1) (if (and (setq p1 (getpoint "Indique o ponto onde a porta gira: ")) (setq p2 (getpoint p1 "Indique o ponto onde a porta bate: ")) (setq p3 (getpoint "indique para que lado a porta abre indicando um ponto: ")) ) (progn (command "ucs" "n" "3" p1 p2 p3) (setq p1 (trans p1 0 1) p2 (trans p2 0 1) ) (command "arc" "c" p1 p2 "a" "45") (command "_.line" p1 (polar p1 (* 0.25 pi) (distance p1 p2)) "") (command "ucs" "world") ) ) (setvar "osmode" osm) (princ) )
For customization try the Visual LISP AutoLISP and General Customization forum...
EDIT: se necessitares de ajude em Português tenta o forum do AutoCAD - Português
Hope that helps
Henrique
Marta,
the code with a slight modification, in order to work in UCS/WCS
(defun c:p45 (/ p1 p1w p2 p2w p3 osm) (setq osm (getvar "osmode")) (setvar "osmode" 1) (if (and (setq p1 (getpoint "\nIndique o ponto onde a porta gira: ")) (setq p2 (getpoint p1 "\nIndique o ponto onde a porta bate: ")) (setq p3 (getpoint "\nIndique para que lado a porta abre indicando um ponto: ")) ) (progn (setq p1w (trans p1 1 0) p2w (trans p2 1 0) ) (command "_.ucs" "_N" "3" p1 p2 p3) (setq p1 (trans p1w 0 1) p2 (trans p2w 0 1) ) (command "_.arc" "_C" p1 p2 "_A" "45") (command "_.line" p1 (polar p1 (* 0.25 pi) (distance p1 p2)) "") (command "_.ucs" "_p") ) ) (setvar "osmode" osm) (princ) )
Hope that helps
Henrique
Hi Henrique,
Sorry, can you help me finihing my command?
you allready gave me onde door, but i really need the of them! thank you!!
Hi Marta,
as I have said in my first post (see the links there), for AutoLISP try the Customization forum, or in Portugês the Portugês forum...
It will be easier to get help there.
This is just a simple amendment to the previous code, If you need the doors with more detail, post in one of those forums
(defun c:2p45 (/ p1 p1w p2 p2w p3 osm) (setq osm (getvar "osmode")) (setvar "osmode" 1) (if (and (setq p1 (getpoint "\nIndique o ponto onde a primeira porta gira: ")) (setq p2 (getpoint p1 "\nIndique o ponto onde a segunda porta gira: ")) (setq p3 (getpoint "\nIndique para que lado as portas abrem indicando um ponto: ")) ) (progn (setq p1w (trans p1 1 0) p2w (trans p2 1 0) ) (command "_.ucs" "_N" "3" p1 p2 p3) (setq p1 (trans p1w 0 1) p2 (trans p2w 0 1) pmid (polar p1 (angle p1 p2) (/ (distance p1 p2) 2.0)) ) (command "_.arc" "_C" p1 pmid "_A" "45") (command "_.arc" "_C" p2 pmid "_A" "-45") (command "_.line" p1 (polar p1 (* 0.25 pi) (distance p1 pmid)) "") (command "_.line" p2 (polar p2 (* 0.75 pi) (distance p2 pmid)) "") (command "_.ucs" "_p") ) ) (setvar "osmode" osm) (princ) )
I hope this helps
(espero que ajude)
Henrique