Ilogic check iProperty of opened file

Ilogic check iProperty of opened file

Anonymous
Not applicable
720 Views
2 Replies
Message 1 of 3

Ilogic check iProperty of opened file

Anonymous
Not applicable

Hi!

Trying to check/Change iProperty of a file that has been opened by iLogic,

But the only value I get is the value from the file when the rule was launched.

I guess there is some secret-refering-stuff I dont understand 🙂

 

 

SyntaxEditor Code Snippet

FileToCheck = "C:\Vault\1782-906-R00.idw"

ThisDoc.Launch(FileToCheck)

RevOfFile = iProperties.Value("Project", "Revision Number")

MessageBox.Show(RevOfFile, "Title")

ThisApplication.ActiveDocument.Close(True)

 

0 Likes
Accepted solutions (1)
721 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

@Anonymous wrote:

Hi!

Trying to check/Change iProperty of a file that has been opened by iLogic,

But the only value I get is the value from the file when the rule was launched.

I guess there is some secret-refering-stuff I dont understand 🙂

 

 

SyntaxEditor Code Snippet

FileToCheck = "C:\Vault\1782-906-R00.idw"

ThisDoc.Launch(FileToCheck)

RevOfFile = iProperties.Value("Project", "Revision Number")

MessageBox.Show(RevOfFile, "Title")

ThisApplication.ActiveDocument.Close(True)

 


 

Try:

 

oDoc = ThisDoc.Launch

oProp = oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value

MsgBox(oProp)

 

http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html


--------------------------------------
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
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Super!
I believe I kind of getting it now:)

Got it to work with:

 

SyntaxEditor Code Snippet

FileToCheck = "C:\Vault\1782-906-R00.idw"

ThisDoc.Launch(FileToCheck)

    ' Get the active document. 
    Dim oDoc As Document 
   oDoc = ThisApplication.ActiveDocument 

'oDoc = ThisDoc.Document'(FileToCheck)

oProp = oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value

'iLogicVb.RunExternalRule("Test show partnumber")

MsgBox(oProp)
     
ThisApplication.ActiveDocument.Close(True)

 

0 Likes