PDA

View Full Version : lwpolyline bulge


pnorman
2005-05-16, 10:53 PM
Can someone please help me with the following. I cannot get the polyline bulge to work. Either I am not setting the bulge value correctly or I am not specifying the vertex properly. I am trying to define a lwpolyline using vla-addLightweightPolyline (instead of (command "_pline"...)). Everything works except adding the arcs using vla-setbulge...

I am trying to get the arc parts of the polyline to match radius RI
see attached beam.DWG


(setq PTLIST (list P1 P2 P2A P5 P6 P7 P8 P9A P11 P12 P13A P15 P16 P17 P18 P19A P1))
(setq PTLIST (apply 'append PTLIST))

(setq SA1 (vlax-make-safearray vlax-vbDouble (cons 0 (- (vl-list-length PTLIST) 1))))

(vlax-safearray-fill SA1 PTLIST)

(setq OBJ (vla-addLightweightPolyline (model-space) SA1))

(setq BLG (- 0 (tan (/ 90 0.25))))

(vla-setbulge OBJ 3 BLG)

(vla-setbulge OBJ 5 BLG)

(vla-setbulge OBJ 11 BLG)

(vla-setbulge OBJ 13 BLG)




Thanks
P

jwanstaett
2005-05-17, 06:00 PM
if it a semicircle you need the bulge is 1 or -1 for clockwise arc

pnorman
2005-05-17, 06:09 PM
if it a semicircle you need the bulge is 1 or -1 for clockwise arc
No its not a semicircle. Its an arc. If I was using the command function I would do this:


(command "_.pline" P1 "_w" "0" "" P2 P4 P5 "_a" P6 "_l" P7 "_a" P8 "_l" P9.......etc etc


Where the points defining the arc segment are P5 and P6 which are defined by a radius RI

What I don't know how to do is get the same polyline using vla-addLightweightPolyline.
I can get vla-addLightweightPolyline to draw the polyline just fine BUT only with a straight line between P5 and P6. I cant work out how to draw the arc segment using vla-setbulge
http://forums.augi.com/images/icons/icon9.gif

pnorman
2005-05-17, 06:59 PM
Can someone please help me with the following. I cannot get the polyline bulge to work.



(setq BLG (- 0 (tan (/ 90 0.25))))

(vla-setbulge OBJ 3 BLG)

(vla-setbulge OBJ 5 BLG)

(vla-setbulge OBJ 11 BLG)

(vla-setbulge OBJ 13 BLG)




Thanks
PHave found my own mistake here: "(setq BLG (- 0 (tan (/ 90 0.25))))"
Should be (setq BLG (- 0 (tan (/ 90 4.00))))
Thanks
Please ignore my own stupidity!
http://forums.augi.com/images/icons/icon11.gif