VisDak Posted May 12, 2009 Posted May 12, 2009 Hi mates, Good day to all , is there any of there having a Lsp route on electrical wiring that will pick first fixture then the second fixture will automatically create a standard wiring pline as shown to the image. The first pick will be line angle 45 degrees and then it will be bend horizontal or vertical line about 100mm far to the lighing fixture and in the next lighting fixture will bend 45 degrees again that will be the second pick for the next lighting fixture and then it will fillet by 150mm dia on each bend. this will be continious to the other lighting fixtures Please provided me so that it will be easier on my life to work on electrical wirings:lol: Quote
CAB Posted May 12, 2009 Posted May 12, 2009 Here is a quicky ;; CAB 05.12.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg) (setq ew_layer "Wire") ; layer name (defun draw-ew (p4 p1 lay / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ pi ) 57.40259411) p3 (polar p4 (+ (angle p4 p1) (/ pi ) 57.40259411) ) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 8 lay) (cons 90 4) '(70 . 0) ; 1 for closed 0 overwise (cons 10 p1) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198912) (cons 10 p2) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 p3) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198913) (cons 10 p4) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) ) ) ) (setq p1 (getpoint "\nPick start point (Draw clockwise")) (setq msg "\nPick next point clockwise.") (while (setq p2 (getpoint p1 msg)) (draw-ew p1 p2 ew_layer) (setq p1 p2) ) (princ) ) (prompt "\nElectric Wire loaded, Enter EW to run.") (princ) Quote
VisDak Posted May 13, 2009 Author Posted May 13, 2009 Perfect!!! this is all i needed. Thanks CAB ;; CAB 05.12.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg) (setq ew_layer "Wire") ; layer name (defun draw-ew (p4 p1 lay / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ pi ) 57.40259411) p3 (polar p4 (+ (angle p4 p1) (/ pi ) 57.40259411) ) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 8 lay) (cons 90 4) '(70 . 0) ; 1 for closed 0 overwise (cons 10 p1) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198912) (cons 10 p2) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 p3) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198913) (cons 10 p4) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) ) ) ) (setq p1 (getpoint "\nPick start point (Draw clockwise")) (setq msg "\nPick next point clockwise.") (while (setq p2 (getpoint p1 msg)) (draw-ew p1 p2 ew_layer) (setq p1 p2) ) (princ) ) (prompt "\nElectric Wire loaded, Enter EW to run.") (princ) Quote
VisDak Posted May 13, 2009 Author Posted May 13, 2009 Hi CAB, the wiring Lsp is greate CAB, but i have some problem regarding when i use it on a rotated UCS plan the layout will not appear on the lighting fixture, it will will go away according to 0.0 UCS. can you fix it on this causes. Thanks again:lol: Quote
Zorg Posted May 13, 2009 Posted May 13, 2009 NICE! i changed it to have straight 45 edges and it work flawlessley Quote
VisDak Posted May 13, 2009 Author Posted May 13, 2009 How did you change it? NICE! i changed it to have straight 45 edges and it work flawlessley Quote
CAB Posted May 13, 2009 Posted May 13, 2009 Try this for UCS: ;; CAB 05.13.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg) (setq ew_layer "Wire") ; layer name (defun draw-ew (p4 p1 lay / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ pi ) 57.40259411) p3 (polar p4 (+ (angle p4 p1) (/ pi ) 57.40259411) ) (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.198912) (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.198913) (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)) (draw-ew p1 p2 ew_layer) (setq p1 p2) ) ) (princ) ) (prompt "\nElectric Wire loaded, Enter EW to run.") (princ) 1 Quote
Nick-H- Posted May 11, 2012 Posted May 11, 2012 I have no Idea how to change lisp's - I need it to have 45 degree chamfers with a lenth of 250mm I dont know if this is possible and that someone could please do this for me id be very very greatful Quote
ctsonhcm Posted April 20, 2015 Posted April 20, 2015 First of all, thank CAB very much. Hi Nick-H-. I have change a litle bit in source for easy to understand. ;; CAB 05.13.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg height ang) (setq ew_layer (getvar "CLAYER")) ; set current layer (setq height (/ 2.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)) (draw-ew p1 p2 ew_layer) (setq p1 p2) ) ) (princ) ) In this code I add new variable height and ang to control height and angle of chamfer. But I fix this with value 2.5*Layout Scale and 45 degree. Do anybody know how to make option to control this variable like this? Command: EW (Height / Angle / Draw): Pick start point (Draw clockwise) When click Height, Angle this go to setting Height and Angle variable. Quote
shezad1991 Posted March 22, 2017 Posted March 22, 2017 can you make the circuit line like image i uploaded , 45 degree line and the corner is filleted. and it's that possible that when we call a cmd and it ask for enter the fillet radius and the distance between fixture and circuit line pls do a needfull. Quote
ahmed eshta369 Posted April 21, 2020 Posted April 21, 2020 hi friends i dont know more about the autolisp but i want that lisp for cad 2019 the file and the appreviation please Quote
BIGAL Posted April 22, 2020 Posted April 22, 2020 Copy the code from ctsonhcm post to notepad and save as say elecwire.lsp then use appload to load it or drag and drop onto Autocad type ew to run. Quote
Ali Abdulfattah Posted August 29, 2021 Posted August 29, 2021 can I edit this to draw an arc instead of a poly line !! and thanks a lot guys Quote
BSmiths1544 Posted November 4, 2021 Posted November 4, 2021 On 8/29/2021 at 2:30 AM, Ali Abdulfattah said: can I edit this to draw an arc instead of a poly line !! and thanks a lot guys I am wondering this also, as well as for creating a SPLINE. Quote
BIGAL Posted November 4, 2021 Posted November 4, 2021 There is at least 4 different style of answer in the old image. I have somewhere pick 1. Pick 1 has a left and right option. Start is another. You need to post a true dwg of what you want. Quote
Tharwat Posted November 5, 2021 Posted November 5, 2021 Here is my Wiring program that anyone can try. https://autolispprograms.wordpress.com/wiring-program/ 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.