.NET

Reply
Valued Contributor
62 Posts
0 Kudos
Registered: ‎06-21-2010
Post 1 of 25

how to fillet line and arc?

1069 Views, 24 Replies
07-19-2010 09:25 PM

is there a way to do that programatically? fillet a line and arc

Valued Mentor
305 Posts
2 Kudos
Registered: ‎01-26-2005
Post 2 of 25

Re: how to fillet line and arc?

07-19-2010 09:42 PM in reply to: mpropst

Yes, but not directly. You have to find the intersection points and then

calculate the new endpoints, and either replace the existing entities with

new ones, or manipulate the existing ones using the methods of the

Curve class (e.g, Extend(), GetSplitCurves(), and so on).

 

 



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


*Expert Elite*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 3 of 25

Re: how to fillet line and arc?

07-20-2010 03:54 AM in reply to: mpropst

Try CommandLine class from there:

 

http://www.caddzone.com/CommandLine.cs

 

it's likes me more :smileyhappy:

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Valued Contributor
62 Posts
0 Kudos
Registered: ‎06-21-2010
Post 4 of 25

Re: how to fillet line and arc?

07-20-2010 05:58 AM in reply to: Hallex

l'll try and figure how to use a c# class in a vbnet app.

the manual calcs are making me feel stupid

:-)

*Expert Elite*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 5 of 25

Re: how to fillet line and arc?

07-20-2010 06:03 AM in reply to: mpropst

Sorry, I don't knew that you use VB.NET

 

Try handle this class instead:

 

http://www.caddzone.com/CommandLine.vb

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Valued Contributor
62 Posts
0 Kudos
Registered: ‎06-21-2010
Post 6 of 25

Re: how to fillet line and arc?

07-20-2010 06:10 AM in reply to: caddzone

hmmm, i'm not seeing it

i imported .Geometry

 

Dim oCurve As Curve2d
'cast arc to curve

    oCurve = CType(oArc3, Curve2d)

I don't get an .Extend method on the oCurve object

what am i missing?

(other than a brain)

:-)

thanks

mark

 

Valued Contributor
62 Posts
0 Kudos
Registered: ‎06-21-2010
Post 7 of 25

Re: how to fillet line and arc?

07-20-2010 06:17 AM in reply to: Hallex

oh, thanks

Valued Contributor
62 Posts
0 Kudos
Registered: ‎06-21-2010
Post 8 of 25

Re: how to fillet line and arc?

07-20-2010 06:23 AM in reply to: Hallex

Do you have a sample of it's use?

i'll search this group too.

*Expert Elite*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 9 of 25

Re: how to fillet line and arc?

07-20-2010 06:26 AM in reply to: mpropst

I have already wrote similar one few moons ago

Still searching in my codes but with no luck yet :smileysad:

 

~'J'~

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
*Expert Elite*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 10 of 25

Re: how to fillet line and arc?

07-20-2010 06:55 AM in reply to: mpropst

Huray, have found it in my garbage

Unfortunatelly it's on C# only

I'm pretty sure you could rewrite the code on VB.NET

(change AllowedType to arc and line)

 

        /// <summary>
        ///                     * FILLET LINES *
        /// </summary>
        [CommandMethod("filletlines", CommandFlags.UsePickSet | CommandFlags.Redraw)]
        public static void FL()
        {
            Database db = HostApplicationServices.WorkingDatabase;

            Document doc = acadApp.DocumentManager.MdiActiveDocument;

            Editor ed = doc.Editor;

            Transaction tr = db.TransactionManager.StartTransaction();

            using (tr)
            {
                try
                {
                    // Prompt for the fillet radius

                    PromptDoubleOptions pdo = new PromptDoubleOptions("\nEnter the fillet radius: ");
                    pdo.AllowZero = false;

                    pdo.AllowNegative = false;

                    pdo.AllowNone = false;

                    PromptDoubleResult pdr = ed.GetDouble(pdo);

                    if (pdr.Status != PromptStatus.OK)

                        return;

                    double rad = pdr.Value;

                    // Prompt for the lines to fillet

                    PromptEntityOptions peo = new PromptEntityOptions("\nSelect first line:");
                    peo.SetRejectMessage("\nSelect lines only");

                    peo.AddAllowedClass(typeof(Line), true);

                    PromptEntityResult per = ed.GetEntity(peo);

                    if (per.Status != PromptStatus.OK)

                        return;

                    ObjectId fid = per.ObjectId;

                    peo.Message = "\nSelect second line:";

                    per = ed.GetEntity(peo);

                    if (per.Status != PromptStatus.OK)

                        return;

                    ObjectId sid = per.ObjectId;

                    ObjectId[] ids = new ObjectId[2];

                    ids[0] = fid;

                    ids[1] = sid;

                    DBObject obj1 = tr.GetObject(fid, OpenMode.ForWrite);

                    DBObject obj2 = tr.GetObject(sid, OpenMode.ForWrite);

                    acadApp.SetSystemVariable("FILLETRAD", rad);

                    acadApp.SetSystemVariable("CMDECHO", 0);

                    ResultBuffer buf = new ResultBuffer();

                    buf.Add(new TypedValue(5005, "_FILLET"));

                    buf.Add(new TypedValue(5006, fid));

                    buf.Add(new TypedValue(5006, sid));

                    acedCmd(buf.UnmanagedObject);

                    buf.Dispose();

                    acadApp.SetSystemVariable("CMDECHO", 1);

                    tr.Commit();
                }

                catch (Autodesk.AutoCAD.Runtime.Exception ex)
                {
                    ed.WriteMessage(ex.Message + "\n" + ex.StackTrace);
                }
            }
        }

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!