冲压模板分离程序
图一
图二
图三
程序:
(defun c:QQ ()
(command "layer" "LO" "*" "")
(command "layer" "U" "AC" "U" "AM" "U" "Af" "")
(command "copy" "ALL" "" "0,0" "500,2000");上模座
(command "layer" "U" "Uf" "U" "UM" "U" "UC" "LO" "AC" "LO" "AM" "LO" "AF" "")
(command "copy" "ALL" "" "0,0" "500,1500");上垫板
(command "layer" "U" "Hf" "U" "HM" "U" "HC" "LO" "UC" "LO" "UM" "LO" "UF" "")
(command "copy" "ALL" "" "0,0" "500,1000");固定板
(command "layer" "U" "Kf" "U" "KM" "U" "KC" "LO" "HC" "LO" "HM" "LO" "HF" "")
(command "copy" "ALL" "" "0,0" "500,500");止高板
(command "layer" "U" "Sf" "U" "SM" "U" "SC" "LO" "KC" "LO" "KM" "LO" "KF" "")
(command "copy" "ALL" "" "0,0" "500,0");脱料板
(command "layer" "U" "Tf" "U" "TM" "U" "TC" "LO" "HC" "LO" "HM" "LO" "HF" "")
(command "copy" "ALL" "" "0,0" "500,500");中空板
(command "layer" "U" "Df" "U" "DM" "U" "DC" "LO" "TC" "LO" "TM" "LO" "TF" "")
(command "copy" "ALL" "" "0,0" "500,0");凹模板
(command "layer" "U" "Bf" "U" "BM" "U" "BC" "LO" "DC" "LO" "DM" "LO" "DF" "")
(command "copy" "ALL" "" "0,0" "500,-500");下垫板
(command "layer" "U" "Zf" "U" "ZM" "U" "ZC" "LO" "DC" "LO" "DM" "LO" "DF" "")
(command "copy" "ALL" "" "0,0" "500,-500");下脱板
(command "layer" "U" "Wf" "U" "WM" "U" "WC" "LO" "ZC" "LO" "ZM" "LO" "ZF" "")
(command "copy" "ALL" "" "0,0" "500,-1000");下夹板
(command "layer" "U" "Lf" "U" "LM" "U" "LC" "LO" "WC" "LO" "WM" "LO" "WF" "")
(command "copy" "ALL" "" "0,0" "500,-1500");下模座
(command "layer" "U" "Pf" "U" "PM" "U" "PC" "LO" "LC" "LO" "LM" "LO" "LF" "")
(command "copy" "ALL" "" "0,0" "1000,500");冲子层
(command "layer" "U" "Rf" "U" "RM" "U" "RC" "LO" "PC" "LO" "PM" "LO" "PF" "")
(command "copy" "ALL" "" "0,0" "1000,500");打料板
(command "layer" "U" "Qf" "U" "QM" "U" "QC" "LO" "RC" "LO" "RM" "LO" "RF" "")
(command "copy" "ALL" "" "0,0" "1000,0");内脱板
(command "layer" "U" "Nf" "U" "NM" "U" "NC" "LO" "QC" "LO" "QM" "LO" "QF" "")
(command "copy" "ALL" "" "0,0" "1000,-500");入块层
(command "layer" "U" "*" "")
)
请问高手们,输入QQ命令后
,提示:
请选取图框左下角点
请选取图框右上角的点
请确定分离位置点
根据图框大小,实现图三效果图,每个图框间距为50mm,请高手们指点迷津,谢谢
本帖最后由 F4164789 于 2016-9-24 12:03 编辑
@Andyhon :还有就是,FOX自己结构图里边主视图可以和下视图右视图关联,设计时把他们画好材质硬度对应好。自动拆模时,下视图和右视图也都可以拆出来对齐套图框加工注解图框材质厚度零件名称,省了很多拆模后还要自己从结构里边找下视图和侧视图的情况。我从富士康一辞职,用外面的外挂有点搞不定了。好在冲模简单些我知道结构图里孔大概表示些什么加工孔,反正出错的几率很大,有机会还请教你。附件是图档供研究,谢谢。 ...FOX自己结构图...
估计每一种外挂都有其伊始背景,
从雏型至大致底定的架构后,大体上只能最适用几种冲模架构
而且往往只适用搭配的工作环境下作业,漫说套用他厂图面,就连自家的图亦不免有水土不服的情况
程式该怎么搭配,多半也是边走边整队,视使用情况再作整合,
也就是内部最好是有人能做程式支援,否则就只能凑合着用第三方的套装了
而一旦选用上路后,想换跑道就很难了...
...每个模板图元都有在主层里...
我们用的图层配置,兼顾了校图作业
全部的上模刀口 同一图层
全部的上模夹块 同一图层
全部的脱料入子 同一图层
全部的下模刀口 同一图层
...
是以拆分各层模板图或零件到各别文件,都能以图层区隔,
也可只开相关图层审视校图...
整个设计过程中图层切换频繁,是以图层能少,效率才不至被拖累
效率化是大家的共同的方向,也希望能提出您的看法... 题外话...
看到这种拆分排列,就会想到 LifeCAD 亦是这种模式...
很多人都这么跟了下去,因为一跟上来就落入了此式子...
比较版...
纯净的总图,连尺寸都不标,亦不含图框
(所以少了很多的图层;即在过程中省了大量的图层切换操作...)
总图确审后,拆分各层模板图到各别文件 (D1.dwg ; D2.dwg ; S1.dwg....)
零件以工程为单位拆分
以冲切为例,
上模刀口一区
上模夹块一区
脱料入子一区
下模刀口一区
共一文件(同在一个 Dwg内 )
但各自有图框,意即各自出图,不会牵扯...
在分图上才有尺寸层...
效率差异如何,请自行分析,谨供参考... 自己顶起来,别沉下去 请大师们多多指点,谢谢 我的作法是不拆分,拆開要是繪圖人員習慣不好。常發生總圖和分圖不符合。 除了发线割,从不分图,再说你写这个不如直接用PRESSCAD得了,何必这么麻烦。 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:be (/ wor pti ptx pty lse lna oce wide sal n num fen fla sla pt pt1 num1 nam lname)
(setq oce (getvar "cmdecho"));自动拆分组立图
(setvar "cmdecho" 0)
(setq wor (getstring "请确认文件中'group'处于'group off'状态(回车确认),否则按'ESC'退出!"))
(if (= wor "") (princ "正在拆分组立图,请稍候!谢谢!"))
(command "rotate" "all" "" "0,0" "90")
(COMMAND "ZOOM" "E" "ZOOM" "0.95X")
(setq wide (* 1.88 (getvar "viewsize")))
(command "rotate" "all" "" "0,0" "-90")
(COMMAND "ZOOM" "E" "ZOOM" "0.95X") ;旋转视力以取得组立图总宽慰、"wide"
(setq sal (ssget "x"))
(setq num 1)(setq n 0)(setq pu_counter 0) ;赋初值
(setq lse (ssget "x" '((0 . "LINE"))))
(setq lna (entget(ssname lse 0))) ;(获取lse中的第一个名字)
(setq pti (cdr (assoc 10 lna)))
(setq ptx (car pti))
(setq pty (cadr pti)) ;取出被拆出的第一张图上的某一点
(setq pti (list (+ wide ptx) (+ (/ wide 2) pty))) ;为下面插入图框做准备
(while (>= (sslength sal) 1)
(progn ;======start progn1
(setq fen (entget(ssname sal 0))) ;取"sal"集合中第一个实体名
(setq fla (cdr (assoc 8 fen))) ;取上述实体所在的层名
(setq pu_list (append pu_list (list fla))) ;建层名列表
(setq n (+ n 1)) ;取总层数
(setq sla (ssget "x" (list (cons 8 fla))));将所有"fla"层的实体加入集合"sla"中
(setq pt (* num wide))
(setq pt1 (list pt 0)) ;设置分解出实体置放点
(command "copy" sla "" "0,0" pt1 ) ;分解
(setq numl 0)
(repeat (sslength sla) ;--start repeat1 ;以sla选择集中对象的数量做为循环次数
(progn ;====start progn2
(setq nam (ssname sla numl))
(ssdel nam sal) ;删除sla选择集中的实体名NAM
(setq numl (+ numl 1))
);====end progn2 ;将补分解的实体从“SAL”集合中清除
);--end repeat1
(setq num (+ num 1))
);==end progn1
);end while
(COMMAND "ZOOM" "E" "ZOOM" "0.95X")
(setvar "cmdecho" oce)
(princ)
) AMTONNY 发表于 2013-8-23 14:40 static/image/common/back.gif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun...
谢谢您的程序。但不是我想要的那种方式。谢谢 自己顶起来,别沉下去 我也是做冲压模的,顶起来