Jump to content

Leaderboard

Popular Content

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

  1. Give This a try (defun c:plhook ( / plent pt1 pt2 pt3 x pt5 add ang1 ang2) (while (setq plent (entsel "Pick pline Enter to exit")) (if plent (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 add 0.03) ;; (setq add (getreal "Enter distance to add on")) (setq pt5 (polar pt1 (+ (* 0.25 pi) ang1) add)) ; 135 degrees (command "line" pt1 pt5 "") ; new line (if (null *mr1) (setq *mr1 "No")) (initget 0 "Yes No") (if (setq tmp (getkword (strcat "\nIs Hook direction OK? [Yes/No] <" *mr1 ">: "))) (setq *mr1 tmp)) ; (setq ans (getstring "is line ok Y or N")) ; is it in correct direction (if (= "Yes" *mr1) ; y or Y (princ "ok") (command "mirror" "Last" "" pt1 pt2 "Y") ; flip line ) (command "pedit" (car plent) "join" (entlast) "" "") (setq pt5 (polar pt4 (+ (* 0.25 pi) ang2) add)) ; other end (command "line" pt4 pt5 "") (if (null *mr2) (setq *mr2 "No")) (initget 0 "Yes No") (if (setq tmp (getkword (strcat "\nIs Hook direction OK? [Yes/No] <" *mr2 ">: "))) (setq *mr2 tmp)) ;(setq ans (getstring "is line ok Y or N")) (if (= "Yes" *mr2) (princ "ok") (command "mirror" "Last" "" pt4 pt3 "Y") ) (command "pedit" (car plent) "join" (entlast) "" "") ) )
    1 point
  2. Hi Abdulellah, Which version you want to update to apply these changes? Hassan
    1 point
  3. Perhaps the easiest way to create the dimension would be something like: (defun c:test ( / ln p1 p2 ) (if (setq p1 (getpoint "\nPunto inicial: ")) (progn (setq p2 (mapcar '+ p1 '(0.5 0 0)) ln (entmakex (list '(0 . "LINE") (cons 10 (trans p1 1 0)) (cons 11 (trans p2 1 0)) '(62 . 2))) ) (command "_.dimlinear" "" (list ln p1) "_non" (mapcar '+ p1 '(0 -0.5 0))) ) ) (princ) ) This approach also has the advantage of creating an associative dimension. The appearance and measurement formatting should be controlled by your Dimension Style.
    1 point
  4. You can find lots of 3D models online. Most of them you will have to pay for, but you might be able to find some free ones if you look around. Nautilus shell 3D model
    1 point
  5. Unfortunately when CADTutor transitioned from vBulletin to the new Invision forum software, BBCode (e.g. color tags) are no longer permitted within code blocks and are consequently now displayed as part of the code itself. You can quite easily remove the color tags in Notepad++ using the following Find/Replace: The RegEx pattern I've used here is: \[color=[^\]]+\]|\[\/color\]
    1 point
×
×
  • Create New...