Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using iLogic to edit and update iPart table

10 REPLIES 10
Reply
Message 1 of 11
LabMan1
2024 Views, 10 Replies

Using iLogic to edit and update iPart table

I want to run an iLogic rule in an iPart.ipt that updates the Part Number parameter. the following code seems to work but does not actually change/update the Part Number parameter in the iPart table. iPart.ChangeRow("", "5033601") iProperties.Value("Project", "Part Number") = MastNo & "01" iPart.ChangeRow("", "5033602") iProperties.Value("Project", "Part Number") = MastNo & "02" iPart.ChangeRow("", "5033603") iProperties.Value("Project", "Part Number") = MastNo & "03" iPart.ChangeRow("", "5033604") iProperties.Value("Project", "Part Number") = MastNo & "04" After running the rule I have noticed the last part modified (5033604) will update when I double click another part in the Table. Any Thoughts?
10 REPLIES 10
Message 2 of 11
mrattray
in reply to: LabMan1

iLogic and iParts simply don't play well together. Why can't you use the part number column in the iPart table?
Mike (not Matt) Rattray

Message 3 of 11
johnsonshiue
in reply to: LabMan1

Hi! Regardless of using iLogic or doing it manually, editing iPart member is better done on the iPart author table. In theory, iPart member files should be defined by the iPart factory ipt. If you try editing iPart member file directly without changing the author table, the change will be wiped out next time the iPart member file is updated.

Thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 4 of 11
LabMan1
in reply to: mrattray

I am creating a configurator for our product. Fill in the blanks in a Excel spreadsheet and "poof" the models and drawings are done. There are 11 parts that need a unique Part Number in every configuration. I do not want to open those 11 parts (that iPart) and edit the table manually each time a new configuration is created. I am thinking I need a variation of the following thread... http://forums.autodesk.com/t5/Inventor-Customization/Edit-filename-of-iAssembly-Table-Member-in-ilog...
Message 5 of 11
mrattray
in reply to: LabMan1

I don't understand why the part number cannot be a part of the factory's iPart author table. This is how iParts are typically used.
Mike (not Matt) Rattray

Message 6 of 11
LabMan1
in reply to: mrattray

It is part of the table. I want to rename the part number in the table each time the configurator is run. The 11 parts that are unique to each configuration take on dash numbers of the top level assembly. Top Level = 1234500 Cut Tube 01 = 1234501 Cut Tube 02 = 1234502
Message 7 of 11
LabMan1
in reply to: LabMan1

Each time the configurator is run a new top level number will be assigned
Message 8 of 11
xiaodong_liang
in reply to: LabMan1

Hi wbsmith,

 

if you could provide a demo sample document, it would be helpful to diagnose the scenario.

 

Message 9 of 11
LabMan1
in reply to: xiaodong_liang

The link I added above appears to be the solution I was looking for. Changing the actual part number led to other issues. I found it more advantageous to add another column to the itable (Prt Number) and manipulate that. The modified code: Dim oDoc As Inventor.PartDocument = ThisApplication.ActiveDocument Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition Dim oFactory As iPartFactory oFactory = odef.CreateFactory Dim oWorkSheet oWorkSheet = oFactory.ExcelWorkSheet Dim oCells oCells = oWorkSheet.Cells ' Columns... ' oCells.Item(1, 1) = "Member" ' oCells.Item(1, 2) = "Part Number" ' oCells.Item(1, 3) = "Description" ' oCells.Item(1, 4) = "OD" ' oCells.Item(1, 5) = "LENGTH" ' oCells.Item(1, 6) = "Prt Number" ' Row 1 values... oCells.Item(2, 1) = "5033600" oCells.Item(2, 2) = "5033600" oCells.Item(2, 3) = "INTERMEDIATE TUBE 8.25" oCells.Item(2, 4) = 8.25 oCells.Item(2, 5) = "TubeLen825" oCells.Item(2, 6) = MastNo & "04" ' Row 2 values... oCells.Item(3, 1) = "5033601" oCells.Item(3, 2) = "5033601" oCells.Item(3, 3) = "INTERMEDIATE TUBE 3.75" oCells.Item(3, 4) = 3.75 oCells.Item(3, 5) = "TubeLen375" oCells.Item(3, 6) = MastNo & "10" ' Row 3 values... oCells.Item(4, 1) = "5033602" oCells.Item(4, 2) = "5033602" oCells.Item(4, 3) = "INTERMEDIATE TUBE 4.50" oCells.Item(4, 4) = 4.50 oCells.Item(4, 5) = "TubeLen450" oCells.Item(4, 6) = MastNo & "09" ' Row 4 values... oCells.Item(5, 1) = "5033603" oCells.Item(5, 2) = "5033603" oCells.Item(5, 3) = "INTERMEDIATE TUBE 5.25" oCells.Item(5, 4) = 5.25 oCells.Item(5, 5) = "TubeLen525" oCells.Item(5, 6) = MastNo & "08" ' Row 5 values... oCells.Item(6, 1) = "5033604" oCells.Item(6, 2) = "5033604" oCells.Item(6, 3) = "INTERMEDIATE TUBE 6.00" oCells.Item(6, 4) = 6.00 oCells.Item(6, 5) = "TubeLen600" oCells.Item(6, 6) = MastNo & "07" ' Row 6 values... oCells.Item(7, 1) = "5033605" oCells.Item(7, 2) = "5033605" oCells.Item(7, 3) = "INTERMEDIATE TUBE 6.75" oCells.Item(7, 4) = 6.75 oCells.Item(7, 5) = "TubeLen675" oCells.Item(7, 6) = MastNo & "06" ' Row 7 values... oCells.Item(8, 1) = "5033606" oCells.Item(8, 2) = "5033606" oCells.Item(8, 3) = "INTERMEDIATE TUBE 7.50" oCells.Item(8, 4) = 7.50 oCells.Item(8, 5) = "TubeLen750" oCells.Item(8, 6) = MastNo & "05" ' Row 8 values... oCells.Item(9, 1) = "5033607" oCells.Item(9, 2) = "5033607" oCells.Item(9, 3) = "INTERMEDIATE TUBE 8.25" oCells.Item(9, 4) = 8.25 oCells.Item(9, 5) = "TubeLen825" oCells.Item(9, 6) = MastNo & "04" ' Row 9 values... oCells.Item(10, 1) = "5033608" oCells.Item(10, 2) = "5033608" oCells.Item(10, 3) = "INTERMEDIATE TUBE 9.14" oCells.Item(10, 4) = 9.124 oCells.Item(10, 5) = "TubeLen914" oCells.Item(10, 6) = MastNo & "03" ' Row 10 values... oCells.Item(11, 1) = "5033609" oCells.Item(11, 2) = "5033609" oCells.Item(11, 3) = "INTERMEDIATE TUBE 10.0" oCells.Item(11, 4) = 10.00 oCells.Item(11, 5) = "TubeLen10in" oCells.Item(11, 6) = MastNo & "02" Dim oWB oWB = oWorkSheet.Parent oWB.Save oWB.Close
Message 10 of 11
LabMan1
in reply to: LabMan1

OK why does my text run together in this forum? Using IE11
Message 11 of 11
xiaodong_liang
in reply to: LabMan1

Hi,
sorry for the trouble of formatting. It may be caused by an issue of the forum server.

your code looks OK to me. It just opens the excel file and edit the relevant cells, finally saves the excel file. It is not clear to me how to reproduce your problem. Could you add the steps and necessary model files. You can provide the model file with the iLogic code. Thus you would not face the issue of formatting.

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

Post to forums  

Autodesk Design & Make Report