Author Topic: Challenge ( Kind of ) Arc Entmake Data  (Read 9012 times)

0 Members and 1 Guest are viewing this topic.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #15 on: April 10, 2010, 02:15:27 PM »
Its much more easy with .NET

Code: [Select]
private void MakeArc(Point3d p1, Point3d p2, Point3d p3)
{
    Database db = HostApplicationServices.WorkingDatabase;
    using (Transaction tr = db.TransactionManager.StartTransaction())
    {
        CircularArc3d arc = new CircularArc3d(p1, p2, p3);
        BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
        Arc a = new Arc(arc.Center, arc.Radius, arc.StartAngle, arc.EndAngle);
        btr.AppendEntity(a);
        tr.AddNewlyCreatedDBObject(a, true);
        tr.Commit();
    }
}
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #16 on: April 10, 2010, 02:17:23 PM »
Where's the fun in that...  :evil:

See below on the bold letters, is there    :evil:
Code: [Select]
(de[b]fun[/b] c:arc3pts (/ p1 p2 p3)
(setq p1 (getpoint "\nStart point: ")
      p3 (getpoint "\nMid point: ")
      p2 (getpoint "\nEnd point: "))
(vl-cmdf "_.ARC" p1 p3 p2) (princ))

Haha, very funny  :-D

LE3

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #17 on: April 10, 2010, 02:25:46 PM »
forgot to use quote instead of code to show it right :)

I made in the way past 18 new method to draw arcs, if I get a permit will try to post them, but you guys are way to smart - that do not need anything  :wink:

Quote
Haha, very funny  :-D
« Last Edit: April 10, 2010, 02:29:28 PM by LE3 »

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #18 on: April 10, 2010, 02:35:49 PM »
but you guys are way to smart - that do not need anything  :wink:

Thanks Luis, but honestly - Gile is leaps and bounds ahead of me, I always learn a great deal from him.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #19 on: April 10, 2010, 03:01:51 PM »
Okay,  that makes sense now.  Thanks!  -David
R12 Dos - A2K

hermanm

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #20 on: April 10, 2010, 03:35:49 PM »

 if I get a permit will try to post them


What's this about a "permit," Luis?

Did I miss something?    :?

LE3

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #21 on: April 10, 2010, 04:11:58 PM »
did those for someone else... was a paid stuff. :)


 if I get a permit will try to post them


What's this about a "permit," Luis?

Did I miss something?    :?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #22 on: April 10, 2010, 04:22:52 PM »
Another version using code from Evgeniy & Gile
Code: [Select]
;;  Points Start, along,& end of the arc
(defun Arc3pt (ps pm pe / r cen tmp)
  (defun clockwise-p (p1 p2 p3) ; gile
    (< (sin (- (angle p1 p3) (angle p1 p2))) -1e-14)
  )
  (if (clockwise-p ps pm pe)
    (setq tmp ps ps pe pe tmp)
  )
  (setq cen (polar pe  ; Evgeniy
              (+ (angle pe pm)
(setq r (- (angle ps pe) (angle ps pm)))
(* pi -0.5)
      )
              (setq r (/(distance pm pe) (sin r) 2.))
       ))
  (setq r  (abs r))

  (entmakex
    (list (cons 0 "ARC")
               (cons 6 "BYLAYER")
               ;(cons 8 "0")
               (cons 10 cen) ;*** Center point (in OCS)
               (cons 40 r) ;*** Radius
               (cons 50 (angle cen ps)) ;*** Start angle
               (cons 51 (angle cen pe)) ;*** End angle
               ))
  (princ)
  )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #23 on: April 10, 2010, 04:35:46 PM »
There's a tool I don't know the English name wich use this property to draw radius and/or find the center of round pieces of wood or iron.
Here's how it looks and how it works:
Speaking English as a French Frog

LE3

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #24 on: April 10, 2010, 04:40:21 PM »
There's a tool I don't know the English name
what's the name in French?

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #25 on: April 10, 2010, 04:48:25 PM »
the french name is: équerre à centrer it's mostly used by turners.
« Last Edit: April 10, 2010, 04:51:27 PM by gile »
Speaking English as a French Frog

LE3

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #26 on: April 10, 2010, 04:52:45 PM »
the french name is: équerre à centrer it's mostly used by turners.

maybe something like:
supported to the center... bracket to center

:)

 :-o
hmmm.... I see that it is an instrument
the square = équerre
« Last Edit: April 10, 2010, 04:57:56 PM by LE3 »

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #27 on: April 10, 2010, 05:02:17 PM »
'bracket to center' is what google translator gives.

IMO litteral translation should rather be 'set-square to center'
Speaking English as a French Frog

LE3

  • Guest
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #28 on: April 10, 2010, 05:06:19 PM »
'bracket to center' is what google translator gives.

IMO litteral translation should rather be 'set-square to center'
Yes, it makes sense.

That can be a good candidate for a custom object, btw. or maybe with these new parametric features or as a dynamic block.... don't know.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Challenge ( Kind of ) Arc Entmake Data
« Reply #29 on: April 10, 2010, 05:08:29 PM »
Some other designs:


Speaking English as a French Frog