cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.NET Joints - IRuleUIBuilder: Additional possibilities

.NET Joints - IRuleUIBuilder: Additional possibilities

I am currently working with the .NET technology for joints and I find it a very convenient and efficient way to create steel joints. Many thanks to the development team! I also find the functionality of creating the user interface very good. But to create even more user-friendly dialogs, I'm missing a few functions.

 

In the SDK in the document "Joints NET.docx" I read that the functions are still limited, but there are plans to expand them according to user feedback.

So I would like to contribute and make the following suggestions:

 

  1. The ability to hide or disable controls
    Controls should be able to be hidden and deactivated when, for example, a CheckBox is edited or a value is entered in a TextBox.
  2. Additional control: TextBlock(int nPageId, string text)
    It is often helpful just to be able to place a text. (For example for hint texts, or optical separations if I pass no text or only spaces)
  3. Additional control: AddImage(int nPageId, , string resourceDllName, string imageResName)
    Place an image between the controls (in addition to the image on the right side that I define in the BuildRulePage() method)
  4. Input Validation
    Output of an error message if, for example, a value is specified which is not permitted. (System.ComponentModel.DataAnnotations)

 

On point 1: How should this be implemented from the user's point of view?

Let's start with the following constellation:

 

public class MyJoint : IRule
{
        public int CreateHeadPlate { get; set; }
        public double HeadPlateThickness { get; set; }

        public void GetRulePages(IRuleUIBuilder builder)
        {
            //...
            builder.AddCheckBox(1, "Create head plate", nameof(CreateHeadPlate));
            builder.AddTextBox(1, "Head plate thickness", nameof(HeadPlateThickness), typeof(double));
        }
}

 

Instead of adding even more parameters to IRuleUIBuilder's methods, I could imagine working with attributes:

 

public class MyJoint : IRule
{
        public int CreateHeadPlate { get; set; }
        public bool HeadPlateVisibility { get => CreateHeadPlate == 1; }

        [RuleUIVisibility(nameof(HeadPlateVisibility))]
        // OR
        [RuleUIEnabled(nameof(HeadPlateVisibility))]
        public double HeadPlateThickness { get; set; }

        public void GetRulePages(IRuleUIBuilder builder)
        {
            //...
            builder.AddCheckBox(1, "Create head plate", nameof(CreateHeadPlate));
            builder.AddTextBox(1, "Head plate thickness", nameof(HeadPlateThickness), typeof(double));
        }
}

 

On each change, the properties specified in the attributes are retrieved and depending on the return(Boolean) the control is hidden or disabled. In the case of the AddBoltSelector() I would use typePropertyName.

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

Submit Idea  

Autodesk Design & Make Report