Hello,
I have excel table with files name and description. Is there any way to batch fill iProperty description field based on my excel table? I mean like "if file name is AA, description will be BB" and so on...
Thank you.
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Many ways. Depends on how you want to accomplish it/what you want user inputs to be.
ie;
Use excel and have excel load the model and edit the files there.
Or use inventor and get it to pop open a table for the user to edit it there, and save the changes when closing,
etc.
And do you really just need iProperty population based off of if statements, or you want a table to bulk edit iProperties as in the Bills Of Materials within inventor, but with excel formula functionality?
Hi michael.sheldon153,
You could use iLogic for this. I do pretty much the same thing at this link, the difference is rather than an iproperty I was writing to a prompted title block (yuck! )
If iLogic is something you'd consider, and the link doesn't help, let me know and I'll work up a quick example (tomorrow). Edit: just saw that @ MechMachineMan replied, he'll likely come up with something better that I would have anyway. What version of Inventor are you using?
http://inventortrenches.blogspot.com/2014/06/ilogic-titleblock-project-data-from.html
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks for answers.
I have over thousand step files without description. I did rename them easily and quickly in cmd line witch script created by Excel formula "ren aaa bbb" "ren ccc ddd"..... Copy, paste, enter, 1000 files done.
Now I need similar workflow for editing description. Task Scheduler only converts steps to ipts for me unfortunately...
I have 2017 version.
Thank you again.
Ok. So I created simple iLogic rule which read Excel and write appropriate iProperty Description.
Now,how could I apply this iLogic rule to bunch of files without manually opening every one of them?
Thank you.
Hi michael.sheldon153,
Here is a "batcher" file I created in the past that you can download: iLogic Part Batch Tool 2015.v.1.4.ipt 180 KB
Create a rule in this file and put your code in it. Make sure that your code specifies ThisApplication.ActiveEditDocument rather than ThisApplication.ActiveDocument in order set the focus to the parts that it opens (rather than the "batcher" file).
If you have 200 files to run, try it on 10 to start with, and once you know it's working, you can try larger batches.
Post your code if you have issues getting it to run, and I'll have a look.
related link:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hello Curtis,
it looks promising, thank you.
Here is my code:
name = ThisDoc.FileName(False) If GoExcel.FindRow("tst.xlsx", "Sheet1", "Name", "=", name) iProperties.Value("Project", "Description") = GoExcel.CurrentRowValue("Desc") End If
Where am I suppose to add "ThisApplication.ActiveEditDocument"?
Thank you again.
Hi michael.sheldon153,
Might be a bit more "long winded" than it needs to be, but try this:
'set the target document oDoc = ThisApplication.ActiveEditDocument 'example: "C:\TEMP\9876543210.ipt" sPathAndName = oDoc.FullFileName 'split into an array oSplit = Split(sPathAndName,"\") 'example: "C:\TEMP\9876543210.ipt" ' oSplit(0) = C: ' oSplit(1) = TEMP ' oSplit(2) = 9876543210.ipt" <-- this is the Ubound for this example 'get the upper bound of the array sNameWithExtension = oSplit(UBound(oSplit)) 'get length of string 'example: 9876543210.ipt" , would return 14 iNameLength = Len(sNameWithExtension) 'remove last four chars, which is the extension ( example: .ipt ) sName = Left(sNameWithExtension, iNameLength - 4) 'compare excel data If GoExcel.FindRow("C:\TEMP\Test.xlsx", "Sheet1", "Name", "=", sName) ' Get a reference to the PropertySets ' we're really only using Design Tracking Properties in this case though Dim oPropSet1 As PropertySet oPropSet1 = oDoc.PropertySets.Item("Inventor Summary Information") Dim oPropSet2 As PropertySet oPropSet2 = oDoc.PropertySets.Item("Design Tracking Properties") Dim oPropSet3 As PropertySet oPropSet3 = oDoc.PropertySets.Item("Inventor User Defined Properties") 'set value to excel data oPropSet2.Item("Description").Value = GoExcel.CurrentRowValue("Desc") End If
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
It looks complex indeed but it works like a charm! 🙂
Thank you very much!
Hello Curtis,
could you help me once more please?
I would like to edit Physical --> Mass iProperty as well. How can I do that?
I guess something like this, but I don't know PropertySets name:
Dim oPropSet4 As PropertySet oPropSet4 = oDoc.PropertySets.Item("What Goes Here???") oPropSet4.Item("Mass").Value = GoExcel.CurrentRowValue("Weight")
btw,is there similar tool for assemblies?
Thank you.
Hi michael.sheldon153,
So the mass props are a bit different. Just add these lines and you should be good to go.
'Set a reference to the mass properties object. Dim oMassProps As MassProperties oMassProps = oDoc.ComponentDefinition.MassProperties oMassProps.Mass = GoExcel.CurrentRowValue("Weight")
As for an Assembly batch, I don't have one handy, but could make the part one do assemblies also (currently the selection dialog is just filtering for part files only) .
Curious what you're needing to batch process for assemblies? Is it just iProperties as well?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Great! Thank you.
Its just for iProperties as well. I have over 200 assemblies (imported from step files) and I need to add description to them so I can have nice parts list in drawings.
Hi michael.sheldon153,
Attached is an updated version of the batch tool that will run parts and assemblies. I only tested it briefly after the changes, so beware and do a couple of small batches first.
Note too that I updated the iProps from Excel run in this file, so it should be ready to go. Post back if you have issues.
And be sure to back up your files before you run this (just in case! )
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi,
I also was trying to do something very similar, I wanted to edit the iproperties via excel. I was able to get the description section to work, however I was also trying to add information to a custom iproperty/parameter. I have code that will create a custom parameter & export it in each part and set it to a default value but now I'm trying to use excel to give that custom iproperty a new value from the excel sheet the same way as Description is filled in. Thanks for any help, I'm really new to programming in ilogic.
Curtis
I am trying to use your tool to create Custom Properties in iProperties of assembly file.
Purpose of this exercise is to add COBi data for a BIM.
What changes should I make to your iLogic rule?
Where should I save my excel file?
What format my excel file should have?
I appreciate your help and I am sure many other inventor users will be very grateful to you too.
Curtis,
How can you use the same script and replace Description with REV? I have to batch a bunch of files to remove the "0" in the REV field with a blank.
Thanks,
Corey
Can't find what you're looking for? Ask the community or share your knowledge.