• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

get fast dxf from sheet metal parts

  • Thread starter Thread starter flaminio
  • Start date Start date
You're right @jenuary ; mea culpa.
I am very impressed by the work you are doing for others; I admire it and I recognize that obviously it is not due.
I had written to you on the previous page on August 26, after trying to change the macro definitions with little results; but honestly I understand nothing and nothing.
in my most total ignorance, I thought the definition of the macro was simplified rather than rebuilt.
However, this attached is the reference macro I had downloaded at the time.
You don't know what a hand you'd give me if I had to help.
in any case I thank you in advance for your availability.
 

Attachments

I understand. @jenuary, sin because it would have been very useful since we still codify the names of the bodies.
you could change the macro so that the export directory is only in c:\dxf, leaving only the <nome file=""> as export reference?</nome>
Let's see if I understand correctly:
prerequisites:
- open together, some or all components are sheet metal parts
- launches the macro

result:
- each sheet metal component is saved in the path c:\dxf
- each body is exported for each configuration of the part

I did not understand however the name of the resulting dxf file as you should call, if it is called only with the <nome file="">, only one will be saved.
otherwise if we put them <nome corpo="">_<nome file=""> then all bodies will be exported
it must be eliminated the material of belonging if I have not understood badly.

Can you post a resulting code example and maybe a side file with the sheets to test on? I am still in 2019, if you send me 2020 I can't open them.</nome></nome></nome>
 
Let's see if I understand correctly:
prerequisites:
- open together, some or all components are sheet metal parts
- launches the macro

result:
- each sheet metal component is saved in the path c:\dxf
- each body is exported for each configuration of the part

I did not understand however the name of the resulting dxf file as you should call, if it is called only with the <nome file="">, only one will be saved.
otherwise if we put them <nome corpo="">_<nome file=""> then all bodies will be exported
it must be eliminated the material of belonging if I have not understood badly.

Can you post a resulting code example and maybe a side file with the sheets to test on? I am still in 2019, if you send me 2020 I can't open them.</nome></nome></nome>
I attached you a typical multibody case.
in this case we have:
file name: sp30tel1605
body name: sp30tel1605_01 (just resume part code + a simple progressive)
so in theory if you name the body only in progressive (_01) could be <nome file=""><nome corpo=""> only if recognized the multibody.
What do you think?
while the material belonging to me is the case of leaving it.
Thanks again </nome></nome>@jenuary
 

Attachments

I tried to do a test, but I noticed that in the feature manager, you did not renamed the bodies but the folders.
the name of the first body to export would be for example cut-extrusion24.
You should rename them correctly if I'm not mistaken.
 

Attachments

  • Immagine.webp
    Immagine.webp
    30.5 KB · Views: 15
I tried to do a test, but I noticed that in the feature manager, you did not renamed the bodies but the folders.
the name of the first body to export would be for example cut-extrusion24.
You should rename them correctly if I'm not mistaken.

ciao @jenuary, forgive the wait.
I have renamed the bodies; But I saw that in the separate cut, the program reads the body folder code.
 

Attachments

good evening.someone can help me in a dxf export?
we bought a bending machine and we have the nerve to export the dxf of the bending line on another level or even on the same as they have another attribute. and that the bending notes were set as text.
Thank you very soon who will help me.
 
Good morning. I have a question.
These macros all go well, but if I want to know how many times a piece is repeated in the axieme, is it possible?

so I immediately know how many times the piece must be cut.
I found this solution nowhere.

Thank you in advance.
 
with distinct materials in the environment together http://help.solidworks.com/2018/ita..._help.htm?id=a7609a18392f49cca9de367e64524ebf

in this debate, what did you leave, managed to solve? Did you contact assistance? Did you ask for the improvement you need?
the solution you have given me the use already, but it is quite uncomfortable because you have to look for the name of the piece on the sheet that you print from the excel and if they are many details you can become mad.

