Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/28/2023 in all areas

  1. Maybe look at the 210 dxf code (210 0.0 0.0 1.0) this is world ucs, an arc drawn in a UCS will be like, (210 0.0 -0.334116324669344 0.94253184645902)
    1 point
  2. Which batch processing routine are you trying them with? There is no user interaction needed and so should work OK (you'll need something like Lee Macs Scriptwriter to run the batch - on his website)
    1 point
  3. Probably a command has changed or been replaced. Hard to know without seeing the file. Is there an error message on the commandline? Did you try checking errors in the VLIDE or similar?
    1 point
  4. Updating to asking for the line # instead of text also needs the first changes done as well. ; mtext find remove (defun C:mtfr2 (/ ent strent ans newline x k ssmtxt removetxt) (setq ssmtxt (ssget '((0 . "Mtext")))) (setq x (getint "\nLine To Remove: ")) (repeat (setq k (sslength ssmtxt)) (setq strent (vlax-ename->vla-object (ssname ssmtxt (setq k (- k 1))))) (setq str (vla-get-textstring strent)) (setq ans (LM:csv->lst str "\\" 0)) (setq removetxt (nth (- x 1) ans)) (setq newline "") (setq x 0) (repeat (length ans) (if (= (wcmatch (strcase (nth x ans)) (strcase removetxt)) T) ;doesn't need a wild card. (princ) (setq newline (strcat newline "\\" (nth x ans))) ) (setq x (+ x 1)) ) (if (eq (vl-string-search "\\P" newline) 0) (setq newline (substr newline 3)) (setq newline (substr newline 2)) ) (vla-put-textstring strent newline) ) ; repeat (princ) )
    1 point
  5. Try the following: (defun c:lpr ( / e g p q ) (while (not (progn (setvar 'errno 0) (setq e (entsel)) (cond ( (= 7 (getvar 'errno)) (prompt "\nMissed, try again.") ) ( (null e)) ( (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getclosestpointto e)) (prompt "\nInvalid object selected.") ) ( (setq e (car e)) (while (= 5 (car (setq g (grread t 13 0)))) (redraw) (if (setq q (vlax-curve-getclosestpointto e (trans (cadr g) 1 0) t)) (grdraw (cadr g) (trans q 0 1) 1) ) ) (if (= 3 (car g)) (progn (entmake (list '(0 . "LINE") (cons 10 (setq p (trans (cadr g) 1 0))) (cons 11 (setq q (vlax-curve-getclosestpointto e (trans (cadr g) 1 0) t))) ) ) (princ "\nLine endpoints: ") (princ p) (princ " | ") (princ q) (princ "\nLength: ") (princ (distance p q)) ) t ) ) ) ) ) ) (redraw) (princ) )
    1 point
  6. Ron was too quick for me, but I'll post mine anyway: (defun c:twrm ( / ent len lst sel ) (if (setq sel (ssget "_X" '( (008 . "TOWER") (410 . "Model") (-04 . "<OR") (000 . "CIRCLE") (-04 . "<AND") (000 . "LWPOLYLINE") (090 . 3) (-04 . "&=") (070 . 1) (-04 . "AND>") (-04 . "OR>") ) ) ) (progn (setq ent (ssname sel 0) lst (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= 10 (car x))) (entget ent))) len (length lst) ) (command "_.move" (ssget "_X" '((410 . "Model"))) "" "_non" (trans (mapcar '/ (apply 'mapcar (cons '+ lst)) (list len len)) ent 1) "_non" '(0.0 0.0) ) ) (princ "\nTower object not found.") ) (princ) )
    1 point
×
×
  • Create New...