.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clipping the boundary of an AutoCAD document in VB.Net

3 REPLIES 3
Reply
Message 1 of 4
tmitchell68
785 Views, 3 Replies

Clipping the boundary of an AutoCAD document in VB.Net

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
3 REPLIES 3
Message 2 of 4
JamieVJohnson
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
Message 3 of 4
krugerm
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!
Message 4 of 4
JasonTuck
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost