Visual LISP, AutoLISP and General Customization
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

Macro to create DXF

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
palc1980
1459 Views, 3 Replies

Macro to create DXF

Hi guys

 

I work with laser cutting, someone have a macro to save an dxf file automaticaly?I think that with a macro that purge the layers, deletes all the layouts, delete all the dimensions anda save the drawing as dxf would be greate.

Unfortunaly i donĀ“t know to created this in autolisp and i would thank the help that everyone could give.

 

Thanks

 

Pedro Carvalho

3 REPLIES 3
Message 2 of 4
devitg
in reply to: palc1980

Upload a sample DWG in 2008 or less
Message 3 of 4
CraigP_
in reply to: palc1980

This is what we use. It allows us to select objects and saves it to R12 dxf format.

Has no error checking though

Craig
Message 4 of 4
1tir.dad1
in reply to: CraigP_

Hello there!

since you're so popular I need your help.

Here is my code and I need it to generate PDF only for it's job, like I have 50 pages and actually what I have here selects one page block (reads it's entity) and generates all the 50 pages, but I need to get PDF from like 25 of them not all of them! it needs to PDF ALL AT ONCE, page by page (with PDF Factory Pro Printer)

can you help me out please??

Here it is :

(defun c:epdf (/ ob ss bn mn mx)
(vl-load-com)
(setq cnt 0)
(setq dir (getvar "dwgprefix"))
(if
(and (progn
(initget "B")
(setq ob (entsel "\nSelect Block/B for blockname: "))
(cond
((eq ob "B")
(setq bn (getstring "\nEtner Block Name: "))
)
((and (eq (type ob) 'LIST)
(vlax-method-applicable-p
(vlax-ename->vla-object (car ob))
'getboundingbox
)
)
(setq bn (cdr (assoc 2 (entget (car ob)))))
)
)
)
(tblsearch "BLOCK" bn)
bn
(setq
ss (ssget "_X"
(list '(0 . "INSERT") '(410 . "Model") (cons 2 bn))
)
)
)


(progn
(vla-zoomextents (vlax-get-acad-object))
(repeat (setq i (sslength ss))
(setq ML "Material-List")
(setq cnt (1+ cnt))

(vla-getboundingbox
(vlax-ename->vla-object (ssname ss (setq i (1- i))))
'mn
'mx
)
(command "plot"
"yes"
"model"
"DWG To PDF.pc3"
"ANSI A (8.50 x 11.00 Inches)"
"inches"
"LANDSCAPE"
"no"
"Window"
(trans (vlax-safearray->list mn) 0 1)
(trans (vlax-safearray->list mx) 0 1)
"fit"
"center"
"yes"
"monochrome.ctb"
"yes"
"As Displayed"
(strcat dir "ML-" (itoa cnt) "-" (getvar "dwgname"))
"no"
"yes"
"yes"
"yes"
)
(command ".delay" "750")
)
)
(princ "\nNo Blocks Selected: ")
)
(princ)
)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

ā€Boost