Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/2024 in all areas

  1. It worked great. Thanks a lot for your help
    1 point
  2. Sorry posted the wrong version where I was testing something else, here is the code I wanted to post in my previous post as it was explained there, auto detect if portrait or landscape, try this. (vl-load-com) (defun c:PDFA1 (/ lst lst_sort lst1 lst2 n Ysort dwg file hnd i len llpt lst mn mx ss tab urpt) (initget 1 "name1 name2") (setq plotstyle (getkword "\nChoose plot style [name1/name2]: ")) (initget 1 "A1 A2 A3 A4") (setq papersize (getkword "\nChoose paper size [A1/A2/A3/A4]: ")) (cond ((= papersize "A1") (setq papersize "ISO full bleed A1 (841.00 x 594.00 MM)") ) ((= papersize "A2") (setq papersize "ISO full bleed A2 (594.00 x 420.00 MM)") ) ((= papersize "A3") (setq papersize "ISO full bleed A3 (420.00 x 297.00 MM)") ) ((= papersize "A4") (setq papersize "ISO full bleed A4 (297.00 x 210.00 MM)") ) );cond (setq lst nil) (if (setq ss (ssget "_X" '((0 . "INSERT") (2 . "PDFA1")))) (progn (repeat (setq i (sslength ss)) (setq hnd (ssname ss (setq i (1- i))) tab (cdr (assoc 410 (entget hnd))) lst (cons (list hnd (cdr (assoc 10 (entget hnd))) tab) lst) ) ) (setq lst_sort nil) (setq n 0) (while (< n (length lst)) (if (not (vl-remove-if-not '(lambda (y) (equal (cadr (cadr (nth n lst))) y 0.01)) Ysort)) (setq Ysort (cons (cadr (cadr (nth n lst))) Ysort)) );if (setq n (1+ n)) );while (setq Ysort (vl-sort Ysort '(lambda (x y) (> x y)))) (setq n 0) (while (< n (length Ysort)) (setq lst1 (vl-remove-if-not '(lambda (x) (equal (nth n Ysort) (cadr (cadr x)) 0.01)) lst)) (setq lst2 (vl-sort lst1 '(lambda (x y) (< (car (cadr x)) (car (cadr y)))))) (setq lst_sort (append lst_sort lst2)) (setq n (1+ n)) );while (setq i 0) (foreach x lst_sort (setq file (strcat (getvar 'DWGPREFIX) (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4)) "-" (itoa (setq i (1+ i))) ".pdf" ) ) (if (findfile file) (vl-file-delete file) ) (vla-getboundingbox (vlax-ename->vla-object (car x)) 'mn 'mx) (setq llpt (vlax-safearray->list mn) urpt (vlax-safearray->list mx) len (distance llpt (list (car urpt) (cadr llpt))) ) (if (< (- (car llpt) (car urpt)) (- (cadr llpt) (cadr urpt))) (setq draworient "Landscape") (setq draworient "Portrait") );if (command "-plot" "yes" (car x) "DWG TO PDF.PC3" papersize ;"ISO full bleed A1 (841.00 x 594.00 MM)" "Millimeters" draworient ;"Landscape" "No" "Window" llpt urpt "Fit" "Center" "yes" plotstyle ;"acad.ctb" ;"Standard-A1.ctb" "yes" "" ) (if (/= (caddr x) "Model") (command "No" "No" file "no" "Yes") (command file "no" "Yes" ) ) ) ) ) (princ) ) And completely understandable, you asked for help, I just wanted to say a lot can be done but all details need to be known to start the right way from the beginning.
    1 point
  3. Just a comment I have work with any size and orientation as you are reading a "TITLE Block" you know its name and scale so can work out the plot parameters, same with hard copy or say to pdf. Happy to talk but everything in the world is not necessarily free.
    1 point
  4. Hi @pondpepo9, The reason why you're getting "error: bad argument type: lselsetp nil" is because "(sslength ss)" is 0, which means that when you asked to "Select a spline to convert to pline:", there is no "SPLINE" entity in the drawing. Can you post a .dwg file? Best regards.
    1 point
  5. The issue is because you are collecting each DXF data list into a parent list (ttl_txt), but then performing the substitution on the parent list rather than each of the DXF lists it contains. However, I see no reason to construct the separate list in the first place, simply perform the update on each item as you encounter it: ;; --- Modify "Panel Zone: Wind 1" to say "Wind Pressure Diagram" --- ;; (cond ( (setq ss5 (tblobjname "BLOCK" "DesCalc")) (while (setq ss5 (entnext ss5)) (setq ent5 (entget ss5)) (if (= (cdr (assoc 1 ent5)) "Panel Zone: Wind 1") (entmod (subst '(1 . "Wind Pressure Diagram") (assoc 1 ent5) ent5)) ) ) ) )
    1 point
  6. In Line with @BIGAL's comments, This stripped down version will suit. When you want to finish press enter or right click the mouse. (defun c:CCC ( / ss pt1 pt2) (prompt "\nSelect objects to copy : ") (setq ss (ssget) pt1 (getpoint "\nSelect Base point : ") ) (while (setq pt2 (getpoint pt1 "\nNext point : ")) (command "copy" ss "" pt1 pt2) ) )
    1 point
×
×
  • Create New...