+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Full Member Ahmeds's Avatar
    Computer Details
    Ahmeds's Computer Details
    Operating System:
    Windows 7 Home Basic
    Computer:
    Desktop only
    Motherboard:
    G31T-M7
    CPU:
    Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz (2 CPUs), ~2.9GHz
    RAM:
    2048MB RAM
    Discipline
    Surveying
    Ahmeds's Discipline Details
    Occupation
    DPWH
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    Nov 2012
    Location
    Tanauan, Batangas, Philippines
    Posts
    59

    Default Select one object/entity, gripped all same entity within the layer

    Registered forum members do not see this ad.

    What function should i use to do that? I'm planning to change all entities in one layer but its is hard to select by windowing/crossing method because i have many entities in my drawing, so, i want to just click one but gripped all objects in the same layer to change simultaneously in just one command.

    Thanks in advance..

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,593

    Default

    QSelect / GetSel
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  3. #3
    Full Member Ahmeds's Avatar
    Computer Details
    Ahmeds's Computer Details
    Operating System:
    Windows 7 Home Basic
    Computer:
    Desktop only
    Motherboard:
    G31T-M7
    CPU:
    Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz (2 CPUs), ~2.9GHz
    RAM:
    2048MB RAM
    Discipline
    Surveying
    Ahmeds's Discipline Details
    Occupation
    DPWH
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    Nov 2012
    Location
    Tanauan, Batangas, Philippines
    Posts
    59

    Default

    Quote Originally Posted by Lee Mac View Post
    QSelect / GetSel
    Thanks Lee, but as I go to Autodesk Help (AutoLisp Functions) to see an example as my reference I've notice that there is no functions such as Getsel.
    can u please give me an example of that?

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,246

    Default

    Quote Originally Posted by Ahmeds View Post
    ........... I've notice that there is no functions such as Getsel.
    GetSel is a command , and Lee gave you two options so you can use either of them

  5. #5
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    A third built-in alternative is the FILTER command.

    The GETSEL command is part of Express pack; for this reason it isn’t listed in AutoCAD’s help. If you cannot call it at command prompt, too, this may be from either the fact that you don’t have that extension installed, or that you are using the LT type of AutoCAD.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  6. #6
    Full Member Ahmeds's Avatar
    Computer Details
    Ahmeds's Computer Details
    Operating System:
    Windows 7 Home Basic
    Computer:
    Desktop only
    Motherboard:
    G31T-M7
    CPU:
    Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz (2 CPUs), ~2.9GHz
    RAM:
    2048MB RAM
    Discipline
    Surveying
    Ahmeds's Discipline Details
    Occupation
    DPWH
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    Nov 2012
    Location
    Tanauan, Batangas, Philippines
    Posts
    59

    Default

    Quote Originally Posted by Tharwat View Post
    GetSel is a command , and Lee gave you two options so you can use either of them
    Ok, I got you guys.. Thanks!

    I tried this routine to make a selection and change all text heights in just one command but all I've got is error: bad argument type: lselsetp

    Would you please help me to do this right..

    Code:
    (defun c:CTH ()
        (graphscr)
        ;(prompt "text height to change")(terpri)
        (setq a (car (entsel)))(terpri)
        (if a (setq a (cdr(assoc 8 (entget a)))
    	  	sslst(list (cons 0 "text")(cons 8 a))
    	  )
        );end if
      
               (setq nh(getreal "New Text Height: "))
               ;(princ "\nWORKING\n")
            (setq N (sslength sslst))
              (progn
              (setq n1 N)
              (repeat N
                (setq n1 (- n1 1))
                (setq b (ssname sslst n1))
                (setq c (cdr(assoc 0(entget b))))
                (if (= c "TEXT") (progn
                    (setq e (entget b))
                    (setq f (assoc 40 e))
                    (setq g (atof(rtos(cdr f)2 6)))
                    (entmod (subst(cons(car f) nh) f e))
    
                ))
                ))
    
    (princ)
    )
    Last edited by Ahmeds; 15th Dec 2012 at 09:36 am.

  7. #7
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    That code attempts to treat a list as a selection set; I believe that this line:
    Code:
    sslst (list (cons 0 "text") (cons 8 a))
    should be instead:
    Code:
    sslst (ssget "_X" (list (cons 0 "text") (cons 8 a)))
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  8. #8
    Full Member Ahmeds's Avatar
    Computer Details
    Ahmeds's Computer Details
    Operating System:
    Windows 7 Home Basic
    Computer:
    Desktop only
    Motherboard:
    G31T-M7
    CPU:
    Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz (2 CPUs), ~2.9GHz
    RAM:
    2048MB RAM
    Discipline
    Surveying
    Ahmeds's Discipline Details
    Occupation
    DPWH
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    Nov 2012
    Location
    Tanauan, Batangas, Philippines
    Posts
    59

    Default

    well, i got it now.. here it is..

    Code:
    (defun c:CTH ()
        (graphscr)
        (prompt "text height to change")(terpri)
        (setq x (car (entsel)))(terpri)
        (if x (setq x (cdr(assoc 8 (entget x)))
    	  	sslst(list (cons 0 "text")(cons 8 x))
    	  )
        );end if
        (setq a (ssget "x" sslst)) 
               (setq nh(getreal "New Text Height: "))
             (setq N (sslength a))
              (progn
              (setq n1 N)
              (repeat N
                (setq n1 (- n1 1))
                (setq b (ssname a n1))
                (setq c (cdr(assoc 0(entget b))))
                (if (= c "TEXT") (progn
                    (setq e (entget b))
                    (setq f (assoc 40 e))
                    (setq g (atof(rtos(cdr f)2 6)))
                    (entmod (subst(cons(car f) nh) f e))
    
                ))
                ))
    
    (princ)
    )
    Thank you Guys...
    Last edited by Ahmeds; 15th Dec 2012 at 09:35 am.

  9. #9
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    You should localize your variables and include the entire processing in the IF, or at least ensure that exit if user didn't select first text item. Just run your routine twice in a row, and second time do not select a text label, input a text height different than at first run and see what is happening.
    Also, please edit the above port and add the required code tags. Thank you.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  10. #10
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,246

    Default

    Registered forum members do not see this ad.

    Pay attention to locked layers with the selection method "_x"

Similar Threads

  1. Select Text Entity from Xref using .net
    By giskumar in forum .NET, ObjectARX & VBA
    Replies: 7
    Last Post: 15th Oct 2012, 05:26 pm
  2. Select all objects that are on same layer as entity selection
    By KRBeckman in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 17th Jun 2010, 04:23 pm
  3. Any way to select an entity knowing it's beginning and end locations?
    By Hudson in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 10th Nov 2009, 08:03 pm
  4. DBX entity select mod
    By ollie in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 15th Oct 2009, 09:19 am
  5. How select an object or entity??
    By vasqrainier in forum AutoCAD General
    Replies: 2
    Last Post: 18th Jan 2007, 04:46 am

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