Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/12/2022 in all areas

  1. The same way you did deduct the first element ( X coordinates ) although it has to be car and not cadr (setq co (list (- (car co) 15.0) ;; X = (car co) so now it is minus 15.0 from oroginal X value. (- (car co) 10.0) ;; Y = (cadr co) so now it is minus 10.0 from original Y value. ) )
    2 points
  2. No it does not need command in between the coordinates if you used them as lists as examples posted above. But if you use them as strings then yes that's required although this is not needed at all because command accepts decimal or string inputs at the same time.
    1 point
  3. 1 point
  4. 1 point
  5. (defun C:text_table (/ vars vals base i c tx base_n currentlayer currenttextstyle currenttextsize somenumber) (setq vars '(snapmode osmode cmdecho ATTDIA ATTREQ LUPREC) ;list of variables vals (mapcar 'getvar vars) ;store old values ) (mapcar 'setvar vars '(0 0 0 0 1 0)) ;set new values (setq base (getpoint "\nEnter Starting Point :") i 0 c 0 ) (setq currentlayer (getvar 'clayer)) ;edited line (setq currenttextstyle (getvar 'textstyle)) ;edited line (setq currenttextsize (getvar 'textsize)) ;edited line (setq somenumber (/ currenttextsize 8)) (while (< i 1000) (setq tx (strcat (AT:NumFix (itoa i) 4) " = " (chr i)) base_n (polar base (* pi 1.5) (* 20 (* i somenumber))) base_n (list (+ (car base) (* (fix (* (/ i 25) somenumber)) 100)) (- (cadr base) (* 20 (* i somenumber)))) ) (entmake (list '(0 . "TEXT") (cons 8 currentlayer) (cons 10 base_n) (cons 11 base_n) (cons 40 currenttextsize) (cons 1 tx) (cons 7 currenttextstyle) '(71 . 0) '(72 . 0) '(73 . 2) ) ) (setq i (1+ i)) (setq c (1+ c)) (if (eq c 25) ;simple counter to step over (progn (setq base (polar base (* PI 0.5) (* 500 somenumber))) (setq c 0) ) ) ) (mapcar 'setvar vars vals) ;restore old values (princ) ) (defun AT:NumFix (s n) ;; Fix number string with leading zeros ;; s - Number string to fix ;; n - Number of characters for final string ;; Alan J. Thompson, 10.29.09 (if (< (strlen s) n) (AT:NumFix (strcat "0" s) n) s ) )
    1 point
  6. If you define 0,0 in co as a list, that should work: (setq co (list 0 0)) of (setq co '(0 0)) The difference being '( makes the string fixed so what follows is exactly as it is used, list( allows you to calculate the list items or refer to other variables (setq String1 ("Hello") ) (setq string2 ("World") ) (setq mylist (list String1 String2)) -> is seen as (Hello World) (setq mylist '(Strng1 String2)) -> is seen as (String1 String2) (though might throw up an error wanting "" around the text strings)
    1 point
  7. Here is one example for you to get started and its easy to modify it for the rest of your variables. (setq co (list 0.0 0.0)) (setq co (list (+ (car co) 1.0) (cadr co))) Just ask if you stuck or might need any further help.
    1 point
  8. Remove the two quotes around the variable to enable the command to evaluate it.
    1 point
  9. I guess you could make a temp copy of the polyline to explode and overkill. Check the total length of entity's left against the length of the unexploded polyline. original length = non returning length original length > returning length -edit You would then even know for what length its overlapping. -edit added lisp : RETURN Select entities: Polyline has 113.886 of overlap : RETURN Select entities: Polyline does not overlap ;;----------------------------------------------------------------------------;; ;; Check if a polyline is overlapping (defun C:RETURN (/ len len+ ss ss1 ent objs LastEnt) (setq len 0.0 len+ 0.0 ss (ssadd) ) (if (setq ss1 (ssget "_+.:E:S" '((0 . "*POLYLINE")))) (progn (setq ent (ssname ss1 0)) (setq len (+ (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent)))) (setq LastEnt (entlast)) (setq objs (vlax-invoke (vlax-ename->vla-object ent) 'explode)) (foreach ent (mapcar 'vlax-vla-object->ename objs) (ssadd ent ss) ) (setvar 'nomutt 1) (command "-overkill" ss "" "") (setvar 'nomutt 0) (if (setq en (entnext LastEnt)) (while en (ssadd en SS) (setq en (entnext en)) ) ) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (if (entget e) (progn (setq len+ (+ len+ (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))) (entdel e) ) (ssdel ent ss) ) ) (if (> len len+) (prompt (strcat "\nPolyline has " (rtos (- len len+) 2 3) " of overlap")) (prompt "\nPolyline does not overlap") ) ) ) (princ) )
    1 point
×
×
  • Create New...