Hello
I am customizing a VB.net add-in for the first time.
I downloaded the MyFirstInventorAddin-master tool from AlexFielder “Github” forum.
Now try to adjust this to my wishes. I'm running into the following problem
I cannot read the “Custom Properties” properties
When I read line 1098 I go to the summer properties (image 1)
1098 myiPropsForm.tbRevNo.Text = iProperties.GetorSetStandardiProperty(DocumentToPulliPropValuesFrom, PropertiesForSummaryInformationEnum.kRevisionSummaryInformation, "", "")
When I read line 1100 I have to go to the cusum Properties (fig2) but then I get an error at the moment
Can anyone help me to solve this.
Hi @info
Can you share an image of the error message?
Can you share the code your working with in the editor? Images of code are not useful because you cannot test the code without rewriting it all.
Hello Alan,
This is the error in line 1100
Severity Code Description Project File Line Suppression State Details
Error BC30057 Too many arguments to 'Friend Shared Function SetorCreateCustomiProperty(Doc As Document, PropertyName As String, [PropertyValue As Object = Nothing]) As Object'.
Attached are the files ipropertiesaddinserver.vb and iproperties.vb
Regards Jos
I am just on mobile, so I cannot think through the debugging or be more helpful..
But I have found that separating out whether things exist or not into a separate function was quite valuable to me. Here is a forum post from not long ago.
Hi @wfajber
After looking at this the Enum doesn't look right. As the iproperty is user defined the Enum might not exist so you might have to loop through the properties by another method in order to return the custom Enum. But to be honest I have never had to do this so can't offer more advice.
PropertiesForUserDefinedPropertiesEnum Enumerator Description
User Defined Properties, InternalName: {D5CDD505-2E9C-101B-9397-08002B2CF9AE}, Name: Inventor User Defined Properties - This Enum is empty because the user defined properties are not predefined but are end-user created.
Methods
Name | Value | Description |
kDummyUserDefinedProperties | 0 |
We are referring to the linked forum post above.
Yes, the enum is a little funny in the try/catch segment. But for the life of me, I cannot remember if I snipped this from a working rule or did I make it up just as an example of the try/catch structure that I would like to avoid. I am away from the office so I can’t look until next week.
But there is a reason the enum is funny. I have been testing out the functionality of Instance Properties, so I have been hiding properties in the LeafOccurrence. In this manner I have been able to tie specific project numbers or other data to some occurrences, and not to others, even if they are the same part.
The proper iLogic call (from the help file) is
iProperties.InstanceValue("PartX:1", "Side") = "Left" Dim partX1Side = iProperties.InstanceValue("PartX:1", "Side")
So I suspect I was typing from memory. And as I type this, I realize that must be true because I was avoiding using the try/catch so it did not exist in my rule.
Can't find what you're looking for? Ask the community or share your knowledge.