Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/22/2020 in all areas

  1. Have you tried my Dynamic Block Counter program?
    1 point
  2. Look into palettes and that may help, or a library of block dwgs the when you do a insert it will be based around a known insert point.
    1 point
  3. If its a case of say getting attributes in simple method 2 lisps but ran individually. ran in 1st dwg dump atts -> text file ran in 2nd dwg Get atts -> text file Why not just copy and paste between the 2 dwgs no code required.
    1 point
  4. If the error persists, or try this shorter routine as an alternative without using COM API. Its just a simpler algorithm merely sorting each row of TEXT from top to bottom. since it does not collect line coordinates and the output just a normal 'csv' file, so don't expect auto cell formatting, column size, alignment etc.. however you still can format cell easily in EXCEL sheet & rename as .xls. (defun c:tt (/ *error* foo ss fn f a b l ls l1 lst) ;hanhphuc 28.10.2019 (defun *error* (msg) (if (and f (= (type f) 'FILE)) (close f) (setq f nil) ) ) (and (setq foo '((a b) (cdr (assoc a (entget b)))) ss (ssget '((0 . "TEXT") (8 . "Text"))) ) (setq l (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) ; (acet-ss-to-list ss) (setq fuzz (* 0.25 (foo 40 (car l))) ls (mapcar ''((x) (cons (foo 1 x) (foo 10 x))) l) ) (setq fn (vl-filename-mktemp "table.csv") ) (setq f (open fn "w")) (setq l nil sl (vl-sort ls ''((a b) (if (equal (caddr a) (caddr b) fuzz) (< (cadr a) (cadr b)) (< (caddr a) (caddr b)) ) ) ) a (caddar sl) ) (foreach x sl (if (equal a (setq b (caddr x)) fuzz) (setq l1 (cons x l1) a b ) (setq l1 (vl-list* x nil l1)) ) (setq a b) ) ;_ end of foreach (foreach x (progn (foreach x l1 (if x (setq l (cons x l)) (setq lst (cons l lst) l nil ) ) ) (setq lst (cons l lst)) (reverse (vl-remove nil lst)) ) ; progn (write-line (apply 'strcat (mapcar ''((x) (strcat x ",")) (mapcar 'car x))) f) ) (progn (if f (close f) ) (vl-cmdf "start" fn) ; or (vl-cmdf "shell" fn) doesn't work if same filename opened i.e:locked for editting ;(startapp "notepad" fn) ; recommand to use this for mutiple files ) ) ;and (princ) ) (or (wcmatch (strcase (getvar 'dwgname)) "*COORDINATE TABLE 1*") (alert "\nThis routine only tested in 'COORDINATE TABLE 1.dwg', \nPlease download at \nhttps://www.cadtutor.net/forum/topic/68979-export-cad-text-table-in-excel-get-error/" ) ) (princ) p/s: In case you have any blank cell in Table, just replace it with "-" or any TEXT! i.e. TEXT in each Cell in a Row must have content & aligned horizontally in WCS, otherwise texts merge from first column to next
    1 point
  5. I wouldn't typically recommend doing this, but if you want to disable snapping to your xref, put it on layer Defpoints and then freeze layer 0. This will make the xref unselectable and you won't be able to snap to it. It is not good practice to put anything on layer Defpoints though, so I only mention this as a temporary workaround. Once you're finished, thaw layer 0 and move your xref off the Defpoints layer.
    1 point
  6. Try this for UCS: ;; CAB 05.13.09 ;; Draw Electric Wire (defun c:ew (/ ew_layer p1 p2 msg) (setq ew_layer "Wire") ; layer name (defun draw-ew (p4 p1 lay / p2 p3) (setq p2 (polar p1 (- (angle p1 p4) (/ pi ) 57.40259411) p3 (polar p4 (+ (angle p4 p1) (/ pi ) 57.40259411) ) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 8 lay) (cons 90 4) '(70 . 0) ; 1 for closed 0 overwise (cons 10 (trans p1 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198912) (cons 10 (trans p2 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) (cons 10 (trans p3 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.198913) (cons 10 (trans p4 1 0)) '(40 . 0.0) '(41 . 0.0) '(42 . 0.0) '(210 0.0 0.0 1.0) ) ) ) (and (setq p1 (getpoint "\nPick start point (Draw clockwise")) (setq msg "\nPick next point clockwise.") (while (setq p2 (getpoint p1 msg)) (draw-ew p1 p2 ew_layer) (setq p1 p2) ) ) (princ) ) (prompt "\nElectric Wire loaded, Enter EW to run.") (princ)
    1 point
×
×
  • Create New...