Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/03/2025 in all areas

  1. Just a comment if you want to read Excel direct can open the correct Excel file. Just edit filename & sheetname (setq myBook (vl-catch-all-apply 'vla-open (list (vlax-get-property myXL "WorkBooks") fileName))) (setq mySheet (vl-catch-all-apply 'vlax-get-property (list (vlax-get-property myBook "Sheets") "Item" sheetName))) (vlax-invoke-method mySheet "Activate") You can add say T5 & T6 values also to the standards list. @GLAVCVS you mentioned no Excel do you use Libre Calc ? Have a get application for that its not as clean as Get Excel but it works.
    1 point
  2. Had to watch a video to see it. I'm good now. Thanks a million
    1 point
  3. I think I misunderstood your explanation of what you needed. Anyway, the code can be easily adapted to what you asked for. I've corrected the small oversight in the 'grvecs' functions, which I included at the last minute and didn't check. Here is the modified code, in case anyone finds it useful... (defun c:ptoZmin? (/ ent lstent punto lstpts zMin ptoZmin conj n) (setq n 0) (if (setq conj (ssget '((0 . "POLYLINE")))) (while (setq ent (ssname conj n)) (setq lstent (entget ent)) (while (/= (cdr (assoc 0 (setq lstent (entget (entnext (cdr (assoc -1 lstent))))) ) ) "SEQEND" ) (setq punto (cdr (assoc 10 lstent))) (if zMin (if (= (min zMin (last punto)) (last punto)) (setq zMin (last punto) ptoZmin punto ) ) (setq zMin (last punto) ptoZmin punto ) ) ) (setq n (1+ n)) ) ) (if ptoZmin (progn (grdraw (polar ptoZmin 0.785398 (* 0.025 (getvar "viewsize"))) (polar ptoZmin 3.92699 (* 0.025 (getvar "viewsize"))) 2 1 ) (grdraw (polar ptoZmin 2.35619 (* 0.025 (getvar "viewsize"))) (polar ptoZmin 5.49779 (* 0.025 (getvar "viewsize"))) 2 1 ) (alert (strcat "Point with minimum Z:\nX = " (rtos (car ptoZmin) 2 2) "\nY = "(rtos (cadr ptoZmin) 2 2) "\nZ = "(rtos (caddr ptoZmin) 2 2))) (princ (strcat "\nPoint with minimum Z:\nX = " (rtos (car ptoZmin) 2 2) "; Y = "(rtos (cadr ptoZmin) 2 2) "; Z = "(rtos (caddr ptoZmin) 2 2))) ) ) (princ) )
    1 point
  4. Easy for lines or plines you pick an end when selecting this implies the start point. You compare the distance to the two ends and flip the pts if necessary. Minimal testing with arcs. (defun swapends (ent / obj) (setq pt3 (cadr ent)) (setq obj (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj)) (setq end (vlax-curve-getEndPoint obj)) (setq d1 (distance pt3 end)) (setq d2 (distance pt3 start)) (if (< d1 d2) (progn (setq temp end) (setq end start) (setq start temp) ) ) (princ) )
    1 point
  5. Try changing this line : (setq gap (getvar "dimtxt")) To this line : (setq gap (* 2.0 (getvar "dimtxt")))
    1 point
×
×
  • Create New...