Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/08/2022 in all areas

  1. Fonts can be referenced to Text Styles or directly by Mtext so it's a complicated task. For managing Text Styles I use the 4.2 version of MergeTextStyles by T.Willey https://www.theswamp.org/index.php?topic=17659.msg575812#msg575812 Make sure you put both MergeTextStyles.lsp & MyDialogs.dcl in a Trusted Support folder. When trying to find where a Text Style is used in a drawing I've changed the font to Wingdings to show where they're used.
    1 point
  2. 1 point
  3. You're welcome. Just add the entity name to the selection set as follows. (0 . "*TEXT,INSERT,LWPOLYLINE")
    1 point
  4. One more revision... I hope it's now even better than before... pts_along_pipe_trees_by_length.lsp
    1 point
  5. Maybe check this also How to enable or disable hardware acceleration in AutoCAD | AutoCAD | Autodesk Knowledge Network
    1 point
  6. (defun c:test (/ int sel ent get pos pts ins srt) ;;----------------------------------------------------;; ;; Author : Tharwat Al Choufi ;; ;; website: https://autolispprograms.wordpress.com ;; ;;----------------------------------------------------;; (and (princ "\nSelect Polylines & Texts : ") (setq int -1 sel (ssget "_:L" '((0 . "*TEXT,LWPOLYLINE"))) ) (while (setq int (1+ int) ent (ssname sel int) ) (setq get (entget ent) pos (cdr (assoc 10 get)) ) (or (and (= (cdr (assoc 0 get)) "LWPOLYLINE") (setq pts (cons pos pts) pts (cons (cdr (assoc 10 (reverse get))) pts) ) ) (setq ins (cons (list pos ent) ins)) ) ) (while (and ins pts) (and (setq pos (car ins)) (setq srt (car (vl-sort pts (function (lambda (j k) (< (distance (car pos) j) (distance (car pos) k)) ) ) ) ) pts (vl-remove srt pts) ) (vlax-invoke (vlax-ename->vla-object (cadr pos)) 'Move (car pos) (append srt '(0.0)) ) ) (setq ins (cdr ins)) ) ) (princ) ) (vl-load-com)
    1 point
  7. There is no need to reinstall Windows if the only application that is malfunctioning is AutoCAD. It appears, from what you have posted above, to be a problem related to your graphics card. Can you elaborate further?
    1 point
  8. Maybe this is better. But I don't know whether Chinese charaters could effect the sort list or not. (defun c:if(/ dir files len col n x y h dy v li minp maxp) (defun sort(l) (mapcar 'cadr (vl-sort (mapcar '(lambda(x) (list (vl-list->string (vl-remove-if-not '(lambda(y) (<= 48 y 57)) (vl-string->list x))) x)) l) '(lambda(m n) (< (car m) (car n))))) ) ;;; main function (vl-load-com) (setq dir (vl-filename-directory (getfiled "Get Directory" (getvar "dwgprefix") "dwg" 4)) files (sort (vl-directory-files dir "*.dwg" 1)) len (length files) col (fix (sqrt len)) n -1 y 0 h 0 ) (while (< n (1- len)) (setq x 0 y (- y h) h 0) (repeat col (setq v (nth (setq n (1+ n)) files)) (if v (progn (vla-AttachExternalReference (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (strcat dir "/" v) (strcat "XREF_IMAGE" (itoa n)) (vlax-3d-point '(0 0)) 1 1 1 0 :vlax-false) (vla-getBoundingBox (vlax-ename->vla-object (entlast)) 'minp 'maxp) (setq li (mapcar 'vlax-safearray->list (list minp maxp))) (command "move" (entlast) "" (list (caar li) (cadadr li)) (list x y)) (if (> (setq dy (abs (- (cadadr li) (cadar li)))) h) (setq h dy)) (setq x (+ x (abs (- (caadr li) (caar li)))) ) ) ) ) ) )
    1 point
×
×
  • Create New...