Results 1 to 6 of 6

Thread: Custom Macro Based on the QSELECT Command

  1. #1
    100 Club
    Join Date
    2005-04
    Posts
    112
    Login to Give a bone
    0

    Question Custom Macro Based on the QSELECT Command

    I would like to create a custom macro based on the QSELECT Command that automatically chooses Object Type: Block Reference > Properties: Name. Since their is no command line version of QSELECT, I don't know what the macro would be. Would this require a lisp routine to execute? Or just a macro created in the CUI for a new custom command?

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Custom Macro Based on the QSELECT Command

    Why not select the block using SSX?

  3. #3
    100 Club
    Join Date
    2005-04
    Posts
    112
    Login to Give a bone
    0

    Default Re: Custom Macro Based on the QSELECT Command

    SSX prompts me to enter the block name; I would rather visually pick it from the list in the QSELECT Dialog.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Custom Macro Based on the QSELECT Command

    Quote Originally Posted by rbdome View Post
    SSX prompts me to enter the block name; I would rather visually pick it from the list in the QSELECT Dialog.
    If you start SSX, pick a block, and hit enter you've selected every block with that name. I've got a lot of blocks in my drawings and only remember the names of a few of them.

    I've written lisp for selecting an item from an AutoCAD table so a modified version shouldn't be that bad. I'm busy today, but if you ask a moderator would move this thread to the lisp forum I'll post one first of next week if nobody beats me to it.

    Sub-routine from another lisp for modifying Attrubutes if anyone wants to play with it:
    Code:
    ;;;********** ChgProp from Table **********
    
      (defun TblSel (TblType / TblLst Idx# txt)
        (setq TblLst ()
              x (tblnext TblType T)
        )
        (while x ; Build table
           (if (/= (cdr (assoc 2 x)) "")		;if table entry isn't ""
              (setq TblLst (cons (cdr (assoc 2 x)) TblLst)) ;add it to list.
           );if
           (setq x (tblnext TblType))
        );while
        (if (> (length TblLst) (getvar "MAXSORT"))
               (setvar "MAXSORT" (+ 200 (length TblLst)))
        ); if
        (setq TblLst (acad_strlsort TblLst)
              Idx# (- (length TblLst)(length(member TblEnt TblLst)))
        )
        (if (= (getvar "cmddia") 0)
          (progn
           (foreach N TblLst (print N))
           (setq txt(strcat "\nEnter " TblType " Name: "))
           (while (not (member (setq TblNam (strcase (getstring txt)))TblLst))
            (princ "\nThat is not a valid style: ")
           ); while
          ); progn
          (progn
            (setq id (load_dialog "chs.dcl"))
            (new_dialog "chs" id)
            (start_list "styles")
            (mapcar 'add_list TblLst)
            (end_list)
            (set_tile "styles" (itoa Idx#))
            (action_tile "styles" "(if $value(setq Idx# (atoi $value)))")
            (mode_tile "styles" 0)
            (mode_tile "styles" 2)
            (start_dialog)
            (done_dialog)
            (setq TblNam (nth Idx# TblLst))
          ); progn
        ); if
      ); defun
    Examples used to select layer or text style:
    Code:
          ((= OP "Layer")
            (progn
              (setq TblSel (vla-get-Layers DocObj)
                    TblEnt ELA
              )
              (TblSel "Layer")
              (vl-catch-all-apply 'vla-put-Layer (list EOBJ TblNam))
            ); progn
          ); Layer
    
          ((= OP "Style")
            (progn
              (setq TblSel (vla-get-TextStyles DocObj)
                    TblEnt (vlax-get-property EOBJ 'StyleName)
              )
              (TblSel "Style")
              (vl-catch-all-apply 'vla-put-StyleName (list EOBJ TblNam))
            ); progn
          ); Style

  5. #5
    100 Club
    Join Date
    2005-04
    Posts
    112
    Login to Give a bone
    0

    Default Re: Custom Macro Based on the QSELECT Command

    I need to see all instances of a particular Block definition in my drawing. SSX only lists the quantity of instances on the Command Line, it does not show all instances with grips, the way QSELECT does. I need to experiment with the FILTER dialog. Can you save selection criteria in that dialog for later recall?

    Thanks

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Custom Macro Based on the QSELECT Command

    I modified the 1999 version of ssx.lsp and getsel.lsp in 2008 to gripselect the way QSELECT does. To add to the selection run ssx or getsel again. I also added Lineweight filter to ssx.lsp. See attached.
    I load them with acaddoc.lsp so they don't get autoloaded from Express Tools.
    Code:
    (load "D:/Users/BeaufordT/AppData/Roaming/Autodesk/VLisp/ssx.lsp")
    (load "D:/Users/BeaufordT/AppData/Roaming/Autodesk/VLisp/getsel.lsp")
    Along with other selection methods like _SelectSimilar, _AecSelectSimilar, Fast Select, Quick Select, Filter, and others I feel this covers all my needs.
    Attached Files Attached Files
    Last edited by Tom Beauford; 2017-06-12 at 09:48 PM. Reason: Modified newest version of ssx.lsp & added Lineweight filter to ssx.lsp

Similar Threads

  1. Macro Repeats Last Command
    By SwizzleStick in forum AutoCAD Customization
    Replies: 8
    Last Post: 2015-06-09, 07:44 PM
  2. 2012: Command and Macro
    By fat_max88477597 in forum AutoCAD General
    Replies: 4
    Last Post: 2012-12-06, 11:49 PM
  3. Command Line QSELECT?
    By mockdeep in forum AutoCAD General
    Replies: 30
    Last Post: 2007-09-14, 08:02 AM
  4. Command macro in Image Menu
    By sifuentes in forum AutoCAD Customization
    Replies: 9
    Last Post: 2006-05-24, 10:17 PM
  5. How can I distribute a custom macro
    By jasontirone in forum AutoCAD Customization
    Replies: 1
    Last Post: 2005-06-30, 09:43 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
  •