Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/24/2024 in all areas

  1. Sounds like you have a plan.
    1 point
  2. Thanks Steven. I saw that post but didn't catch that part of the code did the same thing. However, upon testing it only appears to affect box width, whereas double-clicking the ruler arrows shrinks both the width and the height. I'll review that post to see if that was discussed at all - maybe they already came up with a solution...
    1 point
  3. @EYNLLIB thy has been forgiven.
    1 point
  4. In the line 259 uncomment the line and comment the line 261 Same way on lines 253 and 255 En la linea 259 quita el punto y coma ; Y pon uno en la linea 261 De igual forma en las lineas 253 y 255
    1 point
  5. @3dwannab Here is the simplest way - no minimal error checking: (defun c:moff (/ *error* _Strparse cnt dstr en go op s tl) (defun *error* (msg)(if oc (setvar "cmdecho" oc))(princ msg)) (setq oc (getvar "cmdecho")) (setvar "cmdecho" 0) (command "._undo" "_BE") (defun _StrParse (str del / pos) (if (and str del) (if (setq pos (vl-string-search del str)) (cons (substr str 1 pos) (_StrParse (substr str (+ pos 1 (strlen del))) del)) (list str) ) ) ) (if (and (setq dstr (getstring t "\nEnter Distances separated by spaces: ")) (setq s (entsel "\nSelect a curve to offset: ")) (setq en (car s) cnt 0) (setq go (wcmatch (cdr (assoc 0 (entget en))) "LINE,*POLYLINE,SPLINE,XLINE,CIRCLE,ARC,ELLIPSE")) (setq op (getpoint (cadr s) "\nSelect side to Offset: ")) ) (if (setq tl (_Strparse dstr " ")) (foreach n tl (command "._offset" (nth cnt tl) en "_non" op "") (setq cnt (1+ cnt)) ) ) (if (not go)(princ "\nInvalid Object Selected.")) ) (command "._undo" "_E") (setvar "cmdecho" oc) (princ) )
    1 point
  6. Just in case you didn't know the "direct distance entry" trick, try this: Start the line command (say press L followed by <enter> or <space>). AutoCAD prompts you for the first point. Click on the screen to enter it. When AutoCAD prompts you for the next point, move the mouse to the desired place in order to define the direction (OSNAP is useful at this point!), but don't click. Leave the mouse in that place and enter from the keyboard (+ 5 2 3)<enter> That should draw the line you are after. From there you can continue the line command, meaning to draw the next line, or press <enter> again to exit. Please note that you must enter the plus sign first, a space, and next enter all the numbers to be added, separated by a space. It is not so complicated...
    1 point
  7. Welcome in the forum, Ivy Tr! I think it is possible, but how do you wish to draw the line? Maybe you wish to click the start point, an other click to define the direction, and next enter those numbers? Or if you wish less user inputs, just enter those numbers end let the program to draw a horizontal line from the origin? Please give us more data.
    1 point
  8. That's some old code... To account for variation in the UCS & View, you would need to calculate a bounding box relative to the current UCS - consider the following example: (defun c:zz ( / box sel ) (cond ( (not (setq sel (ssget)))) ( (not (setq box (LM:ucsssboundingbox sel (vlax-tmatrix (LM:transmatrix 1 0))))) (princ "\nUnable to obtain UCS selection set bounding box.") ) ( (vla-zoomwindow (vlax-get-acad-object) (vlax-3D-point (trans (car box) 1 0)) (vlax-3D-point (trans (cadr box) 1 0)) ) ) ) (princ) ) ;; UCS Selection Set Bounding Box - Lee Mac ;; Returns a list of the lower-left & upper-right UCS coordinates of a rectangular frame bounding all ;; objects in a supplied selection set following transformation by the supplied transformation matrix ;; sel - [sel] Selection set for which to return bounding box ;; mat - [var] Variant representing a 4x4 transformation matrix (defun LM:ucsssboundingbox ( sel mat / box idx ls1 ls2 obj ) (repeat (setq idx (sslength sel)) (if (setq idx (1- idx) obj (vlax-ename->vla-object (ssname sel idx)) box (LM:ucsboundingbox obj mat) ) (setq ls1 (cons (car box) ls1) ls2 (cons (cadr box) ls2) ) ) ) (if (and ls1 ls2) (mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list ls1 ls2)) ) ) ;; UCS Bounding Box - Lee Mac ;; Returns a list of the lower-left & upper-right UCS coordinates of a rectangular frame ;; bounding the supplied object following transformation by the supplied transformation matrix ;; obj - [vla] VLA-Object for which to return bounding box ;; mat - [var] Variant representing a 4x4 transformation matrix (defun LM:ucsboundingbox ( obj mat / cpy llp rtn urp ) (if (and (vlax-write-enabled-p obj) (vlax-method-applicable-p obj 'getboundingbox) (setq cpy (LM:catchapply 'vla-copy (list obj))) (LM:catchapply 'vla-transformby (list cpy mat)) (LM:catchapply 'vla-getboundingbox (list cpy 'llp 'urp)) ) (setq rtn (list (vlax-safearray->list llp) (vlax-safearray->list urp))) ) (if (and (= 'vla-object (type cpy)) (vlax-write-enabled-p cpy)) (vla-delete cpy) ) rtn ) ;; Catch Apply - Lee Mac ;; Applies a function to a list of parameters and catches any exceptions. (defun LM:catchapply ( fnc prm / rtn ) (if (not (vl-catch-all-error-p (setq rtn (vl-catch-all-apply fnc prm)))) (cond ( rtn ) ( t )) ) ) ;; Trans Matrix - Lee Mac ;; Returns a 4x4 matrix encoding a transformation from one coordinate system to another (defun LM:transmatrix ( src dst ) (append (mapcar '(lambda ( v o ) (append (trans v src dst t) (list o)) ) '( (1.0 0.0 0.0) (0.0 1.0 0.0) (0.0 0.0 1.0) ) (trans '(0.0 0.0 0.0) dst src) ) '((0.0 0.0 0.0 1.0)) ) ) (vl-load-com) (princ)
    1 point
×
×
  • Create New...