Hello Everyone,
I'm have some problem with Draw Electric Wire Lisp. When I draw Socket outlet line ( refer attach pics). Set Angle is 45 degree. Now, I want to change this angle by fillet. I already upload Draw Electric Wire Lisp. Help me. I come from Viet Nam
With Angle is 45 degree
With Fillet make by Fillet command.
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Solved by danglar. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Here is my WIRE program. https://autolispprograms.wordpress.com/wiring-program/
@ahmedmohamm wrote:
... it should depend on the path the wire was originally coming from in the previous block as shown
Adding numbers, and assuming working left-to-right from 1 through 6, your image suggests that you mean it should take off from the opposite side of the Block from where the previous wire came in, that is, it should go out the right side of #2 to head toward #3, rather than taking the possible route going out the top side of #2, and likewise it should go out the right side of #5 rather than the bottom side.
But that doesn't really answer it. Whether you're coming at it from 1 through 6 or the other way from 6 through 1, it would seem that at #4, the route from there to the next one is a function of where the next one is, and not a function of where the path arrived coming from the previous one. Does the whole thing depend on whether there's a continuation of the direction of the path at a given Block, or a change in direction, and if a change, whether that's a perpendicular change in direction at the Block, or a diagonal direction so that a perpendicularly bent path needs to be taken? It seems to me that only in the latter case does the direction the path arrived from the previous Block enter the picture -- otherwise, only the direction to the next one matters.
Your newer image also suggests that you would never actually want the route shown in Message 15.
I have a humble submission, as am a user of your arc PLA code.
The flip last option is very useful. Is that possible to be applicable to add the same for your EW code also?
@Sunny2006 wrote:
I have a humble submission, as am a user of your arc PLA code.The flip last option is very useful. Is that possible to be applicable to add the same for your EW code also?
Ok, flip option it is.
(defun c:EW (/ draw-ew lay p1 p2 ang flip) (defun draw-ew (p4 p1 lay hgh sid / p2 p3) (setq p2 (polar p1 ((if sid + -) (angle p1 p4) (/ (* ang pi) 180)) hgh) p3 (polar p4 ((if sid - +) (angle p4 p1) (/ (* ang pi) 180)) hgh)) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 8 lay) (cons 90 4) '(70 . 0) ; 1 for closed 0 overwise (cons 10 (trans p1 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 (trans p2 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 (trans p3 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 (trans p4 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(210 0.0 0.0 1.0)))) ; -------------------------------------------------------------------------------------------------------------------------- (setq lay "EL-LT-CABL-160" ang 45) (or (tblsearch "LAYER" lay) (command "_.-LAYER" "_N" lay "_C" 160 lay "")) (cond ((or (not *ew-height*) (not (setq p1 (getpoint (strcat "\nPick start point "))))) (setvar 'filletrad (cond ((getdist (strcat "\nWire radius <" (rtos (getvar 'filletrad)) ">: "))) ((getvar 'filletrad)))) (or *ew-height* (setq *ew-height* (getvar 'filletrad))) (setq *ew-height* (cond ((getdist (strcat "\nChamfer height <" (rtos *ew-height*) ">: "))) (*ew-height*))) (setq p1 (getpoint "\nPick start point: ")))) (while (progn (initget "flipLast andKeepit") (setq p2 (getpoint p1 (strcat "\nPick new point" (if p0 " [flipLast/andKeepit]" "") ": ")))) (cond ((= "flipLast" p2) (command "_.erase" "_l" "" "_.fillet" "_P" (draw-ew p0 p1 lay *ew-height* (not flip)))) ((= "andKeepit" p2) (command "_.erase" "_l" "" "_.fillet" "_P" (draw-ew p0 p1 lay *ew-height* (setq flip (not flip))))) (T (command "_.fillet" "_P" (draw-ew p1 (setq p0 p1 p1 p2) lay *ew-height* flip))))) (princ) )
Can't find what you're looking for? Ask the community or share your knowledge.