Author Topic: Insert multiple blocks  (Read 950 times)

0 Members and 2 Guests are viewing this topic.

mhy3sx

  • Newt
  • Posts: 120
Insert multiple blocks
« on: July 26, 2023, 03:23:37 AM »
Hi, I use this code to insert my blocks in the drawings. This code insert the block from specific file in to autocad by picking the insert point.

I want to add option

a) pick a point for insert the block
b) To give the point number and insert the block and this can be for multiple points

for example 

insert point ?  [poiny / number]

> number
20
enter
44
enter
46
enter
enter (<--- for exit)


This is the code I use

Code - Auto/Visual Lisp: [Select]
  1. (Defun c:DEH ( / dt1 )
  2.  (command "_layer" "_m" "DEH" "_c" "33" "" "")
  3.  (setq olderr *error*
  4.          *error* at_err)
  5.  (setvar "blipmode" 0)
  6.  (setq osm (getvar "osmode"))
  7.  (setvar "cmdecho" 0)
  8.  (setq scl (getint "\n Set Scale (50,100,200,250,500,etc) :"))
  9.  (setq scl1 (* scl 0.0025))
  10.  (setq dt1 (getpoint "\n INSERT DEH:"))
  11.  (command "insert" "c:\\MBL\\DEH1.dwg" dt1 scl1 scl1 0)
  12.  (setvar "cmdecho" 1)
  13.  (setvar "blipmode" 1)
  14.  (setvar "osmode" osm)
  15.  (command "setvar" "clayer" "0")
  16. )
  17.  


I attach  deh1.dwg is the block for this example and the test.dwg have  the points I use  (is attribute blocks)

Can any one help?

Thanks
« Last Edit: July 29, 2023, 02:21:00 AM by mhy3sx »