- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
----edit----
Received some assistance elsewhere and the below snippet works for me now. Figured that I'd add it to the thread in case anyone has the same issue in the future.
'Store the current file's filename
fileName = ThisDoc.FileName(False) 'without extension
drawingNumber = fileName
'Set the custom iProperty to the modified string
iProperties.Value("Custom", "Drawing No") = drawingNumber
Okay, I've been battling this for a while now and I cannot get things to work.
History: Our Part Numbers and Drawing Numbers are not exactly the same. (I.e. part no: 648-1254 & drawing no: 5ASM-648-1254 (much to my chagrin, this cannot be changed)) Because of this, I originally created a prompted entry in the title block where you can enter the drawing number every time you create a new drawing. This worked, however, I would like something that is a little more automated. This led me to the below post which is covering what I would like to do; basically use the filename minus the extension.
I created an iLogic rule and used the code called out in the post and changed the custom field to "Drawing No"
iProperties.Value("Custom", "Drawing No") = iFileName
iFileName = ThisDoc.FileName(False) 'without extension
This gives me the new field in the custom tab, as I would expect
I then edit my title block to utilize this field for the "Drawing No." section.
I save the template, close it and then create a new drawing in order to test it.
The problem is when I save a drawing, nothing happens. The "Drawing No" field does not populate with the document filename (minus extension), which means that the title block section doesn't populate either.
Is there a step that I am missing? I'm pretty new to iLogic, so I wouldn't be surprised. Does anyone have any ideas?
Solved! Go to Solution.