Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault Add-in (Check-in)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
melanie2012
2064 Views, 2 Replies

Vault Add-in (Check-in)

i have an external rule opening drawings for all unsuppressed parts and assemblies.  The code below automates the check-in process.  I  enabled Automatic Log In and Suppressed "Check-in" dialog and the check-in was smooth for instances where adding in a file were not required.  My one snag is that I need to add comments.  I now have taken out the dialog box Suppression and it has sped up checking in files, but I was wondering if there was a was to pass along a comment from a Message Input box.  The comment would be the same for any parts which changed, so I could suppress the "Check-in" dialog box and still get a comment applied to that compontent.

 

ForEachodocAsInventor.DocumentInThisApplication.Documents
DimappAsInventor.Application=ThisApplication
DiminvdocAsInventor.Document=app.ActiveDocument
DimopathandnameAsString=invdoc.FullFilename
DimoextensionAsString=Right(opathandname,3)
DimposnAsInteger=0
posn=InStrRev(opathandname, ".")
Ifposn<>0Then

Ifoextension="dwg"Then

ThisApplication.ActiveDocument.Save
ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute

'Close drawing file(s)
invdoc.Close(False)

'Clear out Addin variable string(s)
onamenoextension=Nothing
EndIf

EndIf

'Clear out application variable String(s)
opathandname=Nothing
posn=Nothing
oextension=Nothing

Next

Thanks in advance,

2 REPLIES 2
Message 2 of 3
jdkriek
in reply to: melanie2012

First you need to have the command wait for you if you hope to fill in the comments.

 

ControlDefinitions.Item("VaultCheckinTop").Execute2(True)

I've not had any luck actually filling in the comments though. Decided that we didn't need them after all, especially since it was being followed by an automatic state change to Release which was pretty much self-explanatory.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 3 of 3
bcornwellmott
in reply to: jdkriek

I've been able to fill in the comments by "cheating" a little bit.

 

Dim Comment as String

Comment = "This is the text that will show up in the comments box."

 

Set ctrdef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckInTop")

ctrdef.Execute2 False

SendKeys Comment & "{TAB}~"

 

The last line will "type" the Comment string into the comments field for the check in, and the {TAB}~ will jump over to the OK button and press OK, thereby initiating the check in.

 

Note that the Execute2 boolean is False. My understanding is that this allows VBA code to be executed even when the check in dialog box is open. If you just use Execute (or Execute2 true I think), the "typing" will only happen after the dialog box is closed (which won't fill in the comments).

 

Hope this helps!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report