Second, I know very well that there are research behind the questions. If I don't have much time to explain why I'm full of work, it's not my fault. and then since you told me that you don't put your hand in the dll I didn't want to go into the question I solved with other solutions.
write that I am not a serious person, that I write a few messages and that it doesn't matter I would be a little more careful to write these things.
Say hi.
 
the solution you have given me the use already, but it is quite uncomfortable because you have to look for the name of the piece on the sheet that you print from the excel and if they are many details you can become mad.
Why do you have to move from the excel if you already have a distinct environment together? use that.
at most save the excel, do not print it, and with the filter command you find your particular.
if you then garb in the forum there is a macro that fills in the part a property with the amounts of the assieme

If I don't have much time to explain why I'm full of work, it's not my fault.
Not even mine. So all those who answer you are the children of the servant who do not deserve an answer?
and then since you told me that you don't put your hand in the dll I didn't want to go into the question I solved with other solutions.
a forum is a place of sharing, if you have found alternative solutions you could share them. or is it too much to ask?
write that I am not a serious person, that I write a few messages and that it doesn't matter I would be a little more careful to write these things.
apart from that if I commit an abuse you are free to report it and administrators, if they think it is necessary, will take measures, you cannot interpret the phrases as you like.
I have written that the applicant, you in this case, must give all information without having to run behind him; If I ask you what function you used would be correct to answer and you did not.
I also did not write that you are a very serious person, but that you write phrases that do not explain the problem and that,
da l'impressione, a I'm sure, of little desire to engage and wait for the nice and ready service.
So it's my impression. Aren't you? Good, prove it!
because your few messages were allusive to the fact that you used a pretentious tone with the phrase
Those two solidworks values will pick them up somewhere, won't they?
as if who answers, I in these cases, was a programmer of the dassault who knows the program and the code with which it is made.

as I wrote in that discussion in the answers there are research, attempts, checks and especially time. Of course I understand very well that it is more convenient to ask for free in the forum for fans who pay assistance to those who do it for business and is more prepared.
 
I don't like to spend for that asshole and villain no matter what, so while I wait for you to find ten minutes free to answer this discussion, I'll give you a summary of the previous debate that I brought up:you asked a question of two lines that had nothing to do with the ongoing discussion without even a greeting and with vague references
then to my answer, speculating the problem, that it didn't seem possible Home that a solution there should be (paraphrase your message but it seems to me that the concept is the same or at least that I understood then) with a rather dry tone among other things.I have returned doing a hypothesis and not giving the solution because I did not know it, in addition to noticing an inconsistency in your request and to invite you to apply for assistance that surely have better tools than mine to clarify this type of doubt.
I asked you what functions you use to convert a solid in sheet metal and this certainly not to make me your own, but to have some extra data with which to search for information in addition to reiterate that I had no idea if there was a .dll library file that contained that data.
you continued telling me how the conversion of a solid in sheet metal works and if you knew where these dll files were.
I again asked to have information about this solid transformation.
Afterwards you disappeared as snow in the sun because you managed to have time to write until that moment, but then from April 1 to today, in which you again needed help, writing among other things in a discussion that has nothing to do with your request, you have been so obligated to work not to find ten minutes to say that you had resolved in another way and share as.
 
Hi.
try this macro, perform this:

macro for exporting the development of sheet metal parts in dxf
the macro should be launched in a file of assembly, if it finds a part in sheet metal then:
- It opens.
- creates a subfolder with the name of the material of the part if it does not yet exist
- create a sub folder with the thickness value inside the sub folder of the material
- for each configuration of the part, inside the sub folder of the thickness, saves the dxf of the configuration
- closes the part and continues the cycle
- at the end of the process message appears

I hope you can do it
beautiful works great, can you activate the bending lines?
 
con la speranza di fare cosa gradita, qui sotto riporto la "sub main" modificata da sovrascrivere nella macro,
in verde trovi i commenti e le spiegazioni per le righe aggiunte, se non è chiaro fammi sapere:

