Using SLDW Macros

Lucas

I did the usual manipulations (without going through the macro)

File/Save As/DWG Format.

when I open the DWG "with AUTOCAD2013, the same message actually appears.

As I said in a previous post about the case:

 

"With a macro you can choose to define a common folder, a folder by file type, a folder (based on a custom customer property, deal number) or offer a file explorer to choose each time where to save the different files."

 

Do you have a personal property or something in the codification that tells you this:

 

top-level file: CAR or  MOTORCYCLE or TRACTOR or BICYCLE

second level file:  Cabriolet or Coupe or MPV or 4x4

 

The part:

swDraw.SaveAs (Filepath + FileName + ".PDF")
swDraw.SaveAs (Filepath + FileName + ". DWG")

 

Should look like this:

 

Select case type 'select case avoids many nested FIs

box = "CAR" 'if type = car

 Folder = "C:\CAR" 'we save in the car folder

case = "MOTO" 'ditto...

  Folder = "C:\MOTO"

box = "TRACTOR"

  Folder = "C:\TRACTOR"

case = "BIKE"

  Folder = "C:\VELO"

else' case 'if other type or no type, error

 msgbox "Type Error1"

 exit

end select

 

Select case type2 

case = "CUT" 'if type1 = cut

 Folder = Folder & "\CUT" 'we add cut to the folder

case = "CAB"

 Folder = Folder & "\CAB"

case = "4x4"

 Folder = Folder & "\4x4"

case = "MONOSPACE"

 Folder = Folder & "\MONOSPACE"

case else

 msgbox "Type2 Error"

 exit

end select

 

For information:

type1 and type2 must be variables that already exist in your files or to be asked of the user when launching the macro.

swDraw.SaveAs(Folder & "\PDF\" & FileName & ".PDF")
swDraw.SaveAs(Folder & "\DWG\" & FileName & ". DWG")

1 Like

To use the FSO, you need to add the Microsoft Scripting Runtime reference to your macro

See screenshot


capture.jpg
4 Likes

For the message problem when opening with AutoCAD, there is no box to uncheck so that the message no longer appears?

 

Otherwise see this link /

 

http://autodesk.blogs.com/between_the_lines/2005/06/how_to_tell_if_.html

Did you get out of it?

1 Like

Hello, I want to thank you for your help.

 

For the moment, the macro suits our BE. We'll just do the DWG and PDF files, by hand.

We already save a lot of time.

 

The company may invest in EPDM...

We will work on the file storage at that time.

 

Kind regards.

 

 

2 Likes

Please designate the best answer in this case!