TheSwamp

CAD Forums => CAD General => Topic started by: Andrea on July 25, 2004, 10:16:27 PM

Title: Insert command ?
Post by: Andrea on July 25, 2004, 10:16:27 PM
hi all.

I'm re-making some new lisps without using AutoCAD command

I need to know how can i insert a block without using the "INSERT" command...?

i know there is a function called...         :vlr-beginInsert

but i do not know really how it work and if this can replace the "INSERT" command.


thanks.
Title: Insert command ?
Post by: Serge J. Gianolla on July 26, 2004, 02:30:34 AM
Ah, travailler le Dimanche et t'as pas les yeux en face des trous! :lol: Tu poses ta question dans General pas VLISP hackers!!
prefix vlr means Visual Lisp Reactor, so that's not gonna' work. I know of vla-AddMInsert, and vla-AddAttribute, look in that direction until someone with a better answer shows up.
Arrivederci.
Title: Insert command ?
Post by: sinc on July 26, 2004, 02:59:13 AM
You can use the InsertBlock method.  This is a method on the Block object.  Remember that Model Space and Paper Space are block objects.  Here's an example:

Code: [Select]
(defun insertblock ()
  (setq  acadObj (vlax-get-acad-object)
           doc (vla-get-activeDocument acadObj)
           mspace (vla-get-modelSpace doc)
  ) ;_ setq
  (vla-insertBlock
    mspace insertionPoint blockNameOrFilename xScale yScale zScale
    rotation) ;_ vla-insertBlock
) ;_ defun


Refer to the "ActiveX and VBA Reference" for further details.