Author Topic: Is possible project the object on the computer screen in scale (1:1)?  (Read 3282 times)

0 Members and 1 Guest are viewing this topic.

Augusto

  • Newt
  • Posts: 75
Hello guys!
Does anyone know of a way to project the object on the computer screen in scale (1:1)?

Have a great day.  :-D

Luís Augusto

kpblc

  • Bull Frog
  • Posts: 396
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #1 on: September 25, 2018, 08:53:33 AM »
Code - Auto/Visual Lisp: [Select]
  1. (command-s "_.zoom" "_sc" 1.)
or
Code - Auto/Visual Lisp: [Select]
  1. (vla-ZoomScaled (vlax-get-acad-object) 1. acZoomScaledAbsolute)
Sorry for my English.

Augusto

  • Newt
  • Posts: 75
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #2 on: September 25, 2018, 09:44:51 AM »
I believe I have not expressed myself correctly.
Display CAD model in true size 1:1 on your monitor.

Searching the internet I found what I needed, however it is a * .vlx file
I used a virtual machine to test the program and it really works.
It requests the size of your screen in inches and the scale.
https://www.cadforum.cz/cadforum_en/display-cad-model-in-true-size-1-1-on-your-monitor-tip8794

Unfortunately I learned the worst way not to use compiled files when you have access to the internet without restrictions of access to FTP for example ...

Opening the .vlx file, we have a hint that two functions have been compiled and one of them is related to the internet I suppose.  :blink:

Code: [Select]
LOAD((:protected . T) (:active-x . T) (:separate-namespace) (:load-file-list (:fas "webupdate") (:fas "view11")))
Unfortunately this routine I can not use.
But thanks for your answer, my friend.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #3 on: September 25, 2018, 09:54:16 AM »
Backing up a step or two... why?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

kpblc

  • Bull Frog
  • Posts: 396
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #4 on: September 25, 2018, 10:45:08 AM »
I checked my code by drawing circle with diameter 20 mm. Excecute code and then measured displayed circle. Diameter was 20 mm.
Sorry for my English.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #5 on: September 25, 2018, 11:17:45 AM »
I checked my code by drawing circle with diameter 20 mm. Excecute code and then measured displayed circle. Diameter was 20 mm.
Not scaled correctly on my monitor.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ribarm

  • Gator
  • Posts: 3306
  • Marko Ribar, architect
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #6 on: September 25, 2018, 11:26:33 AM »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Augusto

  • Newt
  • Posts: 75
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #7 on: September 25, 2018, 12:18:53 PM »
Backing up a step or two... why?
I'm sorry dgorsman, I did not understand your question.
I believe it is due to the fact that i is not native to English.

I checked my code by drawing circle with diameter 20 mm. Excecute code and then measured displayed circle. Diameter was 20 mm.
Not scaled correctly on my monitor.
It did not work here either Ron.

Maybe this can help (sort of)?
http://www.theswamp.org/index.php?topic=42126.0

Ribarm,
I did some testing and I believe this worked for my purpose.
Many thanks for the reply.
I will study the code as soon as I have free time to understand the logic used.

Thank you all.

I think that my code is confusing you, for you are working in mm...

So the code should be :

Code: [Select]
(vl-load-com)

(defun magnif ( / proportion wid magnification )
  (initget 6)
  (setq proportion (getreal "\nEnter proportion ratio (1:100=0.01) <0.01> : "))
  (if (null proportion) (setq proportion 0.01))
  (initget 6)
  (setq wid (getreal "\nEnter with of screen active AutoCAD area in cm <360 mm> : "))
  (if (null wid) (setq wid 360))
  (vl-cmdf "_.zoom" "w" '(0.0 0.0 0.0) (list wid 0.0 0.0))
  (setq magnification (* (getvar 'viewsize) (/ 1.0 proportion)))
  (vl-cmdf "_.zoom" "p")
  magnification
)

(defun c:zoomratio ( / mp )
  (setq mp (getpoint "\nPick center point for zoom : "))
  (vla-zoomcenter (vlax-get-acad-object) (vlax-3d-point mp) (magnif))
  (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acActiveViewport)
(princ)
)

Note : You must measure width of active viewport in mm - this is your measurment setting...

M.R.
« Last Edit: September 25, 2018, 12:22:24 PM by Augusto »

ChrisCarlson

  • Guest
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #8 on: September 25, 2018, 01:05:11 PM »
Basically you want to view the drawing or model at a 1:1 scale on a monitor?

MSTG007

  • Gator
  • Posts: 2606
  • I can't remeber what I already asked! I need help!
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #9 on: September 25, 2018, 01:47:18 PM »
That is what I understand.
Civil3D 2020

frostmourn

  • Mosquito
  • Posts: 4
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #10 on: September 26, 2018, 01:31:52 AM »
Maybe this? :-)
Code - Auto/Visual Lisp: [Select]
  1. (defun C:ShowMeTheBeauty ( / SCRdia SCRres _dwgru-str->list _get-viewctr-size Kr_ScaleOfVP _GetDiag)
  2. (defun _dwgru-str->list (s)
  3.                  ;| (ElpanovEvgeniy)
  4.         ***************************************************************************************
  5.         *
  6.         ...deleted because of cyrillic...:(
  7.  
  8.         * http://www.cadxp.com/XForum+viewthread-fid-101-tid-16943-page-2.html
  9.         ***************************************************************************************
  10.         * :
  11.         * (_dwgru-str->list "point.25.4cm.")           => ("point." 25.4 "cm.")
  12.         * (_dwgru-str->list "point.25,4cm.")           => ("point." 25.4 "cm.")
  13.         * (_dwgru-str->list "point.3/8cm.")            => ("point." 0.375 "cm.")
  14.         * (_dwgru-str->list "qvf12qsdf125 5sf 56dfv2") => ("qvf" 12 "qsdf" 125 " " 5 "sf " 56 "dfv" 2)
  15.         ***************************************************************************************
  16.          |;
  17.          (defun str->list1 (a b f)
  18.           (cond
  19.            ((null b)
  20.                 (list (if f
  21.                            (cond ((vl-position 46 a) (atof (vl-list->string (reverse a))))
  22.                                          ((vl-position 47 a) (distof (vl-list->string (reverse a))))
  23.                                          ((vl-position 44 a) (atof (vl-list->string (subst 46 44 (reverse a)))))
  24.                                          (t (atoi (vl-list->string (reverse a))))
  25.                            ) ;_ cond
  26.                            (vl-list->string (reverse a))
  27.                           ) ;_ if
  28.                 ) ;_ list
  29.            )
  30.            (f
  31.                 (if (or (= (car b) 44) (< 45 (car b) 58))
  32.                  (str->list1 (cons (car b) a) (cdr b) f)
  33.                  (cons (cond ((vl-position 46 a) (atof (vl-list->string (reverse a))))
  34.                                          ((vl-position 47 a) (distof (vl-list->string (reverse a))))
  35.                                          ((vl-position 44 a) (atof (vl-list->string (subst 46 44 (reverse a)))))
  36.                                          (t (atoi (vl-list->string (reverse a))))
  37.                            ) ;_ cond
  38.                            (str->list1 (list (car b)) (cdr b) nil)
  39.                  ) ;_ cons
  40.                 ) ;_ if
  41.            )
  42.            (t
  43.                 (if (< 47 (car b) 58)
  44.                  (cons (vl-list->string (reverse a)) (str->list1 (list (car b)) (cdr b) t))
  45.                  (str->list1 (cons (car b) a) (cdr b) nil)
  46.                 ) ;_ if
  47.            )
  48.           ) ;_ cond
  49.          ) ;_ defun
  50.          (setq s (vl-string->list s))
  51.          (str->list1 (list (car s))
  52.                                  (cdr s)
  53.                                  (if (or (= (car s) 44) (< 45 (car s) 58))
  54.                                   t
  55.                                  ) ;_ if
  56.          )
  57.         )
  58.  
  59.  
  60. (defun _get-viewctr-size ( / VCTR Y_Len SSZ X_Pix Y_Pix X_Len)
  61.                
  62.           (setq VCTR (getvar "VIEWCTR") Y_Len (getvar "VIEWSIZE")
  63.            SSZ (getvar "SCREENSIZE")
  64.            X_Pix (car SSZ) Y_Pix (cadr SSZ)
  65.            X_Len (* (/ X_Pix Y_Pix) Y_Len)
  66.                         )
  67.            (list(mapcar '- VCTR (list (* 0.5 X_len)(* 0.5 Y_len)))
  68.                         (mapcar '+ VCTR (list (* 0.5 X_len)(* 0.5 Y_len)))
  69.                         )
  70.         )
  71.  
  72.         ;|---------------------------------------------------------------
  73.         Kr_ScaleOfVP
  74.         -----------------------------------------------------------------
  75.         ...deleted because of cyrillic...:(
  76.         |;
  77. (defun Kr_ScaleOfVP ( / )
  78.           (if (= (getvar "dimanno") 1)
  79.                 (setq dsc (/ 1 (getvar "CANNOSCALEVALUE")))
  80.                 (progn
  81.        
  82.                                 (if (= (getvar "dimscale") 0) (setq dsc 1) (setq dsc (getvar "dimscale")))
  83.                                 (if (= (Getvar "TILEMODE") 0)
  84.                                   (if (= (Getvar "CVPORT") 1)
  85.                                         (setq dsc 1)
  86.                                         (setq dsc (/ 1 (vla-get-CustomScale (vla-get-ActivePViewport (vla-get-ActiveDocument (vlax-get-Acad-Object))))))
  87.                                   );if
  88.                                  );if
  89.                   );progn
  90.                 );if
  91.                 dsc
  92.         )
  93.  
  94. (defun _GetDiag (lst) (sqrt (apply '+ (mapcar 'expt lst '(2 2)))))
  95.  
  96.         (and
  97.                 (setq SCRres (getstring "\nScreen resolution, AxB: <1920x1080>")
  98.                         SCRdia (getreal "\nScreen diagonal, inches: <24>")
  99.                 )
  100.                 (vla-zoomscaled
  101.                         (vlax-get-acad-object)
  102.                         (*
  103.                                 (/ (_GetDiag (apply 'mapcar (cons '- (reverse (_get-viewctr-size))))) (_GetDiag (getvar "SCREENSIZE")) (* SCRdia 25.4) (Kr_ScaleOfVP))
  104.                                 (_GetDiag (vl-remove-if-not 'numberp (_dwgru-str->list (if (= SCRres "") "1920x1080" SCRres))))
  105.                         )
  106.                         acZoomScaledRelative
  107.                 )
  108.         )
  109. )
  110.  
  111. (defun PIX2UNITS (pix) (* pix (/ (getvar "VIEWSIZE") (cadr (getvar "SCREENSIZE")))))
  112.  

BIGAL

  • Swamp Rat
  • Posts: 1429
  • 40 + years of using Autocad
Re: Is possible project the object on the computer screen in scale (1:1)?
« Reply #11 on: September 26, 2018, 07:31:21 AM »
Seems to me to be doing a lot of work just use zoom c scale as already mentioned . Put a "stick it" on your screen with the correct scale. For me its 86.842.

Now for the fun its called the buttons on the side of your monitor you know the one that makes circles into ovals not much good when x is not the same as y.
A man who never made a mistake never made anything