+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 24
  1. #11
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Mar 2012
    Posts
    37

    Default

    Registered forum members do not see this ad.

    I definitely will, thanks Mircea, it appears SSGET is more complex than it appears at first glance

  2. #12
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,926

    Default

    Did you try an OR filter ?
    Code:
    
    (setq Tchg (ssget '((-4 . "<OR")(0 . "MTEXT")(0 . "TEXT")))
    =David
    R12 (Dos) - A2K

  3. #13
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,634

    Default

    Quote Originally Posted by David Bethel View Post
    Did you try an OR filter ?
    Code:
    
    (setq Tchg (ssget '((-4 . "<OR")(0 . "MTEXT")(0 . "TEXT")))
    =David
    I also noticed that. The "<AND" would only select entities which are both MTEXT and TEXT ... which is kind-of impossible ... so nothing would be selected. But as others have shown you the wild-card matching actually gives a simpler approach in this case. To see other wild-card matches, read the help on the wcmatch function.

    Anyhow, you don't need the "<AND" ... "AND>" grouping in most cases (other than this one ) - it's already implied as such. It's only necessary when you have one or more OR's and portions thereof you want to have as AND's.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  4. #14
    Senior Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2012
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    328

    Default

    What ab. "<XOR"..."XOR>". I really have difficulties understanding XOR... Can someone explain with some example?...

    M.R.

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  5. #15
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,926

    Default

    Quote Originally Posted by marko_ribar View Post
    What ab. "<XOR"..."XOR>". I really have difficulties understanding XOR... Can someone explain with some example?...

    M.R.
    http://cplus.about.com/od/glossar1/g/xor.htm

    Basically XOR returns T if 1 and only 1 test of 2 operands returns T
    R12 (Dos) - A2K

  6. #16
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,926

    Default

    Quote Originally Posted by irneb View Post
    I also noticed that. The "<AND" would only select entities which are both MTEXT and TEXT ... which is kind-of impossible ... so nothing would be selected. But as others have shown you the wild-card matching actually gives a simpler approach in this case. To see other wild-card matches, read the help on the wcmatch function.

    Anyhow, you don't need the "<AND" ... "AND>" grouping in most cases (other than this one ) - it's already implied as such. It's only necessary when you have one or more OR's and portions thereof you want to have as AND's.
    The AND test is normally used for 2 unique DXF group values,
    Code:
    (-4 ". <AND") (0 . "CIRCLE) (40 . 1.0) (-4 . "AND>")
    You can also group AND filters within OR tests

    All of the logical filters (AND,OR,XOR,NOT) must be in balanced pairs

    Wildcards can get to be confusing when you start trying to combine "~" with "*" and "," sequences.
    Last edited by David Bethel; 29th Mar 2012 at 07:24 pm.
    R12 (Dos) - A2K

  7. #17
    Senior Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2012
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    328

    Default

    Quote Originally Posted by David Bethel View Post
    http://cplus.about.com/od/glossar1/g/xor.htm

    Basically XOR returns T if 1 and only 1 test of 2 operands returns T
    Thanks David... It's very understandable link... M.R.

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  8. #18
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,634

    Default

    The usual difficulty when working with and/or/xor is that most people (or rather most languages including English) doesn't define those words exactly as logical comparison defines them. Usually when people say "OR" what they mean is XOR (or Exclusive Or) - i.e. it's either the one or the other - not both. Logic Comp defines OR as "Any of the operands - even just one, but also more than one".

    Then you get to the AND ... which also sometimes gets confusing. Since people sometimes misuse the word in conversation - you end up with situations like these. In Logic Comp AND means "All the operands - not just some".

    The way lisp (and most other programming languages) work on these is the following:

    AND:
    1. Check if next operand returns True (or not nil in the case of Lisp).
    2. If the test is positive, continue. Else return False/Nil.
    3. If there's any more operands repeat from 1, else return True.
    OR:
    1. Check if next operand returns True (or not nil in the case of Lisp).
    2. If the test is positive, return True. Else continue.
    3. If there's any more operands, repeat from 1. Else return False/Nil.
    NOT: Basically an invert toggle. If the operand (only one - doesn't work on more) is False/Nil return True. If the operand is True/NotNil return False/Nil.

    XOR: This is how most people understand the word OR when spoken - i.e. as in "Either OR".
    Though Lisp doesn't have a XOR function, you can make one quite easily. The principle behind it would be to combine OR, NOT & AND. E.g.:
    Code:
    (defun XOR (v1 v2 /)
      (and (or v1 v2) (not (and v1 v2)))
    )
    Thus it returns an AND of an OR & (NOT) AND. I.e. True only if OR returns true, but AND returns FALSE - otherwise return False/Nil.
    Most other languages have built-in XOR functions/operators, but usually they'd be implemented similarly - just already done for you.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  9. #19
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,634

    Default

    Quote Originally Posted by David Bethel View Post
    Wildcards can get to be confusing when you start trying to combine "~" with "*" and "," sequences.
    Not as confusing as when you try to use Regular Expressions ... but yes, you need your wits about you to understand what's going on.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  10. #20
    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
    15,718

    Default

    Registered forum members do not see this ad.

    Three more variations of a possible XOR function, for fun:

    Code:
    (defun XOR ( a b )
        (or (and a (not b)) (and b (not a)))
    )
    
    (defun XOR ( a b )
        (and (or (not a) (not b)) (or a b))
    )
    
    (defun XOR ( a b )
        (or (not (or (not a) b)) (not (or a (not b))))
    )
    Nice explanation Irne
    Lee Mac Programming

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

    Just another Swamper

Similar Threads

  1. Selection sets in vb.net
    By Jozi68 in forum .NET, ObjectARX & VBA
    Replies: 8
    Last Post: 14th Feb 2012, 07:33 pm
  2. selection sets in multiple drawings
    By salman in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 15th Jun 2011, 02:32 pm
  3. VBA - Selection Sets
    By -KarL- in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 3rd Mar 2009, 10:54 am
  4. Little help on selection sets please
    By Galingula in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 17th Apr 2006, 03:39 pm
  5. selection sets..........
    By rajanikrishna in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 14th Nov 2005, 11:32 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