GithubHelp home page GithubHelp logo

xzgboxer / xcad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xarial/xcad

0.0 0.0 0.0 7.11 MB

Framework for developing CAD applications for SOLIDWORKS, including add-ins, stand-alone applications, macro features, property manager pages, etc.

Home Page: https://xcad.net

License: MIT License

C# 99.97% PowerShell 0.03%

xcad's Introduction

Logo xCAD.NET

Base NuGet version (xCAD.Base) Build status---Toolkit NuGet version (xCAD.Toolkit)Build status---SOLIDWORKS NuGet version (xCAD.SolidWorks) Build status

SOLIDWORKS API development made easy

User Guide Examples

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.

xcad's People

Contributors

artem1t avatar eddyalleman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.