TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Newbie on November 23, 2017, 02:35:44 AM
-
Hi!
I have a lisp script and it works almost as I want it to.
Could someone help me fixing it?
Tried to fix it by myself.. guess I’m not that headstrong as I thought
The problem is the arc that’s being made inside the circle, the radius is too small, I need to make it waay bigger then that so the arc would look like a straight line or near it. So the entrance point to the circle would be close to 90 degrees.
See the pics.
The “2” pic is how I need it to be.
(setq radius
(- radius offs
))
(setq ydwn
(- yc radius
)) (setq ycdwn
(+ yc
0.001)) (setq xcleft
(- xc
0.001))
(command "ARC" "c" center ver3 ver33
)
(setq yvr
(+ ydwn radius
)) )
(setq dlvrez
(- yvr ydwn
)) (setq centvrez
(+ ydwn
(/ dlvrez
2))) (command "PEDIT" imia3
"y" "j" imia1
"" "") (command "CHANGE" imia6
"" "p" "c" "blue" "")
)
)
-
Why don't you use a block?
-
Why don't you use a block?
I don’t get it. Could you explain, please?
-
Ronjop i dong get it ether
Just pick a point on circle the using the centre point nominate some form of distance from circle to centre say 1/2 as an example you could do Aline pick mid then just use a big radius using start and end options.
-
Ronjop i dong get it ether
Just pick a point on circle the using the centre point nominate some form of distance from circle to centre say 1/2 as an example you could do Aline pick mid then just use a big radius using start and end options.
That’s the problem. I couldn’t figure out how.
I mean, I’ve read lisp manual , tried to change the code in various ways - nothing
I figured, this part of the code makes the inside arc
(setq yvr
(+ ydwn radius
)) )
(setq dlvrez
(- yvr ydwn
)) (setq centvrez
(+ ydwn
(/ dlvrez
2)))
I need to change these parameters:“ command "ARC" "c" cent vrez ver3)”
And That’s it.
All my efforts end up like that.
-
1st use Arc Start pt1 End pt2 R rad
Sometimes need mirror to flip arc.
Do manual arc using s & e so get idea of result.
-
Ronjop i dong get it ether
Just pick a point on circle the using the centre point nominate some form of distance from circle to centre say 1/2 as an example you could do Aline pick mid then just use a big radius using start and end options.
Maybe I missed the point. Different thought process
-
Here's a quick one to draw an arced polyline at selected circles.
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(42 . 0.1)
'(42 . 4.)
)
)
)
)
)
-
Here's a quick one to draw an arced polyline at selected circles.
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(42 . 0.1)
'(42 . 4.)
)
)
)
)
)
Thanks for an example. I’ll try to figure out how it works and maybe try to apply to my code. 😄
-
@Ron, just curious, why the (42 . 4)?
-
(* 4.0 (atan 0.1)) = 22.842 degree
(* 4.0 (atan 4.0)) = 303.855 degree
I'd rather use (42 . 0.098491403) - (* 4.0 (atan 0.098491403)) = 22.5 degree
And it's complement (42 . 10.15317039) - (* 4.0 (atan 10.15317039)) = 337.5 degree
But my final guess is that 0.1 and 4.0 are Ron's lucky numbers...
^-^
-
I fully understand the definition of polyline bulges. :-)
However, since the polyline has two vertices, the second bulge value is redundant.
-
You are right, but you'll never know when will user like to turn Close option to Yes... And I suppose in that case that first bulge should be positive and second one negative, IMHO...
-
Hi,
The bulge of the last vertex is used by AutoCAD to close the polyline.
Not specified stands for 0.0.
The complement bulge is the inverse number (1 / bulge)
You ca try:
'(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(70 . 1)
'(10 0. 0.)
'(42 . 0.1)
'(10 0. 5.)
)
)
'(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(70 . 1)
'(10 0. 0.)
'(42 . 0.1)
'(10 0. 5.)
'(42 . 10.)
)
)
-
@gile, yes, this clears many things... I've learned something new, thanks...
-
@Ron, just curious, why the (42 . 4)?
I just used Charle's entmake function. No rhyme or reason other than that 😁
-
The complement bulge is the inverse number (1 / bulge)
Thanks gile, I hadn't considered that tan((2pi-x)/4) = cot(x/4), that's a nice property.
-
The complement bulge is the inverse number (1 / bulge)
Thanks gile, I hadn't considered that tan((2pi-x)/4) = cot(x/4), that's a nice property.
More generally:
cotan(a) = tan(pi/2 - a)