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
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
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.
We can either send the pline back or we can change the workflow to let you select a viewport first (or even pre-select)
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")
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) )