[LISP] ssget


Recommended Posts

Witam,

chcę utworzyć grupę obiektów z zadanym filtrem:

(ssget '((-4 . "")(-4 . "")(-4 . "AND>")))

problem w tym, że ni cholerę to działa.

W HELP dla ZwCAD istnieją tylko takie możliwości:

Operator Meaning

"&" Bitwise AND (integers only).

"&=" Bitwise masked equals (integers only).

"*" All.

"=" Equals.

"!=" Not equal to.

"/=" Not equal to.

"<>" Not equal to.

"<" Less than.

"<=" Less than or equal to.

">" Greater than.

">=" Greater than or equal to.

ale najlepsze jest to, że sam zapis w postaci:

(setq lstObj (ssget '((-4 . ""))))

działa bez problemu - zatem postać "

Jak zatem uzyskać filtr, który potrzebuję - czy traktować to jako bug ZwCAD?

Link to comment
Share on other sites

Dokopałem się jeszcze do takiej dokumentacji z HELP:

Use logical operator in filter list

The logical operators used in filter list must appear in pair, same as the logical functions provided by AutoLISP, the operators of each logical operator group must be the expression whose return value is True or False in the filter list. The logical operators can be used in filter list include "", "or>", "xor>" and "not>". If there is not the specified logical operator in the filter list, all the elements in the list should be tested by the operators "". The above logical operators can't be used in filter list unless constructing its string form and dxf code -4 to dotted pair. Executing the following sample code to add the line entities and circle entities in the entire drawing database to the selection set:

command : (ssget "X" '((-4 . "")))

User can also use logical operators in the filter list to add the entity which contains any one of the two application names (“ZWCAD_ELEC” or “ZWCAD_MECH”) to the selection set. Please refer to following code:

command : (ssget "X" '((0 . "LINE") (-4 . "")))

Zatem wynika, że mój kod jest prawidłowy, a nie działa...

Link to comment
Share on other sites

Dorzucam plik w załączniku.

Mój filtr powinien wyłapać tylko białe linie.

W AC działa bez problemu.

Poleceniem:

(entget(car(entsel)) '("*"))

można sprawdzić, że różowe linie posiadają XDATA:

(-3 ("tmpLine" (1002 . "{") (1000 . "tmpLine") (1002 . "}")

Sprawdziłem też pod ZwCAD2011:

_VERNUM = "2011.06.30(16923)"

i problem również występuje.

pozdrawiam,

ZK

test.dwg

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share