I saw a friend’s request and wrote one
![](http://www.theswamp.org/index.php?PHPSESSID=35df068380d69bdb8cba5423154f93de&action=dlattach;topic=58788.0;attach=41612;image)
The idea is:
1. Find the two intersection points of the inner polyline and the outer frame,
2. The two intersection points and other vertices of the polyline are sorted along this polyline.
3. Extract the sub-table between the intersection points of the sorted point table, which is the vertex table of the polyline we want.
4. Generate polyline
Main functions used:1. (xdrx-points-sortoncurve curve intpnts)
Along the curve, sort the point table intpnts
2. (xdrx-setpropertyvalue pline "set" vertexs)
Reset polyline PLINE according to vertex table
![](http://www.theswamp.org/index.php?PHPSESSID=35df068380d69bdb8cba5423154f93de&action=dlattach;topic=58788.0;attach=41611;image)
"\nPick polyline 1<Exit>:"
'((0 . "*polyline"))
)
)
)
"\nPick internal polyline <exit>:"
'((0 . "*polyline"))
)
)
)
(xdrx-begin)
(setq ints
(xdrx
-entity
-intersectwith x e1
3)) (setq verts
(xdrx
-getpropertyvalue x
"vertices") sortpnts1 (xdrx-points-sortoncurve x ints t)
sortpnts2 (xdrx-points-sortoncurve
x
t
)
)
)
)
pl (xdrx-polyline-make)
)
(xdrx-setpropertyvalue pl "set" sortpnts)
(setq pl
(xdrx
-entity
-make pl
)) (xdrx-entity-matchprop x pl)
(xdrx-object-swapid x pl)
(xdrx-entity-delete pl)
)
)
)
(xdrx-pickset->ents ss)
)
(xdrx-end)
)
)
)