|
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 |
|