Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/17/2021 in all areas

  1. I suspect that you are somehow drawing everything with the CELTSCALE set at 20, rather than with a global LTSCALE set to 20.
    2 points
  2. You can have a block of blocks so will have a single insertion point, an explode will do just that turn them into individual blocks again.
    2 points
  3. @cat3appr - that is a macro, where the semicolon is an <enter> So if you are manually typing at the command line: -units 2 1 90 y
    1 point
  4. Pretty sure you are right. The OP's profile says they are using 2010 which would still drop selections that were panned off screen and other silly stuff. I just wanted to eliminate that since the initial description was a little vague, at least for my old retired brain. If they want data to sit around for a while and be added to, then yes, they probably need a way to permanently save the selection set, and append to it or replace it at will. That is out of my league since I retired from 23 years of writing code before I ever heard of LISP. (Just in time )
    1 point
  5. If LTSCALE is altered without doing anything else, it will globally change all lines and polylines in the entire drawing and the LTSCALE will remain defaulted globally to this new setting until changed. That is what it is meant to do. You have to drill down deeper. To change the LTSCALE of a single object or a selection set of objects, you need to issue a CHPROP command beforehand which offers an object property menu, one item of which is LTSCALE. Exploding an object drops the released objects back to whatever their properties were before they were in the group or block. You will have to modify the code to change the LTSCALE Object Property after exploding the mline and selecting the resulting individual lines.
    1 point
  6. I believe the OP wants to be able to create a selection set and then operate on it later without going through a long process of selecting them again (which Tombu addresses). But I could be wrong.
    1 point
  7. You can group objects and have a reference basepoint using the system variable GROUPDISPLAYMODE but that basepoint would always be the geometric center. https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-1EDF8F98-A769-415C-9FF3-B8C304369094
    1 point
  8. Turn your monitor so it is standing on it's left hand side.
    1 point
  9. Another - (defun c:pno ( / a c i l n p q s x ) (if (setq s (ssget "_X" '((0 . "INSERT") (8 . "NUMBERING")))) (progn (repeat (setq i (sslength s)) (setq i (1- i) a (entnext (ssname s i)) x (entget a) ) (while (and (= "ATTRIB" (cdr (assoc 0 x))) (not (and p n))) (cond ( (= "PORT_NUMBER" (cdr (assoc 2 x))) (setq p a) ) ( (= "SORT_ORDER" (cdr (assoc 2 x))) (setq n (atoi (cdr (assoc 1 x)))) ) ) (setq a (entnext a) x (entget a) ) ) (if (and p n) (setq l (cons p l) p nil q (cons n q) n nil ) ) ) (setq c 1) (foreach n (vl-sort-i q '<) (entmod (list (cons -1 (nth n l)) (cons 1 (padz (itoa c) 3)))) (setq c (1+ c)) ) ) ) (princ) ) (defun padz ( x n ) (if (< (strlen x) n) (padz (strcat "0" x) n) x) ) (princ)
    1 point
  10. try this (defun C:nm (/ ss i blk atts lst a1 P O) (vl-load-com) (setq ss (ssget '((0 . "INSERT") (8 . "NUMBERING")))) ;only select blocks on numbering layer (repeat (setq i (sslength ss)) (setq blk (vlax-ename->vla-object (ssname SS (setq i (1- i)))) atts (vlax-safearray->list (vlax-variant-value (vla-getattributes blk))) ) (foreach x atts (if (= (vla-get-tagstring x) "PORT_NUMBER") (setq P (vla-get-textstring x)) (setq O (vla-get-textstring x)) ) ) (setq lst (list P O)) ;create a mini list (setq a1 (append a1 (list lst))) ;join all mini lists into big list ) (vl-sort a1 '(lambda (x y) (< (car x) (car y)))) ;sort by first item in the mini list ) 3. I don't know what you mean.
    1 point
  11. Maybe this will give you some ideas: (defun c:foo (/ a b c d e i l mp o p p2 s) (setq d 0.075) (if (setq s (ssget "_X" '((0 . "LWPOLYLINE")))) (progn (setq s (mapcar 'cadr (ssnamex s))) (while (setq p (getpoint "\nPick a point:")) (setq a (mapcar '(lambda (e) (list (setq p2 (vlax-curve-getclosestpointto e p)) (distance p p2) e)) s ) ) (setq a (vl-sort a '(lambda (r j) (< (cadr r) (cadr j))))) (cond ((< (cadar a) d) (setq o (vlax-ename->vla-object (last (car a)))) (mapcar 'set '(b c) (mapcar 'car a)) (setq mp (mapcar '/ (mapcar '+ b c) '(2 2 2))) (setq l (entmakex (list '(0 . "LINE") (cons 10 (polar p (angle p b) d)) (cons 11 (polar p (angle b p) d)) '(8 . "templayer") ) ) ) (setq i (vlax-invoke o 'intersectwith (vlax-ename->vla-object l) 0)) (entdel l) (if (= 6 (length i)) (setq b (mapcar '+ i '(0 0 0)) c (mapcar '+ (cdddr i) '(0 0 0)) mp (mapcar '/ (mapcar '+ b c) '(2 2 2)) ) ) (entmakex (list '(0 . "CIRCLE") (cons 10 mp) (cons 40 (/ (distance b c) 2)) '(62 . 3))) ) ) ) ) ) ) (vl-load-com)
    1 point
×
×
  • Create New...