Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/15/2019 in all areas

  1. If the solids are made using extrude command, with a height, not path, then you can extract the height like this: (defun c:test ( / e solid) (while (and (setq e (car (entsel))) (setq e (cdr (assoc 350 (entget e)))) (eq (cdr (assoc 0 (setq e (entget e)))) "ACSH_HISTORY_CLASS") (setq e (cdr (assoc 360 e))) (eq (cdr (assoc 0 (setq e (entget e)))) "ACAD_EVALUATION_GRAPH") (setq e (cdr (assoc 360 e))) (setq e (entget e)) (setq solid (cdr (assoc 0 e))) ) (cond ((eq solid "ACSH_EXTRUSION_CLASS") (princ (strcat "\nExtrusion Height: " (rtos (distance '(0 0 0) (cdr (assoc 10 e)))))) ) ((eq solid "ACSH_BOX_CLASS") (princ (strcat "\nBox Height: " (rtos (cdr (assoc 42 (reverse e)))))) ) ((eq solid "ACSH_CYLINDER_CLASS") (princ (strcat "\nCylinder Height: " (rtos (cdr (assoc 40 (reverse e)))))) ) (T (princ "\nUnable to extract solid height.") ) ) ) (princ) ) Doesn't work on edited solids, or modified by a boolean operation. Still, if the section of the solid (section perpendicular to extrusion direction) is a circle or a rectangle, you can find the height with some calculation over the geometric properties.
    1 point
  2. This is latest has offset radius and angle pick pline anywhere. (defun c:plhook ( / plent pt1 pt2 pt3 pt4 ang3 pt5 add ang1 ang2 ang3) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (while (setq plent (entsel "Pick pline Enter to exit")) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))) (setq pt1 (nth 0 co-ord)) ; 1st point (setq pt2 (nth 1 co-ord)) ; second point (setq x (- (length co-ord) 1)) ; how many points- 1 as 1st point is 0 (setq pt3 (nth (- x 1) co-ord)) ; second last point (setq pt4 (nth x co-ord)) ; last point (setq ang1 (angle pt2 pt1)) ; angle ofthe pline (setq ang2 (angle pt3 pt4)) (setq ans (AH:getvalsm (list "Enter length" "Hook length " 5 4 "30" "Radius" 5 4 "25" "angle " 5 4 "45"))) (setq add (atof (nth 0 ans))) (setq rad (atof (nth 1 ans))) (setq ang3 (* pi (/ (atof (nth 2 ans)) 180.0))) (setq pt5 (polar pt1 (+ ang3 ang1) add)) ; 135 degrees (command "line" pt1 pt5 "") ; new line (setq ans (ah:butts but "V" '("Flip " "Yes" "No"))) (if (= "No" ans) (princ "ok") (command "mirror" "Last" "" pt1 pt2 "Y") ) (command "pedit" (car plent) "join" (entlast) "" "") (setq pt5 (polar pt4 (+ ang3 ang2) add)) ; other end (command "line" pt4 pt5 "") (setq ans (ah:butts but "V" '("Flip " "Yes" "No"))) (if (= "No" ans) (princ "ok") (command "mirror" "Last" "" pt4 pt3 "Y") ) (command "pedit" (car plent) "join" (entlast) "" "") (command "fillet" "Polyline" "r" rad (car plent)) ) (princ) ) (c:plhook)
    1 point
  3. You may use my LM:roundup & LM:rounddown functions, supplied with a rounding multiple of 0.1: _$ (LM:roundup 1.025 0.1) 1.1 _$ (LM:roundup 1.08 0.1) 1.1 _$ (LM:rounddown 0.7625 0.1) 0.7 _$ (LM:rounddown 0.51 0.1) 0.5 @hanhphuc Thanks for the recommendation
    1 point
  4. add this line before this block of text (setq str (getstring "\Type string")) Then replace 7th line with with (cons 1 (strcat "VIGA V- " str ))
    1 point
  5. (setq str (getstring t "\nWhat is the name? VIGA V- ") ) ;change this '(1 . "%%UVIGA V-SS01 (.25X .50)") ;to (cons 1 (strcat "VIGA V- " str))
    1 point
  6. You can take a horse to water but it does not mean it will drink.
    1 point
×
×
  • Create New...