Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Check if clip is present in the drawing
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Check if clip is present in the drawing (Read 792 times)
0 Members and 1 Guest are viewing this topic.
w64bit
Newt
Posts: 83
Check if clip is present in the drawing
«
on:
April 27, 2024, 08:37:38 AM »
How I can check if a drawing contains clip?
ssget can help? If yes, someone knows if there is a group code for clip?
«
Last Edit: April 27, 2024, 11:53:41 AM by w64bit
»
Logged
It's Alive!
Retired
Needs a day job
Posts: 8789
AKA Daniel
WWW
Re: Check if clip is present in the drawing
«
Reply #1 on:
April 29, 2024, 03:33:22 AM »
in the whole drawing? it's a Spatial Filter right?
this is python, maybe it can give a hint
Code - Python:
[Select]
import
traceback
from
pyrx_imp
import
Rx
,
Ge
,
Db
,
Ap
,
Ed
def
PyRxCmd_doit
(
)
-
>
None
:
try
:
db
=
Db.
curDb
(
)
print
(
len
(
db.
objectIds
(
Db.
SpatialFilter
.
desc
(
)
)
)
)
except
Exception
as
err:
traceback
.
print_exception
(
err
)
Logged
https://github.com/CEXT-Dan/PyRx
https://pyarx.blogspot.com/
It's Alive!
Retired
Needs a day job
Posts: 8789
AKA Daniel
WWW
Re: Check if clip is present in the drawing
«
Reply #2 on:
April 29, 2024, 03:37:05 AM »
I found this
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/groupcode-for-an-xclip-or-how-to-access-it/m-p/856189
Logged
https://github.com/CEXT-Dan/PyRx
https://pyarx.blogspot.com/
xdcad
Swamp Rat
Posts: 506
WWW
Re: Check if clip is present in the drawing
«
Reply #3 on:
May 02, 2024, 05:21:12 AM »
CLIP information is stored in the extended dictionary of the AcDbBlockReference (INSERT) object,
The Inspector tool can view
You can traverse all INSERTs to determine whether there is ACAD_FILTER
Code - Auto/Visual Lisp:
[Select]
(
defun
XD::Doc:HasFILTER
(
/
SS i bFound dict
)
(
if
(
setq
ss
(
ssget
"x"
'
(
(
0
.
"Insert"
)
)
)
)
(
progn
(
setq
i
-
1
bFound t
)
(
while
(
and
bFound
(
setq
e
(
ssname
ss
(
setq
i
(
1+
i
)
)
)
)
)
(
setq
ed
(
entget
e
)
)
(
if
(
and
(
setq
dict
(
cdr
(
assoc
360
ed
)
)
)
(
=
(
cdr
(
assoc
3
(
entget
dict
)
)
)
"ACAD_FILTER"
)
)
(
setq
bFound
nil
)
)
)
(
not
bFound
)
)
)
)
«
Last Edit: May 02, 2024, 05:26:54 AM by xdcad
»
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
w64bit
Newt
Posts: 83
Re: Check if clip is present in the drawing
«
Reply #4 on:
May 08, 2024, 11:43:07 AM »
Thank you.
Is it possible, please, to add an alert when xclips are found?
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Check if clip is present in the drawing