Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor pli
Active Contributor
pli
Posts: 32
Registered: ‎04-25-2008
Message 1 of 6 (363 Views)

Does XREF/BLOCK have Boundary

363 Views, 5 Replies
12-02-2010 11:23 AM

How can you test if an Xref or Block Insert has been xclipped with a Boundary?

I don't see any difference in the 70 or 71 flags.

Thanks.


Paul Li
Senior Associate
ALTOON PARTNERS LLP
Los Angeles • Amsterdam • Shanghai • Hong Kong • Moscow
444 South Flower Street • 48th Floor • Los Angeles • California • 90071-2901
D +1 213 225 1944 • T +1 213 225 1900 • www.altoonpartners.com


Mentor
t.willey
Posts: 2,504
Registered: ‎02-17-2004
Message 2 of 6 (356 Views)

Re: Does XREF/BLOCK have Boundary

12-02-2010 02:13 PM in reply to: pli

This should work.  Haven't used it since I wrote it, as it wouldn't work for what I wanted, but it will return the boundry of a xclip if it has one.

 

(defun GetSpatialFilter (ename / Data Dict tempDict)
    ; Get the xclip boundry
    
    (if
        (and
            (setq Data (entget ename))
            (setq Dict (cdr (assoc 360 Data)))
            (setq tempDict (dictsearch Dict "ACAD_FILTER"))
            (setq tempDict (dictsearch (cdr (assoc -1 tempDict)) "SPATIAL"))
        )
        (cons '(0 . "SPATIAL_FILTER") (member (assoc 100 tempDict) tempDict))
    )
)

Active Contributor pli
Active Contributor
pli
Posts: 32
Registered: ‎04-25-2008
Message 3 of 6 (354 Views)

Re: Does XREF/BLOCK have Boundary

12-02-2010 02:18 PM in reply to: t.willey

Thanks this works perfectly.

As a side note, can the same be used to test if a clip boundary exists for Image, DGN, DWF, PDF ?


Paul Li
Senior Associate
ALTOON PARTNERS LLP
Los Angeles • Amsterdam • Shanghai • Hong Kong • Moscow
444 South Flower Street • 48th Floor • Los Angeles • California • 90071-2901
D +1 213 225 1944 • T +1 213 225 1900 • www.altoonpartners.com


Mentor
t.willey
Posts: 2,504
Registered: ‎02-17-2004
Message 4 of 6 (350 Views)

Re: Does XREF/BLOCK have Boundary

12-02-2010 02:33 PM in reply to: pli

Don't know.  Don't really work with them, but I would think that you could test them with the program, and see what is returned.  It wouldn't harm any entity, as it is just looking at stuff.

 

You're welcome.

Active Contributor pli
Active Contributor
pli
Posts: 32
Registered: ‎04-25-2008
Message 5 of 6 (347 Views)

Re: Does XREF/BLOCK have Boundary

12-02-2010 02:41 PM in reply to: t.willey

Nope, your routine did not work for the other object types.  Too bad.  Thanks anyways.


Paul Li
Senior Associate
ALTOON PARTNERS LLP
Los Angeles • Amsterdam • Shanghai • Hong Kong • Moscow
444 South Flower Street • 48th Floor • Los Angeles • California • 90071-2901
D +1 213 225 1944 • T +1 213 225 1900 • www.altoonpartners.com


Mentor
t.willey
Posts: 2,504
Registered: ‎02-17-2004
Message 6 of 6 (343 Views)

Re: Does XREF/BLOCK have Boundary

12-02-2010 03:13 PM in reply to: pli

Looks like for images you have to look at dxf codes 13 ( size of the image ) and 14 ( points of clipping ) and compare them, because even when I inserted an image, it has dxf codes 14, so it seems they are always clipped.  But if code 91 is greater than 2, then there is some real clipping for sure, but the clipping could be the whole size of the image.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.