I was wondering if there is a lisp available that when you copy a block you are prompted to enter the attributed information.
Does anyone know of something like this?
|
I was wondering if there is a lisp available that when you copy a block you are prompted to enter the attributed information.
Does anyone know of something like this?
So with using a multiple insert instead of copy I got prompted to edit attributes upon insert one after another...now is someone willing to guide me in making the inserts reference the original insert points...
For example I'd insert block1 at point a then use a getstring to set the next distance variable units to the left or right...
Here is the code thus far
Code:Code: (defun c:Insert (/ InsObj pt js ename nw_str) (initdia);brings up dialog box (command "._insert");starts command (while (> (getvar "cmdactive") 0) (command pause);;pauses for user input ) (setq InsObj (entlast)) (setq Inspt (cdr (assoc 2 (entget InsObj)))) (while (setq pt(getpoint"\nSpecify insertion point: <press ENTER to stop>")) (command "_.-insert" Inspt pt "" "" "")) (princ) )
For anyone interested I got it to work with inserts vs. copies though the block must already be in the drawing anyway
If you want a predefined block simply replace this (getstring "\nBlock name: ") with this "YOUR BLOCKS NAME HERE"
Here is the code
Code:(defun c:tblkInsert (/ blkName cmdEcho attDia blkPoint distPoint polarAng autoSnap) (if (tblsearch "block" (setq blkName (getstring "\nBlock name: "))) (progn (setq cmdEcho (getvar 'cmdEcho) attDia (getvar 'attDia) polarAng (getvar 'polarAng) autoSnap (getvar 'autoSnap)) (setvar 'cmdEcho 0) (setvar 'attDia 1) (setvar 'polarANG 0.261799) (setvar 'autoSnap 63) (while (if blkPoint (setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>" blkPoint)) (setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>")) ) (command "_.-insert" blkName blkPoint 1 1 0) ) (setvar 'cmdEcho cmdEcho) (setvar 'attDia attDia) (setvar 'polarAng polarAng) (setvar 'autoSnap autoSnap) ) (princ (strcat "The block " blkName " doesn't exist in your drawing.")) ) (princ) )