Hạng F
11/1/10
6.129
64.391
113
Mình có 1 file CAD gồm nhiều, thậm chí cả trăm bản vẽ bằng nhau và cách đều nhau như hình.
Hỏi về cách tạo file dxf ở trang 4.

Có cách nào để in nó cùng size A4 hay A3 bằng 1 lệnh mà ko cần paper space? Google nói phải viết lisp mới đựoc. Các anh làm xây dựng, kts, kể cả TCXD, hay họa viên có dùng autoCAD có biết cách nào đơn giản ko?
 
Hạng F
11/1/10
6.129
64.391
113
Mới google được cái này nhưng nhìn cứ như đám rừng, đoạn đầu thì ok, đoạn cuối chẳng hiểu chúng nói gì. Nhìn giống job của mí anh coders.

(defun C:fp ()
(setq startpt (getpoint "\nSelect top-left corner of billpage grid: "))
(setq columns (getint "\nSpecify number of columns: "))
(setq bbl (getpoint "\nSelect bottom left corner of sample billpage: "))
(setq btr (getpoint "\nSelect top right corner of sample billpage: "))
(setq vgapr (getpoint "\nSelect right edge of vertical gap: "))
(setq hgapl (getpoint "\nSelect lower edge of horizontal gap: "))
(setq bpcount (getint "\nSpecify number of billpages: "))
(setq papertype (getstring "\nSpecify sheet size <A=8.5x11 / B=11x17 / P=PDF 11x17 / PP=PDF 8.5x11>: "))
(if (= papertype "A")
(setq paper "Letter (8.5\" x 11\")"))
(if (= papertype "a")
(setq paper "Letter (8.5\" x 11\")"))
(if (= papertype "B")
(setq paper "11\" x 17\""))
(if (= papertype "b")
(setq paper "11\" x 17\""))
(if (= papertype "P")
(setq paper "11 x 17"))
(if (= papertype "p")
(setq paper "11 x 17"))
(if (= papertype "PP")
(setq paper "letter"))
(if (= papertype "pp")
(setq paper "letter"))
(setq orientation (getstring "\nSpecify sheet orientation <L=Landscape/ P=Portrait>: "))

từ đây trở đi là điếc.
-----------------------------------------------------------------------------------------------------------------

(setq w_rows (fix (/ bpcount columns)))
(setq bpheight (- (cadr btr) (cadr bbl)))
(setq bpwidth (- (car btr) (car bbl)))
(setq bpvgap (- (car vgapr) (car btr)))
(setq bphgap (- (cadr bbl) (cadr hgapl)))
(setq p_col (fix (rem bpcount columns)))
(setq row 1)
(setq x_0 (car startpt))
(setq y_0 (cadr startpt))
(while (<= row w_rows)
(setq col 0)
(while (<= col (- columns 1))
(setq bl (list (+ x_0 (* col (+ bpwidth bpvgap))) (- y_0 (+ (* row bpheight) (* (- row 1) bphgap)))))
(setq tr (list (+ x_0 (+ (* (+ col 1) bpwidth) (* col bpvgap))) (- y_0 (* (- row 1) (+ bpheight bphgap)))))
(command "-plot")
(command "y");Detailed plot configuration
(command "");Enter an output device plotter
(command "");Enter paper size
(command paper)
(command "i")Enter paper units
(command orientation);orientation above command
(command "n");Plot upside down
(command "w");Enter plot area Display Extents Limits View Window
(command bl);Above cords
(command tr);Above cords
(command "f");Enter plot scale FIT
(command "");Enter plot offset x,y
(command "y");Plot with plot styles
(command "");Enter plot style table name CTB name
(command "y");Plot with lineweights
(command "");Enter shade plot setting As displayed legacy Wireframe legacy Hidden Visual styles Rendered
(command "n");Write the plot to a file
(command "n");Save changes to page setup
(command "y");Proceed with plot
(setq col (+ col 1))
)
(setq row (+ row 1))
)
(if (/= p_col 0)
(progn
(setq col 0)
(while (<= col (- p_col 1))
(setq bl (list (+ x_0 (* col (+ bpwidth bpvgap))) (- y_0 (+ (* (+ 1 w_rows) bpheight) (* w_rows bphgap)))))
(setq tr (list (+ x_0 (+ (* (+ col 1) bpwidth) (* col bpvgap))) (- y_0 (* w_rows (+ bpheight bphgap)))))
(command "-plot")
(command "y")
(command "")
(command "")
(command "")
(command "i")
(command orientation)
(command "n")
(command "w")
(command bl)
(command tr)
(command "f")
(command "")
(command "y")
(command "")
(command "y")
(command "")
(command "n")
(command "n")
(command "y")
(setq col (+ col 1))
)
)
)
)
(princ)
 
