placing part/assembly from the Vault or local HDD

placing part/assembly from the Vault or local HDD

Anonymous
Not applicable
904 Views
3 Replies
Message 1 of 4

placing part/assembly from the Vault or local HDD

Anonymous
Not applicable

Hello,

 

Does anybody know how to place part or assembly from the Vault or local Hard drive in to the existing assembly?

Basically I do have a list of parts (wall panels different sizes etc...) I was going to create an iLogic form with drop downs, so engineer can choose wall panel assemblies he needs and qty`s. iLogic will pull these assemblies from the vault/HDD in to the existing assembly. Currently we have to go to so many different folders to pick them up.

 

Thanks,

Alex

 

 

0 Likes
905 Views
3 Replies
Replies (3)
Message 2 of 4

jdkriek
Advisor
Advisor

Since you recently asked this question in another thread, I decided to respond to the orginal thread.

 

Concerning HDD interactions to place files:

 

This is based off the VBA example given in

Help section > Additional Help > Programming Help > Sample Code section

 

I have converted it to iLogic for you

 

' Set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

' Set a reference to the transient geometry object.
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry

' Create a matrix.  A new matrix is initialized with an identity matrix.
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix

' Set the rotation of the matrix for a 45 degree rotation about the Z axis.
oMatrix.SetToRotation(3.14159265358979 / 4, oTG.CreateVector(0, 0, 1), oTG.CreatePoint(0, 0, 0))

' Set the translation portion of the matrix so the part will be positioned
' at (3,2,1).
oMatrix.SetTranslation(oTG.CreateVector(3, 2, 1))

' Add the occurrence.
Dim oOcc As ComponentOccurrence
oOcc = oAsmCompDef.Occurrences.Add("C:\Vault Local Files\test.ipt", oMatrix)

There is a lot more you can do with this obviously, but that's the basic idea.

 

Concerning Vault interactions to place files:

 

You'll have limited access inside of Inventor. The VaultAddin itself can be refrenced directly in VBA, BUT you will be blocked from using it by Autodesk. If this were possible, it would be simple. You would just Tools > Refrence > Browse inside of VBA and simply add C:\Program Files\Autodesk\Inventor 20XX\Bin\InventorVault.dll which would enable you to write custom scripts to do anything you wanted to do - like this:

 

Sub Blocked()
    Dim oVault As New VaultAddInLib.FileUtility
    Dim Result As FetchFileResult
    oVault.CheckOutFile "C:\Vault Local Files\fubar.ipt", Result
    If Result = kFetchFileSuccess Then
        'do your thing
    Else
        'Report the error to the user
    End If
End Sub

 But like I said, you can't.

 

You can trigger the actual commands used by the VaultAddin from VBA or iLogic, but the moment it requires some sort of user interaction you will be out of luck, because Autodesk has chosen not to include the actual Vault Browser Pane in the API - you can play with the Inventor Browser Pane all day however. So you would still be forced to do some actions manually.

 

Example:

 

oCommandMgr.ControlDefinitions.Item("VaultGetLatest").Execute
oCommandMgr.ControlDefinitions.Item("VaultGetCheckoutTop").Execute2(True)
oCommandMgr.ControlDefinitions.Item("VaultCheckinTop").Execute2(True)
oCommandMgr.ControlDefinitions.Item("VaultChangeStateTop").Execute2(True)

 

Your best bet is to develop your own standalone application where apprentice will have access to everything or your own Add-In that would have access as well. Here's an example of what you are looking at:

 

http://forums.autodesk.com/t5/Autodesk-Vault/GetFiles-using-NET/td-p/3018348

 

Hope this helps.

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


0 Likes
Message 3 of 4

Anonymous
Not applicable

Great post! Thank you! First script works like a charm.

 

Vault ........ The iLogic code I wrote uses Excel spreadsheet to replace parts.

 

If Width=144 Then
	
	NUM=GoExcel.CellValue("B" & CStr(GoExcel.FindRow("c:\Work12\Designs\ILOGIC\iDropOverFrame\drop over common parts.xls", "144", "DISCHARGE", "=", DisBeamOffset)))
	NUM1=GoExcel.CellValue("C" & CStr(GoExcel.FindRow("c:\Work12\Designs\ILOGIC\iDropOverFrame\drop over common parts.xls", "144", "DISCHARGE", "=", DisBeamOffset)))
	NUM2=GoExcel.CellValue("D" & CStr(GoExcel.FindRow("c:\Work12\Designs\ILOGIC\iDropOverFrame\drop over common parts.xls", "144", "DISCHARGE", "=", DisBeamOffset)))
	FILENAME="c:\Work12\Designs\PARTS\PARTS - T\T37000-T37999\" & NUM & ".ipt"
	FILENAME1="c:\Work12\Designs\PARTS\PARTS - T\T37000-T37999\" & NUM1 & ".ipt"
	FILENAME2="c:\Work12\Designs\PARTS\PARTS - T\T37000-T37999\" & NUM2 & ".ipt"
	
	Component.Replace("Sheet1", FILENAME, True) : Component.Replace("Sheet2", FILENAME, True)
	Component.Replace("Sheet3", FILENAME1, True)
	Component.Replace("DisSideCover:1", FILENAME2, True) 

'and so on

 attached is the Excel spreadsheet with part #`s. All these parts are in the vault as well. for me its not a problem to run the ilogic code since I have them on my local HDD, script works and replaces the parts, but for the engineer on a different computer it will give a error. So I`m wondering if there are other ways to get the files from that spreadsheet on to the local HDD....

 

 

Thanks in advance!!!

Alex.

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hiii ..

 

I have an assembly in which I have segregated various design options in different folders. I want to drive the structure by using these "True / False" parameters. When I Click "True" it should Un-suppress the folder, When I Click "False" It should Suppress the folder.

 

Please help.

 

Buttons for true-false.PNGRow column structure.PNG

Kindly help.Model Tree.PNG

0 Likes