- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Exhausted my searched and didn't find anything so just posting a quick question. Can you change the read only state of a file (or files) with iLogic (or something else) from inside Inventor? Looking for a quick and dirty (non-Vault) way to change the state of files.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Maybe explaining why you want this functionality would be helpful/wise,etc...
VB/system.io has the functionality you want though..
-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570
Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @phlyx
This question would have been better placed on the Inventor Customization forum so I've asked the moderators to move it to there, please keep that in mind for the future
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
as for your question though, here is an example I had on hand.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
strPath = System.IO.Directory.GetParent(ThisDoc.Document.FullFileName).FullName 'set read only off for each file in the folder Dim dir As New System.IO.DirectoryInfo(strPath) For Each File As System.IO.FileInfo In dir.GetFiles("*", System.IO.SearchOption.AllDirectories) ' Set flag. File.IsReadOnly = False Next MessageBox.Show("Read Only turned off for all files in: " &vbLf &vbLf & _ strPath, "iLogic", MessageBoxButtons.OK, MessageBoxIcon.Information)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
That's close but that handles all files in a folder. We're really just looking to have something we can click on to toggle read only on and off for the active document we're in.
Why we're looking to do this is that we are nowhere close to being at a position to even consider Vault so we're trying to do some minor file editing control using the file properties to protect completed designs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @phlyx
see this example
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
sFileName = ThisApplication.ActiveEditDocument.fullfilename Dim oFile As System.IO.FileInfo oFile = New System.IO.FileInfo(sFileName) oFile.IsReadOnly = False
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All I can say is PERFECT! Created a quick form that you can access while in a part or assembly and change the read-only state on or off. That is exactly what we needed! Thanks!!!