几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 09:08 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】auto create 11 flat pattern and save as dxf

auto create 1:1 flat pattern and save as dxf
i have updated one of the macros on my site to now automatically create a 1:1 flat pattern with no annotations or bend lines etc... from a model, and create a sheet with the view on ready for you to do as you please with.
from there it also asks whether you would like it to create a dxf sheet for you from it.
i created a macro a couple of years ago that does this, plus it ask you if you would like to rotate the flat pattern (for grain direction). it also automatically saves the dxf in a specified user directory (see who is logged into the machine). one of things i would like to add to it though is the ability to color certain lines on the dxf. if we have something that needs to be etched or a line that needs to be cut, we need to open the dxf file in dwg editor and manually change the line color. etching gets yellow while cuts get blue.
anyone know a way to do this automatically in solidworks? the sketches that define these etches and cuts are in the model with names like "etch1" or "cut1". as long as the sketch is not hidden, the dxf macro will show it on the final dxf.
any suggestions?
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
we are putting all the sketches & text to a layer bend notes & the template is set ith a layer.
cheers!
swaps
you could also create a mapping file and set solidworks to use this file when you are exporting the dxf drawing. we use one to assign entities to a layer called "cut" of a colour yellow and all other notese and annotations are assigned to other layers and colours aside from this.
i have attached our map file, and you can modify as necessary. you may still have to create sketches for etch1 and assign the sketch in the drawing, but entities for cut can be just left as the view in the drawing.
the file being sent is just edited in notepad but has to be loaded in the dxf options.
refer to help for dxf mapping to see how to point to the directory for the map file.
hope this maybe help you.
ben conners
lovat inc.
sw 2008 sp 3.1
that attachment doesn't work.
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
i have zipped the file again and a pic to show where to reference it.
you would still use a macro or a manual save as to create the dxf file.
if you wish to edit the map file- use notepad.
in the pic, i went to file, save as, and selected the filetype as dxf then went to the options button. i then pointed to the directory where the mapping file was. you only have to do this once, not for every dxf generation. you are setting global paramaters for dxf generation.
hope that will work for you.
originally posted by: ben conners
i have zipped the file again and a pic to show where to reference it.
thanks ben, i am looking at it now. quick question. if i have a sketch on my model thats called "etch". how do i get this to show up on the dxf on layer "etch" ? the dxf macro we use automatically creates a new sheet with the flat-pattern geometry scaled 1:1, then saves the file. does this mean that i would have to manually create a sheet with the view scaled 1:1, create a layer called "etch", assign the layer blue for color, then export the dxf manually?
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
i have attached a couple pics of an idea that i had but it seems that your macro creates everything all in one shot - creates the view auto and the dxf file. here the engineer creates the dxf file view as a 1:1 manually then we use a dxf macro to onyl save the file to the parent directory.
the idea i had that you can try and see if it works for you - is create the dxf flat pattern view manually - and then covert entities from the model sketch called etch to the view is your drawing. so then you essentially have created entities called sketch lines as you will see in pic2.
so essentially you want to create or modify the map file i gave you to include the etch layer with a colour and linetype. then tell the etch layer to include the sketch lines and hopes it will pick up the sketch entity you converted.
pic1 shows where the reference file is for mapping, but do not select the box indicated. hen you say ok to options and then hiot save as if you were to create the dxf. the box in pic 2 will then appear where you can do your setup.
sorry for the long winded explanation.
i have included the zip file which will have 2 pics and the dxf macro we use.
i tried the above but when i export the file, i get a double lines for the etch. the top lines are blue but it also has lines behind it that are the default color. this would confuse our laser program.
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
after you convert the etch sketch from the model - do you then hide the etch sketch from the model in the view on the drawing - so all you have left is the converted line you made.
give that a try
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 10:06 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多