Clipped vewport via bpoly issue

Clipped vewport via bpoly issue

danglar
Advocate Advocate
1,344 Views
6 Replies
Message 1 of 7

Clipped vewport via bpoly issue

danglar
Advocate
Advocate

Usually I need to clip view port like it shown on picture.

I do it by following steps

1. use BPOLY command in order to create closed polyline

2. use VPCLIP command to create polygonal clipped viewport

Is it possible to automate this process and do these steps via lisp?

Lisp can ask internal point to create closed polyline and ask which viewport need to clip

and return clipped viewport like it shown on the picture

Any help will be very appreciated

Capture.JPG

0 Likes
Accepted solutions (1)
1,345 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant

I don't use this workflow so... just try.

 

(defun c:BVPORT ( / enl)
  (setq enl (entlast)) 
  (setvar 'HPISLANDDETECTIONMODE 1)
  (command-s "_.BOUNDARY")
  (if (not (equal enl (entlast)))
    (command "_.VPCLIP" PAUSE (entlast)))
  (princ)
)

Adjust an islanddetection as you with.

0 Likes
Message 3 of 7

danglar
Advocate
Advocate

First of all thank you      

for your rapid question

I just have a trouble to select viewport in VPCLIP command because a boundary polyline placed above viewport..

any suggestions will be appreciated 

0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

We can either send the pline back or we can change the workflow to let you select a viewport first (or even pre-select)

0 Likes
Message 5 of 7

danglar
Advocate
Advocate

not matter how we can do it but I prefer a possibility to select viewport after creating boundary

Probably something like this?

 (command "DRAWORDER" "L" "Back")

0 Likes
Message 6 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

If a command allows selecting more objects, as the boundary does, you need to close the selectionset.

 

(defun c:BVPORT ( / enl)
  (setq enl (entlast)) 
  (setvar 'HPISLANDDETECTIONMODE 1)
  (command-s "_.BOUNDARY")
  (if (not (equal enl (entlast)))
    (command "_.DRAWORDER" "_L" "" "_Back"
             "_.VPCLIP" PAUSE "_L"))
  (princ)
)
Message 7 of 7

danglar
Advocate
Advocate

Perfect solution!      

I just forgot about draworder selecting mode (more than one object per session):)

Thank you very match. Your solution will save me a lot of time to prepare layouts

0 Likes