TRIMING DATA OUTSIDE OF SELECTED BLOCK/POLYGONs (IN LAYER)

TRIMING DATA OUTSIDE OF SELECTED BLOCK/POLYGONs (IN LAYER)

bit_Cad2018
Advocate Advocate
2,247 Views
10 Replies
Message 1 of 11

TRIMING DATA OUTSIDE OF SELECTED BLOCK/POLYGONs (IN LAYER)

bit_Cad2018
Advocate
Advocate

Dear all, 

               I need to Trim Data Outside Of the Selected Block/Polygons (In Layer)

 

I have multiple blocks/polygons (in the layer) so kindly help me.

0 Likes
2,248 Views
10 Replies
Replies (10)
Message 2 of 11

JBerns
Advisor
Advisor

@bit_Cad2018,

 

Have you tried the Express Tool named, BTRIM?

It well trim to your block.

It's a start until some better automation is provided.

 

I tried EXTRIM, but it removes too much geometry in your case, so avoid that tool.

 

I thought for automation:

  1. Select Block/Polygons
  2. For each block/polygon,
  3.    Get coordinates of vertices
  4.    Build an outward offset list of points for
  5.    Trim using Fence based on offset list of points
  6. Select all geometry
  7. Remove from selection, a crossing-polygon window based on each block/polygon vertices

Other thoughts?

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 3 of 11

hak_vz
Advisor
Advisor

@bit_Cad2018  Do you really need to use trim at all. You can use layouts with rotated viewports. There are many  codes added that automatically create layouts with rotated viewports.

If you don't prefer using layouts you can use Autocad commands PLAN and UCS object to change rotation

Step 1)

Run command UCS and select option OBject, or simply click on icon. Click on rectangle edge that you want to be lower edge of your paper

Untitled.png

 

Step 2)

Run command PLAN and press <enter> twice.

Untitled1.png

 

Your view changes so you can print your drawing, or add other information.

 

To go back to World ucs run UCS W or hit command icon. Run command PLAN and hit <enter> twice, And you are back in previous view. You can even use named views if you want. Trimming is least viable option. What if you have to make some changes. With trimming you are doomed, while layouts or method I described enable work continuation without fuss.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 4 of 11

Sea-Haven
Mentor
Mentor

Something like this note the 15 layouts and all have a title block.

 

 

Message 5 of 11

bit_Cad2018
Advocate
Advocate

@hak_vz I am doing the same. But I have Approximately 253 Polygon. for this, it is a very long process.

 

@Sea-Haven  your routine is very helpful can you update this routine? 

For example, by selecting the polygon and creating a viewport in 1:1000

 

bittuds1996_0-1631767185181.png

 

0 Likes
Message 6 of 11

bit_Cad2018
Advocate
Advocate

@JBerns Sorry for the late reply. actually, I am trying to use btrim command. I have appx 250 polygons in one layer.

The problem is btrim command does not select a similar object.

 

if one object missed selecting so I can't find what I require.

0 Likes
Message 7 of 11

3wood
Advisor
Advisor

You can try EXPLODEALL (need a free registration).

You can also clip the block with multiple boundaries with the code below.

EXPLODEALL MULTIPLE CLIPPED.gif

 

 

;;; Clip block with multiple polylines
;;; by 3wood 2021.09.1
(defun C:MCLIP (/ e1 s1 n1 os)
  (command "._undo" "begin")
  (prompt "\nPick up blcok: ")
  (setq e1 (car (entsel)))
  (prompt "\nSelect boundaries: ")
  (setq s1 (ssget '((0 . "LWPOLYLINE"))))
  (setq n1 0)
  (setq os (getvar "OSMODE"))
  (setvar "OSMODE" 0)
  (repeat (sslength s1)
    (command "copy" e1 "" "@" "@")
    (command "xclip" "last" "" "New" "Select" (ssname s1 n1))
    (setq n1 (1+ n1))
    )
  (command "._erase" e1 "")
  (setvar "OSMODE" os)
  (command "._undo" "end")
  )

 

Use MCLIP to clip select block into multiple parts:

MCLIP.gif

 

Message 8 of 11

bit_Cad2018
Advocate
Advocate

@3wood Thank You for your tips.  🙏

0 Likes
Message 9 of 11

JBerns
Advisor
Advisor

And BTRIM does not allow you to preselect with SELECTSIMILAR or QSELECT.

That is unfortunate.

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Message 10 of 11

Sea-Haven
Mentor
Mentor

3wood did you look at video should be able to make 253 layouts, at scale, the newer version has improved overlap function, erases or trims  nothing. This is a standard thing in Civil software. 

 

Just created 288 layouts in about 40 seconds.

Message 11 of 11

3wood
Advisor
Advisor

I guess sometimes people need send out part information to outside and don't want to expose the whole drawing to other company.

0 Likes