SQLite for autoLisp

I've made a build of my SQLite for Autolisp routine for V12, here is the link

 

http://www.cadext.com/downloads/SQLiteLsp.zip

 

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.

 

SQLiteLsp is a BRX module with the SQLite engine embedded inside,  it's a crazy fast database for  lisp

 

Enjoy

Comments

  • Would love to check this out... but I would have to download and install bricscad for windows, just to do that :(

    Do you have any plans releasing this for Linux, too?

  • Hi Daniel,

    thanks for the tools you are offering to the Bricsacd community...!

    You could propably answer as a developer my question....(i have posted it in the developer forum as well)

    Is it possible to access via BREP API + C# .NET- the Face/Edge Subentities of a 3D solid ????

    I am testing the BREP API of V12   TD_MgdBrep.dll   as exposed to .NET !

    The following simple C# command colorates all faces of a 3D ACIS Solid3D  in AutoCAD

    by accessing the subentity IDs of the Faces (or Edges).

    The Autocad Lines are out-commended and replaced with the V12 lines in red ...

    /*
    using System;
    using System.Collections.Generic;
    using System.IO;
    using Autodesk.AutoCAD.ApplicationServices;
    using Autodesk.AutoCAD.Runtime;
    using Autodesk.AutoCAD.DatabaseServices;
    using Autodesk.AutoCAD.Geometry;
    using Autodesk.AutoCAD.EditorInput;
    using Autodesk.AutoCAD.Colors;
    using Autodesk.AutoCAD.BoundaryRepresentation;
    */


    // system
    using System;
    using System.Text;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Runtime.InteropServices;
    using System.IO;


    // ODA
    using Teigha.Runtime;
    using Teigha.DatabaseServices;
    using Teigha.Geometry;
    using Teigha.BoundaryRepresentation;
    using Teigha.Colors;

    // Bricsys
    using Bricscad.ApplicationServices;
    using Bricscad.Runtime;
    using Bricscad.EditorInput;


    // alias
    using _AcAp = Bricscad.ApplicationServices;
    using _AcDb = Teigha.DatabaseServices;
    using _AcGe = Teigha.Geometry;
    using _AcEd = Bricscad.EditorInput;


    namespace ColorateSolidFaces
    {
        public class Commands
        {
            [CommandMethod("CSF")] //ColorateSolidFaces

            public void FacesColor()
            {

                Document doc = Application.DocumentManager.MdiActiveDocument;
                Database db = doc.Database;
                Editor ed = doc.Editor;


                PromptEntityOptions peo = new PromptEntityOptions("\nSelect a 3D solid: ");
                peo.SetRejectMessage("\nInvalid selection...");
                peo.AddAllowedClass(typeof(Solid3d), true);
                PromptEntityResult per = ed.GetEntity(peo);

                if (per.Status != PromptStatus.OK)

                    return;

                 using (Transaction Tx = db.TransactionManager.StartTransaction())
                {

                    Solid3d solid = Tx.GetObject(per.ObjectId, OpenMode.ForWrite) as Solid3d;
                    //ObjectId[] ids = new ObjectId[] { solid.ObjectId };

                    // Autocad !
                    // FullSubentityPath path = new FullSubentityPath(ids, new SubentityId(SubentityType.Null, IntPtr.Zero));

                    List<SubentityId> SubentIds = new List<SubentityId>();

                    // Build the BRep topology object that will be traversed.

                    // Autocad !
                    //using (Brep brp = new Brep(path))

                    using (Brep brp = new Brep(solid))
                    {

                        // SubentityID not yet implemented ! ???

                        foreach (Teigha.BoundaryRepresentation.Face face in brp.Faces)
                        {
                            SubentIds.Add(face.SubentityPath.SubentId);
                        }
                    }
                    short colorIdx = 1;

                    foreach (SubentityId subentId in SubentIds)
                    {
                        Color color = Color.FromColorIndex(ColorMethod.ByColor, ++colorIdx);
                        solid.SetSubentityColor(subentId, color);


                    }

                    Tx.Commit();
                }
            }
        }

    }

    As seen, I cannot use Subentity paths because there is not method Brep(path) to use in the expression
    Brep brp = new Brep(path);

    So i used the existing one Brep(solid)
    The program compiles and net-loads without any Errors but after selecting a Solid
    an error message will be shown :

    Message : Not implemented yet
    Stack Trace: bei Teigha.Runtime.Interop.Check(Int32 returnValue)
                         bei Teigha.BoundaryRepresentation.BrepEntity.get_SubentityPath()...

    etc.
    As expected without Subentitypath Access, no subentity access ???

    Or one could propably use GraphicsMarkers to get subentities ??


    To finalize :
    Is there a way to access Subentities of a Solid3d via  C# .NET and BREP and change their Colors ?

    If it is possible, please show it in a code snippet !

    Many thanks
    Best Regards
    Konstantin

    Heidelberg-Germany

  • Would love to check this out... but I would have to download and install bricscad for windows, just to do that :(

    Do you have any plans releasing this for Linux, too?

    Here is a 'very' beta version for v12b, tested on ubuntu-11.10 compiled on gcc 4.6   : |

    cheers!

    SQLiteLspV12x32.zip

This discussion has been closed.