Retrieving parts informations into Assembly with Ilogic

Retrieving parts informations into Assembly with Ilogic

Anonymous
Not applicable
512 Views
8 Replies
Message 1 of 9

Retrieving parts informations into Assembly with Ilogic

Anonymous
Not applicable

Greetings everyone,

 

I've been looking around for this, although I found small pieces of solutions, mixing them did not work as expected haha.

Anyway here's my situation:

 

I'm currently in a Assembly. I have 3 parts in that said assembly. Thru Ilogic, I need to retrieve the part number and the description of each part into customs properties in the assembly.

 

Text exemple:

 

Assy1:

   - Part1

          a) Part number: XXXX

          b) Description : YYYY

   - Part2

          a) Part number: XXXX

          b) Description: YYYY

   - Part 3

          a) Part number: XXXX

          b) Description: YYYY

 

Thanks a lot

 

G. Thibeault

0 Likes
513 Views
8 Replies
Replies (8)
Message 2 of 9

ADSKDJW4
Alumni
Alumni

Hello GThibeault,

 

I will move this post into the Inventor customization forum as the ILogic questions are better served there to be answered. This is where the customization questions get better visibility.

 

Best Regards,

 

Don Warner

 

0 Likes
Message 3 of 9

MechMachineMan
Advisor
Advisor

Check this out:

 

http://modthemachine.typepad.com/my_weblog/2009/03/accessing-assembly-components.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
0 Likes
Message 4 of 9

Anonymous
Not applicable

Hi,

 

Thanks for the reply. Unfortunately, I've already read that web page and tried the code, and no luck.

 

the command "SET" isn't supported anymore, and the .DisplayName get me an error saying the argument needs to be in between paranthesis...

 

 

0 Likes
Message 5 of 9

MechMachineMan
Advisor
Advisor
The Set command isn't supported directly in iLogic because it is vba style.
Getting rid of the set would make it work perfect.

Try .displayname ()

--------------------------------------
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
0 Likes
Message 6 of 9

Anonymous
Not applicable

Yes I removed the Set.

 

Here's a screenshot of the actual code

 

I tried to enclose the oRefDoc.DisplayName into paranthesis. No error from the console but when I run the rule, nothing happens.

 

 

 

0 Likes
Message 7 of 9

MechMachineMan
Advisor
Advisor
I think the Debug.Print is for use in the Visual Studio/VBA environment.

If you are just coding in inventor, replace that line with

MsgBox(oRefDoc.DisplayName, MsgBoxStyle.OkOnly, "TITLE OF BOX")
or simply MsgBox(oRefDoc.DisplayName)

in order to pop-up a window to see what is happening realtime

--------------------------------------
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 8 of 9

Anonymous
Not applicable

Oh god I look stupid... lolll

 

Well anyway, thank you, it is working so far!! Now I'll try to code the rest in order to achieve my goal!

 

 

0 Likes
Message 9 of 9

MechMachineMan
Advisor
Advisor
Haha it's all good. Coding/ learning to code is definitely a struggle... especially if it is your first programming language as well.

Feel free to ask away if you get caught on anything else! I'm happy to help as long as a see effort being put it and not just someone expecting hand-outs.

--------------------------------------
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
0 Likes