+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Qselect

  1. #1
    Senior Member alijahed's Avatar
    Computer Details
    alijahed's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL M4500
    Using
    Inventor 2014
    Join Date
    Apr 2007
    Location
    Melbourne
    Posts
    486

    Default Qselect

    Hi All,

    how can I use QSELECT command in lisp and set its parameters to select a specific block through block name filter.

    Cheers

    Ali

  2. #2
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    Look into using ssget instead.

  3. #3
    Senior Member alijahed's Avatar
    Computer Details
    alijahed's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL M4500
    Using
    Inventor 2014
    Join Date
    Apr 2007
    Location
    Melbourne
    Posts
    486

    Default

    I have dynamic blocks so I prefer to use QSELECT.

  4. #4
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    QSelect doesn't have a commandline option.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  5. #5
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    If you want to roll your own, you can specify the block name and cycle through a selection (removing what doesn't match the vla-get-effectivename) and the use sssetfirst to select what's left.

    Code:
    (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," name))))
    This will select all dynamic blocks and blocks matching the specified name. From there, you can cycle (what I said above).
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  6. #6
    Senior Member alijahed's Avatar
    Computer Details
    alijahed's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL M4500
    Using
    Inventor 2014
    Join Date
    Apr 2007
    Location
    Melbourne
    Posts
    486

    Default

    After weeks I came back to this and I confused!
    so it is better to simplify the situation.
    Let's say I have a dynamic block inserted on the screen and I know the name of the dynamic block.
    How can I select that dynamic block by it's name?

    Cheers

    Ali

  7. #7
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,752

    Default

    Ali,

    you can filter any Entity you want with Autolisp, but to put selection on hold is not that needed, so there must be an action to do after selecting any Entity.

    For example this lisp is made by me it will ask you to select a block and it will insert the selected Block with non stop action until you hit enter. Try it.
    Code:
    (defun c:qs (/ a ins)
    (setq b (cdr(assoc 2 (entget(car(entsel"\nSelect a Block: "))))))
    (while (setq ins (getpoint"\n Insertion point <enter to exit> :"))
    	(command "_insert" b ins  "" "" "" ))
    (princ "Written by Tharwat")
    (princ))
    Tharwat

  8. #8
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    3,752

    Default

    Hi

    Your question is not clear and to whom it is dedicated ?

    clarify please

    Tharwat

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,737

    Default

    Quote Originally Posted by alijahed View Post
    How can I select that dynamic block by it's name?
    When a dynamic blocks properties are altered, it becomes an anonymous block, therefore you are unable to select it using its name in an ssget filter, rather, use the filter that Alan has suggested, and filter through the resultant set (should there be one), and check against the EffectiveName property.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  10. #10
    Full Member
    Using
    AutoCAD 2012
    Join Date
    Jul 2010
    Location
    Dublin Ireland
    Posts
    55

    Default

    Registered forum members do not see this ad.

    Sorry to gravedig here . I need to be able to select a block and have AutoCAD tell me how many times that block has been placed in the drawing file. Tharwat's routine looks like it could be altered to do this - but I have no idea how to do so. Can anyone assist please ?

Similar Threads

  1. Qselect Wildcards
    By qball in forum AutoCAD General
    Replies: 7
    Last Post: 13th Jan 2011, 03:32 pm
  2. How QSELECT functioning?
    By Billy in forum AutoCAD General
    Replies: 5
    Last Post: 23rd Feb 2010, 03:09 pm
  3. Qselect
    By dhl in forum AutoLISP, Visual LISP & DCL
    Replies: 26
    Last Post: 2nd Nov 2009, 11:02 am
  4. qselect and filters
    By robcad in forum AutoCAD Drawing Management & Output
    Replies: 16
    Last Post: 11th May 2007, 02:23 pm
  5. QSELECT in transparency mode??
    By tzframpton in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 7th Mar 2007, 11:31 pm

Bookmarks

Posting Permissions

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