salmozzo
Guest
Hello.
I am trying to fill out my function that I need to number the wires of an electrical schematic quickly.
I already have the whole program in mind, so I'm going to small steps and testing every inch of code because I don't know the wrong program even the simplest things.
in a few words the code does this:
select a point on autocad (input).
records the coordinates
adds to these coordinates of x and y numbers so as to identify the 4 points where they go to insert the text (wire numbering)
then insert the number (input)imposed the text to printmold the text processed in the 4 points found.
The final goal is:
I write 15.
♪
♪
♪
No.
I came to this point:
then there are many other things I would like to add:
I've worked six hours for now. and it's about 1 hour and a half that I'm still finding the solution to merge r with 15
thanks to who can help me
I am trying to fill out my function that I need to number the wires of an electrical schematic quickly.
I already have the whole program in mind, so I'm going to small steps and testing every inch of code because I don't know the wrong program even the simplest things.
in a few words the code does this:
select a point on autocad (input).
records the coordinates
adds to these coordinates of x and y numbers so as to identify the 4 points where they go to insert the text (wire numbering)
then insert the number (input)imposed the text to printmold the text processed in the 4 points found.
The final goal is:
I write 15.
♪
♪
♪
No.
I came to this point:
(defun c:silpi4 ()
; set the 4 coordinates of the texts
(setq p0 (getpoint "\n click")); reference point (input)
(setq x_p1234 (+ 30 (car p0)));
(setq y_p1 (+ 80 (cadr p0)) ;coordinated y first point
(setq y_p2 (+ 75 (cadr p0)) ;coordinated y second point
(setq y_p3 (+ 70 (cadr p0)) ;coordinated y third point
(setq y_p4 (+ 65 (cadr p0)) ;coordinated y fourth point
; input number
(setq num (getint "\n enter a number"))
; set the 4 texts
(setq r_text "r")
(setq s_text "s")
(setq t_text "t")
(setq n_text "n")
;write the 4 texts
(command "text" (list x_p1234 y_p1) "2.5" "0" r_text ") ; write text in point 1
(command "text" (list x_p1234 y_p2) "2.5" "0" s_text") ; write text in point 2
(command "text" (list x_p1234 y_p3) "2.5" "0" t_text ") ; write text in point 3
(command "text" (list x_p1234 y_p4) "2.5" "0" n_text ") ; write text in point 4
; set the 4 coordinates of the texts
(setq p0 (getpoint "\n click")); reference point (input)
(setq x_p1234 (+ 30 (car p0)));
(setq y_p1 (+ 80 (cadr p0)) ;coordinated y first point
(setq y_p2 (+ 75 (cadr p0)) ;coordinated y second point
(setq y_p3 (+ 70 (cadr p0)) ;coordinated y third point
(setq y_p4 (+ 65 (cadr p0)) ;coordinated y fourth point
; input number
(setq num (getint "\n enter a number"))
; set the 4 texts
(setq r_text "r")
(setq s_text "s")
(setq t_text "t")
(setq n_text "n")
;write the 4 texts
(command "text" (list x_p1234 y_p1) "2.5" "0" r_text ") ; write text in point 1
(command "text" (list x_p1234 y_p2) "2.5" "0" s_text") ; write text in point 2
(command "text" (list x_p1234 y_p3) "2.5" "0" t_text ") ; write text in point 3
(command "text" (list x_p1234 y_p4) "2.5" "0" n_text ") ; write text in point 4
I've worked six hours for now. and it's about 1 hour and a half that I'm still finding the solution to merge r with 15
thanks to who can help me