Choose file location

Choose file location

Anonymous
Not applicable
667 Views
3 Replies
Message 1 of 4

Choose file location

Anonymous
Not applicable

I have a macro/Ilogic combination that creates a drawing of a sheet metal part and it saves the new drawing in the same location as the part its being run on.  I want to make a box pop up that lets you select the location of the new drawing, but can't seem to figure it out.

 

To use the code run the macro on a sheet metal part with either the Vendor or Category marked as Laser.  The macro then runs the CreateDrawingSingle rule after adding a couple Iproperties.  RuleForDrawingSingle is then set up to run on open on the template.  

0 Likes
668 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Here's the template.  If you want to test it yourself make sure you change the file location in CreateDrawingSingle.

0 Likes
Message 3 of 4

JelteDeJong
Mentor
Mentor

hi,

have a look at this page:

https://adndevblog.typepad.com/manufacturing/2012/08/using-inventor-file-dialog-to-opensave.html

I changed the example on that page for use in iLogic

Dim oDLG As FileDialog = Nothing
ThisApplication.CreateFileDialog(oDLG)
oDLG.FileName = "C:\Temp\Temp.ipt"
oDLG.Filter = "Inventor Part Files (*.ipt)|*.ipt"
oDLG.ShowSave() ' to save files
MsgBox(oDLG.FileName)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 4 of 4

Anonymous
Not applicable

That's not really helpful, because that lets you select a file not a folder.  I got it to save the file in the right location using.

Imports System.Windows.Forms
' Toma la ruta del archivo activo Dim RutaExport As String = ThisDoc.Path ' Define el cuadro de dialogo de busqueda de carpeta Dim Dialog = New FolderBrowserDialog() ' Establece opciones del cuadro de dialogo Dialog.SelectedPath = RutaExport Dialog.ShowNewFolderButton = True Dialog.Description = "Elige la carpeta de exportación" ' muestra el cuadro de dialogo If DialogResult.OK = Dialog.ShowDialog() Then ' captura la ruta de exportacion seleccionada RutaExport = Dialog.SelectedPath & "\"

 and changing 

'In parts & asemblies - Write new drawing name to temp text file
oWrite = System.IO.File.CreateText("C:\TempPath\" & ThisDoc.FileName & ".txt")
oWrite.WriteLine(RutaExport & ThisDoc.FileName & ".dwg")
oWrite.Close()

 but now it doesn't replace the drawing views at all and I can't figure out why.

0 Likes