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.
Specify RADIUS...
;; CAB 05.13.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg height ang) (setvar 'filletrad 1) (setq ew_layer (getvar "CLAYER")) ; set current layer (setq height (/ 1.5 (getvar "CANNOSCALEVALUE"))) ; set chamfer height (setq ang 45) ; set chamfer angle (defun draw-ew (p4 p1 lay / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ (* ang pi) 180)) height) p3 (polar p4 (+ (angle p4 p1) (/ (* ang pi) 180)) height) ) (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) ) ) ) (and (setq p1 (getpoint "\nPick start point (Draw clockwise")) (setq msg "\nPick next point clockwise.") (while (setq p2 (getpoint p1 msg)) (command "_.fillet" "_P" (draw-ew p1 p2 ew_layer)) (setq p1 p2) ) ) (princ) )
Best regards to Viet Nam! Have a nice night.
After long time using, Your lisp write very useful for me but still now, i want to give some idea for improvement. The pic bellow show that: " set chamber height" don't remember value. Example, Set value is 200. But when I command again and also need to set again the value, It's mean I need this command need to remmember the value. The next problem, I can setup automatic load lisp when Auto cad startup.
Sorry, I thought that danglar would do that... then I forgot about you.
(defun c:EW (/ draw-ew lay p1 p2 ang) (defun draw-ew (p4 p1 lay hgh / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ (* ang pi) 180)) hgh) p3 (polar p4 (+ (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 <change r=" (rtos (getvar 'filletrad)) ", h=" (rtos *ew-height*) "> "))))) (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 (setq p2 (getpoint p1 "\nPick new point: ")) (command "_.fillet" "_P" (draw-ew p1 (setq p1 p2) lay *ew-height*))) (princ) )
I just ran across your circuiting lisp and I like the way it works straight out of the box with one exception, I don't know if I'm missing a step but I'm having an issue changing the parameters once set. Example if I run "EW" and set the EW-Height at 9" and then run it again I cant seem to reset the EW-Height to 12".
Thanks.
Not sure what's happening here, I can't replicate the issue.
Can you record your doing and post the video here? SCREENCAST would be probably the best one...
hello,
Is there any way to modify this great wiring lisp so that we can draw wire between 2 blocks that are not on the same x or y axis and make the wire orthogonal i.e the wire cant have any angle except 0 or 90 degrees,
thanks
hi,
The attached photo shows the current EW lisp polyline between 2 blocks and the required polyline after modification.
Thanks, a lot.
You know what - keep searching. This example of yours is a totally different thing from the original request in this thread, so it basically means to start over. And while this topic has come up so many times before... just keep searching.
I get your point , I think its relevant because normal day to day practice require connection between fixture as shown in the image, but thanks anyway.
Just think of it as a pick pt1, pick pt2 and work out the points in between make a pline of 3 sections then fillet pline all done. A good lisp learning task.
You would at least need to spell out some criteria by which it should be as required in your image, and not like any of these, all of which fit your original description:
you have a point there, I think it should depend on the path the wire was originally coming from in the previous block as shown
Can't find what you're looking for? Ask the community or share your knowledge.