Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/29/2019 in all areas

  1. Nice coding Kruuger I tweaked it a little for a more intuitive input: (defun c:test ( / p1 p2 ) ;; Kruuger's code, tweaked by Lee Mac (if (and (setq p1 (getpoint "\nSpecify First Corner of Viewport: ")) (setq p2 (getcorner "\nSpecify Opposite Corner of Viewport: " p1)) ) (progn (setq p1 (trans p1 1 0) p2 (trans p2 1 0) ) (vla-Display (vla-AddPViewport (vla-Get-PaperSpace (vla-Get-ActiveDocument (vlax-Get-Acad-Object))) (vlax-3D-Point (mapcar '(lambda ( a b ) (/ (+ a b) 2.)) p1 p2)) (abs (- (car p1) (car p2))) (abs (- (cadr p1) (cadr p2))) ) :vlax-true ) ) ) (princ) )
    1 point
  2. Change the name of the name according to the one you need as noticed in the routine . (defun c:Test (/ p1 p2 e)(vl-load-com) ;; Tharwat 10. 07. 2011 (if (eq (vla-get-activespace (vla-get-activedocument (vlax-get-acad-object)) ) 0 ) (if (and (setq p1 (getpoint "\n First corner fo Viewport :")) (setq p2 (getcorner p1 "\n Second corner fo Viewport :")) ) (progn (command "_.mview" "_non" p1 "_non" p2) (vla-put-customscale (setq e (vlax-ename->vla-object (entlast))) acVpScaleToFit ) (vla-put-layer e [color=red][b]"0"[/b][/color])[color=red]; <<-- Change the "0" to your favourite layer[/color] ) (princ) ) (princ "\n you must be in paper space world !!") ) (princ) ) Tharwat
    1 point
×
×
  • Create New...