Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/17/2020 in all areas

  1. All linework should be created in model space while all dimensions and text should be in paper space. Well, at least, that is what I would recommend. As for the height of your paper space text, assuming you used the default template for AutoCAD drawings (acad.dwt), and since it is based on the Imperial not Metric system of dimensioning, I would suggest a text height of 0.125 (the decimal equivalent of 1/8th inch). One other suggestion. Text and dimensions should be on their own separate layers with distinctly different colors. Consult the instructions P-F provided you.
    1 point
  2. Damn I created a GIF, but couldn't upload it. I have same problem which is why I don't post animations as much as I would like to.
    1 point
  3. Hi Yash, This is a way to do it without using the (command) feature using your original code: (defun c:rects ( / a b c dataline f x) (setq f (open "D:/3DY/FromAutoCAD/Circle.csv" "r")) (setq dataline (read-line f)) (setq dataline (read-line f)) (setq x 1) (setq a 0) (setq b 0) (setq c 0) (while (/= dataline "EOF") (setq dataline (vl-string-trim " " dataline)) (cond ((= (rem x 3) 0) (setq c (mapcar 'atof (JH:str->lst dataline ","))) (3Darc a b c) ) ((= (rem x 3) 1) (setq a (mapcar 'atof (JH:str->lst dataline ","))) ) ((= (rem x 3) 2) (setq b (mapcar 'atof (JH:str->lst dataline ","))) ) ) (setq x (+ 1 x)) (setq dataline (read-line f)) ) (close f) ) (defun 3DArc (p1 p2 p3 / cen n1 m1 m2 z1 z2 z3) (setq n1 (vx1 (v^v (mapcar '- p1 p2) (mapcar '- p3 p2)))) (mapcar '(lambda (x z) (set z (mapcar '(lambda (y) (if (< (abs y) 1e-8) 0.0 y) ) (trans x 0 n1) ) ) ) (list p1 p2 p3) '(z1 z2 z3) ) (setq m1 (mapcar '(lambda (x y) (/ (+ x y) 2.0)) z1 z2) m2 (mapcar '(lambda (x y) (/ (+ x y) 2.0)) z2 z3) cen (inters m1 (polar m1 (+ (* 0.5 pi) (angle z1 z2)) 1) m2 (polar m2 (+ (* 0.5 pi) (angle z2 z3)) 1) nil ) ) (entmake (list '(0 . "ARC") (cons 10 cen) (cons 40 (distance cen z1)) (cons 50 (angle cen z3)) (cons 51 (angle cen z1)) (cons 210 n1) ) ) ) (defun v^v ( u v ) (list (- (* (cadr u) (caddr v)) (* (cadr v) (caddr u))) (- (* (car v) (caddr u)) (* (car u) (caddr v))) (- (* (car u) (cadr v)) (* (car v) (cadr u))) ) ) (defun vx1 ( v ) ( (lambda ( n ) (if (equal 0.0 n 1e-10) nil (mapcar '/ v (list n n n)))) (distance '(0.0 0.0 0.0) v) ) ) ;; JH:str->lst --> Jonathan Handojo ;; Parses a string into a list using a specified delimiter ;; str - string to parse ;; del - delimiter string (defun JH:str->lst (str del / l rtn src) (setq l (1+ (strlen del))) (while (setq src (vl-string-search del str)) (setq rtn (cons (substr str 1 src) rtn) str (substr str (+ src l)) ) ) (reverse (cons str rtn)) ) Heck why am I even doing so much work for something that can be solved using the (command) feature, lol
    1 point
×
×
  • Create New...