Recent Posts

Pages: 1 ... 8 9 [10]
Layers / Load base or custom linetypes
« Last post by fixo on February 14, 2013, 06:40:08 PM »
This code allow user to load both linetypes from "acad.lin" or "acadiso.lin" file
and from the custom linetype file,
see attachment, both C# and VB.NET code included
AutoCAD talk / Re: Autoload dll from a personal folder
« Last post by (gile) on February 13, 2013, 10:29:59 PM »

As far as I know, you cannot use the autoloader from a different folder of those provided by Autodesk:
- %appdata%\Autodesk\ApplicationPlugins
- %programfiles%\Autodesk\ApplicationPlugins
- %programdata%\Autodesk\ApplicationPlugins

If you have rights to write in the registry, you can register your application:
AutoCAD talk / Autoload dll from a personal folder
« Last post by madmat on February 13, 2013, 08:30:39 PM »

I'm searching how to load my .Net dll via the autoloader method, but from a folder on my d:\ drive (second partition).
I managed to get it loaded from a local path (C:\Program Files\Autodesk\ApplicationPlugins\Capacites.bundle\) with xml file. That works fine.
But at work I'm not administrator anymore, and if I have to copy some files on my hard drive, I have to do it on d:\

So... my question :
Is there any way to tell Autocad to watch any self-defined path at startup for personal plugins, and to load them automatically?
I've tried "Autoloadpath" but it didn't work for me (It's maybe only a path for vba and lisp applications).

Does anybody have an idea?
This site / Re: MockFlow is a wireframing suite for user interface design
« Last post by cherly77 on February 13, 2013, 02:12:28 PM »
Excellent forum, Thnkx for uploading the important material. I found it useful. Best regards !!
Dimensions / Extend leader to selected curve
« Last post by fixo on February 05, 2013, 11:50:26 AM »
Code: [Select]
        public void testLeaderExtend()
            // Get active document and database
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            // Prompt the user to select a leader.
            PromptEntityOptions pso = new PromptEntityOptions("\nPlease select a leader ");
            pso.SetRejectMessage("\nSelect leader only ");
            pso.AddAllowedClass(typeof(Leader), false);
            PromptEntityResult res = ed.GetEntity(pso);
            if (res.Status != PromptStatus.OK) return;
            // Prompt the user to select a curve.
            PromptEntityOptions pno = new PromptEntityOptions("\nPlease select a single curve to extend leader to: ");
            pso.SetRejectMessage("\nSelect curve only ");
            pso.AddAllowedClass(typeof(Curve), false);
            PromptEntityResult nres = ed.GetEntity(pno);
            if (nres.Status != PromptStatus.OK) return;

            using (Transaction tr = db.TransactionManager.StartTransaction())
                // open current space for write to modify leader
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                ObjectId ldid;
                ldid = res.ObjectId;
                ObjectId crid;
                crid = nres.ObjectId;
                Leader leader = tr.GetObject(ldid, OpenMode.ForRead) as Leader;
                if (leader == null) return;
                Point3d arrPt = leader.VertexAt(0);
                ed.WriteMessage("\nPoint on arrow:\t({0:f3}\n", arrPt);
                Curve curv = tr.GetObject(crid, OpenMode.ForRead) as Curve;
                if (curv == null) return;
                // Get point on curve
                Point3d nearPt = curv.GetClosestPointTo(nres.PickedPoint, false).TransformBy(Matrix3d.Identity);
                ed.WriteMessage("\nPoint on line:\t({0:f3}\n", nearPt);
                leader.SetVertexAt(0, nearPt);
                // Commit transaction
DesignScript / Benefits Of Using Dropshipper Reviews
« Last post by Wholesaler1 on February 03, 2013, 04:08:41 PM »
A dropshipper is a person or company who will earn a commission by passing orders on to the actual manufacturer of a product. Such a person or company can be a retailer or an agent. The goods ordered by the customer will be directly drop shipped from the manufacturer to their home. As a result, the agent will not have to keep diversified stock of the inventory.
Tables / Create block table summary
« Last post by fixo on February 03, 2013, 12:48:27 PM »
The code is similar on command ATTOUT,
start command with 'CRAT' in the command line,
please use second attached file, because first one have a bug
when just one block selected on screen
Selection sets / Re: Selection Ordinate Dimensions with Filter (dxf code)
« Last post by madmat on February 03, 2013, 12:13:07 PM »
Thanx Gile for your answers, I've tried your last solution and it's working fine.
Selection sets / Re: Selection Ordinate Dimensions with Filter (dxf code)
« Last post by (gile) on February 02, 2013, 03:36:48 PM »
The upper method isn't very strict, even it will work fine with ordinate dimensions because it uses a bitwise test on values wich aren't binary codes: it will work with 6, 5 (3 points angular dimensions), 3 (diameter dimension) but not with 4, 2, 1 or 0.

Another way, better in my opinion, is to combinate a classical selection filter and a Editor.SelectionAdded event handler to filter the selected objects.

Code: [Select]
        public void test()
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

            TypedValue[] filter = { new TypedValue(0, "dimension"), new TypedValue(3, "ISO-25") };

            ed.SelectionAdded += ed_SelectionAdded;
            PromptSelectionResult psr = ed.GetSelection(new SelectionFilter(filter));
            ed.SelectionAdded -= ed_SelectionAdded;
            if (psr.Status != PromptStatus.OK) return;

        void ed_SelectionAdded(object sender, SelectionAddedEventArgs e)
            for (int i = 0; i < e.AddedObjects.Count; i++)
                if (e.AddedObjects[i].ObjectId.ObjectClass.Name != "AcDbOrdinateDimension")

Code: [Select]
        <CommandMethod("Test")> _
        Public Sub test()
            Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

            Dim filter As TypedValue() = { New TypedValue(0, "dimension"), new TypedValue(3, "ISO-25") }

            AddHandler ed.SelectionAdded, AddressOf ed_SelectionAdded
            Dim psr As PromptSelectionResult = ed.GetSelection(New SelectionFilter(filter))
            RemoveHandler ed.SelectionAdded, AddressOf ed_SelectionAdded
            If psr.Status <> PromptStatus.OK Then
            End If
        End Sub

        Private Sub ed_SelectionAdded(sender As Object, e As SelectionAddedEventArgs)
            For i As Integer = 0 To e.AddedObjects.Count - 1
                If e.AddedObjects(i).ObjectId.ObjectClass.Name <> "AcDbOrdinateDimension" Then
                End If
        End Sub
Selection sets / Re: Selection Ordinate Dimensions with Filter (dxf code)
« Last post by (gile) on February 02, 2013, 02:27:08 PM »

Look at the 70 dxf group.

Code: [Select]
TypedValue[] tvs = {
    new TypedValue(0, "dimension"),
    new TypedValue(3, "ISO-25"),
    new TypedValue(-4, "&="),
    new TypedValue(70, 6)};

SelectionFilter filter = new SelectioFilter(tvs);

PromptSelectionResult psr = ed.GetSelection(filter);
Pages: 1 ... 8 9 [10]