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: 

Assembly iProperties Exel Importing

7 REPLIES 7
Reply
Message 1 of 8
varga_zsolt
598 Views, 7 Replies

Assembly iProperties Exel Importing

Hi all,

i have made a iLogic Module who, whit an external rules, import the iProperties value from an external exel file.

The exel file is connected from SQL with the our managerial software.

This in the external rule:

i = GoExcel.FindRow("Z:\DISEGNI_INVENTOR\Descrizioni.xls", "Descrizioni", "Cod.Art.", "=", iProperties.Value ("Project", "Part Number"))
iProperties.Value ("Project", "Description") = GoExcel.CurrentRowValue("Descr. Articolo Princ.")
'iProperties.Value("Project", "Project") = GoExcel.CurrentRowValue("Gruppo")
iProperties.Value ("Custom", "Descrizione inglese") = GoExcel.CurrentRowValue("Descr. tradotta")
iProperties.Value ("Custom", "Descr. Agg. ITA") = GoExcel.CurrentRowValue("Descr. Agg. Articolo Princ.")
iProperties.Value ("Custom", "Descr. Agg. ENG") = GoExcel.CurrentRowValue("Descr. Agg. tradotta")
iProperties.Value("Custom", "FileName") = ThisDoc.FileName(True)
'Da abilitare e correggere solo quanto in SAM funzionerà il campo della descrizione in RUSSO!!!
iProperties.Value ("Custom", "Descrizione_Russo") = ("") 'GoExcel.CurrentRowValue("Descrizione. Russo")
iLogicVb.UpdateWhenDone=True

 It's work fine but i have same question.

There is some string to refresh an iLogic Module? When i push the ruel button the rule add the custom value in iProperties, but there are disabled, i have close the module an reopen it for correct display the value of the iProperties.ff.jpeg

 

Onother question, the most important, is: this module work with single parts. Can I do an rule who do the same thing of my string but in one assembly, do this for every parts of assembly automaticly???

 

P.s. Exuse me for my bad english.

7 REPLIES 7
Message 2 of 8
varga_zsolt
in reply to: varga_zsolt

Nobody can help me?? Please! Man Surprised

Message 3 of 8
stang_shane
in reply to: varga_zsolt

I would try adding:

 

InventorVB.DocumentUpdate()

 

to the code you wrote.  This shoud update the iproperties in the document and when I have used it with ilogic forms, the iproperties updated in the form.  Does the model you are using have the custom iproperties already added or is the rule creating and populating the custom iproperties?

 

 

For your second question, I don't know of a way to change the iproperties of a part in an assembly without using the bill of materials.  It is something that I will be experimenting with shortly, as I have the same need.  I have created an API code in the past that cycled through open files and performed updates, then closed the files.  The loop continued until there were no more open files.

Message 4 of 8
varga_zsolt
in reply to: stang_shane

he model who i use some times have this custom iproperties and sometime these must be created.

 

Message 5 of 8
varga_zsolt
in reply to: varga_zsolt

So i try to explain me better.

When i open one parts or assembly this don't have the custom iProperties. I open my module (the immage on top) with my externar ilogic rule i copy the custom iProperties from the excel file, but when i open the module the form are disabled.

When i press the buttom the value appare in the form but there are always disabled. I must close and reopen the module for activate this form. I searching for some string to put an the end of my esternar rule vho refresh the module and activate the form with the new value.

Message 6 of 8
varga_zsolt
in reply to: varga_zsolt

I need this function so i retriy here Smiley Indifferent

 

In the single parte (ipt) i use this ilogic rule that compile the iProperties i nedd copy this from the excel file.

I nedd the same story for the assembly file (iam) in this my ilogi rule must be aply for every single part of assembly, after that i can save all the part (ipt) with the corect iProperties. 

Message 7 of 8
varga_zsolt
in reply to: stang_shane


@stang_shane wrote:

I would try adding:

 

InventorVB.DocumentUpdate()

 

to the code you wrote.  This shoud update the iproperties in the document and when I have used it with ilogic forms, the iproperties updated in the form.  Does the model you are using have the custom iproperties already added or is the rule creating and populating the custom iproperties?

 

 

For your second question, I don't know of a way to change the iproperties of a part in an assembly without using the bill of materials.  It is something that I will be experimenting with shortly, as I have the same need.  I have created an API code in the past that cycled through open files and performed updates, then closed the files.  The loop continued until there were no more open files.


So this is what i need. I need a loop who open every single part in assembly and lunch the my external roule who update all te iproperties!

Message 8 of 8

Hi,

 

iLogic is based on VB.net. Most API of .net could be used within it. e.g. you can iterate a folder to get the documents and use Inventor API to open it one by one, finally do your own work. Please refer to MSDN on more info about these methods.

 

Dim oFolder As String 
oFolder = "c:\"
Dim Files  As  String() 
' filter iptFiles  =  System.IO.Directory.GetFiles(oFolder,"*.ipt")  
 Dim oEachDocument
 For  Each  s  In  Files  
      ' s is each file name      oEachDocument  = ThisApplication.Documents.Open(s)     
 Next  

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

Post to forums  

Autodesk Design & Make Report