Aller au contenu

utilisation des operateurs Booleen dans une sellection


bucheron

Messages recommandés

bonjours

 

J'ai un nouveau probleme a vous soumettre.

 

j'aimerais creer un bouton qui me permette de sellection toutes les entitées SAUF les blocks en utilisant l'operateur "NOT" dans la ligne. J'ai fait quelques test mais c'est pas concluant.

 

Je suis parti d'un exemple de Patrick_35 :

(ssget"_X" '((-4 . "AND") (0 . "CIRCLE") (40 . 0,1)(-4 . "AND>")));

 

comment utiliser le "NOT" dans une sellection?

 

Merci

 

Lien vers le commentaire
Partager sur d’autres sites

Salut

Un extrait de l'aide d'autocad

You can also test groups by creating nested Boolean expressions that use the logical grouping operators shown in the following table:

 

Grouping operators for selection set filter lists

 

Starting

operator

Encloses Ending

operator

"AND" One or more operands "AND>"

"OR" One or more operands "OR>"

"XOR" Two operands "XOR>"

"NOT" One operand "NOT>"

The grouping operators are specified by –4 groups, like the relational operators. They are paired and must be balanced correctly in the filter list or the ssget call will fail. An example of grouping operators in a filter list follows:

 

(ssget "X"

 

'(

(-4 . "OR")

(-4 . "AND")

(0 . "CIRCLE")

(40 . 1.0)

(-4 . "AND>")

(-4 . "AND")

(0 . "LINE")

(8 . "ABC")

(-4 . "AND>")

(-4 . "OR>")

)

 

)

 

This code selects all circles with a radius of 1.0 plus all lines on layer "ABC". The grouping operators are not case-sensitive; for example, you can specify "and>", "or", instead of "AND>", "OR".

Grouping operators are not allowed within the –3 group. Multiple application names specified in a –3 group use an implied AND operator. If you want to test for extended data using other grouping operators, specify separate –3 groups and group them as desired. To select all circles having extended data for either application "APP1" or "APP2" but not both, enter the following:

 

(ssget "X"

'((0 . "CIRCLE")

(-4 . "XOR")

(-3 ("APP1"))

(-3 ("APP2"))

(-4 . "XOR>")

)

 

)

 

You can simplify the coding of frequently used grouping operators by setting them equal to a symbol. The previous example could be rewritten as follows (notice that in this example you must explicitly quote each list):

 

(setq xor '(-4 . "XOR")

xor> '(-4 . "XOR>") )

(ssget "X"

(list

'(0 . "CIRCLE")

xor

'(-3 ("APP1"))

'(-3 ("APP2"))

xor>

)

 

)

 

:mad: grrrr..., le "<" ne passe pas avec les opérandes, ne pas oublier de les ajouter

 

@+

 

[Edité le 3/11/2004 par Patrick_35]

Les Lisps de Patrick

Le but n'est pas toujours placé pour être atteint, mais pour servir de point de mire.

Joseph Joubert, 1754-1824

Lien vers le commentaire
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer. Politique de confidentialité