predefined list of vendors

predefined list of vendors

stefan.godfroid
Participant Participant
693 Views
8 Replies
Message 1 of 9

predefined list of vendors

stefan.godfroid
Participant
Participant
How can I create a predefined list of vendors from which you can choose when you create a purchase component?
0 Likes
694 Views
8 Replies
Replies (8)
Message 2 of 9

MechMachineMan
Advisor
Advisor

Apply this to a global trigger for either Part Documents or All Files; triggering on "On New Document" or whatever you so desire.

 

Sub Main()
	If ThisDoc.Document.DocumentType = kPartDocumentObject
             ThisDoc.Document.PropertySets("Design Tracking Properties")("Vendor").Value = SelectVendor()
        End if
End Sub

Function SelectVendor()	As String

        Dim oList As New List(Of String)
        
        oList.Add("Michael's Car Shop")
        oList.Add("<CUSTOM>")
	oList.Add("<NONE>")	

	oListSelection = InputListBox("Select the Vendor For this Part" _
	                          ,oList, "")

	If oListSelection = "" Or oListSelection = "<NONE>" Then
		MsgBox("No Vendor Selected!" & vbLf & vbLf & "Leaving Blank!")
		oListSelection = ""
	End If

        If oListSelection = "<CUSTOM>" Then
             oListSelection = InputBox("Enter Custom Vendor Number!", "VendorHelper", "<CUSTOM>")
        End if

        Return oListSelection
End Function

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

stefan.godfroid
Participant
Participant

Thank you for response.

 

Can it be done frome a drop down menu in the ribbon?

0 Likes
Message 4 of 9

MechMachineMan
Advisor
Advisor

When people are solving problems for ya, it's usually nice to know if they're actually solving the right problem or just a tiny irrelevant portion.

 

The code to create a drop down is very different than what I have posted here.

 

Next time, it's better to post a detailed description of what you want to end up with, rather than a vague statement so that people don't solving one problem only to find out the actual thing you wanted was different.


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

stefan.godfroid
Participant
Participant

My apologies for this. My knowledge of Ilogic is still minimal.  I'm also new here on this forum.


I'm going to formulate it differently.
I have a predefined list of suppliers and manufacturers.
If I have a part or assembly that has to be a purchased part. For example, I enter the purchase part data (123456 DFM-80-200-PPV-A).
And then I want to choose the right supplier and manufacturer from a drop down menu and let both data automatically fill in the properties of the part / assembly.
Supplier and manufacturer is a custom property that I have already created in the part / assembly template.
Each manufacturer has a corresponding supplier.

 

Below a short list. The real list is much longer (80 manufacturers)

 

Manufactur                               Supplier

ELESA                                        SHAKE HANDS

FESTO                                        FESTO BELGIUM NV

NTN                                           IMES DEXIS NV

SMC                                          S.M.C. PNEUMATICS NV

SNR                                           IMES DEXIS NV

TURCK                                       MULTIPROX NV

 

If I select a manufacturer, it must be possible to automatically fill the corresponding supplier into the custom properties.
Also, it should be possible for me to select the supplier separately (manufacturer will remain empty). Of course, via a drop down menu.

 

So:
1) 2 drop down menus in the ribbon: manufacturer and supplier
2) The 2 drop down menus contain predefined data
3) If I select a manufacturer, the corresponding supplier must be selected automatically. (Each manufacturer has a supplier)
4) It should also be possible to select the supplier only, manufacturer remains empty.
5) Automatically fill in the selected data in the custom properties of the part / assembly

 

Also, there must be a possibility that the properties should remain empty (for parts that are not purchased parts)

 

0 Likes
Message 6 of 9

MechMachineMan
Advisor
Advisor

Now we are getting somewhere!

 

So wanting dropdown boxes on the ribbon means you either need to develop it as an add-in, or have code run on an event trigger to add the dropdowns to the ribbon.

 

An easier way would be to have a iLogic rule that brings up a form on save and allows the user to select the information from a form. How does this sound?


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

stefan.godfroid
Participant
Participant

A drop down menu is preferred.  Because not alle parts are purchased parts with a manufacture and supplier.

0 Likes
Message 8 of 9

MechMachineMan
Advisor
Advisor

Are there any other Properties that act as 'flags' to know if a part is purchased or not? You could always just make the supplier/manufacturer information only pop up on purchased files. 


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

stefan.godfroid
Participant
Participant

Yes, there is one:

A custom property "tekeningcode".  When this value is "K", then this part is a purchased part.

0 Likes