AutoCAD Inventor :: Change Filename Before First Save
Dec 17, 2013
I'd like to change the filename of a part before it's first save.The code would look somewhat like below.
Private Sub m_appEvents_OnNewDocument( _ByVal DocumentObject As Inventor._Document, _ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ByVal Context As Inventor.NameValueMap, _ByRef HandlingCode As Inventor.HandlingCodeEnum) _Handles m_appEvents.OnNewDocumentDim oDoc As Inventor.DocumentDim Name1 As String = "New Filename...."oDoc = DocumentObjectoDoc = oDocoDoc.PropertySets("Design Tracking Properties").Item("Part Number").Value = Name1oDoc.DisplayName = Name1oDoc.FullFileName = Name1.
The code partly works when opening a template but doesn;t work when create a an in place component or frame generated part? What do I need to modify to catch and change the filename before it's saved?
An application that will let me choose a group of Drawing files (.idw) and perform "Save Copy As" to a PDF format on them. The Filename of each Drawing should be extracted from a custom Parameter I embeded in the IDW file.
I know I can use the Task Manager with a virtual PDF Printer to create these files, but then the PDF Filename will equal the IDW Filename, and I want it to be derived from the custom parameter I prepared inside the drawings.
When using save copy as to make an identical part with a different number, the file name in the top and the browser doesn't update to the new filenumber. only in the bottom file tabs is the name correct. if I go to file> save as I can also see the new filename. This is a hassle when doing this to multiple files in an assembly, as it makes it hard to keep track of which parts have been given a new name. It seems the filename input in the browser is only written once, and that is when the first file was saved for the first time.
I have VB code that loops through and utilizes Excel data to pick which file(s) to open, update, and close. Then it opens the appropriate .idw file, updates it and saves it as a .pdf.
and that writes the file to my desktop as a .pdf.
However, as the loop runs over and over, it will find another data set that is the same A60 type, so it will want to save OVER that .pdf it's already created.
How do I go about having a variable filename? Something where it would add a _01 _02 _03 (or similar) to the end of the filename (i.e. A60_01.pdf, A60_02.pdf).
in Autocad 2012 whenever I want to make a PDF from a DWG I use the Autocad builtin DWG to PDF, but it wont suggest the filename anymore. When I use pdfcreator is will suggest the filename, but i dont have the correct paper sizes,
Whenever I want to save my DWG to PDF I use the builtin pc3 from Autodesk. Normally when I use it, the filename of the dwg is suggested as name for the pdf. But now this is empty and when you have to save 20-30 pdfs a day this is a pain to type over the names everytime. When I use PDFcreator however, it does suggest the name correct, but then I dont have the correct paper sizes.
and i would want the outcome to be: variable.dwg, rather than filename.dwg. I have tried numerous different ways of doing this with command prompt and cant seem to get anything to stick. Everything that works just creates a file named "filename.dwg", which is not what i want to do.
We have a few iMacs here all running 10.8.4 - we have PhotoShop CS 5.5 and all the artwork etc is saved on a shared server ( Windows 2008 r2) and we are forever getting these problems......
Only in photoshop we get the following error message......
"Could not save [filename] because the file is locked or you do not have the necessary access privilege. Use the 'Get info' command in the finder to unlock the file or change permissions on the file or enclosing folders"
For many years I have been edit photo montages in Premiere Pro. When I would find a photo that needs retouching so I would open Photoshop, retouch the pic, save it, and the new image would magically appear on the PPro timeline. But in my CS6 suite, I get the error message "Could not save "filename" because file is locked, you do not have necessary access permissions, or another program is using the file".
And this only happens when PPro is still open, regardless of where the CTI is on the timeline, or which pic on the timeline is selected. I never had this problem with any other versions of PPro and Photoshop. I don't want to shut down PPro everytime I need to retouch a pic.
Is it me or is 'save for web' totally broken in Illustrator CS6, when saving a file with a space in the filename? First it says the file already exists (whether or not this is the case) and when I click 'replace' it just doesn't do anything. Tried with different files, even after relaunching Illustrator.
I am used to copying filenames into the save as window ... it is more accurate and mroe efficient than typing them. When I upgraded to CS1 and CS3, I can not do this, either on Snow Leopard or on Win7. How do I regain the ability to do this?
I have recently purchased a new desktop under WIN 7 as well as Adobe Creative Suite CS6.My first internal hard disk is 2 TB, the second one installed is from my old PC, 250 GB.
I am getting this error when trying to save a file over an existing file using the “Save” command.The message is wrong, because the filename IS valid. This error is persistent.This error does not occur when doing the same action on my second internal hard disk.This error happens on files larger than about 1MB in weight.
What happens is that the original file over which I try to do the ”Save” command gets corrupted and lost.If I don't use the “Save as” command to save my work under a different name, my work is lost.The same problem occurs with both PS CS6 versions, 64 Bit and 32 Bit.
I am using Paintshop Pro X2. I've created a script that goes something like this.
1. Save original size as jpg in folder 1. 2. Resize 50% 3. Save as jpg in folder 2. 4. Resize 100x77 5. Save as jpg in folder 3. 6. Close file.
Everything works great except for one thing. During the save as operations the script remembers the original file names from when I record the script. Is it possible to replace that old static file name in the script with the file name of the current image?
I'm trying to add some efficiencies to larger projects buy reducing the number of steps required to export to pdf. I'm looking to add a custom file name to the string.
DESIRED
From: 20131006_KK_Brochure_v1.pdf
To: 20131006_KK_Brochure_v1_OUTLINES_PRINT.pdf
However, I'm experiencing problems with the following code that I have modified. The below code is adding "_OUTLINES_PRINT" as a prefix, rather than a suffix.
function getTargetFile(docName, ext, destFolder) { var newName = "_OUTLINES_PRINT"; if (docName.indexOf('.') < 0) { newName = docName + ext;
I am trying to write code to collect standard info from a csv file to be added to iProperties.
Following is the code I have so far.
Dim Separators() As Char = {""c} Words = ThisDoc.Path.Split(Separators) FilName = "C:VaultDesigns" & Words(3) & "Spec_Sheet.csv"
Dim ReadCSV As New System.IO.StreamReader(FilName) Dim WordSets As New ArrayList()
Do While ReadCSV.Peek <> -1 WordSets.Add(ReadCSV.ReadLine.Split(",")) Loop
i = 0 SName = iProperties.Value("Project", "Stock Number")
For Each wrd In WordSets If WordSets.item(i)(0) = SName Then iProperties.Value("Project", "Description") = WordSets.item(i)(1) iProperties.Value("Custom", "Finish") = WordSets.item(i)(2) End If i += 1 Next
The only problem I have is that this line crashes. I am not competent enough to understand why.
Dim ReadCSV As New System.IO.StreamReader(FilName)
Is there a way to use the filename to drive the parameters of the file?
Example: I have a cube that is called 4x4x4.ipt its dimensions d0,d1,d2 are 4,4,4 respectively. I want to rename it to 4x4x6.ipt and have the dimensions d0,d1,d2 resize to 4,4,6.
I would like to change the default filename for the HTML pages produced by Lightroom 3 in the web gallery. Specifically, I would like to remove the string "_large" from the HTML filename, so it corresponds exactly to the image filename.
Specifically, the URL by default is like this: [URL] ....
and I would like it to be like this: [URL] ....
I assume there is some way to make this change using the template editors, but I can't figure it out.
I am using this code snippet to open an idw. With this code, the idw has to reside at the same file path as the current document.
>>>>>>>>>>>>>>>>
Sub OpenIDW() On Error GoTo Oops Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument Dim sFullFileName As String sFullFileName = oDoc.FullFileName Dim sDrawingName As String sDrawingName = Left(sFullFileName, Len(sFullFileName) - 4) & ".idw" Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.Documents.Open(sDrawingName) Exit Sub Oops: MsgBox "IDW File could not be found. FileName of IDW must be the same as this file.", vbInformation End Sub >>>>>>>>>>>>>>>>>
"What if"... my idw is not at the same location, but under a subfolder instead..... like this
Part file c:designsDrawingsJobxxx
Idw file c:designsDrawingsJobxxxIDW
I am sure that this can be done by editing the line "sDrawingName = Left(sFullFileName, Len(sFullFileName) - 4) & ".idw" " . Everything I have tried did not work.
I'm attempting to create a rule using iLogic, which reads the first two letters of either the File Name or Part number (Which ever is easier)i.e. if a part number was AB12345, I would want the code to recognize the "AB"...At which point I'm trying to use an If-Then-Else statement to modifiy the material of the part, dependent on the first two characters of the File name.
As an example, where the underlined portion is what i don't know how to If iProperties.Value("Project", "Part Number") Begins with "AB" Then iProperties.Material = "Steel" Else If iProperties.Value("Project", "Part Number") Begins with "AC" Then iProperties.Material = "Aluminum" End If
I am trying to use the iProperties.Value("part1", "Summary", "iProperty") function to get the filename or complete filepath of a component within a subassembly. I know that these iProperties exist because I can insert them onto a drawing, and I see them in the general tab of the iProperty window.
I get an error message indicating that the General tab can't be found. How might I go about getting this filename iProperty, or is there an easier way?
I have an assembly which serves as a configurator. This Assy, needs to be copied many times. The assy contains 2 parts, which also must be copied. but when copied, the parts must have a new filename, and then the Rule cannot find them anymore. Therefore my plan is to define the filename with the configurator rule..
Example.:
Assy = Module.iam
Part1 = Module-1.ipt
Part2 = Module-2.ipt
I have this so far, but is doesn't work.. what do i put before the .ipt??
I need some VBA code that will allow me to get the Filename from the border of a drawing. I've got code to get to the text of the filename, but I need to get the filename itself. Hope that males sense. Here's the
Public Sub GetModelFilename() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument
[Code]...
What the code returns is the text <FILENAME>. What I need is the filename itself.
Create a Content Center Part that prompts for a file name and sets the Part Number to whatever I save the part as? It would also be nice to... Have the browser Display name the same as the saved filename.
If I have a standard part with a blank filename, inventor will make the part number equal the filename at the first save. It is this functionality that I require when using Custom Content parts.
E.G. If I have a length of 'RHS 200x100x6.3 - 2000mm' selected from content centre and I want the filename to be saved as 'Part-001', then I would like the Part Number to be set as 'Part-001'.
If I then place the same member in another project/assembly I may want to call it 'ProjectPart-100', where the part number would then be 'ProjectPart-100' and so on.
This method ignores the filename entry in the Ipart table.
"The filename, directory name or volume label syntax is incorrect. The database in K;lah/blahlah.widget.ipt* could not be saved".It's nothing to do with an improper name; even saving as the default 'Part 3' doesn't work.
At the moment I'm limping by using Save Copy As. Neither Save not Save As work at all.
When I publish from Inventor to DWF (including sheets in the idw and an view of the iam assembly file) numerous part properties are included in the dwf that I would like to strip out so we don't share too much info with.
For example, filenames are included, stock numbers the complete bom from the model (as opposed to the parts lists that are shown in the idw's... This info shows in the structured bill, and if you click on a part in the iam.
How do I filter all this out so I only show part numbers and descriptions in iproperties?
here's a macro I wrote to copy the filename to the Part Number iProperty for all parts and sub-assemblies contained in a top-level assembly. I wrote this after using a bunch of custom iParts and all the Part Numbers were the same for each part! (my fault of course, but a pain to fix one at a time).
Public Sub SetAllComponentPartNumbersToFileName() Dim oAsmDoc As AssemblyDocument Set oAsmDoc = GetActiveAssembly If oAsmDoc Is Nothing Then Exit Sub SetAssemblyComponentPartNumbersToFileName oAsmDoc End Sub
When you do a Save As or Save Copy As in Inventor the part number in the iProperties is automatically updated to match the new filename. I would expect the Document.SaveAs method in the API to act in a similar way. However I found out that this is not the case.
SaveAs: Document.SaveAs(filename, False) does not update the part number. The new part will still have the same part number as the original part. This can give problems since in the BOM parts with the same part number are interpreted as the same physical part.
SaveCopyAs: Document.SaveAs(filename, True) does work as expected and the part number will update correctly.
Is this a bug in the API? or is there a reasonable explanation for this?
I have AutoCAD 2010 on a 2002 Windows XP Professional system. I do not know what I did to cause it but when I do a "save as" using the button, I no longer get a window. I can only save through the command bar. I cannot seem to change the save to folder using the command bar so I really need to get the window back.