Recent Posts

Pages: 1 ... 8 9 [10]
91
AutoCAD talk / Autoload dll from a personal folder
« Last post by madmat on February 13, 2013, 08:30:39 PM »
Hi,

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?
92
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 !!
93
Dimensions / Extend leader to selected curve
« Last post by fixo on February 05, 2013, 11:50:26 AM »
 
Code: [Select]
       [CommandMethod("Lex")]
        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.UpgradeOpen();
                leader.SetVertexAt(0, nearPt);
                leader.RecordGraphicsModified(true);
                // Commit transaction
                tr.Commit();
            }
        }
94
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.
95
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
96
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.
97
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.

C#
Code: [Select]
        [CommandMethod("Test")]
        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;
            ed.SetImpliedSelection(psr.Value);
        }

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

VB
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
                Return
            End If
            ed.SetImpliedSelection(psr.Value)
        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
                    e.Remove(i)
                End If
            Next
        End Sub
98
Selection sets / Re: Selection Ordinate Dimensions with Filter (dxf code)
« Last post by (gile) on February 02, 2013, 02:27:08 PM »
Hi,

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);
99
Selection sets / Selection Ordinate Dimensions with Filter (dxf code)
« Last post by madmat on February 01, 2013, 11:15:43 PM »
Hello,

I need your help... (my problem is on the 3rd "MyParam.Setvalue" line)
I try to make a SelectionSet with Filter, in order to have only Ordinate Dimensions in my SelectionSet.
I've done following, but the "100" dxfCode doesn't seem to work (but the 2 other do).

-----------------
Dim MyParam(2) As TypedValue
MyParam.SetValue(New TypedValue(0, "Dimension"), 0)
MyParam.SetValue(New TypedValue(DxfCode.DimStyleName, "ISO-25"), 1)
MyParam.SetValue(New TypedValue(100, "AcDbOrdinateDimension"), 2)  '<-This one doesn't seem to work...

Dim MyFilter As SelectionFilter = New SelectionFilter(MyParam)

Dim PSR As PromptSelectionResult = myEd.GetSelection(MyFilter)
-----------------


I've tried to write "DxfCode.Subclass" instead of "100" but the result was the same.
When I type "(entget(car(entsel)))" in Autocad, I find "AcDbOrdinateDimension" for the 100 dxfCode.
Does anybody know what to do?
Is there maybe another way to filter this selection?
100
This site / Re: Welcome on the AutoCAD .NET developpers forums
« Last post by bcinnv on February 01, 2013, 04:42:21 AM »
Hello!
Pages: 1 ... 8 9 [10]