Author Topic: How to get length from part of ellipse  (Read 2235 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
How to get length from part of ellipse
« on: March 29, 2007, 09:51:58 PM »
Look at attach file, I got trouble to find length from part of ellipse,then look again in this below code.
If you check by list function,it can displayed,but I got teribble to find in lisp, have you idea to find it.

This object search by list function
Code: [Select]
Command: _list
Select objects: 1 found

Select objects:

                  ELLIPSE   Layer: "0"
                            Space: Model space
                   Color: 2 (yellow)    Linetype: "BYLAYER"
                   Handle = CE
                           Length: 12.1106
                           Center: X = 0.0000   , Y = 0.0000   , Z = 0.0000
                       Major Axis: X = -10.0000 , Y = 0.0000   , Z = 0.0000
                       Minor Axis: X = 0.0000   , Y = -5.0000  , Z = 0.0000
                      Start Point: X = 10.0000  , Y = 0.0000   , Z = 0.0000
                        End Point: X = 0.0000   , Y = 5.0000   , Z = 0.0000
                      Start Angle: 180
                        End Angle: 270
                     Radius Ratio: 0.5000
it get with vlisp
Code: [Select]
(setq ss (car (entsel "\nSelect an ellipse object")))
(setq sse (entget ss))

((-1 . <Entity name: 7efb30f0>)
  (0 . "ELLIPSE")
  (330 . <Entity name: 7ef60cf8>)
  (5 . "CE")
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "0")
  (62 . 2)
  (100 . "AcDbEllipse")
  (10 0.0 0.0 0.0)
  (11 -10.0 0.0 0.0)
  (210 0.0 0.0 1.0)
  (40 . 0.5)
  (41 . 3.14159)
  (42 . 4.71239))
_$
here I try with activeX
Code: [Select]
(setq ss (car (entsel "\nSelect an ellipse object")))
(setq vevo (vlax-ename->vla-object ss))
(vlax-dump-object vevo)

; IAcadEllipse: AutoCAD Ellipse Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00b9b5e4>
;   Area (RO) = 14.2699
;   Center = (0.0 0.0 0.0)
;   Document (RO) = #<VLA-OBJECT IAcadDocument 010f3d20>
;   EndAngle = 4.71239
;   EndParameter = 4.71239
;   EndPoint (RO) = (1.83691e-015 5.0 0.0)
;   Handle (RO) = "CE"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 06492014>
;   Layer = "0"
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   MajorAxis = (-10.0 0.0 0.0)
;   MajorRadius = 10.0
;   MinorAxis (RO) = (0.0 -5.0 0.0)
;   MinorRadius = 5.0
;   Normal = (0.0 0.0 1.0)
;   ObjectID (RO) = 2130391280
;   ObjectName (RO) = "AcDbEllipse"
;   OwnerID (RO) = 2130054392
;   PlotStyleName = "Color_2"
;   RadiusRatio = 0.5
;   StartAngle = 3.14159
;   StartParameter = 3.14159
;   StartPoint (RO) = (10.0 -6.12303e-016 0.0)
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 064966d0>
;   Visible = -1

T
_$

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to get length from part of ellipse
« Reply #1 on: March 29, 2007, 10:15:11 PM »
Try something like :
Code: [Select]
(cond
  ((setq ent (car (entsel "\nSelect curve object: ")))
   (and (setq obj (vlax-ename->vla-object ent))
(not (vl-catch-all-error-p
       (setq
endParam (vl-catch-all-apply
    'vlax-curve-getendparam
    (list obj)
  )
       )
     )
)
(setq dist (vlax-curve-getdistatparam obj endParam))
(prompt (strcat "   Length is: " (VL-PRINC-TO-STRING dist)))
   )
  )
)
« Last Edit: March 29, 2007, 10:17:19 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Adesu

  • Guest
Re: How to get length from part of ellipse
« Reply #2 on: March 29, 2007, 10:30:50 PM »
Wow.......it's great,thanks you very much.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to get length from part of ellipse
« Reply #3 on: March 30, 2007, 09:43:35 AM »
you're welcome
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.