change document settings

change document settings

Anonymous
Not applicable
1,934 Views
4 Replies
Message 1 of 5

change document settings

Anonymous
Not applicable

The company I work for does not use vault.  I still want to build a way to "check out" drawings.

 

I want the user to open the drawing that they wish to revision and just click the illogic button.

that would then run code to change the drawing's document settings under TOOLS ribbon and the "Drawing" tab to "Defer Updates". 

save the drawing forcing to create an "old version" as well.

then last but not least open the "save copy as" dialogue box for user input. 

 

Something very simple but I have no idea on the code for the drawings document settings or the defer updates check box.

 

I would attach what I have so far but it doesn't seem to do anything at all and I am afraid it would confuse people more  😕

 

THANK YOU ALL!

0 Likes
1,935 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

I have gotten this far.....

 

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 7257 StartFragment: 314 EndFragment: 7225 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet

'get the current sectioning setting
Dim sCurrentSetting As String
If ThisDoc.Document.DocumentSettings.DeferUpdates = True Then
sCurrentSetting = "Checked out"
Else 
sCurrentSetting = "NOT checked out"
End If

'get input from user
bDocupdatesQuestion = MessageBox.Show("Do you want to check out the drawing?" & vbLf & _
vbLf & "Currentlly set to: " & sCurrentSetting, _
"iLogic",MessageBoxButtons.YesNo)

'set document setting based on user input
If bDocupdatesQuestion = vbYes Then
ThisDoc.Document.DocumentSettings.DeferUpdates = True
ElseIf bDocupdatesQuestion = vbNo Then
ThisDoc.Document.DocumentSettings.DeferUpdates = False
End If

but it errors out as "DocumentSettings " is not recognized.

in addition to what is shown, I would like a cancel function to kill the change if the drawing is already "checked out"

AND.....when checked out I would like it to ask for your initials for "Checked By:" and the "Checked Date:"

 

I can work on that later but right now I am focusing on the "Document Settings" thing.

 

Thank you all.

0 Likes
Message 3 of 5

MechMachineMan
Advisor
Advisor

Can't you just avoid doing this by code by using the Legacy Project type "Multi-User Project"?

 

  • enable creation of legacy projects in your settings first
  • Create the new MASTER multi-user project file
  • Create new USER multi user project files in the users workspaces.
  • Watch the checkin/out "magic" happen.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 4 of 5

Anonymous
Not applicable

We tried that.  We had it set up and the "check in/out magic" happened alright  🙂

 

among the 4 of us that check stuff in and out we had a LOT of problems with parts just being checked out and not being able to do anything with them.  Files would get checked out that we didn't want to check out.  These same parts would then not be able to get checked back in for no reasons we could decipher.  We obviously didn't have a good understanding of the process......HOWEVER, also, for the same reason we don't look into anything vault can do, we have the need for drawings to be able to be revised in as many projects as possible, all at the same time.

 

So revision "A" will be in CURRENT

revision "B" through "D" will be in a bunch of different engineering change order folders on the network.  Then.....finally....someone will release the "E" revision ahead of all the other changes, "B" through "D" will then go straight to the "OBSOLETE" folder as old revisions when released while "E" sits comfortably in the CURRENT folder for everyone to see when it is released.  We like changes to be separated out individually to record any and all changes very specifically.  This system requires a lot of talk and communications among the group and autocad works perfectly fine for this because what you do does not affect my part, unless you communicate that to me and we actually need to change something.  That isn't how inventor works  😞

you would think that we could still communicate but 2 of us are very scared of inventor and do not understand a lick of it and then everything gets messed up etc. etc.  (such is real life)  Also why I am making a button that does everything for the person and not even relying on a human to toggle through and click something.  It's really a worse case scenario with 2 of the designers.

 

I have designed a system where any models would just be named as their part numbers and the drawings will be named with their part numbers followed by the revision level, ex: "55555E".  It's an odd system that allows for a "LIVE" part to be constantly growing and revising and a drawing system that can mimic what we do with autocad perfectly. 

 

Thank you All again for looking

Thank you MechMachine for your suggestion. 

0 Likes
Message 5 of 5

8013068
Enthusiast
Enthusiast

I know this is an old thread, but it was the only one I could find when I ran into the same problem. I figured out that the problem is that you need to specify the document type the settings are in, and then use DrawingSettings (in this case) rather than DocumentSettings. So, instead of this:

ThisDoc.Document.DocumentSettings.DeferUpdates = True

You need to do this: 

Dim oDoc As DrawingDocument = ThisDoc.Document
oDoc.DrawingSettings.DeferUpdates = True

I'm guessing this is because the settings are different depending on what type of document it is.

Hope this helps someone in the future.
 

0 Likes