Jump to content

Scale of Viewport


pmadhwal7

Recommended Posts

is their any way to export scale of viewport(Layout) to excel??? or any way where we check is my all layout scale correct or not like if i am working with 1:1 scale is any of my layout is different scale

Edited by pmadhwal7
Link to comment
Share on other sites

You can get viewport properties 

Select object: ; IAcadPViewport: IAcadPViewport Interface
; Property values:
;   CustomScale = 1.973

 

zoomed out

 

;   CustomScale = 6.052

 

I set viewport 1:250 metric ie 1000/4

;   CustomScale = 4.000

Link to comment
Share on other sites

4 hours ago, BIGAL said:

You can get viewport properties 

Select object: ; IAcadPViewport: IAcadPViewport Interface
; Property values:
;   CustomScale = 1.973

 

zoomed out

 

;   CustomScale = 6.052

 

I set viewport 1:250 metric ie 1000/4

;   CustomScale = 4.000

is this an lsp???

Link to comment
Share on other sites

Hi to all,

I don't know if it are closed, so, looking for it, I had found on "express tools" menu of Autocad the following command: VPSCALE (vpscale.lsp) attached here.

For a multiple viewport in paper space, you can get one by one the scale data.

I think that it can help.

vpscale.lsp

Link to comment
Share on other sites

I use dumpit.lsp to get properties of an object then write a lisp etc to suit.

 

(setq obj (vlax-ename->vla-object (car (entsel "pick viewport edge "))))
(alert (strcat "Your viewport scale is " (rtos (vla-get-customscale obj) 2 4)))

 

Link to comment
Share on other sites

actually i want to all  view port scale checked at once because i have layout nearly 500 in one route...is is possible

Edited by pmadhwal7
Link to comment
Share on other sites

Try this:

(defun c:foo (/ _writefile _dxf r s)
  ;; RJP » 2019-11-20
  (defun _writefile (fn l / f)
    (cond ((and (eq 'str (type fn)) (setq f (open fn "w")))
	   (foreach x l (write-line x f))
	   (close f)
	   fn
	  )
    )
  )
  (defun _dxf (c e) (cdr (assoc c (entget e))))
  (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
    (foreach e (mapcar 'cadr (ssnamex s))
      (setq r (cons (cons (_dxf 410 e) (/ 1 (/ (_dxf 41 e) (_dxf 45 e)))) r))
    )
  )
  (_writefile
    (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) "-VPSCALES.csv")
    (mapcar '(lambda (x) (strcat (vl-princ-to-string (car x)) "," (vl-princ-to-string (cdr x))))
	    (vl-sort r '(lambda (r j) (< (car r) (car j))))
    )
  )
  (princ)
)

 

Link to comment
Share on other sites

On 11/20/2019 at 9:20 PM, ronjonp said:

Try this:


(defun c:foo (/ _writefile _dxf r s)
  ;; RJP » 2019-11-20
  (defun _writefile (fn l / f)
    (cond ((and (eq 'str (type fn)) (setq f (open fn "w")))
	   (foreach x l (write-line x f))
	   (close f)
	   fn
	  )
    )
  )
  (defun _dxf (c e) (cdr (assoc c (entget e))))
  (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
    (foreach e (mapcar 'cadr (ssnamex s))
      (setq r (cons (cons (_dxf 410 e) (/ 1 (/ (_dxf 41 e) (_dxf 45 e)))) r))
    )
  )
  (_writefile
    (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) "-VPSCALES.csv")
    (mapcar '(lambda (x) (strcat (vl-princ-to-string (car x)) "," (vl-princ-to-string (cdr x))))
	    (vl-sort r '(lambda (r j) (< (car r) (car j))))
    )
  )
  (princ)
)

 

not working

Link to comment
Share on other sites

9 hours ago, pmadhwal7 said:

not working

Strange .. worked for me. It saves a csv file in the same directory as the drawing.

Edited by ronjonp
Link to comment
Share on other sites

19 hours ago, ronjonp said:

Strange .. worked for me. It saves a csv file in the same directory as the drawing.

yes sir not working but anyway i found it in plot.log file thanks all

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, pmadhwal7 said:

yes sir not working but anyway i found it in plot.log file thanks all

Glad you got it worked out. Years ago when our plotters often had wider margins than required I used a Plot Stamp with Plot Scale included.  While 1:1 was hardly noticeable 1:096827435 stood out.  Worth considering if you're having issues. http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-C8CEF1EE-9816-40F8-AA2C-8C320A3C8564

Link to comment
Share on other sites

On 11/23/2019 at 7:55 PM, tombu said:

Glad you got it worked out. Years ago when our plotters often had wider margins than required I used a Plot Stamp with Plot Scale included.  While 1:1 was hardly noticeable 1:096827435 stood out.  Worth considering if you're having issues. http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-C8CEF1EE-9816-40F8-AA2C-8C320A3C8564

Thanks sir... 🙂

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...