Hi,
Created a routine to insert blocks as per excel database. It works fine for few blocks. but some blocks are not inserted on its position. VL console shows perfect coordinates. Tried purge redefining block that is "HCR21=C:/Users/shrinand_bhedasgaonk/Desktop/stuff/IO DRAWINGS/HCR21.dwg" .
code is lengthy but simple.
(setq xflst (car xfi))
(setq xlstlength (length xflst))
(setq tocheck (nth 13 xflst));3
(setq lno (nth 2 xflst))
(if (= lno "1") (setq ax 58.7470 ay 620.7206))
(if (= lno "2") (setq ax 58.7470 ay 600.7206))
(if (= lno "3") (setq ax 58.7470 ay 580.7206));var set
(if (= lno "4") (setq ax 58.7470 ay 560.7206))
(if (= lno "5") (setq ax 58.7470 ay 540.7206))
(if (= lno "6") (setq ax 58.7470 ay 520.7206))
(if (= lno "7") (setq ax 58.7470 ay 500.7206))
(if (= lno "8") (setq ax 58.7470 ay 480.7206))
(if (and (/= xtocheck nil)
(/= xlno nil)
)
(progn
(if (= xtocheck "Field") (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/Field_wire_connection.dwg" (strcat (rtos (- ax 2.5)) "," (rtos ay)) "1" "1" "0"))
(if (= xtocheck "Panel") (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/Panel_wire_connection.dwg" (strcat (rtos (- ax 2.5)) "," (rtos ay)) "1" "1" "0"))
(command "explode" "last")
(command "purge" "Blocks" "Panel_wire_connection" "no")
(if (vl-string-search "PB" xlno) (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/HPB11.dwg" (strcat (rtos (- ax 27.8577)) "," (rtos (- ay 10))) "1" "1" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" xlno))
(if (vl-string-search "M" xlno) (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/HCR21.dwg" (strcat (rtos (- ax 27.8577)) "," (rtos (- ay 10))) "1" "1" "0" "" "" "" "" "" "" "" "" "" "" "" "" xlno))
(if (vl-string-search "LS" xlno) (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/HLS11.dwg" (strcat (rtos (- ax 27.8577)) "," (rtos (- ay 10))) "1" "1" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" xlno))
(if (vl-string-search "HLS" xlno) (command "-insert" "C:/Users/Cad_Machine_12/Desktop/stuff/IO DRAWINGS/HFL11.dwg" (strcat (rtos (- ax 27.8577)) "," (rtos (- ay 10))) "1" "1" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" xlno))
)
)