View Single Post
Old 01-20-2020, 07:38 AM
ssusana ssusana is offline
Registered User
Join Date: Aug 2004
Location: Italy
Posts: 56
Re: convert view to dwg 1:1

;converte i disegni in dwg con viste scala 1:1, utile per esportazioni cad-cam, taglio laser, etc
;necessita d'impostare il parametro "ConvertMIDimensionsToGeometry ON" del file DXFDWG.CON e per questo ne ho creato uno dedicato.
(sd-defdialog 'SntDwg-1.1
:module       "ANNOTATION"
:dialog-title "Converti DWG 1:1" 
:toolbox-button nil
			(setq dwgname (SD-AM-INQ-DRAWING-NO))
			(setq scale_sheet (sinteco-string-to-number(sd-am-sheet-struct-scale (sd-am-inq-sheet (sd-am-inq-curr-sheet))))) ;convert string to number 
			(AM_SAVE_SHEET_MI :SHEET (uib:get-file-manager-objects) :filename (format nil "c:/temp/~a.mi" dwgname) :overwrite )
			(SD-SYS-EXEC (format nil "~a/dxfdwg/scala1.1/dxfdwg.exe -m c:\\temp\\~a.mi" oli::*ci-percorso-pers-sinteco* dwgname))
			(am_drawing_delete :dwg :YES)
			(AM_LOAD_ANY_MI :ENABLE_WARNING :off :FILENAME (format nil "C:/Temp/~a.dwg" dwgname) )
			(am_sketch_resize :sketch "1/TOP" (/ 1 scale_sheet))
	;		(if (<= scale_sheet 1)  (am_sketch_resize :sketch "1/TOP" (/ 1 scale_sheet)) (am_sketch_resize :sketch "1/TOP" scale_sheet) )	
			(AM_SAVE_SKETCH :SKETCH "1/TOP" :FILENAME (format nil "C:/Temp/~a.dwg" dwgname) :OVERWRITE)
			(system(format nil "del c:\\temp\\~a.mi" dwgname))
			(system(format nil "del c:\\temp\\~a.log" dwgname))
			(am_drawing_delete :dwg :YES)
		:failure (sd-display-warning "Errore in conversione")
		:success (oli::undo  :NUM_STEPS 1)
Reply With Quote