Hạng B2
12/3/18
371
21.790
103
Mới google được cái này nhưng nhìn cứ như đám rừng, đoạn đầu thì ok, đoạn cuối chẳng hiểu chúng nói gì. Nhìn giống job của mí anh coders.

(defun C:fp ()
(setq startpt (getpoint "\nSelect top-left corner of billpage grid: "))
(setq columns (getint "\nSpecify number of columns: "))
(setq bbl (getpoint "\nSelect bottom left corner of sample billpage: "))
(setq btr (getpoint "\nSelect top right corner of sample billpage: "))
(setq vgapr (getpoint "\nSelect right edge of vertical gap: "))
(setq hgapl (getpoint "\nSelect lower edge of horizontal gap: "))
(setq bpcount (getint "\nSpecify number of billpages: "))
(setq papertype (getstring "\nSpecify sheet size <A=8.5x11 / B=11x17 / P=PDF 11x17 / PP=PDF 8.5x11>: "))
(if (= papertype "A")
(setq paper "Letter (8.5\" x 11\")"))
(if (= papertype "a")
(setq paper "Letter (8.5\" x 11\")"))
(if (= papertype "B")
(setq paper "11\" x 17\""))
(if (= papertype "b")
(setq paper "11\" x 17\""))
(if (= papertype "P")
(setq paper "11 x 17"))
(if (= papertype "p")
(setq paper "11 x 17"))
(if (= papertype "PP")
(setq paper "letter"))
(if (= papertype "pp")
(setq paper "letter"))
(setq orientation (getstring "\nSpecify sheet orientation <L=Landscape/ P=Portrait>: "))

từ đây trở đi là điếc.
-----------------------------------------------------------------------------------------------------------------

(setq w_rows (fix (/ bpcount columns)))
(setq bpheight (- (cadr btr) (cadr bbl)))
(setq bpwidth (- (car btr) (car bbl)))
(setq bpvgap (- (car vgapr) (car btr)))
(setq bphgap (- (cadr bbl) (cadr hgapl)))
(setq p_col (fix (rem bpcount columns)))
(setq row 1)
(setq x_0 (car startpt))
(setq y_0 (cadr startpt))
(while (<= row w_rows)
(setq col 0)
(while (<= col (- columns 1))
(setq bl (list (+ x_0 (* col (+ bpwidth bpvgap))) (- y_0 (+ (* row bpheight) (* (- row 1) bphgap)))))
(setq tr (list (+ x_0 (+ (* (+ col 1) bpwidth) (* col bpvgap))) (- y_0 (* (- row 1) (+ bpheight bphgap)))))
(command "-plot")
(command "y");Detailed plot configuration
(command "");Enter an output device plotter
(command "");Enter paper size
(command paper)
(command "i")Enter paper units
(command orientation);orientation above command
(command "n");Plot upside down
(command "w");Enter plot area Display Extents Limits View Window
(command bl);Above cords
(command tr);Above cords
(command "f");Enter plot scale FIT
(command "");Enter plot offset x,y
(command "y");Plot with plot styles
(command "");Enter plot style table name CTB name
(command "y");Plot with lineweights
(command "");Enter shade plot setting As displayed legacy Wireframe legacy Hidden Visual styles Rendered
(command "n");Write the plot to a file
(command "n");Save changes to page setup
(command "y");Proceed with plot
(setq col (+ col 1))
)
(setq row (+ row 1))
)
(if (/= p_col 0)
(progn
(setq col 0)
(while (<= col (- p_col 1))
(setq bl (list (+ x_0 (* col (+ bpwidth bpvgap))) (- y_0 (+ (* (+ 1 w_rows) bpheight) (* w_rows bphgap)))))
(setq tr (list (+ x_0 (+ (* (+ col 1) bpwidth) (* col bpvgap))) (- y_0 (* w_rows (+ bpheight bphgap)))))
(command "-plot")
(command "y")
(command "")
(command "")
(command "")
(command "i")
(command orientation)
(command "n")
(command "w")
(command bl)
(command tr)
(command "f")
(command "")
(command "y")
(command "")
(command "y")
(command "")
(command "n")
(command "n")
(command "y")
(setq col (+ col 1))
)
)
)
)
(princ)
Anh tưởng xài đồ free dễ thế à.
Giờ có phí mới giải thích.
:cool: