Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/12/2025 in all areas

  1. This function returns the screen resolution. To get the cursor size in real time and drawing units, simply run the following: (* (/ (AnchoResol) 100.0) (getvar "CURSORSIZE") (/ (GETVAR "VIEWSIZE") (cadr (getvar "SCREENSIZE"))) )
    2 points
  2. Hi @GLAVCVS thanks! This code makes the block Obedient. Muchas gracias! Es super! Te debo otra taza de cafe...
    1 point
  3. Hi Try this (defun c:makeBlockObedient (/ conj it n e le) (princ "\nSelect block to analyze...") (if (setq conj (ssget '((0 . "INSERT")))) (while (setq it (ssname conj (setq n (if n (1+ n) 0)))) (while (/= (cdr (assoc 0 (setq le (entget (setq e (entnext (if e e it))))))) "SEQEND") (if (assoc 60 le) (if (setq p (getpoint (cdr (assoc 10 le)) "\nInvisible attribute detected: Indicates its new position (RIGHT CLICK to skip)...? ")) (vla-move (vlax-ename->vla-object e) (vlax-3d-point (cdr (assoc 10 le))) (vlax-3d-point p)) ) ) ) ) ) (princ) )
    1 point
  4. Yes It's perfect This is exactly what I need Thank you so much
    1 point
  5. This way you'll get the longitude from the north end to the south end of the cursor (or from the east end to the west end). I hope this is what you're looking for.
    1 point
  6. @Vica Excuse me. You're right. To make the calculation correct, it's essential to include the screen resolution in the equation. AutoCAD's system variables only refer to the dimensions of the drawing area. Therefore, my previous formula could only be approximate. If you want to calculate the cursor dimensions exactly, you need to obtain the screen resolution. To do this, you can use this function (defun AnchoResol (/ s i is) (setq s (vlax-invoke (vlax-create-object "WbemScripting.SWbemLocator") 'ConnectServer nil nil nil nil nil nil nil) is (vlax-invoke s 'ExecQuery "SELECT CurrentHorizontalResolution, CurrentVerticalResolution FROM Win32_VideoController") ) (vlax-for i is (vlax-get i 'CurrentHorizontalResolution)) )
    1 point
×
×
  • Create New...