sub main()
dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
dim swassy as sldworks.assemblydoc
dim swconf as sldworks.configuration
dim swrootcomp as sldworks.component2
dim nstart as single
dim bret as boolean
set swapp = application.sldworks
set swmodel = swapp.activedoc
set swconf = swmodel.getactiveconfiguration
set swrootcomp = swconf.getrootcomponent3(true)
debug.print "file = " & swmodel.getpathname
''' '''' '' '' ''' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' ' ' ' ' '' '' '' ' '' '' ' '' ' ' ' ' ' '
''' '''' '' '' ''' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' ' ' ' ' '' '' '' ' '' '' ' '' ' ' ' ' ' '
Setting area for export dxf-dwg
'
'in this part of code imposed the settings because solidworks do not show me
'to every rescue dwg\dxf the mapping set mask

dim bshowmap as boolean
'imposed using the mapping file
bshowmap = swapp.getuserpreferencetoggle(swuserpreferencetoggle_e.swdxfdontshowmap)
if bshowmap = false then bshowmap = true else bshowmap = true
swapp.setuserpreferencetoggle swuserpreferencetoggle_e.swdxfdontshowmap, false 'This part is optional, before changing the mapping file if already set,
'Save in a variable the string of the mapping file so that it can reset after the end of the macro

dim old_mapping_file as string
old_mapping_file = swapp.getuserpreferencestringlistvalue(swdxfmappingfiles) ' mi ritorna ad esempio "c:\...\mio_file.dat" '
'now step to the pointing string of the mapping file
'from before the white, i.e. the gate

swapp.setuserpreferencestringlistvalue swuserpreferencestringlistvalue_e.swdxfmappingfiles, "" whitening mapping strings
'now imposed the mapping file to which solidworks must refer for subsequent rescues
swapp.setuserpreferencestringlistvalue swuserpreferencestringvalue_e.swdxfmappingfiles, "c:\...\mia_mappatura.dat" 'imposed the mapping file
'Having with the compiled string the curtain that we find under the options during saving dxf\dwg I have to pass the dropdown line index
swapp.setuserpreferenceintegervalue swuserpreferenceintegervalue_e.swdxfmappingfileindex, 0 'I'm the first on the list then 0
'This command is optional, I go to set the rescue version

swapp.setuserpreferenceintegervalue swuserpreferenceintegervalue_e.swdxfversion, 3 ' imposed the export release "es.r2000-2002"
'
'fine setting area for export dxf-dwg



traversecomponent swrootcomp, 1

Having finished the cycle, inserting these two rows is restored the initial mapping file
swapp.setuserpreferencestringlistvalue swuserpreferencestringlistvalue_e.swdxfmappingfiles, ""
swapp.setuserpreferencestringlistvalue swuserpreferencestringlistvalue_e.swdxfmappingfiles, old_mapping_file 'imposed the mapping file

''' '''' '' '' ''' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' ' ' ' ' '' '' '' ' '' '' ' '' ' ' ' ' ' '
''' '''' '' '' ''' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' ' ' ' ' '' '' '' ' '' '' ' '' ' ' ' ' ' '
msgbox ("export completed!")

end
Good morning to all,
I know that I'm commenting on a dated post, I downloaded the macros I attach and despite trying to set the export mapping in dxf, the fold lines I just can't see them. I also tried to set the line:
swchildmodel.exportflatpatternview exfilename & ".dxf", 1
con
swchildmodel.exportflatpatternview exfilename & ".dxf", but nothing.
I also read this solution:
"to change the fold lines in the files exported with the macro, then, you have to write in the mapping file the line:
halfway lines [14] = 2, bylayer, 0"
but I do not understand where to insert it because in the configuration of the mapping I do not find the possibility to set it with this data ( surely wrong something ).
If anyone could help me, I'd be grateful.
I currently have a 2023 sp05 version.
thanks and good holidays to all.
ps if you miss some info I will gladly communicate
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top