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

macro creation .dxf and .ppi

  • Thread starter Thread starter tripsy
  • Start date Start date

tripsy

Guest
hello to all to me would need a macro for solidwork that automatically create a text file but with .ppi extension with inside some strings that I need then to use with jetcam and a .dxf file. directly from the part file.

strings are as follows.

#units=mm
#material=inox satin
#thickness=0.8
#rot_allowed=0
#mirr_allowed=1
#jeo_notes_
#geo_notes_1=
#geo_notes_2=
#geo_notes_3=
#geo_notes_4=
#geo_notes_5=

where the only values change are material and thickness.

the generated files will have the same name as both the ppi and the dxf.

I can insert the data by hand through an input box maybe with a drop-down menu where it gives me the values.poi if you can tell me what values are changing

Thank you very much to all.

Matteo
 
Hi.
what you need to do is quite simple.
-for .ppi extension no problem
-for strings no problem, even by uploading them into the manageable comoboxes also from external files (so you can also edit them easily without changing the macro code).
even it would be interesting to know if the value to associate with your strings is the value of a variable of your part file (eg the material), so with a click you create and fill the text file nenza you can miss or choose the value from the macro interface.

I don't know what you need the dxf, is it an empty file or saving the part file table?

Let me know.
 
thanks for the answer

then values are the material and thickness of the part files. only that they have to be written in a certain precise way except the car that will punch me does not recognize them.
if you can make me a drop-down menu is perfect x because then I put them in and select them without problems.

the .dxf file and the autocad geometry file, there is on save by name but every time I have to select the part to flatten it save by name, dxf extension and then save, I needed something more intuitive and fast, like a command to save it directly.

I don't know if you understand me..cmq ask without problems.

Hello and thank you
 
Hi.
for the thickness of the part file you mean the thickness of a sheet, executed with the sheet command?
 
Hi, I got you something.
the macro in opening populates the comboboxes taking from the individual external text files.
if the open side file has set the material, it is extracted and written in the label(I put it if you need to recover it in the modification of the macro to your liking), otherwise the user receives a message to video (if it bothers to remove it).
to the command applies the macro save in the director of the part file a .ppi text file
that is overwritten in case it already exists, the same goes for the dxf.
for dxf exposition use the settings set at that time in solidworks (version r, mapping file, scale etc.).
Let me know if that's enough. :finger:
 

Attachments

hello thank you so much for your answer and interest the problem that when I try to run the macro gives me this error.

2rrq4xf.jpg
 
Hello, let's try again.
I wrote it with 2009, but I don't think it's a problem, the references should update themselves.
Let me know.
 

Attachments

Nothing, still the same mistake. .

I can't understand why.

click on tools ---> macro ---> run and then select your file.

That's the right procedure, right? ?

hello and thanks again
 
Sorry I'm late,
I can't understand the reason for this problem, but I'd like to propose that you do a test:
instead of running the macro, press the macro change button, and you should open the vba and see the code.
if this goes well, click on the module and launch the macro from the "sub main" pressing the vba play button.
Let me know, at the limit in a 15-day period, I'm going to install 2011 and if you do, we'll align.
 
cmq now leaves but does not work, opens me visual basic and a window appears with written
" compilation error: impossible to find the project or library"and highlights this string ----> private sub create_file_ppi()
 

Forum statistics

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

Members online

No members online now.
Back
Top