Hello
The link below shows how to read iproperties using iLogic - what's the equivalent in VB.net?
https://adndevblog.typepad.com/manufacturing/2018/04/accessing-iproperties-through-ilogic-code.html
Tried a few things without success...
Regards
Andrew
Hi, here is an example. First I think you should specify the inventor application. As I cannot prove it at this time I have created an ilogic rule, which is based on the language of vb.net
Under the simple rule I have left you a thread where you can consult the information.
I hope it is useful for you. regards
Dim invapp = ThisApplication Dim doc As Document = invapp.ActiveDocument
Dim oProp As String
oProp = doc.PropertySets.Item("Inventor Summary Information").Item("title").Value
MsgBox(oProp)
https://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
Hello & thanks
I'm trying to access iproperty information from idw's using Apprentice - thinking this will be faster than waiting for the drawing to open in Inventor. It's only to see which iproperties are present within the file.
The code used was copied from mod the machine & edited after to a different iproperty but the error message relates to a 3d driver?
Regards
Andrew
there's more info :
the MA24-4 zip file has a list of iproperties..
If you're intending to get the "Title" property, you have it backwards. You're setting it. It may be throwing an exception if Title doesn't already have a value.
...
Title = oProperty.Value
MessageBox.Show(Title)
Some bit are working! 🙂
Design Tracking Properties will edit.
Next is finding the path to custom iproperties - there's a reference but it'e VBA...
In your latest post, you're referencing the PropertySet class as if it's a static class, not your PropertySet object
customProp = customPropSet.Item("TITLE_LINE_1).Value
If you're meaning to set the property to TextBox3.Text then keep the second equals. I didn't follow what you were doing.
Just a couple of suggestions. It would be good practice to check PropertySetExists on the collection before getting a property set so you don't throw an exception. Since an exception is thrown if you try to access a property that doesn't exist and there's no "PropertyExists" method, I also find it helpful to "for each" the properties collection and add them to a custom collection (I've used List<T> when T is a custom class with the name and value as the only properties). Once you have your list, you can work off of that instead of having exception handling for every property you're dealing with.
Hello
I have some success 🙂 - thanks.
But i was testing using a 2016 idw & the code fails on a 2018 idw.
Not sure how to change the .net version (or if this is even the right action) of the solution?
Regards
Andrew
I'm not sure what the error would be. It shouldn't be due to your .NET target framework version. I'm assuming you're using Inventor 2018 and the IDW opens in Inventor without issues.
Hello
Just about to restart the m/c
Will make sure 2018 is loaded first.
Think it might be using apprentice 2016 & not 2018.
Not too sure how to tell the difference. The test file is the same - just a save copy as in 2018 for the second version.
Regards
Andrew
Restarting, using 2018 make no difference - swap the code in 2 places to see the 2016 file & not the 2018 file works for 2016 but not 2018...
2016 working:
2018 - unspecified error
Regards
Andrew
The only thing I can think of is to check your reference to Apprentice under Reference Manager is VS. I'm using Inventor 2017, so when I hover over Autodesk Inventor's Apprentice Object Library in the COM section, I see it points to C:\Program Files\Autodesk\Inventor 2017\Bin\bin32\RxApprentice.tlb
Thanks - it's working.
I think installing Inventor view has helped but not sure if it's required - thought 'Apprentice' was installed with Inventor?
Uninstalling the Anti Virus helped too - why it effect 2018 & not 2016, mystery.
Running ccleaner - possibly helped
Running the profile reset tool helped too.
Regards
Andrew
Hi Andrew,
You don't really need Apprentice to read and write iProperties from Inventor-files. iProps is all MS-Technology, so Windows brings everything you need. (The Macro in the attached Excel-File is made for a 32-Bit-VBA-client - which afaik is still standard even in newer, 64-Bit editions of Excel). To get it to run in a 64-Bit Excel-VBA-client there need to be made some changes in the code. (Save everything in Excel before trying: If it's the wrong version, it wil crash!)
Greetings, Bert
Thanks
I'll need to figure out how to run the macro for 64 bit excel - it really custom iproperties which will need editing - can these still be seen without Apprentice?
Regards
Andrew
Short answer: Yes it can, but i need to put some effort in it to adapt it. But before i need to update to a current version of excelMyself 😕 . So long i can only offer you the .ivb file underneath wich contains the 64-Bit versions of the Windows system-function calls used in the excelfile i posted before. Maybe you can put the puzzle together yourself 😉
FYI: the macro inside runs in Inventor's (64-Bit) - VBA-Client, but bypasses Inventor to perform some cheats! 🙂
I think I've a choice between wrestling with VBA or vb.net (visual studio) & guess investment in vb.net is the way forward, but:
https://adndevblog.typepad.com/manufacturing/2014/07/using-apprentice-from-a-windows-service.html
the above is the error appearing & I need to look up what a Windows service is - i didn't think this project would be such a challenge!
Regards
Andrew
Can't find what you're looking for? Ask the community or share your knowledge.