AutoCAD Inventor :: Batch Save Copy As PDF With A Custom Parameter Filename
May 14, 2012
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.
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'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 publish to the CC a guide rail. The vendor of the rail gives me the option of entering the desired length of the rail. After that he gives me the option to choose between the length that I entered and a shorter and longer standard length witch can be delivered faster.
I want to do the same thing with my published part, but I cannot make a key parameter to change depending on the entered custom parameter. I want the user to make the next steps when inserting from the CC: 1- select the size of the rail; 2-select the type of the rail; 3- enter the desired length of the rail; 4- choose between the desired length and the 2 recommended lengths (I need these 3 lengths to be shown)
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
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?
I've got a custom VBA function that works perfectly when called from a parameter in my part.
However, when in the context of my assembly, there is no error, but the function no longer runs, and the parameter text is red.
Apparently, the function is no longer in context?
I've heard of external rules, but have never implemented one.
Is there a way to declare my function and keep it in context regardless?
Public Function BumpHeight(dblHeight As Double, dblMember As Double) As Double Dim X As Integer X = 2 If dblHeight > dblMember * 2 Then BumpHeight = dblHeight Else BumpHeight = dblMember * X End If BumpHeight = BumpHeight / 2.54 End Function Here is the Parameter:
VBA:BumpHeight(ValanceBackBumpoutHeight;ValanceMemberSize) * 1 in
Update: (problem better defined)
What seems to be happening is that once I insert the part into an assembly, it creates a new blank copy of the parts' modules in VBA and the functions no longer work.
If I go to the VBA editor,
There are now two copies of my part listed in the browser tree, but the new one is blank.
If I paste in my function to the new one, it will work until I return to the parent assembly.
Next time I come back to the part, it will have a new blank set of modules.
This appears to continue indefinitely...
see the attached screenshot.
At this point there are only 2 copies of the DocumentProject. The original still contains my functions, but the new one is blank.
I need these functions to work in order to build my model.
-- I can write without problems Action for each special folder, but it take too many time to make 1000 Actions like 1000 folders I have. The problem is in SAVE AS command wich I use in Action. It remembers folder witch was used while recording. Then if I try "Override SAVE AS" option in the Batch window I get edited original files without creatig copies.
I can choose destination NONE, SAVE AND CLOSE, FOLDER. Simply, what I need is SAVE AS COPY AND CLOSE.
Just installed 2013 Pro x64 and I'm doing a little testing. Using Tube and Pipe, I created a few mock pipe runs which are named according to a unique line number. When clicking on the Iproperties of any of these pipe runs, I can see that the value of model parameter "Part Number" now includes the name of the top level assembly and the line number, which is the name I assigned to the pipe run when I created it (see Fig 1 attached). Then in IDW I created a user defined symbol which contains text that I have directed to extract value of "part number" from the model properties, and fill in my symbol with that value (see Fig 2). The problem is, when I tag the pipe run with my custom symbol, the value in the symbol remains blank, instead of giving me the value of "part number". WHAT am I missing??
I would like to use a multi-list parameter in a form, that isn't a problem. However I want the selection to be copied to a custom parameter when the form closes. Is there anyway to fire a rule when the form closes or to add a multi-select list to a parameter, in a form?
when i create an ipart with an custom parameter column, the files are created in the workspace. Is there any way how i can change this location?
Many parts are piling up in the workspace.For example to the library (like "normal iparts" do) or to a folder in the workspace (workspace/ custom_ ipart_ folder)?
In a simple case I have an extrusion with some attached seals/weather stripping, all implemented as iParts having their own LENGTH parameters.
RailPart.ipt, Seal_A.ipt, Seal_B.ipt
The goal is to encapsulate these IParts within an iAssembly: RailAssy.iam, where a LENGTH parameter can be input when the iAssembly is placed, causing RailPart and Seal_A to have their length parameters set to the LENGTH provided at that time and SEAL_B having Length set by an iLogic rule to LENGTH - 5.
I've been unable to set up a Custom Parameter Column in an iAssembly table. Is this even permitted?
I try to copy a color with a custom texture to a part. In my data source I use a scale for the image between 0,1 and 1. (10-100%). On my form I have a slider to change the scale between this range.
But in the styles editor it is possible to go to 1000%. Is that also possible in the API?
When I implemented Inventor Pro 2013 I added all our custom materials to the Inventor Material Library. This library is not local but on a shared network drive that everyone in my company can access.You can clearly see that it is not locked and is write enabled. I dragged the local material to the library and I shows up in the library. When I close and exit Inventor and re-open, it is no longer available.
You can clearly see by my screen capture that the new material was added to the library. Why isn't is updating the library?
I have managed our Inventor styles and libraries for Inventor since 2003 (R5) and I never had as much problems getting my mind to wrap around this new appearances change that Autodesk has made. I have wasted 4 hours this morning trying to add a simple custom material to my library and I cannot.
I have gotten in the habit of using a leader text with a custom iproperty to do material call outs on my drawings. I have been doing the first one then copy/pasting the leader onto each piece i want to call out.
This worked flawlessly in 2010 and has worked well previously in 2012. For some reason it is not working at all in this particular .idw.
work flow is to create the first instance, copy. right click outside the view border and select paste. Then attach to as many different parts as needed.
attached is the error message I get.
The custom iproperty is text. 1/2 a36 or 4x4x3/8 Angle
My ultimate goal is to have a virtual human model that I can re-size parametrically to reflect real-world measurements. I've used MAX to make architectural models and scenes so I know how to manipulate basic shapes in MAX.
how to make some sort of basic-custom geometric shape and control that shape parametrically, like the built-in "Box", "Sphere" and "Cylinder" objects.
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,
I got a problem to pass parameter from VB to batch file. My code is below to run the batch file and to pass parameter.
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click Dim input As String Dim output AsString input = "C:atchFile est.gds" output ="C:atchFile est.dxf" Dim batchFile As String = "C:atchFileLC_gds2dxf.bat" Process.Start(batchFile, input & ""& output) EndSub
With this code the output is like below:
If you look at the screen shot you can find out that input and output variable is passing to one variable LC_gdsin. But I want that output file location will be assigned to LC_dxfout. I tried a lot but could not able to do that.
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.
I've looked around for this but haven't found much. I have a server with thousands of print proof sheets, and since the beginning, long before me, the files were saved with verbal descriptive names. It would be a lot better if they were saved according to the PO number. All the proof sheets have a po number listed in pretty much the same place on the sheet... is there a way to copy that PO number from the field within the pdf, and save the file to a new folder using that number as the filename using a script?
I have a master batch process which comprises several steps each of which will change the database. I am gettting the database once, then pass it thought the subsequent steps. Simple example in pseudo
void BatchAll(){ database db = new database BindXref(db) PurgeAll(db) DoSomethingElse(db) save dwg }finish BatchAll
Should the database db be passed by reference (ref db)?
I have user parameters that are no longer needed and are not being used anywhere. They each takes 4-5 seconds to delete, prior to 2012 this would happen instantly.