Utilize multiple closed polylines for use with boundary trim?

Utilize multiple closed polylines for use with boundary trim?

Anonymous
Not applicable
2,560 Views
8 Replies
Message 1 of 9

Utilize multiple closed polylines for use with boundary trim?

Anonymous
Not applicable

So for a particular task I need to trim and remove cells from a boundary with an action macro I can accomplish this fairly simply using the following procedure.

 

  1. Create unit cell (closed polylines)
  2. Copy unit cell
  3. Change layer to temporary layer
    1. Prevents deleting original unit cell or other completed boundaries
  4. Create a rectangular array from the cell
    1. Large enough to encompass the chosen boundary
  5. Move array to boundary location
  6. Explode rectangular array
  7. Run a boundary trim (outside) using boundary to remove only temporary layer
  8. Select open polylines to isolate partially trimmed cells
    1. Delete partially trimmed cells to ensure only complete cells are allowed
  9. Change objects back to original layer
  10. Repeat for other boundaries (sometimes upwards of 20)

So the process is fairly straightforward but time consuming-mostly because I am unable to select multiple boundaries to apply a boundary trim. If I could select multiple boundaries I would be able to skip the layer manipulations, copy/move operations, and multiple boundary trim/select/delete operations as well. The process is depicted visually below:

 

Cell overlay on boundaries (orange)Cell overlay on boundaries (orange)Boundary trim of cells to boundaryBoundary trim of cells to boundaryIncomplete cells removedIncomplete cells removed

 

I still need the objects to be countable (using a count by layer command or something similar) so I don't believe any sort of Hatch command will suit my needs but I am open to any and all suggestions to improve this task efficiency!

 

Thanks!

0 Likes
2,561 Views
8 Replies
Replies (8)
Message 2 of 9

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I see that you are visiting as a new member to the AutoCAD forum. Welcome to the Autodesk Community!

 

 Perhaps you are looking for EXTRIM.  Give that a try and let me know if that gets you closer to your goal.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 3 of 9

Anonymous
Not applicable

Hey John,

 

Thanks for the reply. I have played around with EXTRIM and it does work similarly as boundary trim without deleting the cells outside of my boundary which would add an additional step. It also runs slower than the action macro I have built using the boundary trim command and still doesn't allow multiple cutting edges to be selected unfortunately.

 

I don't think that is the answer unless I am missing something with the extrim command

0 Likes
Message 4 of 9

3wood
Advisor
Advisor

I think you can try SMARTSEL.

It does exactly what you want.

Given you have an exploded rectangle array contains of multiple polylines on Layer 0.

Then you have some boundary polylines on Layer 1 which is red:

smartsel1.JPG

 

Step 1. Use SMARTSEL to select whole rectangles inside all polylines on Layer 1:

smartsel5.JPG

Result:

smartsel2.JPG

 

Step2. Press "Esc" to deselect these rectangles. This selection is saved in a selection set of "previous".

Step3. Lock Layer 1.

Step4. Use ERASE to remove all other rectangles.

smartsel6.JPG 

Remove "previous" selection from "all" selection.

smartsel3.JPG 

Final result:

smartsel4.JPG

0 Likes
Message 5 of 9

dbhunia
Advisor
Advisor

Try this.....

 

To Delete Objects Outside the Circles within a Selected Region use "Delete Objects Outside the Circles within Selected Region.lsp"....(As your requirements)

 

To Delete Objects (with multiple options) Outside the Selected Boundaries (Boundaries made by "LWPOLYLINE" & "CIRCLE") use "Delete Objects Outside the Selected Boundaries.lsp"....... (this is the modification code of this)

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 6 of 9

Anonymous
Not applicable

This seems really close to what I need - do you know what tools/commands this is built off of? It doesn't quite match my exact needs (the example provided is somewhat simplified) but I am confident I can adapt it to suit my needs.

0 Likes
Message 7 of 9

Anonymous
Not applicable

Is there anyway to use the select command along with the window polygon option using an existing polygon? I can actually accomplish what I want to do using this procedure (similar to SmartSel located below) but I have to manually trace the polygons which is quite time consuming.

0 Likes
Message 8 of 9

3wood
Advisor
Advisor

Can you post a real example file so we can test it in the real condition?

0 Likes
Message 9 of 9

dbhunia
Advisor
Advisor

For this....Try the attached code...

 


@Anonymous wrote:

Is there anyway to use the select command along with the window polygon option using an existing polygon? I can actually accomplish what I want to do using this procedure (similar to SmartSel located below) but I have to manually trace the polygons which is quite time consuming.


 

First you put all the Boundaries (i.e. circle or closed polygon) in a separate layer..... then run the code with the below options....

 

Capture.PNG

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....