Author Topic: block insertion point problem  (Read 2399 times)

0 Members and 1 Guest are viewing this topic.

vincent.r

  • Newt
  • Posts: 101
block insertion point problem
« on: August 30, 2019, 11:53:58 AM »
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))
         )
)

ChrisCarlson

  • Guest
Re: block insertion point problem
« Reply #1 on: August 30, 2019, 12:05:44 PM »
Common problem add the following "_non" to the beginning of your insert line, just before the block insertion point.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: block insertion point problem
« Reply #2 on: August 30, 2019, 12:18:41 PM »
This answer offers various methods describing how to avoid the influence of Object Snap when supplying point input to AutoCAD commands.

vincent.r

  • Newt
  • Posts: 101
Re: block insertion point problem
« Reply #3 on: September 04, 2019, 05:21:20 AM »
Common problem add the following "_non" to the beginning of your insert line, just before the block insertion point.

Thank you very much Master_Shake

vincent.r

  • Newt
  • Posts: 101
Re: block insertion point problem
« Reply #4 on: September 04, 2019, 05:23:25 AM »
This answer offers various methods describing how to avoid the influence of Object Snap when supplying point input to AutoCAD commands.


Thanks Lee! You are always explanative. Everything clear about Osnap.