iLogic Code to Save File

iLogic Code to Save File

Anonymous
Not applicable
1,686 Views
5 Replies
Message 1 of 6

iLogic Code to Save File

Anonymous
Not applicable

Hey all,

I'm trying to save a file as "PartNumber-SequenceNumber.ipt" with iLogic code. For example, 12345678-0001.ipt is how a file would look if the code were functioning properly.

So far, what I've got is this:

 

 

 

Dim PartNumber As String
Dim SequenceNumber As String

PartNumber = iProperties.Value("Project", "Part Number")
SequenceNumber = iProperties.Value("Custom", "Sequence Number")

ThisDoc.Document.SaveAs(PartNumber & "-" & SequenceNumber, False)

I think I'll need to specify file location too...not sure though.

Thanks in advance!

 

  -Luke

0 Likes
Accepted solutions (1)
1,687 Views
5 Replies
Replies (5)
Message 2 of 6

sigurdurie
Participant
Participant

Hi I got this from somewhere:

 

Dim oDocu As Document
oDocu = ThisApplication.ActiveDocument
' Save all "dirty" files
Call oDocu.Save2(True)

Hope it helps

Message 3 of 6

sigurdurie
Participant
Participant
Message 4 of 6

Anonymous
Not applicable

From what I got from that second link, I updated my code to this:

 

Dim PartNumber As String
Dim SequenceNumber As String

PartNumber = iProperties.Value("Project", "Part Number")
SequenceNumber = iProperties.Value("Custom", "Sequence Number")

NewFileName = PartNumber & "-" & SequenceNumber
ThisDoc.Document.SaveAs(Newfilename,False)

The major change here is that I create the NewFileName string before I try to name my file.

 

It didn't work. Thanks for the idea though.

0 Likes
Message 5 of 6

sigurdurie
Participant
Participant

But aren't you missing one thing:

 

NewFileName = PartNumber & "-" & SequenceNumber & ".ipt"

if you are saving to ipt that is 

0 Likes
Message 6 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution