Print Page | Close Window

block insertion code

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=722
Printed Date: 01.Jun.2026 at 01:32


Topic: block insertion code
Posted By: priyanka
Subject: block insertion code
Date Posted: 09.May.2008 at 10:18

Hi all,

I m not sure if i m in the right forum to ask this question. But i need a code in VBA or AutoLISP for inserting block with insertion point specified on screen.

Please Help with the code or where else can i search for it




Replies:
Posted By: chris h.
Date Posted: 09.May.2008 at 15:09
getpoint
 
(setq ? (getpoint sp "\nInsert Point: ))


-------------
chris h.


Posted By: Arben.Allaraj
Date Posted: 09.May.2008 at 15:23
Originally posted by priyanka priyanka wrote:

Hi all,

I m not sure if i m in the right forum to ask this question. But i need a code in VBA or AutoLISP for inserting block with insertion point specified on screen.

Please Help with the code or where else can i search for it

Maybe This can help you.

 If doesn't function tell us again.

(defun c:MyBlock (/ pt)
  (while (setq pt (getpoint "\nPick Insertion point."))
    (command "-insert" "BlockName" "_non" pt "" "" pause)
  )
  (princ)
)


-------------
Ing Arben.Allaraj
http://cad-drafting-corner.blogspot.com



Print Page | Close Window