Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

yes or no custom ipropery

3 REPLIES 3
Reply
Message 1 of 4
j_kleijnjansY73VU
98 Views, 3 Replies

yes or no custom ipropery

Hello everyone,

Can you help me with a solution for my problem.
I would like that when the custom property "Tappen" is "yes" the text Tappen appears in my docable window. Example 1
If "No" is stated

1.png

Tappen then no text appears in the docable window.  Example 2.

2.png

Labels (2)
3 REPLIES 3
Message 2 of 4

If this "Yes / No" parameter will exist in all documents you should add it to your template. Create a "True/False" User Parameter.

 

Once that is done, you can then go into your form and select the "Tappen" property and set the "Enabling Parameter" to your Yes / No parameter.

 

If you would like to use iLogic to control when this "Tappen" parameter is true and false I can help with that too, but you'd need to describe how you would like it to work. 

 

Message 3 of 4

Hi all,

Happy new year

I have here an example of the .ipt I want to use

I am a beginner in programming

Yes I found what went wrong thanks C_Haines_ENG

 

gr Jos

Message 4 of 4

Hi @j_kleijnjansY73VU 

Your code is not prepared for this property, but you need to add code similar to this sample

'Assign x_TappenProp
Dim x_TappenProp = x_PartDoc.PropertySets.Item("Inventor User Defined Properties").Item("Tappen")

If x_TappenProp.Value Then
    Me.lblTappen.Text = "Tappen"
Else
    Me.lblTappen.Text = ""
End If

 

But here are few notes to your code:

  • !!!NEVER!!! use m_InvApp = GetObject(, "Inventor.Application") in your addin. Always pass the reference to the instance you obtained in Activate method. Create property of type Inventor.Application in the form and set this property to the value when you create new instance of this form.
  • It is much better to use UserControl instead of Form as the content of the dockable window.
  • Use AddHandler statement instead of Handles, because you have much better control over the events handling.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report