Acessing iProperties from VB

Acessing iProperties from VB

Anonymous
Not applicable
628 Views
1 Reply
Message 1 of 2

Acessing iProperties from VB

Anonymous
Not applicable

I am brand new to both iLogic and MS Visual Studio 2010 Express. I am trying to find out how to access iProperties from VB. What I want to do is create a dialogue box in MS VS that has checkboxes and combo lists that will allow a user to change many iProperties at once instead of having to wade through a long series of dialogue boxes for individual iLogic rule dialogues. Specifically, I want to access the list of Materials that we created in our Style Library and display this list in a combo box so the user can select a specific material. Something like:

 

Public Class dlgCase

    Public Parameter As IParamDynamic

    Public MultiValue As IMultiValueParam

    Public ILogicVB As ILowLevelSupport

    Public vbMat As String

    Public vbMatList As ArrayList

 

Private Sub MAT_ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MAT_ComboBox1.SelectedIndexChanged

        vbMatList = ?????

        For Each vbMat_val As String In vbMatList

            MAT_ComboBox1.Items.Add(vbMat_val)

        Next

        MAT_ComboBox1.Text = vbMat

    End Sub

 

I know this is probably way wrong and violates any number of best programming practices, but I have to start somewhere. How do I assign the materials list from Inventor Style Library to the vbMatlist array where arll the question marks are (if this is the way to do it)?

Any help greatly appreciated!

Mike

0 Likes
629 Views
1 Reply
Reply (1)
Message 2 of 2

MjDeck
Autodesk
Autodesk

You can access the iLogic iProperties object (which includes materials) by adding this line to your dialog source file:

 

Public iProperties as IiProperties

 

The following code should work (if you change some of the names)

 

	Public iLogicVb As ILowLevelSupport
	Public iProperties As IiProperties

	Private Sub Dialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		For Each material In iProperties.Materials
			ComboBox1.Items.Add(material)
		Next
		ComboBox1.Text = iProperties.Material
	End Sub

	Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
		iProperties.Material = ComboBox1.Text
		iLogicVb.DocumentUpdate()
	End Sub

 

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes