Export sheetmetal for fabrication
BricsCAD has some nice features to automate sheet-metal
One thing it does not do so well is automate the stuff for fabrication, I know it can do it and write to HTML etc. but my suppliers do not work that way.
Normally we send the dxf file for fabrication and an accompanying pdf.
I've created a custom export function via LISP.
The only thing I cannot get it to do is get the thickness of the local body.
I can get the global thickness value via LISP, but not the local thickness.
So you have to input thickness and the quantity manually.
The code is not tested extensively, but it gives you an idea of how to automate this process.
Is assumes you have a folder called "Laser" in the same folder as the drawing.
(vl-load-com)
(princ "SMEXPORT Loaded") (defun c:smexport (/ feature filenameStr body thickness LastEnt flange material ss ss2)
(setq feature (ssget "_:V"))
(setq flange (car (SmLispGet "FeaturesBySubEntity" feature)))
(setq LastEnt (SmLispGet "SelectEntities" "Top" flange)) (initget 1 "1.5 2 3 4 5 6 8 10 12") (setq thickness(getkword "\nSelect Thickness [1.5/2/3/4/5/6/8/10/12]: ")) (setq nPcs (getint "Amount to produce: ")) (setvar 'nomutt 1) ;(initget 1 "1 2 3 4 _ S235 S355 AISI304L AISI316L") ;(setq material(getkword "\nSelect material [1=S235/2=S355/3=AISI304L/4=AISI316L]: ")) (setq material (BmLispGet "Material" (car (BmLispGet "Components")))) (setq body (SmLispGet "BodyName" (ssname feature 0))) ;(setq body "test") (setq filenameStr (strcat (getvar 'dwgprefix) "//Laser//" (vl-filename-base (getvar "dwgname")))) (setq filenameStr (strcat filenameStr "_" body)) (setq filenameStr (strcat filenameStr "_" thickness "mm_" material "_" (itoa nPcs) "stk")) (command "_smUnfold" "#0,0,0" "#0,0,0" "2D" (strcat filenameStr ".dxf") "2013") (command "_layer" "OFF" "Attributes" "") (command "_layer" "OFF" "Bend Annotations" "") (command "_layer" "OFF" "Bends Down" "") (command "_layer" "OFF" "Defpoints" "") (command "_layer" "OFF" "Bends Up" "") (command "_layer" "OFF" "Overall Dimensions" "") (command "_layer" "ON" "Attributes" "") (command "_layer" "ON" "Overall Dimensions" "") (command "_Style" "" "" "15" "" "" "" "") (setq ss (ssget "_X" '((0 . "DIMENSION")))) (repeat (setq n (sslength ss)) (vla-put-TextHeight (vlax-ename->vla-object (ssname ss (setq n (1- n)))) 15) ); repeat (setq ss2 (ssget "_X" '((0 . "MTEXT")))) (repeat (setq n (sslength ss2)) (setq obj (vlax-ename->vla-object (ssname ss2 (setq n (1- n))))) (vla-put-Height obj 15) (setq posi (+ -60 (* n -15))) (vlax-put-property obj "InsertionPoint" (strcat "0,"(itoa posi)",0")) ); repeat (setvar 'CLAYER "Attributes") (command "_.MTEXT" "0,-80,0" "_Justify" "BL" "_Height" 15 "_none" "@" (strcat "Quantity = " (itoa nPcs) "pcs" ) "") (setvar 'CLAYER "0") (command "_exportpdf" (strcat filenameStr ".pdf") "Y") ;(command "_exportpdf" "" "Y") (command "_layer" "OFF" "Attributes" "") (command "_layer" "OFF" "Bend Annotations" "") (command "_layer" "OFF" "Bends Down" "") (command "_layer" "OFF" "Defpoints" "") (command "_layer" "OFF" "Bends Up" "") (command "_layer" "OFF" "Overall Dimensions" "") (command "_saveas" "DXF" "V" "2013" "5" (strcat filenameStr ".dxf") "Y") (vl-load-com) (vla-SendCommand (vla-get-ActiveDocument (vlax-get-acad-object)) "_.CLOSE ") ;(command "_smexport2d" (strcat (getvar 'dwgprefix) "//" (vl-filename-base (getvar "dwgname")) "_" body ".dxf") "2010") (setvar 'nomutt 0) (princ) )
0