Friends,
The attached code is not working on the attached particular drawing. Anybody please go thru the code and let me know what the changes need to be done. please its very urgent.
What actually lisp works: It will draw a pline(drop) in between the pole and consumer and place the footage by using Object data of both blocks.
But it's not working in this particular drawing.
(defun c:Test ( / js_pole ent_pole dxf_pole js_consu ent_consu dxf_consu) (princ "\nSelect block pole") (setq js_pole (ssget "_+.:E:S" '((0 . "INSERT") (67 . 0) (410 . "Model") (8 . "CHR_IKE_POLES") (2 . "POLE-TEL,`*U10"))) ) (cond (js_pole (princ "\nSelect block consumer") (setq ent_pole (ssname js_pole 0) dxf_pole (entget ent_pole) js_consu (ssget "_+.:E:S" '((0 . "INSERT") (67 . 0) (410 . "Model") (8 . "CHR_IKE_SUB_SYMBOLS") (2 . "`*U3"))) ) (cond (js_consu (setq ent_consu (ssname js_consu 0) dxf_consu (entget ent_consu) ) (cond ((eq (ade_odgetfield ent_pole "Pole_Information_point" "Power_Comp" 0) (ade_odgetfield ent_consu "Customer_Information_poin" "Power_Comp" 0)) (command "_.pline" "_none" (cdr (assoc 10 dxf_pole)) "_none" (cdr (assoc 10 dxf_consu)) "") (if (eq (ade_odgetfield ent_consu "Customer_Information_poin" "Customer_S" 0) "Aerial") (command "_.chprop" (entlast) "" "_layer" "CHR_AERIAL_DROP" "_color" "5" "_ltscale" 0.4 "") (command "_.chprop" (entlast) "" "_layer" "CHR_BURIED_DROP" "_color" "1" "_ltscale" 0.75 "") ) (command "_.text" "_justify" "_BC" "_none" (mapcar '* (mapcar '+ (cdr (assoc 10 dxf_pole)) (cdr (assoc 10 dxf_consu))) '(0.5 0.5 0.5)) 18.0 (angtos (angle (cdr (assoc 10 dxf_pole)) (cdr (assoc 10 dxf_consu)))) (ade_odgetfield ent_consu "Customer_Information_poin" "Span_Fro00" 0)) (if (eq (ade_odgetfield ent_consu "Customer_Information_poin" "Customer_S" 0) "Aerial") (command "_.chprop" (entlast) "" "_layer" "CHR_AERIAL_DROP_FOOTAGE" "_color" "5" "") (command "_.chprop" (entlast) "" "_layer" "CHR_BURIED_DROP_FOOTAGE" "_color" "1" "") ) ) (T (princ "\nBad choice!")) ) ) ) ) ) (prin1) )
Solved! Go to Solution.
Solved by _gile. Go to Solution.
js_consu (ssget "_+.:E:S" '((0 . "INSERT") (67 . 0) (410 . "Model") (8 . "CHR_IKE_SUB_SYMBOLS") (2 . "`*U6")))
Apparently according to your code the consumer block is called *U3 and there is none in the drawing.
(ssget "_+.:E:S" '((0 . "INSERT") (67 . 0) (410 . "Model") (8 . "CHR_IKE_SUB_SYMBOLS") (2 . "`*U3")))
But why the use of unnamed blocks? That is a recipe for disaster if you are asking me.
ya friend. it's working fine. Can I know how to change that value "U6" for the particular drawing?. what "6" indicates?
Can't find what you're looking for? Ask the community or share your knowledge.