Results 1 to 3 of 3

Thread: Block Insertion Lisp/ Palette command - - HELP!

  1. #1
    Member
    Join Date
    2008-10
    Posts
    46
    Login to Give a bone
    0

    Default Block Insertion Lisp/ Palette command - - HELP!

    I'm trying to create what should be a very simple lisp routine, or maybe something that can just be put into the pallet as a macro command. Either way; I'm happy as long as it works.

    I need to insert a block named grdot into the drawings, but there are variables. I need it to match the annotation scale, plus a user input prompt for either sheet size B, or D.
    If it's D size, then the block needs to be inserted at twice the annotation scale, for B size, it would just need to be scaled at the annotation scale.

    I'm not having any luck figuring it out and and I'm relatively new at lisp.

  2. #2
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Block Insertion Lisp/ Palette command - - HELP!

    Please upload a sample.dwg
    Attached Files Attached Files

  3. #3
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: Block Insertion Lisp/ Palette command - - HELP!

    You could write it all in one line or what would be better would be to use a lisp that you pass the block name.
    not tested
    Code:
    macro
    ^c^c^p(if (not insblk)(load "insblk"))(insblk "grdot"))
    
    lisp file
    (defun insblk (bname  / sheet sz )
    (setq sheet (strcase (getstring "Enter sheet size B or D")))
    (cond
    ((= sheet "B")(setq sz 2.0))
    ((= sheet "D")(setq sz 1.0))
    )
    (command "-insert" (getpoint) bname sz 0.0)
    )

Similar Threads

  1. Simulate Palette Block Insertion
    By LSElite in forum AutoLISP
    Replies: 7
    Last Post: 2015-03-19, 10:41 PM
  2. block insertion from palette overwrites existing
    By Wish List System in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2014-10-29, 01:29 PM
  3. Block Insertion Errors from Tool Palette
    By DWS44 in forum AutoCAD General
    Replies: 1
    Last Post: 2008-05-20, 02:08 PM
  4. Dynamic Block Match Object Layer on insertion from Tool Palette
    By sfanello in forum Dynamic Blocks - Technical
    Replies: 5
    Last Post: 2007-08-02, 08:20 PM
  5. Add Block insertion macro to a Tool Palette
    By bboss in forum AutoCAD Customization
    Replies: 3
    Last Post: 2007-05-09, 07:13 PM

Posting Permissions

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