Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
XDRX-API
»
Topic:
[XDrX-PlugIn(39)] Specify tolerance polyline curvature
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: [XDrX-PlugIn(39)] Specify tolerance polyline curvature (Read 796 times)
0 Members and 1 Guest are viewing this topic.
xdcad
Swamp Rat
Posts: 527
WWW
[XDrX-PlugIn(39)] Specify tolerance polyline curvature
«
on:
December 10, 2023, 11:50:05 AM »
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
defun
_remove
-
arc
(
)
(
setq
cinx
(
vl-position
seg segs
)
)
(
setq
prevseg
(
nth
(
1-
cinx
)
segs
)
nextseg
(
nth
(
1+
cinx
)
segs
)
)
(
if
(
and
(
xdrx
-
object
-
iskindof prevseg
"kLineSeg3d"
)
(
xdrx
-
object
-
iskindof nextseg
"kLineSeg3d"
)
)
(
progn
(
if
(
setq
ints
(
xdrx
-
entity
-
intersectwith prevseg nextseg
3
)
)
(
progn
(
setq
ints
(
car
ints
)
)
(
xdrx
-
setpropertyvalue poly
"removevertexat"
inx
)
(
xdrx
-
setpropertyvalue poly
"pointat"
(
list
inx ints
)
)
t
)
)
)
)
)
(
defun
_process
(
poly
)
(
if
(
not
(
xdrx
-
getpropertyvalue poly
"isOnlyLines"
)
)
(
progn
(
setq
segs
(
xdrx
-
getpropertyvalue poly
"allsegs"
)
)
(
setq
inx
0
)
(
foreach
seg segs
(
if
(
xdrx
-
object
-
iskindof seg
"kCircArc3d"
)
(
progn
(
setq
radius
(
xdrx
-
getpropertyvalue seg
"radius"
)
)
(
if
(
<
radius #xd
-
var
-
poly
-
arc
-
radius
)
(
progn
(
_remove
-
arc
)
(
setq
inx
(
1-
inx
)
)
)
)
)
)
(
setq
inx
(
1+
inx
)
)
)
)
)
)
;main program
(
xdrx
-
begin
)
(
if
(
not
#xd
-
var
-
poly
-
arc
-
radius
)
(
setq
#xd
-
var
-
poly
-
arc
-
radius
1.0
)
)
(
if
(
setq
temp
(
getreal
(
xdrx
-
string
-
format
"
\n
Please output the recurvature radius tolerance <%0.1f>:"
#xd
-
var
-
poly
-
arc
-
radius
)
)
)
(
setq
#xd
-
var
-
poly
-
arc
-
radius temp
)
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select the polyline to be recurved<Exit>:"
'
(
(
0
.
"*polyline"
)
)
)
)
(
mapcar
'
(
lambda
(
poly
)
(
_process poly
)
)
(
xdrx
-
ss
->
ents ss
)
)
)
(
xdrx
-
end
)
(
princ
)
)
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
XDRX-API
»
Topic:
[XDrX-PlugIn(39)] Specify tolerance polyline curvature