Assigning Material via iLogic and MS Visual Studio 2010 Express

Assigning Material via iLogic and MS Visual Studio 2010 Express

Anonymous
Not applicable
1,534 Views
3 Replies
Message 1 of 4

Assigning Material via iLogic and MS Visual Studio 2010 Express

Anonymous
Not applicable

I have managed to create a form in MS Visual Studio 2010 Express with a simple combo box that is called from an iLogic rule in INV 2011 (SP1). This combo box is then populated with a list generated from the iProperties Materials. MS VS is set to compile for .NET Framework 3.5

When I run the rule, I always get this error message:

 

"Object Reference not set to an instance of an Object"

 

The details of this error message are not clear to me - WHAT object is not having an instance set???

 

I can accept the error and the part in the ipt file is duly changed to the material I selected in the combo box, but I cannot get the error to go away.

 

The offending code in the VB project seems to be following:

 

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

iProperties.Value = "Design Tracking Properties", "Material") = ComboBox1.Text 

iProperties.Material = ComboBox1.Text

ILogicVB.Document Update()

End Sub

It may also be possible that "Design Tracking Properties" is not correct. I have included in the attached zip file a screen shot of the error message, the ipt file with embedded iLogic Rule, and the entire Combo_MAT_Test project complete with compiled Comb-MAT_Test.dll (in the bin/Release sub folder) that is being called from the iLogic rule.

I am just beginning in both iLogic and VB, so slowly, please! Any help greatly appreciated!!

Thanks

Mike

Win7 Pro 64 bit, MS Office 2010 

 

0 Likes
1,535 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

This may be the blind leading the blind, but here goes! Smiley Surprised

I didn't look at your files, but I think you're right about the design tracking properties.

Here are a couple of lines that may be of help, that I use in iLogic to set materials:

 

 

'read the available materials from the part file and populate the Multi-Value parameter list
MultiValue.List("Materials_List") = iProperties.Materials

'set the material iProperty using the list box selection
iProperties.Material= InputListBox("Select a Material", MultiValue.List("Materials_List"), iProperties.Material , Title := "Materials", ListName := "List of Materials")

 

 

 

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you for your reply. However, I am not using an iLogic dialog with a multi-value list box to set the property value, that value is being pased from the VB form dll to the iLogic Rule code. The reason for this is that eventually my dialog will be much more robust with many more choices such as material thicknesses, sizes, profiles, etc - I need to be able to set these all in one dialog box instead of multiple pop-up dialogs that would be generated thru the use of strictly INV Rules, and the only way I can see to do this is

to design the form in VB. See attached screen shot of the anticipated dialogPedestal Dialog.jpg

0 Likes
Message 4 of 4

MjDeck
Autodesk
Autodesk

The object that is not being set is ILogicVB in your form code:

Public ILogicVB As ILowLevelSupport

This has to be hooked up to the corresponding object in the iLogic rule.  Add this line to your rule:

dlg.ILogicVB = iLogicVb

 

Here it is in context:

  dlg.iProperties = iProperties
  dlg.ILogicVB = iLogicVb
  Dim i As Integer = dlg.ShowDialog()

 

(Note: if you had used the same upper/lowercase combination as the iLogic name, then the Create Rule for a Dialog wizard would have automatically added this line of code.)

 

This is not related to the error, but in your form code the line:

iProperties.Value("Design Tracking Properties", "Material") = ComboBox1.Text

isn't required.

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes