how to Circle become MgGeometry

how to Circle become MgGeometry

Anonymous
Not applicable
811 Views
3 Replies
Message 1 of 4

how to Circle become MgGeometry

Anonymous
Not applicable

i draw a Circle, i need become Circle to MgGeometry,please tell me how to do? thans!

0 Likes
812 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

If memory serves there is no _circle_ type in MgGeometry.

Use a couple arcs in a linestring.

 

r,

dennis

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi,

 

MgGeometry is the base class for all the geometry types. The simple geometry types are:

 

  • MgPoint — a single point
  • MgLineString — a series of connected line segments
  • MgCurveString — a series of connected curve segments
  • MgPolygon — a polygon with sides formed from line segments
  • MgCurvePolygon — a polygon with sides formed from curve segments

The curve segments are circular arcs, defined by a start point, an end point, and a control point.

 

Complex types are formed by aggregating simple types. The complex types are:

 

  • MgMultiPoint — a group of points
  • MgMultiLineString — a group of line strings
  • MgMultiCurveString — a group of curve strings
  • MgMultiPolygon — a group of polygons
  • MgMultiCurvePolygon — a group of curve polygons
  • MgMultiGeometry — a group of simple geometry objects of any type

 

HTH,

 

Partha Sarkar

Autodesk

0 Likes
Message 4 of 4

braudpat
Mentor
Mentor

 

hello

 

You can use this routine to convert circles to polygons ...

 

Bye, Pat

 


;;
;; C2GON.LSP (c) 2003 Tee Square Graphics
;; Converts selected CIRCLE objects to many-sided polygons
;; (closed LWPOLYLINE objects consisting of multiple straight line segments)
;;
;; Les polygones reguliers sont crees sur le MEME calque que les cercles
;;

(defun C:C2GON (/ ss n temp cir ent cen rad ltp clr ang verts)
  (while (not (setq ss (ssget '((0 . "CIRCLE"))))))
  (if (not sides)(setq sides 32))
  (setq n (1- (sslength ss))
        sides (if (setq temp (getint (strcat "\nNumber of sides <" (itoa sides) ">: ")))
                temp sides
              );;if
  );;setq
  (while (>= n 0)
    (setq cir (ssname ss n)
          n (1- n)
          ent (entget cir)
          cen (cdr (assoc 10 ent))
          rad (cdr (assoc 40 ent))
          ltp (assoc 6 ent)
          clr (assoc 62 ent)
          ang 0
          verts nil
    );;setq
    (repeat sides
      (setq verts (append verts (list (cons 10 (polar cen ang rad))))
            ang (+ ang (* (/ pi sides) 2))
      );;setq
    );;repeat
    (entmake
      (append
        (list
          '(0 . "LWPOLYLINE")
          '(100 . "AcDbEntity")
          '(100 . "AcDbPolyline")
          (assoc 8 ent)
          (cons 90 sides)
          '(70 . 129)
          (if ltp ltp '(6 . "BYLAYER"))
          (if clr clr '(62 . 256))
        );;list
        verts
      );;append
    );;entmake

;;;;;;;;;;;;; Suppression EVENTUELLE des cercles
;;    (entdel cir)
;;;;;;;;;;;;;

    (princ)
  );;while

  (alert
    (strcat
      (itoa (sslength ss))
      " CIRCLE object(s) converted to "
      (itoa sides)
      "-sided polygon(s)."
    );;strcat
  );;alert
  (princ)
)

;;  (alert
;;   (strcat
;;     "C2GON.LSP - (c) 2003 Tee Square Graphics\n"
;;     "          Type C2GON to start."
;;   )
;;  )

  (princ "\nTapez C2GON pour lancer ...\n")

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


0 Likes