Insert with preview

Insert with preview

Anonymous
Not applicable
1,131 Views
2 Replies
Message 1 of 3

Insert with preview

Anonymous
Not applicable

Hi everyone, I'm here for one more time.
I use the code below to insert some of the most usual blocks, it works perfectly well, problem is that other than the insert command it does not give me the preview, I can not see the where the object will stay before inserting it, some idea how to get around this?

 

(defun c:Demo ()
  (initget " O T ")
      (setq Cb (getkword "\nTo choose: [blockOne/blockTwo] "))
  (if (= Cb "O")
    (progn
      (setq Lc (getpoint "\nClick location: "))
      (vl-cmdf "_.Insert" "c:\\Blocos\\testvl.Dwg" "_S" 1  Lc pause "" "_.explode" "_L")
      )
    (if (= Cb "T")
      (progn
      (setq Lc (getpoint "\nClick location: "))
      (vl-cmdf "_.Insert" "c:\\Blocos\\testvl2.Dwg" "_S" 1  Lc pause "" "_.explode" "_L")
      )
      )
    )
  (princ)
  )

 

 

 

 

 

 

Júnior Nogueira.

Por favor,  Aceitar como Solução se meu post te ajudar.

Please Accept as Solution if my post helps you.

 

 

0 Likes
Accepted solutions (1)
1,132 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

 

If you want to 'drag' the block during insertion, you have to use 'pause' inside the (vl-cmdf ...) expression instead of passing the point got previously with (getpoint ...)

 

(vl-cmdf "_.insert" "C:\\Blocos\\testv1.dwg" "_scale" 1 pause 0 "_.explode" "_last")


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3

Anonymous
Not applicable

Thanks for listening. @_gile

0 Likes