- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hello,
I am new to Autodesk scripts, and could use some help. I've received a few hundred dxf files from a vendor that i need to convert to dwgs. If someone could assist with writing a script to open a dxf file and save as a dwg, that would be very helpful. I am running the scripts using proscript if that helps at all. Thank you in advance!
¡Resuelto! Ir a solución.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
@Zesty46 ,
Take a look at the Dxf2Dwg from the Autodesk App Store:
Please select the "Accept as Solution" button if my post solves your issue or answers your question.
Emilio Valentin
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Edit: I started this before the question got answered haha, figured id share anyway.
Scripts are easy generally. Dont get me wrong, there are lots of ways they go sideways but basically you just write each command on a new line in a text file.
next rename your .txt file to a .scr file. Be sure that you are changing the file extension and not just adding a .scr to the file name. if you cant see the file extensions, turn those on.
One way you can tell if you have created a script file is if the icon has changed.
What goes into your script file is basically just the command you would send to the command line. So if you wanted to start a line command you would put line in your script file. The other key aspect is that to simulate pressing the enter key is done by going to the next line.
Now specific to your task you will likely need to toggle off the save file dialog. That can be done by changing the FILEDIA system variable to 0. This will allow your save commands to be run from the command line.
Once that is set then use the save as command and then select the DWG version you would like. When it prompts for the file name just do an enter (go to the next line).
Once you are don remember to reset your filedia back to 1.
Here is the contect of a script fil that will save the current file to dwg:
FILEDIA
0
SAVEAS
LT2018
FILEDIA
1
One thing that is always a little tricky is the next line/ enter thing. Some time you may have too many enters which cause command to run again, or some times you forget to do a new line which doesn't finish the command like you though it would.
Hope all that helps!
CADnoob
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
No worries haha, i really appreciate the well written response. I didnt realize is was as easy as just writing out the command sequence. Is the sequence you wrote something i should be able to copy into a script file and use in ProScript?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Yes, you should be able to copy the script. This is with the caveat that in the process of copying sometimes carriage returns/line breaks aren't always preserved. It's best to test the script file on one drawing first to ensure it does what you think it should. Once you verify that it did what you needed and didn't stop unexpectedly in the wrong place, you can run it through script pro.
CADnoob
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Yeah, i had to add an extra return line and it worked fantastic. Thank you for not only solving my issue but teaching me how to avoid it in the future!
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Glad it worked!
Scripts are an excellent tool for handling batch operations.
If you start playing with it more, remember that some commands have dialogs much like the save as dialog, but some of those can be surpressed using a dash command "-" version of the command.
CADnoob