We've got a base product that needs to be changed a little bit for each client. To make the process quicker, I'm planning to use Vault's "copy design" to copy over the base files into a new folder. Then I'll make the edits on the newly copied files.
The whole thing consist of about thirty drawings and I'd need to open up each one update them, save them and then export them as PDF.
I've already found some code that can automatically save drawings as a pdf but I was wondering if there's anything out there that can batch open all my drawings and update them without me having to intervene?
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
See if this link helps you.
If this solved your issue please mark this posting "Accept as Solution".
Or if you like something that was said and it was helpful, Kudos are appreciated. Thanks!!!!
Hi amarciniakTF6LQ,
What version of Inventor are you using? I have a batch routine I can share if you're using Inventor 2015 or later.
See attached for a *.ipt file and a *.idw file. Click the Instructions button on the form as shown, The form will show when you open the file or save the file.
Or expand this "Spoiler" box:
iLogic Rule Batch Process Tool
This tool is offered: AS IS !!! Use at YOUR OWN RISK !!! Make sure all open files are SAVED before running the batch !!!
_____________________________________________________________________________________________
_____________________________________________________________________________________________
This ilogic Batch Process tool simply opens each file in the list and then runs the selected rule on that file.
It then saves and closes the file.
Once the batch process starts, there is no way to stop it so start with small batches to make sure things work.
General Guidelines and Hints
1) Rules to be run must contain three asterisks in their name. Example: 'MyRule ***'
2) Create your rules using ThisApplication.ActiveEditDocument rather than ThisApplication.ActiveDocument
so that the batch processor is looking at the newly opened file, rather than the file the ilogic rule resides in.
3) Once your rules are created, you can attempt to run them using the batch processor by clicking the 'Refresh Rule List' button.
4) You might need to trouble shoot the iLogic code in your rules in order to get them to run.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
@Curtis_Waguespack to the rescue... Or should I say @Curtis_Waguespack has an app for that...
Mark Lancaster
& Autodesk Services MarketPlace Provider
Autodesk Inventor Certified Professional & not an Autodesk Employee
Likes is much appreciated if the information I have shared is helpful to you and/or others
Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
@Curtis_Waguespack wrote:Hi amarciniakTF6LQ,
What version of Inventor are you using? I have a batch routine I can share if you're using Inventor 2015 or later.
See attached for a *.ipt file and a *.idw file. Click the Instructions button on the form as shown, The form will show when you open the file or save the file.
Or expand this "Spoiler" box:
SpoileriLogic Rule Batch Process Tool
This tool is offered: AS IS !!! Use at YOUR OWN RISK !!! Make sure all open files are SAVED before running the batch !!!
_____________________________________________________________________________________________
_____________________________________________________________________________________________This ilogic Batch Process tool simply opens each file in the list and then runs the selected rule on that file.
It then saves and closes the file.Once the batch process starts, there is no way to stop it so start with small batches to make sure things work.
General Guidelines and Hints
1) Rules to be run must contain three asterisks in their name. Example: 'MyRule ***'
2) Create your rules using ThisApplication.ActiveEditDocument rather than ThisApplication.ActiveDocument
so that the batch processor is looking at the newly opened file, rather than the file the ilogic rule resides in.
3) Once your rules are created, you can attempt to run them using the batch processor by clicking the 'Refresh Rule List' button.
4) You might need to trouble shoot the iLogic code in your rules in order to get them to run.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks Curtis! This will be very useful. I noticed on your site you have an ilogic article for saving PDFs automatically with a revision number at the end of the filename. I'm guessing I could use that ilogic rule with this batch file then?
I also found another way of updating all of the drawings using task Scheduler. You can make a task for "Update Design" , select the project folder and it should update all of the files and save them.
amarciniakTF6LQ wrote:...I'm guessing I could use that ilogic rule with this batch file then?
I also found another way of updating all of the drawings using task Scheduler. You can make a task for "Update Design" , select the project folder and it should update all of the files and save them.
Hi amarciniakTF6LQ,
You "should" be able to use any iLogic rule you put in the file, so long as it is authored to run on the ActiveEdit document (see instruction notes), but I haven't tested this batch tool all that widely, so there will likely be hiccups with some rules. But we do use it quite a bit, with rules that we have in house.
So set up the rule and test with some small batches first. I have not run that exact rule through this tool, but we do batch out PDFs with it, using some version of the same thing. If you can't get that PDF rule to work, let me know and I'll have a look.
re: Task Scheduler
I was going to recommended that until I saw you wanted a PDF, so I went this route.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks for this tool. I need to create pdf file available in one of the folders. But, it does not go to the other files. All the files selected open. But my external rule for creating the pdf runs always in the original file.
Any help is appreciated.
Create your rules using ThisApplication.ActiveEditDocument rather than ThisApplication.ActiveDocument
Also to use this batch tool I generally recreate the rule as an internal rule in the batch file
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hello @Curtis_Waguespack,
That's a nice program you made. I only have one question:
I made a rule (DWG ***) to create DWG's in batches and it sort of works but I can't get it to name the files using certain (custom) iProperties. The same rule runs perfectly in the local drawing.
The rule you added yourself: "iProperties Report Text File Example Rule" has no problem reading those custom iProperties.
I added the files I'm working on, could you please have a look at what I'm doing wrong?
Best Regards,
Hi @Anonymous
I think the issue was with accessing the custom iproperties in the active edit document, I think this version will work for you.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
' Get the DWG translator Add-In. Dim DWGAddIn As TranslatorAddIn DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}") 'Set a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveEditDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then Dim strIniFile As String strIniFile = "C:\Workspace\_CAD Standards\Inventor Settings\DWG_export_Akerveld_scheetscale_modelspace_v2007.ini" ' Create the name-value that specifies the ini file to use. oOptions.Value("Export_Acad_IniFile") = strIniFile End If 'get user param set from document oUserParams = oDocument.PropertySets.Item("Inventor User Defined Properties") Dim iProp As Inventor.Property 'get property value iProp = oUserParams.Item("NL_META_TEKENINGNUMMER") oValue1 = iProp.Value 'get property value iProp = oUserParams.Item("NL_META_VERSIE") oValue2 = iProp.Value 'Set the destination file name Documentnummer = oValue1 & "-" & oValue2 'MsgBox(Documentnummer) Locatie = "C:\Users\Bart\Desktop\TEST\" oDataMedium.FileName = Locatie & Documentnummer & ".dwg" 'Publish document. DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 'Launch the dxf file in whatever application Windows is set to open this document type with i = MessageBox.Show("Preview the DWG file?", "Title",MessageBoxButtons.YesNo,MessageBoxIcon.Question) If i = vbYes Then ThisDoc.Launch(oDataMedium.FileName)
Hi! Another option is to use the standalone tool called Task Scheduler in Inventor (All Programs -> Autodesk -> Inventor 20xx -> Tools). You can schedule a Update Design task to update all drawings regularly.
Many thanks!
I have done a rule (PDF ***) for printing Drawing to PDF doc. When I am trying to print a drawing file in this patch process, the printed file gets automatically saved as “iLogic Drawing Batch Tool 2015.v.1.4-1 new” and the same file name overrides for all the drawings.
Please look at this program and advise me to proceed.
If I understand this right, the code/syntax for "accessing" or reading the custom iproperties is here:
'get user param set from document oUserParams = oDocument.PropertySets.Item("Inventor User Defined Properties") Dim iProp As Inventor.Property 'get property value iProp = oUserParams.Item("NL_META_TEKENINGNUMMER") oValue1 = iProp.Value
I want to do the opposite: How would I go about assigning a value to the custom iproperty through iLogic?
How would the syntax for that look like? (say, my custom property name is "xyz")
I want to be able to read the current revision level and write it to a custom iproperty I have created (which is being used in the title block).
Of course, my rule needs to work with this batch tool (which is super cool, by the way!).
I'm fairly new to inventor scripting, any help would be really appreciated!
Hello Curtis
Any ways this works in a vault project while checking out and saving the drawings and check them back in?
Can't find what you're looking for? Ask the community or share your knowledge.