New Member
Posts: 1
Registered: ‎12-06-2006
Message 1 of 4 (315 Views)

Clipping the boundary of an AutoCAD document in VB.Net

315 Views, 3 Replies
12-06-2006 12:55 PM

I have an AutoCAD DWG file that is represented in some VB.Net code as an AutoCAD.ACADDocument.

What I need to do is clip a specified boundary of the DWG file, so that all that remains is the part that is within the boundary.

This would be similar to the manual 'xclip' AutoCAD command; only I need to do this from the code.

The closest thing I have been able to find is a 'ClipBoundary' function. The only problem is that this works for a raster object, but not a DWG ACADDocument.

Any help would be GREATLY appreciated.

Thanks in advance,
Distinguished Contributor
Posts: 136
Registered: ‎09-29-2008
Message 2 of 4 (315 Views)

Re: Clipping the boundary of an AutoCAD document in VB.Net

01-09-2009 10:45 AM in reply to: tmitchell68
Have you made any progress on this? I have been working on a similar process to trim out xclip-ed blocks and xrefs. So far I found that i can get X-clip defenition data from the SpacialFilter object attached to the extended data of any given blockreference. I am still looking for a way to make the filter indexer, which is responsible for returning the cliped entities, to work for me.

I don't think anybody has done this in anything.net yet, so if you have, please help.

Posts: 17
Registered: ‎01-07-2009
Message 3 of 4 (315 Views)

Re: Clipping the boundary of an AutoCAD document in VB.Net

01-11-2009 06:15 PM in reply to: tmitchell68
I too would be interested if you find an answer. At the moment I'm manually clipping all the geometry, but I can't help but feel there _has_ to be a better way!
New Member
Posts: 1
Registered: ‎12-17-2008
Message 4 of 4 (315 Views)

Re: Clipping the boundary of an AutoCAD document in VB.Net

01-12-2009 07:45 AM in reply to: tmitchell68
I'm working on something pretty similar (a clipbind command - erase non-visible objects in xrefs to keep bound file size down).. right now im getting the points via the spatialfilterdefinition, transforming the points from the definition.getpoints to real modelspace points using the following transforms:

So far I can draw plines in modelspace for each clipped block, which is a decent starting point. Where it gets tricky for me is that sometimes i have the same xref copied around, but each one is clipped differently. So i have to duplicate/clone the block definition multiple times so i can map the blockreferences to a distinct block definition, then modify the definition to erase the non-visible entities. Or something. This is my first .net project and its making my brain hurt.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
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.