Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clipped vewport via bpoly issue

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
danglar
1025 Views, 6 Replies

Clipped vewport via bpoly issue

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

6 REPLIES 6
Message 2 of 7
ВeekeeCZ
in reply to: danglar

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.

Message 3 of 7
danglar
in reply to: ВeekeeCZ

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 

Message 4 of 7
ВeekeeCZ
in reply to: danglar

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

Message 5 of 7
danglar
in reply to: ВeekeeCZ

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")

Message 6 of 7
ВeekeeCZ
in reply to: danglar

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
in reply to: ВeekeeCZ

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost