.NET

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

Clipping the boundary of an AutoCAD document in VB.Net

290 Views, 3 Replies
12-06-2006 12:55 PM
Hello,

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,
Tim
Distinguished Contributor
JamieVJohnson
Posts: 136
Registered: ‎09-29-2008
Message 2 of 4 (290 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.



jvj
Contributor
krugerm
Posts: 17
Registered: ‎01-07-2009
Message 3 of 4 (290 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
jasontuck
Posts: 1
Registered: ‎12-17-2008
Message 4 of 4 (290 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:
SpatialFilter.ClipSpaceToWorldCoordinateSystemTransform
SpatialFilter.OriginalInverseBlockTransform
BlockReference.BlockTransform

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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community