Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/24/2020 in all areas

  1. That is cool Lee for a situation like this show the result, in this case 4 lines.
    1 point
  2. Yes - update the image tile within the action_tile statement for your controls - here is an existing example.
    1 point
  3. @loudy000 Like this? (defun c:test ( / dmz ly lynm obj pat wgt) (setq dmz (getvar 'dimzin)) (setvar 'dimzin 0) (while (setq ly (tblnext "layer" (null ly))) (setq ly (cdr (assoc 2 ly)) obj (tblobjname "layer" ly) wgt (cdr (assoc 370 (entget obj))) pat (cdr (assoc 6 (entget obj))) lynm (strcat (rtos (* wgt 0.01) 2 2) "-" pat "-" ly) ) (entmod (subst (cons 2 lynm) (assoc 2 (entget obj)) (entget obj) ) ) ) (setvar 'dimzin dmz) )
    1 point
  4. I don't see where the color fits in... (defun c:test ( / dmz ly lynm obj wgt) (setq dmz (getvar 'dimzin)) (setvar 'dimzin 0) (while (setq ly (tblnext "layer" (null ly))) (setq ly (cdr (assoc 2 ly)) obj (tblobjname "layer" ly) wgt (cdr (assoc 370 (entget obj))) lynm (strcat (rtos (* wgt 0.01) 2 2) "-" ly) ) (entmod (subst (cons 2 lynm) (assoc 2 (entget obj)) (entget obj) ) ) ) (setvar 'dimzin dmz) ) The above should do it (I think... because I don't know how in my computer the line weight reads 50 instead of 0.50, so I just divide by 100)
    1 point
  5. (setq txt_IP_1 00) (while (setq IP (getpoint "\nPick IP: ")) (setq txt_IP_1 (1+ txt_IP_1)) (setq txt_IP_Node (strcat "IP" (rtos txt_IP_1 2 0))) (command ".text" "C" (list ( car IP) (1+ (cadr IP)) 0.0) 0.75 0 txt_IP_Node) ) On a more advanced note, this will do: Incremental Numbering Suite... And I mean, waaaay more advanced
    1 point
  6. Salut Mircea Linear regression assure that the sum of differences between a series of values (e.g. y) and the approximation line is minimum. It is working good if data meet some criteria. For example, set your points around a vertical line, then use simple linear regression (like Lee's lisp. BTW Lee, your code is amazing). Here is my lisp, using a formula from another (surprisingly) domain. (defun C:TEST ( / vxv ss i n l o d dx dy a) (defun vxv (a b) (apply '+ (mapcar '* a b))) (if (setq ss (ssget '((0 . "POINT")))) (progn (repeat (setq i (sslength ss) n i) (setq l (cons (cdr (assoc 10 (entget (ssname ss (setq i (1- i)))))) l)) ) (setq o (mapcar '/ (apply 'mapcar (cons '+ l)) (list n n)) d (mapcar '(lambda (a) (mapcar '- o a)) l) dx (mapcar 'car d) dy (mapcar 'cadr d) a (* 0.5 (atan (* 2 (vxv dx dy)) (- (vxv dx dx) (vxv dy dy)))) ) (entmake (list '(0 . "XLINE") '(100 . "AcDbEntity") '(100 . "AcDbXline") '(62 . 1) (cons 10 o) (list 11 (cos a) (sin a) 0.0) ) ) ) ) (princ) )
    1 point
×
×
  • Create New...