Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

cut Blockreference durch eine Linie

reithinger
Advocate

cut Blockreference durch eine Linie

reithinger
Advocate
Advocate

Hi,

i want to cut BlockReference Left or right from a line are.

Show my Image:

schneiden.jpg

Here are 16 Blockreferences and i want to cut the Blocj Left or Rights from the Line.

Have you got any Idea to do this ?

I can do this with a closed Polyline. 

Question is can i create a closed polyline with ACAD Function.

Thanks for your answer.

I hope the example is good.

Thanks Fabrice

0 Likes
Reply
Accepted solutions (1)
207 Views
6 Replies
Replies (6)

norman.yuan
Mentor
Mentor
Accepted solution

Have you tried to run commands "CLIP"/"CLIPIT"/"XCLIP". If clipping the block reference as the "CLIP" command does is what you want and you want to do it via code, you can read a recent discussion here:

https://forums.autodesk.com/t5/net/clipping-a-block/td-p/13204565 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

reithinger
Advocate
Advocate

Hi Norman, thanks for your link.

My question is rather if we could do this automatically.

In your example you have to click the points yourself. Is it possible with Autocad to automatically create a polygoniand use it with the spatial filter ?

0 Likes

norman.yuan
Mentor
Mentor

Well, if you do not want user input for the clip boundary, yes, AutoCAD should be able to "automatically" gather a set of points to form the boundary BY YOUR CODE. So it is your task as programming to find out the boundary you need for clipping.

 

In your case, it might be rather easy to do, something like:

 

1. Get the extents of the 16 blocks. In this case it should be a square/rectangle;

2. Create closed polyline of the extents (do not have to added to the database);

3. Find the intersection points of the line and the rectangle/square polyline. you should get 2 points.

4. Now with the the vertex points of the polyline and the 2 intersecting points, you can have 2 sets of points that can form 2 boundaries.

5. choose one set of points for the clipping.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

reithinger
Advocate
Advocate

Hi Norman,

 

give it a way to invert the clip boundary ?

I doesn't cut outer the clip boundary, but i want tocut the inner Blockreferences from the clipboundary.

Thanks

0 Likes

norman.yuan
Mentor
Mentor

SpatialFilter has a read/write property "Inverted", which toggles the "clipped" area being inside or outside.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

reithinger
Advocate
Advocate

Hi,

I have tested, it changed nothing.. with inverted true or false, i have the same result

 

0 Likes