PDA

View Full Version : Bulge or Line


kennet.sjoberg
2006-02-24, 08:49 AM
Input :
LWPOLYLINE made of one line and one arc
a point on the LWPOLYLINE

How do I identify if the point is on the arc (bulge) or the line segment ?

: ) Happy Computing !

kennet

fixo
2006-02-24, 10:39 AM
Input :
LWPOLYLINE made of one line and one arc
a point on the LWPOLYLINE

How do I identify if the point is on the arc (bulge) or the line segment ?

: ) Happy Computing !

kennet

Hi Kennet,
maybe something like this:



(vl-load-com)
(setvar "osmode" 512)
(setq pt (getpoint "\n >> Pick point on pline >> \n"))
(setq ss (ssget "_C" pt pt)
plObj (vlax-ename->vla-object (ssname ss 0)))
(if (not (vl-catch-all-error-p
(vl-catch-all-apply
(function (lambda ()
(vlax-curve-getclosestpointto plObj pt))))))
(alert "Point is on pline")
(alert "Point isn't on pline"))

~'J'~

kennet.sjoberg
2006-02-24, 11:48 AM
Thank you fixo, but. . .

Hi Kennet,
maybe something like this:. . .
. . .not really, "plObj" the LWPOLYLINE is made of lines and arcs
I want to know if the point hit a arc or a line in the polyline
( not if the point hit the plObj or not )


: ) Happy Computing !

kennet


Example :
Command: LIST
Select objects: 1 found

Select objects:
LWPOLYLINE Layer: "0"
Space: Model space
Handle = FD30
Open
Constant width 0.0000
area 29.7893
length 18.0050

at point X=98249.6956 Y=6575080.4971 Z= 0.0000 <-- Arc end
bulge 0.3035
center X=98245.0105 Y=6575087.3055 Z= 0.0000
radius 8.2646
start angle 304.53348
end angle 12.06065
at point X=98253.0927 Y=6575089.0323 Z= 0.0000 <-- Line end / Arc Start
at point X=98251.3658 Y=6575097.1145 Z= 0.0000 <-- Line start
? ? Do i hit the arc or the line ? ? bulge or not

kennet.sjoberg
2006-02-24, 12:16 PM
Thank you for your time . . . problem is solved
vlax-curve-getSecondDeriv return (0.0 0.0 0.0) when line segment

: ) Happy Computing !

kennet

fixo
2006-02-24, 02:57 PM
Thank you for your time . . . problem is solved
vlax-curve-getSecondDeriv return (0.0 0.0 0.0) when line segment

: ) Happy Computing !

kennet

Thank you too
There is easy and elegant solution!

~'J'~

Opie
2006-02-24, 03:32 PM
Thank you for your time . . . problem is solved
vlax-curve-getSecondDeriv return (0.0 0.0 0.0) when line segment

: ) Happy Computing !

kennet
Thanks kennet. That is what I was looking for.

kennet.sjoberg
2006-02-24, 04:09 PM
Thanks kennet. That is what I was looking for.
You are welcome, I think we are doing equal programs ;)

: ) Happy Computing !

kennet