Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solidworks Add-in to explore the vector files stored on the AMB82-Mini's MicroSD #17

Open
ajsb85 opened this issue Aug 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ajsb85
Copy link
Owner

ajsb85 commented Aug 21, 2023

Solidworks Add-in Development task

@ajsb85 ajsb85 added this to the Version 0.3 milestone Aug 21, 2023
@ajsb85 ajsb85 self-assigned this Aug 21, 2023
@ajsb85 ajsb85 added the enhancement New feature or request label Aug 21, 2023
@ajsb85
Copy link
Owner Author

ajsb85 commented Aug 21, 2023

xCAD.NET is a framework for building CAD agnostic applications. It allows developers to implement complex functionality with a very simple innovative approach. This brings the best user experience to the consumers of the software.

It has never been easier to create SOLIDWORKS add-ins with toolbar and menu commands.

[ComVisible(true)]
public class MyAddIn : SwAddInEx
{
    public enum Commands_e
    {
        Command1,
        Command2
    }

    public override void OnConnect()
    {
        this.CommandManager.AddCommandGroup<Commands_e>().CommandClick += OnCommandsButtonClick;
    }
    
    private void OnCommandsButtonClick(Commands_e cmd)
    {
        //TODO: handle the button click
    }
}

Framework reinvents the way you work with Property Manager Pages. No need to code a complex code behind for adding the controls and handling the values. Simply define your data model and the framework will build the suitable Property Manager Page automatically and two-way bind controls to the data model.

public class MyPMPageData
{
    public string Text { get; set; }
    public int Number { get; set; }
    public ISwComponent Component { get; set; }
}

private ISwPropertyManagerPage<MyPMPageData> m_Page;
private MyPMPageData m_Data = new MyPMPageData();

private enum Commands_e
{
    ShowPmpPage
}

public override void OnConnect()
{
    m_Page = this.CreatePage<MyPMPageData>();
    m_Page.Closed += OnPageClosed;
    this.CommandManager.AddCommandGroup<Commands_e>().CommandClick += ShowPmpPage;
}

private void ShowPmpPage(Commands_e cmd)
{
    m_Page.Show(m_Data);
}

private void OnPageClosed(PageCloseReasons_e reason)
{
    Debug.Print($"Text: {m_Data.Text}");
    Debug.Print($"Number: {m_Data.Number}");
    Debug.Print($"Selection component name: {m_Data.Component.Name}");
}

Complex macro features became ease with xCAD.NET

[ComVisible(true)]
public class BoxMacroFeature : SwMacroFeatureDefinition
{
    public override CustomFeatureRebuildResult OnRebuild(ISwApplication app, ISwDocument model, ISwMacroFeature feature)
    {
        var body = app.MemoryGeometryBuilder.CreateSolidBox(new Point(0, 0, 0),
            new Vector(1, 0, 0), new Vector(0, 1, 0),
            0.1, 0.1, 0.1);

        return new CustomFeatureBodyRebuildResult()
        {
            Bodies = body.Bodies.ToArray()
        };
    }
}

Watch the video demonstration of xCAD in action.

Visit User Guide page and start exploring the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant