Results 1 to 3 of 3

Thread: Prompt to change Attributes upon copy

  1. #1
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Prompt to change Attributes upon copy

    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?

  2. #2
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Re: Prompt to change Attributes upon copy

    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)
    )

  3. #3
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Re: Prompt to change Attributes upon copy

    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)
    )

Similar Threads

  1. Change Select Objects Prompt
    By ccowgill in forum AutoLISP
    Replies: 8
    Last Post: 2010-11-12, 10:03 PM
  2. Insert prompt for text for attributes missing
    By jeff.smith in forum AutoCAD General
    Replies: 2
    Last Post: 2008-02-29, 09:08 PM
  3. No prompt when inserting Block with Attributes
    By tim.blanchard in forum AutoCAD General
    Replies: 4
    Last Post: 2005-10-20, 01:21 PM
  4. change profile from command prompt?
    By hostetterkl in forum AutoLISP
    Replies: 1
    Last Post: 2005-07-21, 03:52 PM
  5. Change the order of Attributes as they prompt me for input?
    By jardesign in forum AutoCAD LT - General
    Replies: 4
    Last Post: 2005-05-17, 11:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •