+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Question How to distinguish between Ellipse and Ellipse Arc?

    Registered forum members do not see this ad.

    Hi CADmates,

    how is it possible to recognize an ellipse object is closed (i.e. full ellipse) or open (i.e ellipse arc)?

    Any reply appreciated.
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  2. #2
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,951

    Default

    Code:
    (if 
    (= StartAngle 0)
    (Closed/FullEllipse)
    (Open/EllipseArc)
    )

  3. #3
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,053

    Default

    My approach ...

    Code:
    (vlax-curve-IsClosed (car (entsel "\n Select Ellipse :")))
    If Yes T . nil otherwise

  4. #4
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,951

    Default

    Good one tharwat
    I didint know that one

  5. #5
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,053

    Default

    Quote Originally Posted by pBe View Post
    Good one tharwat
    I didint know that one
    Thank you pBe ,

    I knew these functions which are start with vlax-curve-****** when I was fighting with Polylines to know how to handle them .

    So no chance to forget them anymore .

    Cheers .

  6. #6
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    pBe and Tharwat,
    thank you very much for your help.
    Meanwhile I researched inside Ellipse and Ellipse Arc lists. I found a dxf code inside them which shows whether ellipse is closed or not.

    The advantage of the following code is filtering them automatically or on the fly (when selecting objects).

    Code:
    (setq ellipses 
      (ssget "X"
        (list
          (cons -4 "<AND")
            (cons 0 "ELLIPSE")
            (cons 41 0)
          (cons -4 "AND>")
        )
       )
     )
    
    (setq ellipsearcs 
      (ssget "X"
        (list
          (cons -4 "<AND")
            (cons 0 "ELLIPSE")
            (cons -4 "<NOT")
              (cons 41 0)
            (cons -4 "NOT>")
          (cons -4 "AND>")
        )
      )
    )
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  7. #7
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,951

    Default

    That is correct though

    Code:
     (ssget "X" '((0 . "ELLIPSE") (41 . 0)))
    would be enough for filter list

    I was too engrossed with vlaobjects to think about a simple syntax with vanilla

    Good stuff Ahankhah

  8. #8
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    pBe,
    thanks a lot.
    everything you explain is very clear, unless you name pBe
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,322

    Default

    Quote Originally Posted by pBe View Post
    Code:
    (if 
    (= StartAngle 0)
    (Closed/FullEllipse)
    (Open/EllipseArc)
    )
    Not quite.

    Consider:

    Code:
    (entmakex
        (list
            (cons 0 "ELLIPSE")
            (cons 100 "AcDbEntity")
            (cons 100 "AcDbEllipse")
            (list 10 0.0 0.0 0.0)
            (list 11 1.0 0.0 0.0)
            (cons 40 0.5)
            (cons 41 0.0)
            (cons 42 pi)
        )
    )


    Quote Originally Posted by Ahankhah View Post
    Meanwhile I researched inside Ellipse and Ellipse Arc lists. I found a dxf code inside them which shows whether ellipse is closed or not.
    Code:
    (setq ellipses 
      ...
    )
    
    (setq ellipsearcs 
       ...
    )
    This won't work for the above counter example, consider the following instead:

    Code:
    (defun c:ellipses nil
        (sssetfirst nil
            (ssget "_X"
                (list
                    (cons 0 "ELLIPSE")
                    (cons 41 0.0)
                    (cons 42 (* 2 pi))
                )
            )
        )
    )
    
    (defun c:ellipsearcs nil
        (sssetfirst nil
            (ssget "_X"
                (list
                    (cons 0 "ELLIPSE")
                    (cons -4 "<OR")
                        (cons -4 "<>")
                        (cons 41 0.0)
                        (cons -4 "<>")
                        (cons 42 (* 2 pi))
                    (cons -4 "OR>")
                )
            )
        )
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  10. #10
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,951

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    Not quite.
    I realize that right after i posted.

    Quote Originally Posted by Lee Mac View Post
    Consider:
    consider the following instead:

    Code:
    (defun c:ellipses nil
        ......                (cons 42 (* 2 pi)) ......
                )
            )
        )
    )
    Really? Guess i ddnt do a thorough test

    Thank you for the info.

Similar Threads

  1. Ellipse Not Right
    By gsksun4 in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 25th Mar 2010, 04:34 pm
  2. Ellipse
    By mjalawami in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 15th Sep 2009, 12:22 pm
  3. Can't trim an ellipse
    By MAK in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 16th Jun 2008, 07:21 pm
  4. Ellipse
    By johnengineer in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 30th Mar 2007, 12:55 am
  5. ellipse
    By pjl66892 in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 29th Sep 2006, 10:08 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts